Fixed a problem with apps that override the default behaviour on
WM_MOUSEACTIVATE message (main window was not activated).
diff --git a/windows/message.c b/windows/message.c
index c956043..4673aa2 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -316,7 +316,7 @@
/* Activate the window if needed */
- if (hWnd != GetActiveWindow() && hWnd != GetDesktopWindow())
+ if (hwndTop != GetForegroundWindow() && hwndTop != GetDesktopWindow())
{
LONG ret = SendMessageA( hWnd, WM_MOUSEACTIVATE, hwndTop,
MAKELONG( hittest, message ) );
@@ -324,10 +324,11 @@
if ((ret == MA_ACTIVATEANDEAT) || (ret == MA_NOACTIVATEANDEAT))
eatMsg = TRUE;
- if (((ret == MA_ACTIVATE) || (ret == MA_ACTIVATEANDEAT))
- && hwndTop != GetActiveWindow() )
+ if (((ret == MA_ACTIVATE) || (ret == MA_ACTIVATEANDEAT)))
+ {
if (!WINPOS_SetActiveWindow( hwndTop, TRUE , TRUE ))
eatMsg = TRUE;
+ }
}
}
} else sendSC = (remove && sendSC);