mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 23:58:12 +00:00
WindowServer: Introduce a WM event mask so Taskbar can ignore window rects.
Taskbar was waking up to do nothing every time a window rect changed.
This commit is contained in:
parent
ab94a6be00
commit
49e7ffc06a
10 changed files with 97 additions and 3 deletions
|
@ -38,8 +38,10 @@ WSWindow::WSWindow(WSClientConnection& client, WSWindowType window_type, int win
|
|||
, m_frame(*this)
|
||||
{
|
||||
// FIXME: This should not be hard-coded here.
|
||||
if (m_type == WSWindowType::Taskbar)
|
||||
if (m_type == WSWindowType::Taskbar) {
|
||||
m_wm_event_mask = WSAPI_WMEventMask::WindowStateChanges | WSAPI_WMEventMask::WindowRemovals | WSAPI_WMEventMask::WindowIconChanges;
|
||||
m_listens_to_wm_events = true;
|
||||
}
|
||||
WSWindowManager::the().add_window(*this);
|
||||
}
|
||||
|
||||
|
@ -210,6 +212,15 @@ void WSWindow::event(CEvent& event)
|
|||
break;
|
||||
}
|
||||
|
||||
case WSEvent::WM_WindowRectChanged: {
|
||||
auto& changed_event = static_cast<const WSWMWindowRectChangedEvent&>(event);
|
||||
server_message.type = WSAPI_ServerMessage::Type::WM_WindowRectChanged;
|
||||
server_message.wm.client_id = changed_event.client_id();
|
||||
server_message.wm.window_id = changed_event.window_id();
|
||||
server_message.wm.rect = changed_event.rect();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue