Alexandre Julliard : user: Don't send WM_PARENTNOTIFY to the desktop window .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 30 05:44:28 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 4d3282a5fbc8a4b0c92d11f13df795080afc7989
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=4d3282a5fbc8a4b0c92d11f13df795080afc7989

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Mar 30 13:22:27 2006 +0200

user: Don't send WM_PARENTNOTIFY to the desktop window.

---

 dlls/user/message.c |    1 +
 dlls/user/win.c     |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/user/message.c b/dlls/user/message.c
index 8fe2ee7..18c5d4b 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -1563,6 +1563,7 @@ static void send_parent_notify( HWND hwn
         if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)) break;
         if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY) break;
         if (!(parent = GetParent(hwnd))) break;
+        if (parent == GetDesktopWindow()) break;
         MapWindowPoints( hwnd, parent, &pt, 1 );
         hwnd = parent;
         SendMessageW( hwnd, WM_PARENTNOTIFY,
diff --git a/dlls/user/win.c b/dlls/user/win.c
index 44c2461..10a1a4f 100644
--- a/dlls/user/win.c
+++ b/dlls/user/win.c
@@ -275,8 +275,12 @@ static void send_parent_notify( HWND hwn
 {
     if ((GetWindowLongW( hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
         !(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY))
-        SendMessageW( GetParent(hwnd), WM_PARENTNOTIFY,
-                      MAKEWPARAM( msg, GetWindowLongPtrW( hwnd, GWLP_ID )), (LPARAM)hwnd );
+    {
+        HWND parent = GetParent(hwnd);
+        if (parent && parent != GetDesktopWindow())
+            SendMessageW( parent, WM_PARENTNOTIFY,
+                          MAKEWPARAM( msg, GetWindowLongPtrW( hwnd, GWLP_ID )), (LPARAM)hwnd );
+    }
 }
 
 




More information about the wine-cvs mailing list