summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-05-08 22:10:31 +0200
committerGitHub <noreply@github.com>2025-05-08 22:10:31 +0200
commit239cdd67fd5ec54701ac3b0a477c0449beb4d869 (patch)
tree7f0a66832b6f8ffa981f7d617989b1b702802929 /src
parentf01e3043b81d1ad7d886f0502b445bdf3cea0ccc (diff)
socket2: fix order of window events on map (#10341)
Diffstat (limited to 'src')
-rw-r--r--src/events/Windows.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 240070a3..48cf78d5 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -417,6 +417,10 @@ void Events::listener_mapWindow(void* owner, void* data) {
if (PWINDOW->m_swallowed)
PWINDOW->m_swallowed->m_currentlySwallowed = true;
+ // emit the IPC event before the layout might focus the window to avoid a focus event first
+ g_pEventManager->postEvent(
+ SHyprIPCEvent{"openwindow", std::format("{:x},{},{},{}", PWINDOW, requestedWorkspace != "" ? requestedWorkspace : PWORKSPACE->m_name, PWINDOW->m_class, PWINDOW->m_title)});
+
if (PWINDOW->m_isFloating) {
g_pLayoutManager->getCurrentLayout()->onWindowCreated(PWINDOW);
PWINDOW->m_createdOverFullscreen = true;
@@ -673,8 +677,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
Debug::log(LOG, "Map request dispatched, monitor {}, window pos: {:5j}, window size: {:5j}", PMONITOR->m_name, PWINDOW->m_realPosition->goal(), PWINDOW->m_realSize->goal());
- auto workspaceID = requestedWorkspace != "" ? requestedWorkspace : PWORKSPACE->m_name;
- g_pEventManager->postEvent(SHyprIPCEvent{"openwindow", std::format("{:x},{},{},{}", PWINDOW, workspaceID, PWINDOW->m_class, PWINDOW->m_title)});
+ // emit the hook event here after basic stuff has been initialized
EMIT_HOOK_EVENT("openWindow", PWINDOW);
// apply data from default decos. Borders, shadows.