mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
WindowServer: Expose window parent information and more modal improvements
* The parent information is necessary by the Taskbar to be able to determine a modal window's parent * Minimize and maximize modal window stacks together
This commit is contained in:
parent
2f731150a2
commit
bbdf0665fc
8 changed files with 113 additions and 43 deletions
|
@ -114,31 +114,40 @@ public:
|
|||
|
||||
class WMWindowStateChangedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, const StringView& title, const Gfx::IntRect& rect, bool is_active, WindowType window_type, bool is_minimized, bool is_frameless, int progress)
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, int parent_client_id, int parent_window_id, const StringView& title, const Gfx::IntRect& rect, bool is_active, bool is_modal, WindowType window_type, bool is_minimized, bool is_frameless, int progress)
|
||||
: WMEvent(Event::Type::WM_WindowStateChanged, client_id, window_id)
|
||||
, m_parent_client_id(parent_client_id)
|
||||
, m_parent_window_id(parent_window_id)
|
||||
, m_title(title)
|
||||
, m_rect(rect)
|
||||
, m_window_type(window_type)
|
||||
, m_active(is_active)
|
||||
, m_modal(is_modal)
|
||||
, m_minimized(is_minimized)
|
||||
, m_frameless(is_frameless)
|
||||
, m_progress(progress)
|
||||
{
|
||||
}
|
||||
|
||||
int parent_client_id() const { return m_parent_client_id; }
|
||||
int parent_window_id() const { return m_parent_window_id; }
|
||||
String title() const { return m_title; }
|
||||
Gfx::IntRect rect() const { return m_rect; }
|
||||
bool is_active() const { return m_active; }
|
||||
bool is_modal() const { return m_modal; }
|
||||
WindowType window_type() const { return m_window_type; }
|
||||
bool is_minimized() const { return m_minimized; }
|
||||
bool is_frameless() const { return m_frameless; }
|
||||
int progress() const { return m_progress; }
|
||||
|
||||
private:
|
||||
int m_parent_client_id;
|
||||
int m_parent_window_id;
|
||||
String m_title;
|
||||
Gfx::IntRect m_rect;
|
||||
WindowType m_window_type;
|
||||
bool m_active;
|
||||
bool m_modal;
|
||||
bool m_minimized;
|
||||
bool m_frameless;
|
||||
int m_progress;
|
||||
|
|
|
@ -273,7 +273,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::MenuItemActiva
|
|||
void WindowServerConnection::handle(const Messages::WindowClient::WM_WindowStateChanged& message)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(message.client_id(), message.window_id(), message.title(), message.rect(), message.is_active(), static_cast<WindowType>(message.window_type()), message.is_minimized(), message.is_frameless(), message.progress()));
|
||||
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_WindowRectChanged& message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue