mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
WindowServer: set_active_window() should not assume window has a client
I saw this assertion fire once and I don't know how I made it happen, but it seems fine for client-less windows to become active, they just don't have a menubar to install.
This commit is contained in:
parent
e0e100f009
commit
7527b9ee72
Notes:
sideshowbarker
2024-07-19 05:02:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7527b9ee720
1 changed files with 5 additions and 4 deletions
|
@ -1030,10 +1030,11 @@ void WindowManager::set_active_window(Window* window)
|
|||
active_client = m_active_window->client();
|
||||
Core::EventLoop::current().post_event(*m_active_window, make<Event>(Event::WindowActivated));
|
||||
m_active_window->invalidate();
|
||||
|
||||
auto* client = window->client();
|
||||
ASSERT(client);
|
||||
MenuManager::the().set_current_menubar(client->app_menubar());
|
||||
if (auto* client = window->client()) {
|
||||
MenuManager::the().set_current_menubar(client->app_menubar());
|
||||
} else {
|
||||
MenuManager::the().set_current_menubar(nullptr);
|
||||
}
|
||||
tell_wm_listeners_window_state_changed(*m_active_window);
|
||||
} else {
|
||||
MenuManager::the().set_current_menubar(nullptr);
|
||||
|
|
Loading…
Add table
Reference in a new issue