[NTUSER] Fix ShellHook notifications when creating/activating windows (#2396)
authorJoachimHenze <33393466+JoachimHenze@users.noreply.github.com>
Thu, 5 Mar 2020 14:39:23 +0000 (15:39 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Mar 2020 14:39:23 +0000 (15:39 +0100)
win32ss/user/ntuser/focus.c
win32ss/user/ntuser/winpos.c

index cc9ac5f..3c5ee19 100644 (file)
@@ -52,7 +52,6 @@ VOID FASTCALL
 UpdateShellHook(PWND Window)
 {
    if ( Window->spwndParent == UserGetDesktopWindow() &&
-        Window->spwndOwner == NULL &&
        (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
          (Window->ExStyle & WS_EX_APPWINDOW)))
    {
@@ -511,7 +510,8 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
                          MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE, (Window->style & WS_MINIMIZE) != 0),
                         (LPARAM)(WindowPrev ? UserHMGetHandle(WindowPrev) : 0));
 
-      UpdateShellHook(Window);
+      if (Window->style & WS_VISIBLE)
+         UpdateShellHook(Window);
 
       Window->state &= ~WNDS_NONCPAINT;
 
index 6467c2c..b5927d1 100644 (file)
@@ -1913,6 +1913,8 @@ co_WinPosSetWindowPos(
               (Window->ExStyle & WS_EX_APPWINDOW)))
          {
             co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+            if (!(WinPos.flags & SWP_NOACTIVATE))
+               UpdateShellHook(Window);
          }
       }