mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:47:35 +00:00
WindowServer: Fix crash when no active input window is set
This commit is contained in:
parent
a269e3e573
commit
d87f876946
1 changed files with 4 additions and 1 deletions
|
@ -433,7 +433,10 @@ void MenuManager::set_current_menu(Menu* menu)
|
|||
auto& wm = WindowManager::the();
|
||||
if (!previous_current_menu) {
|
||||
// When opening the first menu, store the current active input window
|
||||
m_previous_input_window = wm.active_input_window()->make_weak_ptr();
|
||||
if (auto* active_input = wm.active_input_window())
|
||||
m_previous_input_window = active_input->make_weak_ptr();
|
||||
else
|
||||
m_previous_input_window = nullptr;
|
||||
}
|
||||
|
||||
wm.set_active_input_window(m_current_menu->menu_window());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue