summaryrefslogtreecommitdiff
path: root/src/desktop/Workspace.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-29 13:03:38 +0000
committerVaxry <vaxry@vaxry.net>2024-02-29 13:03:38 +0000
commitb39dcfa497f84486569bf862092dfcfadbfd8747 (patch)
treec9f7a99c04ed6091ef79eea41a61d53dd04cc7cb /src/desktop/Workspace.hpp
parent4bff762d9733ba7334cd37b995cf51552cc80be0 (diff)
refactor: move a few things to desktop/
Diffstat (limited to 'src/desktop/Workspace.hpp')
-rw-r--r--src/desktop/Workspace.hpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/desktop/Workspace.hpp b/src/desktop/Workspace.hpp
new file mode 100644
index 00000000..d4915769
--- /dev/null
+++ b/src/desktop/Workspace.hpp
@@ -0,0 +1,67 @@
+#pragma once
+
+#include "../helpers/AnimatedVariable.hpp"
+#include <string>
+#include "../defines.hpp"
+
+enum eFullscreenMode : int8_t {
+ FULLSCREEN_INVALID = -1,
+ FULLSCREEN_FULL = 0,
+ FULLSCREEN_MAXIMIZED
+};
+
+class CWindow;
+
+class CWorkspace {
+ public:
+ CWorkspace(int monitorID, std::string name, bool special = false);
+ ~CWorkspace();
+
+ // Workspaces ID-based have IDs > 0
+ // and workspaces name-based have IDs starting with -1337
+ int m_iID = -1;
+ std::string m_szName = "";
+ uint64_t m_iMonitorID = -1;
+ // Previous workspace ID is stored during a workspace change, allowing travel
+ // to the previous workspace.
+ struct SPrevWorkspaceData {
+ int iID = -1;
+ std::string name = "";
+ } m_sPrevWorkspace;
+
+ bool m_bHasFullscreenWindow = false;
+ eFullscreenMode m_efFullscreenMode = FULLSCREEN_FULL;
+
+ wl_array m_wlrCoordinateArr;
+
+ // for animations
+ CAnimatedVariable m_vRenderOffset;
+ CAnimatedVariable m_fAlpha;
+ bool m_bForceRendering = false;
+
+ // "scratchpad"
+ bool m_bIsSpecialWorkspace = false;
+
+ // last window
+ CWindow* m_pLastFocusedWindow = nullptr;
+
+ // user-set
+ bool m_bDefaultFloating = false;
+ bool m_bDefaultPseudo = false;
+
+ // last monitor (used on reconnect)
+ std::string m_szLastMonitor = "";
+
+ // Whether the user configured command for on-created-empty has been executed, if any
+ bool m_bOnCreatedEmptyExecuted = false;
+
+ void startAnim(bool in, bool left, bool instant = false);
+ void setActive(bool on);
+
+ void moveToMonitor(const int&);
+
+ CWindow* getLastFocusedWindow();
+ void rememberPrevWorkspace(const CWorkspace* prevWorkspace);
+
+ std::string getConfigName();
+};