summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-06-29 19:51:26 -0600
committerAndreas Kling <kling@serenityos.org>2021-07-03 12:27:23 +0200
commit584b144953ba0f715c02b54444a61674a4c99e8a (patch)
treeba318d1627bb82dee3626e228b3c121f30361ae5 /Userland/Libraries
parent944e5cfb350ec1117ae2923dffb094b68588b8e9 (diff)
downloadserenity-584b144953ba0f715c02b54444a61674a4c99e8a.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGfx/DisjointRectSet.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/DisjointRectSet.h b/Userland/Libraries/LibGfx/DisjointRectSet.h
index ccb17b30df..cafb9157f2 100644
--- a/Userland/Libraries/LibGfx/DisjointRectSet.h
+++ b/Userland/Libraries/LibGfx/DisjointRectSet.h
@@ -129,6 +129,17 @@ public:
const Vector<IntRect, 32>& rects() const { return m_rects; }
Vector<IntRect, 32> take_rects() { return move(m_rects); }
+ void translate_by(int dx, int dy)
+ {
+ for (auto& rect : m_rects)
+ rect.translate_by(dx, dy);
+ }
+ void translate_by(Gfx::IntPoint const& delta)
+ {
+ for (auto& rect : m_rects)
+ rect.translate_by(delta);
+ }
+
private:
bool add_no_shatter(const IntRect&);
void shatter();