From ef23ef60c5641c5903f9cf40571ead7ad6aba1b9 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:32:39 +0100 Subject: Workspace/core: Refactor workspace storage (#5380) * refactor workspaces to use ptrs * clang-format --- src/Compositor.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Compositor.hpp') diff --git a/src/Compositor.hpp b/src/Compositor.hpp index ace2a388..98bbe899 100644 --- a/src/Compositor.hpp +++ b/src/Compositor.hpp @@ -92,7 +92,7 @@ class CCompositor { std::vector> m_vMonitors; std::vector> m_vRealMonitors; // for all monitors, even those turned off std::vector> m_vWindows; - std::vector> m_vWorkspaces; + std::vector m_vWorkspaces; std::vector m_vWindowsFadingOut; std::vector m_vSurfacesFadingOut; @@ -145,9 +145,9 @@ class CCompositor { CWindow* getWindowFromHandle(uint32_t); CWindow* getWindowFromZWLRHandle(wl_resource*); bool isWorkspaceVisible(const int&); - CWorkspace* getWorkspaceByID(const int&); - CWorkspace* getWorkspaceByName(const std::string&); - CWorkspace* getWorkspaceByString(const std::string&); + PHLWORKSPACE getWorkspaceByID(const int&); + PHLWORKSPACE getWorkspaceByName(const std::string&); + PHLWORKSPACE getWorkspaceByString(const std::string&); void sanityCheckWorkspaces(); void updateWorkspaceWindowDecos(const int&); int getWindowsOnWorkspace(const int& id, std::optional onlyTiled = {}); @@ -172,12 +172,12 @@ class CCompositor { void updateWorkspaceWindows(const int64_t& id); void updateWindowAnimatedDecorationValues(CWindow*); int getNextAvailableMonitorID(std::string const& name); - void moveWorkspaceToMonitor(CWorkspace*, CMonitor*, bool noWarpCursor = false); + void moveWorkspaceToMonitor(PHLWORKSPACE, CMonitor*, bool noWarpCursor = false); void swapActiveWorkspaces(CMonitor*, CMonitor*); CMonitor* getMonitorFromString(const std::string&); bool workspaceIDOutOfBounds(const int64_t&); void setWindowFullscreen(CWindow*, bool, eFullscreenMode mode = FULLSCREEN_INVALID); - void updateFullscreenFadeOnWorkspace(CWorkspace*); + void updateFullscreenFadeOnWorkspace(PHLWORKSPACE); CWindow* getX11Parent(CWindow*); void scheduleFrameForMonitor(CMonitor*); void addToFadingOutSafe(SLayerSurface*); @@ -189,13 +189,13 @@ class CCompositor { void closeWindow(CWindow*); Vector2D parseWindowVectorArgsRelative(const std::string&, const Vector2D&); void forceReportSizesToWindowsOnWorkspace(const int&); - CWorkspace* createNewWorkspace(const int&, const int&, const std::string& name = ""); // will be deleted next frame if left empty and unfocused! + PHLWORKSPACE createNewWorkspace(const int&, const int&, const std::string& name = ""); // will be deleted next frame if left empty and unfocused! void renameWorkspace(const int&, const std::string& name = ""); void setActiveMonitor(CMonitor*); bool isWorkspaceSpecial(const int&); int getNewSpecialID(); void performUserChecks(); - void moveWindowToWorkspaceSafe(CWindow* pWindow, CWorkspace* pWorkspace); + void moveWindowToWorkspaceSafe(CWindow* pWindow, PHLWORKSPACE pWorkspace); CWindow* getForceFocus(); void notifyIdleActivity(); void setIdleActivityInhibit(bool inhibit); -- cgit v1.2.3