mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:07:45 +00:00
WindowServer: Add basic virtual desktop support
This creates a 2-dimensional array of WindowStack instances, one for each virtual desktop. The main desktop 0,0 is the main desktop, which is the desktop used for all stationary windows (e.g. taskbar, desktop). When adding windows to a desktop, stationary windows are always added to the main desktop. When composing the desktop, there are usually two WindowStacks involved. For stationary windows, the main desktop will be traversed, and for everything else the current virtual desktop will be iterated. Iteration is interweaved to preserve the correct order. During the transition animation, two WindowStacks will be iterated at the same time.
This commit is contained in:
parent
944e5cfb35
commit
584b144953
11 changed files with 900 additions and 213 deletions
|
@ -17,6 +17,7 @@ namespace WindowServer {
|
|||
|
||||
class Screen;
|
||||
class Window;
|
||||
class WindowStack;
|
||||
|
||||
class Overlay {
|
||||
friend class Compositor;
|
||||
|
@ -27,6 +28,7 @@ public:
|
|||
enum class ZOrder {
|
||||
WindowGeometry,
|
||||
Dnd,
|
||||
WindowStackSwitch,
|
||||
ScreenNumber,
|
||||
};
|
||||
[[nodiscard]] virtual ZOrder zorder() const = 0;
|
||||
|
@ -168,4 +170,24 @@ private:
|
|||
Gfx::IntRect m_label_rect;
|
||||
};
|
||||
|
||||
class WindowStackSwitchOverlay : public RectangularOverlay {
|
||||
public:
|
||||
static constexpr int default_screen_rect_width = 40;
|
||||
static constexpr int default_screen_rect_height = 30;
|
||||
static constexpr int default_screen_rect_margin = 16;
|
||||
static constexpr int default_screen_rect_padding = 8;
|
||||
|
||||
WindowStackSwitchOverlay(Screen&, WindowStack&);
|
||||
|
||||
virtual ZOrder zorder() const override { return ZOrder::WindowStackSwitch; }
|
||||
virtual void render_overlay_bitmap(Gfx::Painter&) override;
|
||||
|
||||
private:
|
||||
Gfx::IntSize m_content_size;
|
||||
const int m_rows;
|
||||
const int m_columns;
|
||||
const int m_target_row;
|
||||
const int m_target_column;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue