From 3bbdf9dc5ad2851f5d9f317362fc16705e4fd990 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 26 Jun 2025 09:32:44 -0700 Subject: protocols: add ext-workspace implementation (#10818) --- src/desktop/Workspace.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/desktop/Workspace.hpp') diff --git a/src/desktop/Workspace.hpp b/src/desktop/Workspace.hpp index 4f109257..5bf38489 100644 --- a/src/desktop/Workspace.hpp +++ b/src/desktop/Workspace.hpp @@ -4,6 +4,7 @@ #include #include "DesktopTypes.hpp" #include "../helpers/MiscFunctions.hpp" +#include "../helpers/signal/Signal.hpp" enum eFullscreenMode : int8_t { FSMODE_NONE = 0, @@ -21,6 +22,8 @@ class CWorkspace { CWorkspace(WORKSPACEID id, PHLMONITOR monitor, std::string name, bool special = false, bool isEmpty = true); ~CWorkspace(); + WP m_self; + // Workspaces ID-based have IDs > 0 // and workspaces name-based have IDs starting with -1337 WORKSPACEID m_id = WORKSPACE_INVALID; @@ -60,8 +63,6 @@ class CWorkspace { // Inert: destroyed and invalid. If this is true, release the ptr you have. bool inert(); void startAnim(bool in, bool left, bool instant = false); - void setActive(bool on); - void moveToMonitor(const MONITORID&); MONITORID monitorID(); PHLWINDOW getLastFocusedWindow(); void rememberPrevWorkspace(const PHLWORKSPACE& prevWorkspace); @@ -83,6 +84,13 @@ class CWorkspace { void forceReportSizesToWindows(); void updateWindows(); + struct { + CSignal destroy; + CSignal rename; + CSignal monitorChange; + CSignal activeChange; + } m_events; + private: void init(PHLWORKSPACE self); // Previous workspace ID and name is stored during a workspace change, allowing travel @@ -91,7 +99,6 @@ class CWorkspace { SP m_focusedWindowHook; bool m_inert = true; - WP m_self; }; inline bool valid(const PHLWORKSPACE& ref) { -- cgit v1.2.3