1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:17:44 +00:00

WindowServer: Add special treatment for modal windows.

While a WSClientConnection has a modal window showing, non-modal windows
belonging to that client are not sent any events.
This commit is contained in:
Andreas Kling 2019-03-19 00:52:39 +01:00
parent 57ff293a51
commit 43304d2adf
13 changed files with 89 additions and 17 deletions

View file

@ -12,10 +12,12 @@ class WSMenu;
class WSWindow final : public WSMessageReceiver, public InlineLinkedListNode<WSWindow> {
public:
WSWindow(WSClientConnection&, int window_id);
WSWindow(WSClientConnection&, int window_id, bool modal);
WSWindow(WSMessageReceiver&, WSWindowType);
virtual ~WSWindow() override;
bool is_blocked_by_modal_window() const;
WSClientConnection* client() { return m_client; }
const WSClientConnection* client() const { return m_client; }
@ -38,6 +40,11 @@ public:
bool is_visible() const { return m_visible; }
void set_visible(bool);
bool is_modal() const { return m_modal; }
bool is_resizable() const { return m_resizable; }
void set_resizable(bool);
Rect rect() const { return m_rect; }
void set_rect(const Rect&);
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
@ -106,6 +113,8 @@ private:
bool m_visible { true };
bool m_has_alpha_channel { false };
bool m_has_painted_since_last_resize { false };
bool m_modal { false };
bool m_resizable { false };
RetainPtr<GraphicsBitmap> m_backing_store;
RetainPtr<GraphicsBitmap> m_last_backing_store;
int m_window_id { -1 };