]> Pileus Git - wmpus/blobdiff - sys-win32.c
Add floating layer
[wmpus] / sys-win32.c
index 04e4ef4e52d75978520751034339291d9f431d0a..ba3a7e9c9bb04f70701bb286d8554e8958a062ac 100644 (file)
@@ -324,9 +324,13 @@ void sys_focus(win_t *win)
         * certain circumstances and instead flashes the windows toolbar icon.
         * Attaching the thread input queues avoids this behavior */
        DWORD oldId = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
-       DWORD newId = GetWindowThreadProcessId(win->sys->hwnd,        NULL);
+       DWORD newId = GetCurrentThreadId();
        AttachThreadInput(oldId, newId, TRUE);
+
+       BringWindowToTop(win->sys->hwnd);
        SetForegroundWindow(win->sys->hwnd);
+       SetFocus(win->sys->hwnd);
+
        AttachThreadInput(oldId, newId, FALSE);
 }