windows: add misc:initial_workspace_tracking

By default enabled, will track the initial opened workspace of a window spawned for 2 minutes or until it's moved to a different workspace.

For example: you run a launcher and open an app on workspace 1, but quickly switch to workspace 2. The app will now open on workspace 1 regardless of your switch.
This commit is contained in:
Vaxry
2024-04-23 01:28:20 +01:00
parent 7778f01194
commit 29308b94ca
5 changed files with 110 additions and 12 deletions

View File

@@ -357,6 +357,9 @@ class CWindow {
// for idle inhibiting windows
eIdleInhibitMode m_eIdleInhibitMode = IDLEINHIBIT_NONE;
// initial token. Will be unregistered on workspace change or timeout of 2 minutes
std::string m_szInitialWorkspaceToken = "";
// for groups
struct SGroupData {
CWindow* pNextWindow = nullptr; // nullptr means no grouping. Self means single group.
@@ -437,6 +440,9 @@ class CWindow {
void setAnimationsToMove();
void onWorkspaceAnimUpdate();
//
std::unordered_map<std::string, std::string> getEnv();
private:
// For hidden windows and stuff
bool m_bHidden = false;