mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
WindowServer+Taskbar: Show applets in taskbar :^)
WindowServer now collects applet windows into an "applet area" which is really just a window that a WM (window management) client can position via IPC. This is rather hackish, and I think we should come up with a better architecture eventually, but this brings back the missing applets since the global menu where they used to live is gone.
This commit is contained in:
parent
44602ae141
commit
9bbc1c9c93
18 changed files with 145 additions and 40 deletions
|
@ -77,6 +77,7 @@ public:
|
|||
WM_WindowStateChanged,
|
||||
WM_WindowRectChanged,
|
||||
WM_WindowIconBitmapChanged,
|
||||
WM_AppletAreaSizeChanged,
|
||||
__End_WM_Events,
|
||||
};
|
||||
|
||||
|
@ -108,6 +109,20 @@ private:
|
|||
int m_window_id { -1 };
|
||||
};
|
||||
|
||||
class WMAppletAreaSizeChangedEvent : public WMEvent {
|
||||
public:
|
||||
explicit WMAppletAreaSizeChangedEvent(const Gfx::IntSize& size)
|
||||
: WMEvent(Event::Type::WM_AppletAreaSizeChanged, 0, 0)
|
||||
, m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
const Gfx::IntSize& size() const { return m_size; }
|
||||
|
||||
private:
|
||||
Gfx::IntSize m_size;
|
||||
};
|
||||
|
||||
class WMWindowRemovedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowRemovedEvent(int client_id, int window_id)
|
||||
|
|
|
@ -269,6 +269,12 @@ void WindowServerConnection::handle(const Messages::WindowClient::WM_WindowState
|
|||
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(message.client_id(), message.window_id(), message.parent_client_id(), message.parent_window_id(), message.title(), message.rect(), message.is_active(), message.is_modal(), static_cast<WindowType>(message.window_type()), message.is_minimized(), message.is_frameless(), message.progress()));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WM_AppletAreaSizeChanged& message)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMAppletAreaSizeChangedEvent>(message.size()));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WM_WindowRectChanged& message)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
|
|
|
@ -69,6 +69,7 @@ private:
|
|||
virtual void handle(const Messages::WindowClient::WM_WindowStateChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::WM_WindowIconBitmapChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::WM_WindowRectChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::WM_AppletAreaSizeChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::AsyncSetWallpaperFinished&) override;
|
||||
virtual void handle(const Messages::WindowClient::DragDropped&) override;
|
||||
virtual void handle(const Messages::WindowClient::DragAccepted&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue