1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibGUI+WindowServer: Create and broadcast an event when a window moves

LibWeb's Window object will need to know the OS-level position and size
of the GUI::Window for e.g. screenX, screenY, outerWidth, outerHeight.
It will also need to know about changes to that data.
This commit is contained in:
Timothy Flynn 2022-11-01 14:23:22 -04:00 committed by Linus Groh
parent 6b41da0b9e
commit f7e747b68e
7 changed files with 47 additions and 0 deletions

View file

@ -35,6 +35,7 @@ public:
WindowInputLeft,
WindowCloseRequest,
WindowResized,
WindowMoved,
};
Event() = default;
@ -157,4 +158,18 @@ private:
Gfx::IntRect m_rect;
};
class MoveEvent final : public Event {
public:
MoveEvent(Gfx::IntRect const& rect)
: Event(Event::WindowMoved)
, m_rect(rect)
{
}
Gfx::IntRect const& rect() const { return m_rect; }
private:
Gfx::IntRect m_rect;
};
}