From 92acc58af692920cc3ae9d89fb81a28162c9ad63 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 9 Sep 2004 00:30:29 +0000 Subject: [PATCH] Get rid of the WIN_SetRectangles export from user32. --- dlls/ttydrv/Makefile.in | 2 +- dlls/ttydrv/wnd.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- dlls/user/user32.spec | 1 - dlls/x11drv/window.c | 50 +++++++++++++++++++++++++++++++++++++++++++++--- dlls/x11drv/winpos.c | 4 ++-- dlls/x11drv/x11drv.h | 1 + include/win.h | 1 - windows/win.c | 47 --------------------------------------------- 8 files changed, 101 insertions(+), 56 deletions(-) diff --git a/dlls/ttydrv/Makefile.in b/dlls/ttydrv/Makefile.in index 385a74b99f1..477ae812014 100644 --- a/dlls/ttydrv/Makefile.in +++ b/dlls/ttydrv/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = ttydrv.dll -IMPORTS = user32 gdi32 kernel32 +IMPORTS = user32 gdi32 kernel32 ntdll EXTRALIBS = @CURSESLIBS@ C_SRCS = \ diff --git a/dlls/ttydrv/wnd.c b/dlls/ttydrv/wnd.c index 71395e50b17..714fff3d6dc 100644 --- a/dlls/ttydrv/wnd.c +++ b/dlls/ttydrv/wnd.c @@ -25,6 +25,7 @@ #include "winpos.h" #include "wownt32.h" #include "wine/wingdi16.h" +#include "wine/server.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ttydrv); @@ -36,18 +37,66 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv); #define SWP_AGG_STATUSFLAGS \ (SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW) +/*********************************************************************** + * set_window_rectangles + * + * Set the window and client rectangles. + */ +static void set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient ) +{ + WND *win = WIN_GetPtr( hwnd ); + BOOL ret; + + if (!win) return; + if (win == WND_OTHER_PROCESS) + { + if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd ); + return; + } + SERVER_START_REQ( set_window_rectangles ) + { + req->handle = hwnd; + req->window.left = rectWindow->left; + req->window.top = rectWindow->top; + req->window.right = rectWindow->right; + req->window.bottom = rectWindow->bottom; + req->client.left = rectClient->left; + req->client.top = rectClient->top; + req->client.right = rectClient->right; + req->client.bottom = rectClient->bottom; + ret = !wine_server_call( req ); + } + SERVER_END_REQ; + if (ret) + { + win->rectWindow = *rectWindow; + win->rectClient = *rectClient; + + TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd, + rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom, + rectClient->left, rectClient->top, rectClient->right, rectClient->bottom ); + } + WIN_ReleasePtr( win ); +} + + /********************************************************************** * CreateWindow (TTYDRV.@) */ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) { BOOL ret; + RECT rect; HWND hwndLinkAfter; CBT_CREATEWNDA cbtc; WND *wndPtr = WIN_GetPtr( hwnd ); TRACE("(%p)\n", hwnd); + /* initialize the dimensions before sending WM_GETMINMAXINFO */ + SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); + set_window_rectangles( hwnd, &rect, &rect ); + if (!wndPtr->parent) /* desktop window */ { wndPtr->pDriverData = root_window; @@ -602,7 +651,7 @@ BOOL TTYDRV_SetWindowPos( WINDOWPOS *winpos ) /* FIXME: actually do something with WVR_VALIDRECTS */ - WIN_SetRectangles( winpos->hwnd, &newWindowRect, &newClientRect ); + set_window_rectangles( winpos->hwnd, &newWindowRect, &newClientRect ); if( winpos->flags & SWP_SHOWWINDOW ) WIN_SetStyle( winpos->hwnd, wndPtr->dwStyle | WS_VISIBLE ); diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec index 15b1547f8e0..511c74c681e 100644 --- a/dlls/user/user32.spec +++ b/dlls/user/user32.spec @@ -739,7 +739,6 @@ @ cdecl WIN_ReleaseWndPtr(ptr) @ cdecl WIN_RestoreWndsLock(long) @ cdecl WIN_SetExStyle(long long) -@ cdecl WIN_SetRectangles(long ptr ptr) @ cdecl WIN_SetStyle(long long) @ cdecl WIN_SuspendWndsLock() @ cdecl WIN_UnlinkWindow(long) diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index 873d5f36ebf..75219ac11e8 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -41,6 +41,7 @@ #include "wine/debug.h" #include "x11drv.h" +#include "wine/server.h" #include "win.h" #include "winpos.h" #include "mwm.h" @@ -739,6 +740,49 @@ void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data } +/*********************************************************************** + * X11DRV_set_window_rectangles + * + * Set the window and client rectangles. + */ +void X11DRV_set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient ) +{ + WND *win = WIN_GetPtr( hwnd ); + BOOL ret; + + if (!win) return; + if (win == WND_OTHER_PROCESS) + { + if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd ); + return; + } + SERVER_START_REQ( set_window_rectangles ) + { + req->handle = hwnd; + req->window.left = rectWindow->left; + req->window.top = rectWindow->top; + req->window.right = rectWindow->right; + req->window.bottom = rectWindow->bottom; + req->client.left = rectClient->left; + req->client.top = rectClient->top; + req->client.right = rectClient->right; + req->client.bottom = rectClient->bottom; + ret = !wine_server_call( req ); + } + SERVER_END_REQ; + if (ret) + { + win->rectWindow = *rectWindow; + win->rectClient = *rectClient; + + TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd, + rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom, + rectClient->left, rectClient->top, rectClient->right, rectClient->bottom ); + } + WIN_ReleasePtr( win ); +} + + /********************************************************************** * create_desktop */ @@ -997,7 +1041,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) /* initialize the dimensions before sending WM_GETMINMAXINFO */ SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); - WIN_SetRectangles( hwnd, &rect, &rect ); + X11DRV_set_window_rectangles( hwnd, &rect, &rect ); if (!wndPtr->parent) { @@ -1038,7 +1082,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE; SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); - WIN_SetRectangles( hwnd, &rect, &rect ); + X11DRV_set_window_rectangles( hwnd, &rect, &rect ); X11DRV_sync_whole_window_position( display, wndPtr, 0 ); } WIN_ReleasePtr( wndPtr ); @@ -1066,7 +1110,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) if (!(wndPtr = WIN_GetPtr(hwnd))) return FALSE; if (rect.left > rect.right || rect.top > rect.bottom) rect = wndPtr->rectWindow; - WIN_SetRectangles( hwnd, &wndPtr->rectWindow, &rect ); + X11DRV_set_window_rectangles( hwnd, &wndPtr->rectWindow, &rect ); X11DRV_sync_client_window_position( display, wndPtr ); X11DRV_register_window( display, hwnd, data ); diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index 11ddb53f477..af18c176327 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -967,7 +967,7 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos ) /* FIXME: actually do something with WVR_VALIDRECTS */ - WIN_SetRectangles( winpos->hwnd, &newWindowRect, &newClientRect ); + X11DRV_set_window_rectangles( winpos->hwnd, &newWindowRect, &newClientRect ); if (get_whole_window(wndPtr)) /* don't do anything if X window not created yet */ { @@ -1579,7 +1579,7 @@ void X11DRV_handle_desktop_resize( unsigned int width, unsigned int height ) screen_height = height; TRACE("desktop %p change to (%dx%d)\n", hwnd, width, height); SetRect( &rect, 0, 0, width, height ); - WIN_SetRectangles( hwnd, &rect, &rect ); + X11DRV_set_window_rectangles( hwnd, &rect, &rect ); SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_depth, MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL ); } diff --git a/dlls/x11drv/x11drv.h b/dlls/x11drv/x11drv.h index 2912e464e56..9f9822acfa6 100644 --- a/dlls/x11drv/x11drv.h +++ b/dlls/x11drv/x11drv.h @@ -559,6 +559,7 @@ extern Window X11DRV_create_desktop( XVisualInfo *desktop_vi, const char *geomet extern void X11DRV_sync_window_style( Display *display, WND *win ); extern int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder ); extern int X11DRV_sync_client_window_position( Display *display, WND *win ); +extern void X11DRV_set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient ); extern void X11DRV_set_wm_hints( Display *display, WND *win ); extern void X11DRV_handle_desktop_resize(unsigned int width, unsigned int height); diff --git a/include/win.h b/include/win.h index 319e610a100..6f9964a5adb 100644 --- a/include/win.h +++ b/include/win.h @@ -105,7 +105,6 @@ extern void WIN_UnlinkWindow( HWND hwnd ); extern HWND WIN_SetOwner( HWND hwnd, HWND owner ); extern LONG WIN_SetStyle( HWND hwnd, LONG style ); extern LONG WIN_SetExStyle( HWND hwnd, LONG style ); -extern void WIN_SetRectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient ); extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient ); extern LRESULT WIN_DestroyWindow( HWND hwnd ); extern void WIN_DestroyThreadWindows( HWND hwnd ); diff --git a/windows/win.c b/windows/win.c index 433e0b58c04..8ec41d39698 100644 --- a/windows/win.c +++ b/windows/win.c @@ -540,49 +540,6 @@ LONG WIN_SetExStyle( HWND hwnd, LONG style ) /*********************************************************************** - * WIN_SetRectangles - * - * Set the window and client rectangles. - */ -void WIN_SetRectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient ) -{ - WND *win = WIN_GetPtr( hwnd ); - BOOL ret; - - if (!win) return; - if (win == WND_OTHER_PROCESS) - { - if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd ); - return; - } - SERVER_START_REQ( set_window_rectangles ) - { - req->handle = hwnd; - req->window.left = rectWindow->left; - req->window.top = rectWindow->top; - req->window.right = rectWindow->right; - req->window.bottom = rectWindow->bottom; - req->client.left = rectClient->left; - req->client.top = rectClient->top; - req->client.right = rectClient->right; - req->client.bottom = rectClient->bottom; - ret = !wine_server_call( req ); - } - SERVER_END_REQ; - if (ret) - { - win->rectWindow = *rectWindow; - win->rectClient = *rectClient; - - TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd, - rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom, - rectClient->left, rectClient->top, rectClient->right, rectClient->bottom ); - } - WIN_ReleasePtr( win ); -} - - -/*********************************************************************** * WIN_GetRectangles * * Get the window and client rectangles. @@ -731,7 +688,6 @@ BOOL WIN_CreateDesktopWindow(void) { HWND hwndDesktop; CREATESTRUCTA cs; - RECT rect; TRACE("Creating desktop window\n"); @@ -765,9 +721,6 @@ BOOL WIN_CreateDesktopWindow(void) cs.lpszName = NULL; cs.lpszClass = DESKTOP_CLASS_ATOM; - SetRect( &rect, 0, 0, cs.cx, cs.cy ); - WIN_SetRectangles( hwndDesktop, &rect, &rect ); - SERVER_START_REQ( set_window_info ) { req->handle = hwndDesktop; -- 2.11.4.GIT