From 640d0754409efbfe66d694b04588f46830b17a58 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 6 Apr 2016 18:51:03 +0200 Subject: [PATCH] winex11-_NET_ACTIVE_WINDOW: Update patchset. --- patches/patchinstall.sh | 2 ++ ...king-a-WM-to-activate-a-window-make-.patch | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 patches/winex11-_NET_ACTIVE_WINDOW/0002-user32-Before-asking-a-WM-to-activate-a-window-make-.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e71afff3..195d721a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -7541,8 +7541,10 @@ fi # | if test "$enable_winex11__NET_ACTIVE_WINDOW" -eq 1; then patch_apply winex11-_NET_ACTIVE_WINDOW/0001-winex11.drv-Add-support-for-_NET_ACTIVE_WINDOW.patch + patch_apply winex11-_NET_ACTIVE_WINDOW/0002-user32-Before-asking-a-WM-to-activate-a-window-make-.patch ( echo '+ { "Dmitry Timoshkov", "winex11.drv: Add support for _NET_ACTIVE_WINDOW.", 1 },'; + echo '+ { "Dmitry Timoshkov", "user32: Before asking a WM to activate a window make sure that the window is in foreground and not minimized.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/winex11-_NET_ACTIVE_WINDOW/0002-user32-Before-asking-a-WM-to-activate-a-window-make-.patch b/patches/winex11-_NET_ACTIVE_WINDOW/0002-user32-Before-asking-a-WM-to-activate-a-window-make-.patch new file mode 100644 index 00000000..a8cf0bd6 --- /dev/null +++ b/patches/winex11-_NET_ACTIVE_WINDOW/0002-user32-Before-asking-a-WM-to-activate-a-window-make-.patch @@ -0,0 +1,31 @@ +From 731298c0bd68f8ff4368a119cdb5e8e7fe0d0950 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 6 Apr 2016 15:14:25 +0800 +Subject: user32: Before asking a WM to activate a window make sure that the + window is in foreground and not minimized. + +This patch fixes iconify action using WM's taskbar buttons for Winamp. +--- + dlls/user32/focus.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c +index 1c705d5..d52c3f5 100644 +--- a/dlls/user32/focus.c ++++ b/dlls/user32/focus.c +@@ -154,9 +154,10 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) + SendMessageW( hwnd, WM_ACTIVATE, + MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, IsIconic(hwnd) ), + (LPARAM)previous ); +- } + +- USER_Driver->pSetActiveWindow( hwnd ); ++ if (hwnd == GetForegroundWindow() && !IsIconic( hwnd )) ++ USER_Driver->pSetActiveWindow( hwnd ); ++ } + + /* now change focus if necessary */ + if (focus) +-- +2.7.1 +