From bca7804bb6e1bf5ce5a99b9ae4806be25e36993c Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:43:12 +0100 Subject: internal: Window storage rework - part 1 (#5762) * Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks --- src/protocols/ForeignToplevelWlr.hpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/protocols/ForeignToplevelWlr.hpp') diff --git a/src/protocols/ForeignToplevelWlr.hpp b/src/protocols/ForeignToplevelWlr.hpp index c22a71cd..e3b6f3f3 100644 --- a/src/protocols/ForeignToplevelWlr.hpp +++ b/src/protocols/ForeignToplevelWlr.hpp @@ -10,15 +10,15 @@ class CMonitor; class CForeignToplevelHandleWlr { public: - CForeignToplevelHandleWlr(SP resource_, CWindow* pWindow); + CForeignToplevelHandleWlr(SP resource_, PHLWINDOW pWindow); bool good(); - CWindow* window(); + PHLWINDOW window(); wl_resource* res(); private: SP resource; - CWindow* pWindow = nullptr; + PHLWINDOWREF pWindow; bool closed = false; int64_t lastMonitorID = -1; @@ -32,22 +32,22 @@ class CForeignToplevelWlrManager { public: CForeignToplevelWlrManager(SP resource_); - void onMap(CWindow* pWindow); - void onTitle(CWindow* pWindow); - void onClass(CWindow* pWindow); - void onMoveMonitor(CWindow* pWindow); - void onFullscreen(CWindow* pWindow); - void onNewFocus(CWindow* pWindow); - void onUnmap(CWindow* pWindow); + void onMap(PHLWINDOW pWindow); + void onTitle(PHLWINDOW pWindow); + void onClass(PHLWINDOW pWindow); + void onMoveMonitor(PHLWINDOW pWindow); + void onFullscreen(PHLWINDOW pWindow); + void onNewFocus(PHLWINDOW pWindow); + void onUnmap(PHLWINDOW pWindow); bool good(); private: SP resource; - bool finished = false; - CWindow* lastFocus = nullptr; // READ-ONLY + bool finished = false; + PHLWINDOWREF lastFocus; // READ-ONLY - SP handleForWindow(CWindow* pWindow); + SP handleForWindow(PHLWINDOW pWindow); std::vector> handles; }; @@ -58,7 +58,7 @@ class CForeignToplevelWlrProtocol : public IWaylandProtocol { virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); - CWindow* windowFromHandleResource(wl_resource* res); + PHLWINDOW windowFromHandleResource(wl_resource* res); private: void onManagerResourceDestroy(CForeignToplevelWlrManager* mgr); -- cgit v1.2.3