1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:57:45 +00:00

Taskbar: Show minimized window titles in [brackets].

Had to plumb the minimization state from WindowServer to Toolbar in order
to implement this.
This commit is contained in:
Andreas Kling 2019-04-06 00:57:51 +02:00
parent 74142d78c1
commit ef9fbef4c6
9 changed files with 35 additions and 7 deletions

View file

@ -82,12 +82,13 @@ public:
class GWMWindowStateChangedEvent : public GWMEvent {
public:
GWMWindowStateChangedEvent(int client_id, int window_id, const String& title, const Rect& rect, bool is_active, GWindowType window_type)
GWMWindowStateChangedEvent(int client_id, int window_id, const String& title, const Rect& rect, bool is_active, GWindowType window_type, bool is_minimized)
: GWMEvent(GEvent::Type::WM_WindowStateChanged, client_id, window_id)
, m_title(title)
, m_rect(rect)
, m_active(is_active)
, m_window_type(window_type)
, m_minimized(is_minimized)
{
}
@ -95,12 +96,14 @@ public:
Rect rect() const { return m_rect; }
bool is_active() const { return m_active; }
GWindowType window_type() const { return m_window_type; }
bool is_minimized() const { return m_minimized; }
private:
String m_title;
Rect m_rect;
bool m_active;
GWindowType m_window_type;
bool m_minimized;
};
class QuitEvent final : public GEvent {

View file

@ -274,7 +274,7 @@ void GEventLoop::handle_wm_event(const WSAPI_ServerMessage& event, GWindow& wind
dbgprintf("GEventLoop: handle_wm_event: %d\n", (int)event.type);
#endif
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, event.wm.is_active, (GWindowType)event.wm.window_type));
return post_event(window, make<GWMWindowStateChangedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length), event.wm.rect, event.wm.is_active, (GWindowType)event.wm.window_type, event.wm.is_minimized));
if (event.type == WSAPI_ServerMessage::WM_WindowRemoved)
return post_event(window, make<GWMWindowRemovedEvent>(event.wm.client_id, event.wm.window_id));
ASSERT_NOT_REACHED();