diff options
author | Vaxry <[email protected]> | 2024-04-02 03:29:48 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-02 12:11:15 +0100 |
commit | b07ca870a4470ff295767522f0615b37519cf352 (patch) | |
tree | e4dbaaef9b9552b19344c6420b93ffb45b6b9812 /src/desktop/Window.hpp | |
parent | 2e5b146e57364795aabeb2dea6fd2257db8b2c3a (diff) | |
download | Hyprland-b07ca870a4470ff295767522f0615b37519cf352.tar.gz Hyprland-b07ca870a4470ff295767522f0615b37519cf352.zip |
refactor workspaces to use ptrs
Diffstat (limited to 'src/desktop/Window.hpp')
-rw-r--r-- | src/desktop/Window.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index bc1820a0..31b0edce 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -11,6 +11,7 @@ #include "Popup.hpp" #include "../macros.hpp" #include "../managers/XWaylandManager.hpp" +#include "DesktopTypes.hpp" enum eIdleInhibitMode { IDLEINHIBIT_NONE = 0, @@ -254,7 +255,7 @@ class CWindow { std::string m_szTitle = ""; std::string m_szInitialTitle = ""; std::string m_szInitialClass = ""; - int m_iWorkspaceID = -1; + PHLWORKSPACE m_pWorkspace; bool m_bIsMapped = false; @@ -384,7 +385,7 @@ class CWindow { void destroyToplevelHandle(); void updateToplevel(); void updateSurfaceScaleTransformDetails(); - void moveToWorkspace(int); + void moveToWorkspace(PHLWORKSPACE); CWindow* X11TransientFor(); void onUnmap(); void onMap(); @@ -400,6 +401,8 @@ class CWindow { bool shouldSendFullscreenState(); void setSuspended(bool suspend); bool visibleOnMonitor(CMonitor* pMonitor); + int workspaceID(); + bool onSpecialWorkspace(); int getRealBorderSize(); void updateSpecialRenderData(); @@ -430,6 +433,7 @@ class CWindow { // For hidden windows and stuff bool m_bHidden = false; bool m_bSuspended = false; + int m_iLastWorkspace = WORKSPACE_INVALID; }; /** @@ -464,7 +468,7 @@ struct std::formatter<CWindow*, CharT> : std::formatter<CharT> { std::format_to(out, "["); std::format_to(out, "Window {:x}: title: \"{}\"", (uintptr_t)w, w->m_szTitle); if (formatWorkspace) - std::format_to(out, ", workspace: {}", w->m_iWorkspaceID); + std::format_to(out, ", workspace: {}", w->m_pWorkspace ? w->workspaceID() : WORKSPACE_INVALID); if (formatMonitor) std::format_to(out, ", monitor: {}", w->m_iMonitorID); if (formatClass) |