diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-04 01:44:35 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-04 01:44:35 +0200 |
commit | 96104b55249ad0201b1be805e1874c759fdd0ac9 (patch) | |
tree | e56bc509d217f8e618a729b835ebd92b8bb6c16c /LibGUI/GEventLoop.cpp | |
parent | ea801a99dcd2f00e048f107e89d29fd07d7f018b (diff) | |
download | serenity-96104b55249ad0201b1be805e1874c759fdd0ac9.zip |
Taskbar: More bringup work. We now see a basic window list.
Diffstat (limited to 'LibGUI/GEventLoop.cpp')
-rw-r--r-- | LibGUI/GEventLoop.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/LibGUI/GEventLoop.cpp b/LibGUI/GEventLoop.cpp index 9bd68bee1f..a7c02b8bb6 100644 --- a/LibGUI/GEventLoop.cpp +++ b/LibGUI/GEventLoop.cpp @@ -268,6 +268,17 @@ void GEventLoop::handle_menu_event(const WSAPI_ServerMessage& event) ASSERT_NOT_REACHED(); } +void GEventLoop::handle_wm_event(const WSAPI_ServerMessage& event, GWindow& window) +{ + if (event.type == WSAPI_ServerMessage::WM_WindowAdded) + return post_event(window, make<GWMWindowAddedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length), event.wm.rect)); + if (event.type == WSAPI_ServerMessage::WM_WindowStateChanged) + return post_event(window, make<GWMWindowStateChangedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length), event.wm.rect)); + if (event.type == WSAPI_ServerMessage::WM_WindowRemoved) + return post_event(window, make<GWMWindowRemovedEvent>(event.wm.client_id, event.wm.window_id)); + ASSERT_NOT_REACHED(); +} + void GEventLoop::wait_for_event() { fd_set rfds; @@ -397,6 +408,11 @@ void GEventLoop::process_unprocessed_messages() case WSAPI_ServerMessage::Type::WindowResized: handle_resize_event(event, *window); break; + case WSAPI_ServerMessage::Type::WM_WindowAdded: + case WSAPI_ServerMessage::Type::WM_WindowRemoved: + case WSAPI_ServerMessage::Type::WM_WindowStateChanged: + handle_wm_event(event, *window); + break; default: break; } |