mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
WindowServer: Add set_virtual_dekstop WindowManager message
Users can specify the row and column of the virtual desktop, and WindowServer will animate to it.
This commit is contained in:
parent
b8f3441300
commit
2b37fad60b
4 changed files with 12 additions and 0 deletions
|
@ -154,6 +154,11 @@ void WMClientConnection::set_manager_window(i32 window_id)
|
|||
WindowManager::the().greet_window_manager(*this);
|
||||
}
|
||||
|
||||
void WMClientConnection::set_virtual_desktop(u32 row, u32 col)
|
||||
{
|
||||
WindowManager::the().switch_to_window_stack(row, col);
|
||||
}
|
||||
|
||||
void WMClientConnection::set_window_taskbar_rect(i32 client_id, i32 window_id, Gfx::IntRect const& rect)
|
||||
{
|
||||
// Because the Taskbar (which should be the only user of this API) does not own the
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
virtual void set_applet_area_position(Gfx::IntPoint const&) override;
|
||||
virtual void set_event_mask(u32) override;
|
||||
virtual void set_manager_window(i32) override;
|
||||
virtual void set_virtual_desktop(u32, u32) override;
|
||||
|
||||
unsigned event_mask() const { return m_event_mask; }
|
||||
int window_id() const { return m_window_id; }
|
||||
|
|
|
@ -263,6 +263,11 @@ public:
|
|||
Window* hovered_window() const { return m_hovered_window.ptr(); }
|
||||
|
||||
void switch_to_window_stack(WindowStack&, Window* = nullptr, bool show_overlay = true);
|
||||
void switch_to_window_stack(u32 row, u32 col, Window* carry = nullptr, bool show_overlay = true)
|
||||
{
|
||||
if (row < window_stack_rows() && col < window_stack_columns())
|
||||
switch_to_window_stack(m_window_stacks[row][col], carry, show_overlay);
|
||||
}
|
||||
|
||||
size_t window_stack_rows() const { return m_window_stacks.size(); }
|
||||
size_t window_stack_columns() const { return m_window_stacks[0].size(); }
|
||||
|
|
|
@ -12,4 +12,5 @@ endpoint WindowManagerServer
|
|||
popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint screen_position) =|
|
||||
set_window_taskbar_rect(i32 client_id, i32 window_id, Gfx::IntRect rect) =|
|
||||
set_applet_area_position(Gfx::IntPoint position) =|
|
||||
set_virtual_desktop(u32 row, u32 column) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue