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

WindowServer: WSWindow can have a pointer to the client rather than an ID.

Since WSWindows are owned by WSConnectionClients, it's fine for them to just
reference the client directly.
This commit is contained in:
Andreas Kling 2019-02-17 08:54:57 +01:00
parent 1056a39bd6
commit 9a39c01551
5 changed files with 19 additions and 22 deletions

View file

@ -7,15 +7,17 @@
#include "WSMessageReceiver.h"
#include <WindowServer/WSWindowType.h>
class WSClientConnection;
class WSMenu;
class WSWindow final : public WSMessageReceiver, public InlineLinkedListNode<WSWindow> {
public:
WSWindow(int client_id, int window_id);
WSWindow(WSClientConnection&, int window_id);
explicit WSWindow(WSMenu&);
virtual ~WSWindow() override;
int client_id() const { return m_client_id; }
WSClientConnection* client() { return m_client; }
const WSClientConnection* client() const { return m_client; }
WSWindowType type() const { return m_type; }
int window_id() const { return m_window_id; }
@ -63,7 +65,7 @@ public:
WSWindow* m_prev { nullptr };
private:
int m_client_id { 0 };
WSClientConnection* m_client { nullptr };
String m_title;
Rect m_rect;
WSWindowType m_type { WSWindowType::Normal };