summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-10-24 17:00:08 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-10-24 17:00:08 +0100
commite0bc952c8382992c2e9621865b94c904e728a8c3 (patch)
treed2a4943a7386f75caecff54c7ac1d4eb9791bb62 /src/events/Windows.cpp
parentcf869d963687d26876f6e203a925cd6648380c4a (diff)
minor fix to silent ws rules
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 627da575..54000a6a 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -375,14 +375,23 @@ void Events::listener_mapWindow(void* owner, void* data) {
// move the window
const auto OLDWORKSPACE = PWINDOW->m_iWorkspaceID;
- std::stringstream stream;
- stream << std::hex << (uintptr_t)PWINDOW;
- std::string hexStr(stream.str());
-
- if (requestedWorkspace != "special") {
- g_pKeybindManager->m_mDispatchers["movetoworkspacesilent"](requestedWorkspace + ",address:0x" + hexStr);
+ if (g_pCompositor->m_pLastWindow == PWINDOW) {
+ if (requestedWorkspace != "special") {
+ g_pKeybindManager->m_mDispatchers["movetoworkspacesilent"](requestedWorkspace);
+ } else {
+ g_pKeybindManager->m_mDispatchers["movetoworkspace"]("special");
+ }
} else {
- g_pKeybindManager->m_mDispatchers["movetoworkspace"]("special,address:0x" + hexStr);
+ // yes this is fucking weird no clue why this won't work for everyone
+ std::stringstream stream;
+ stream << std::hex << (uintptr_t)PWINDOW;
+ std::string hexStr(stream.str());
+
+ if (requestedWorkspace != "special") {
+ g_pKeybindManager->m_mDispatchers["movetoworkspacesilent"](requestedWorkspace + ",address:0x" + hexStr);
+ } else {
+ g_pKeybindManager->m_mDispatchers["movetoworkspace"]("special,address:0x" + hexStr);
+ }
}
g_pCompositor->forceReportSizesToWindowsOnWorkspace(OLDWORKSPACE);