Dll separation (2)

Dimitrie O. Paun dpaun at rogers.com
Sun Sep 22 22:53:08 CDT 2002


The USER driver does not need to know about the caret,
or the notifications that are being sent on SetWindowPos.

So move them to USER, and get rid of the last CARET_*
function exported from USER.

ChangeLog:
  Move caret handling and notification from x11drv to user.

Index: dlls/user/user32.spec
===================================================================
RCS file: /var/cvs/wine/dlls/user/user32.spec,v
retrieving revision 1.53
diff -u -r1.53 user32.spec
--- dlls/user/user32.spec	20 Sep 2002 19:35:54 -0000	1.53
+++ dlls/user/user32.spec	23 Sep 2002 03:26:48 -0000
@@ -680,7 +680,6 @@
 ################################################################
 # Wine dll separation hacks, these will go away, don't use them
 #
-@ cdecl CARET_GetHwnd() CARET_GetHwnd
 @ cdecl CLIPBOARD_DeleteRecord(ptr long) CLIPBOARD_DeleteRecord
 @ cdecl CLIPBOARD_EmptyCache(long) CLIPBOARD_EmptyCache
 @ cdecl CLIPBOARD_GetFormatName(long ptr long) CLIPBOARD_GetFormatName
Index: dlls/x11drv/winpos.c
===================================================================
RCS file: /var/cvs/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.48
diff -u -r1.48 winpos.c
--- dlls/x11drv/winpos.c	29 Aug 2002 01:48:18 -0000	1.48
+++ dlls/x11drv/winpos.c	23 Sep 2002 03:44:53 -0000
@@ -45,10 +45,7 @@
 
 #define SWP_AGG_NOGEOMETRYCHANGE \
     (SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
-#define SWP_AGG_NOPOSCHANGE \
-    (SWP_AGG_NOGEOMETRYCHANGE | SWP_NOZORDER)
-#define SWP_AGG_STATUSFLAGS \
-    (SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW)
+#define SWP_AGG_NOPOSCHANGE (SWP_AGG_NOGEOMETRYCHANGE | SWP_NOZORDER)
 
 #define SWP_EX_NOCOPY       0x0001
 #define SWP_EX_PAINTSELF    0x0002
@@ -1008,31 +1005,6 @@
     WIN_ReleaseWndPtr(wndPtr);
 
     if (wvrFlags & WVR_REDRAW) RedrawWindow( winpos->hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE );
-
-    if (winpos->hwnd == CARET_GetHwnd())
-    {
-        if( winpos->flags & SWP_HIDEWINDOW )
-            HideCaret(winpos->hwnd);
-        else if (winpos->flags & SWP_SHOWWINDOW)
-            ShowCaret(winpos->hwnd);
-    }
-
-    if (!(winpos->flags & SWP_NOACTIVATE))
-    {
-        /* child windows get WM_CHILDACTIVATE message */
-        if ((GetWindowLongW( winpos->hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD)
-            SendMessageA( winpos->hwnd, WM_CHILDACTIVATE, 0, 0 );
-        else
-            SetActiveWindow( winpos->hwnd );
-    }
-
-      /* And last, send the WM_WINDOWPOSCHANGED message */
-
-    TRACE("\tstatus flags = %04x\n", winpos->flags & SWP_AGG_STATUSFLAGS);
-
-    if (((winpos->flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE))
-        SendMessageA( winpos->hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)winpos );
-        /* WM_WINDOWPOSCHANGED is send even if SWP_NOSENDCHANGING is set */
 
     return TRUE;
 }
Index: windows/winpos.c
===================================================================
RCS file: /var/cvs/wine/windows/winpos.c,v
retrieving revision 1.136
diff -u -r1.136 winpos.c
--- windows/winpos.c	27 Aug 2002 01:14:44 -0000	1.136
+++ windows/winpos.c	23 Sep 2002 03:45:36 -0000
@@ -40,6 +40,14 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(win);
 
+#define SWP_AGG_NOGEOMETRYCHANGE \
+    (SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
+	
+#define SWP_AGG_NOPOSCHANGE (SWP_AGG_NOGEOMETRYCHANGE | SWP_NOZORDER)
+	
+#define SWP_AGG_STATUSFLAGS \
+    (SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW)
+
 #define HAS_DLGFRAME(style,exStyle) \
     (((exStyle) & WS_EX_DLGMODALFRAME) || \
      (((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
@@ -1575,8 +1583,38 @@
     winpos.cx = cx;
     winpos.cy = cy;
     winpos.flags = flags;
-    if (WIN_IsCurrentThread( hwnd )) return USER_Driver.pSetWindowPos( &winpos );
-    return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
+
+    if (!WIN_IsCurrentThread( hwnd )) 
+	return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
+
+    if (!USER_Driver.pSetWindowPos( &winpos )) return FALSE;
+
+    if (winpos.hwnd == CARET_GetHwnd())
+    {
+        if( winpos.flags & SWP_HIDEWINDOW )
+            HideCaret(winpos.hwnd);
+        else if (winpos.flags & SWP_SHOWWINDOW)
+            ShowCaret(winpos.hwnd);
+    }
+
+    if (!(winpos.flags & SWP_NOACTIVATE))
+    {
+        /* child windows get WM_CHILDACTIVATE message */
+        if ((GetWindowLongW( winpos.hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD)
+            SendMessageA( winpos.hwnd, WM_CHILDACTIVATE, 0, 0 );
+        else
+            SetActiveWindow( winpos.hwnd );
+    }
+
+      /* And last, send the WM_WINDOWPOSCHANGED message */
+
+    TRACE("\tstatus flags = %04x\n", winpos.flags & SWP_AGG_STATUSFLAGS);
+
+    if (((winpos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE))
+        SendMessageA( winpos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)&winpos );
+        /* WM_WINDOWPOSCHANGED is send even if SWP_NOSENDCHANGING is set */
+
+    return TRUE;
 }
 
 




More information about the wine-patches mailing list