summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2022-08-25 16:33:36 +1200
committerBossCode45 <human.cyborg42@gmail.com>2022-08-25 16:33:36 +1200
commit4a07bd68dd3e3ccdf613ebc1b7114dd277e29c47 (patch)
treed801bd9be1203c25bd6df5db1e226349c9037d79 /main.cpp
parent59d09d10ff9cd28431a62cefddbaa6c16bfcd542 (diff)
downloadYATwm-4a07bd68dd3e3ccdf613ebc1b7114dd277e29c47.tar.gz
YATwm-4a07bd68dd3e3ccdf613ebc1b7114dd277e29c47.zip
Moving windows betweeen workspaces
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 2066993..1724b82 100644
--- a/main.cpp
+++ b/main.cpp
@@ -104,6 +104,30 @@ void changeWS(const KeyArg arg)
tile(currWS, outerGaps, outerGaps, sW - outerGaps*2, sH - outerGaps*2);
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
+void wToWS(const KeyArg arg)
+{
+ Window focusedWindow;
+ int revertToReturn;
+ XGetInputFocus(dpy, &focusedWindow, &revertToReturn);
+ if(focusedWindow == root)
+ return;
+
+ int fID = frameIDS.find(focusedWindow)->second;
+ vector<int>& pSF = frames.find(frames.find(fID)->second.pID)->second.subFrameIDs;
+ for(int i = 0; i < pSF.size(); i++)
+ {
+ if(pSF[i] == fID)
+ {
+ pSF.erase(pSF.begin() + i);
+ break;
+ }
+ }
+ frames.find(fID)->second.pID = arg.num;
+ frames.find(arg.num)->second.subFrameIDs.push_back(fID);
+ XUnmapWindow(dpy, focusedWindow);
+ tile(currWS, outerGaps, outerGaps, sW - outerGaps*2, sH - outerGaps*2);
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+}
void keyPress(XKeyEvent e)
{
@@ -236,6 +260,7 @@ void destroyNotify(XDestroyWindowEvent e)
break;
}
}
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
tile(currWS, outerGaps, outerGaps, sW - outerGaps*2, sH - outerGaps*2);
}