Commit 92acc58a authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the WIN_SetRectangles export from user32.

parent 17c775f1
...@@ -3,7 +3,7 @@ TOPOBJDIR = ../.. ...@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = ttydrv.dll MODULE = ttydrv.dll
IMPORTS = user32 gdi32 kernel32 IMPORTS = user32 gdi32 kernel32 ntdll
EXTRALIBS = @CURSESLIBS@ EXTRALIBS = @CURSESLIBS@
C_SRCS = \ C_SRCS = \
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "winpos.h" #include "winpos.h"
#include "wownt32.h" #include "wownt32.h"
#include "wine/wingdi16.h" #include "wine/wingdi16.h"
#include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ttydrv); WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
...@@ -36,18 +37,66 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv); ...@@ -36,18 +37,66 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
#define SWP_AGG_STATUSFLAGS \ #define SWP_AGG_STATUSFLAGS \
(SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW) (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.@) * CreateWindow (TTYDRV.@)
*/ */
BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
{ {
BOOL ret; BOOL ret;
RECT rect;
HWND hwndLinkAfter; HWND hwndLinkAfter;
CBT_CREATEWNDA cbtc; CBT_CREATEWNDA cbtc;
WND *wndPtr = WIN_GetPtr( hwnd ); WND *wndPtr = WIN_GetPtr( hwnd );
TRACE("(%p)\n", 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 */ if (!wndPtr->parent) /* desktop window */
{ {
wndPtr->pDriverData = root_window; wndPtr->pDriverData = root_window;
...@@ -602,7 +651,7 @@ BOOL TTYDRV_SetWindowPos( WINDOWPOS *winpos ) ...@@ -602,7 +651,7 @@ BOOL TTYDRV_SetWindowPos( WINDOWPOS *winpos )
/* FIXME: actually do something with WVR_VALIDRECTS */ /* 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 ) if( winpos->flags & SWP_SHOWWINDOW )
WIN_SetStyle( winpos->hwnd, wndPtr->dwStyle | WS_VISIBLE ); WIN_SetStyle( winpos->hwnd, wndPtr->dwStyle | WS_VISIBLE );
......
...@@ -739,7 +739,6 @@ ...@@ -739,7 +739,6 @@
@ cdecl WIN_ReleaseWndPtr(ptr) @ cdecl WIN_ReleaseWndPtr(ptr)
@ cdecl WIN_RestoreWndsLock(long) @ cdecl WIN_RestoreWndsLock(long)
@ cdecl WIN_SetExStyle(long long) @ cdecl WIN_SetExStyle(long long)
@ cdecl WIN_SetRectangles(long ptr ptr)
@ cdecl WIN_SetStyle(long long) @ cdecl WIN_SetStyle(long long)
@ cdecl WIN_SuspendWndsLock() @ cdecl WIN_SuspendWndsLock()
@ cdecl WIN_UnlinkWindow(long) @ cdecl WIN_UnlinkWindow(long)
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "x11drv.h" #include "x11drv.h"
#include "wine/server.h"
#include "win.h" #include "win.h"
#include "winpos.h" #include "winpos.h"
#include "mwm.h" #include "mwm.h"
...@@ -739,6 +740,49 @@ void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data ...@@ -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 * create_desktop
*/ */
...@@ -997,7 +1041,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) ...@@ -997,7 +1041,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
/* initialize the dimensions before sending WM_GETMINMAXINFO */ /* initialize the dimensions before sending WM_GETMINMAXINFO */
SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); 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) if (!wndPtr->parent)
{ {
...@@ -1038,7 +1082,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) ...@@ -1038,7 +1082,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE; if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE;
SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); 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 ); X11DRV_sync_whole_window_position( display, wndPtr, 0 );
} }
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
...@@ -1066,7 +1110,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) ...@@ -1066,7 +1110,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
if (!(wndPtr = WIN_GetPtr(hwnd))) return FALSE; if (!(wndPtr = WIN_GetPtr(hwnd))) return FALSE;
if (rect.left > rect.right || rect.top > rect.bottom) rect = wndPtr->rectWindow; 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_sync_client_window_position( display, wndPtr );
X11DRV_register_window( display, hwnd, data ); X11DRV_register_window( display, hwnd, data );
......
...@@ -967,7 +967,7 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos ) ...@@ -967,7 +967,7 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos )
/* FIXME: actually do something with WVR_VALIDRECTS */ /* 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 */ 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 ) ...@@ -1579,7 +1579,7 @@ void X11DRV_handle_desktop_resize( unsigned int width, unsigned int height )
screen_height = height; screen_height = height;
TRACE("desktop %p change to (%dx%d)\n", hwnd, width, height); TRACE("desktop %p change to (%dx%d)\n", hwnd, width, height);
SetRect( &rect, 0, 0, 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, SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_depth,
MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL ); MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL );
} }
......
...@@ -559,6 +559,7 @@ extern Window X11DRV_create_desktop( XVisualInfo *desktop_vi, const char *geomet ...@@ -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 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_whole_window_position( Display *display, WND *win, int zorder );
extern int X11DRV_sync_client_window_position( Display *display, WND *win ); 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_set_wm_hints( Display *display, WND *win );
extern void X11DRV_handle_desktop_resize(unsigned int width, unsigned int height); extern void X11DRV_handle_desktop_resize(unsigned int width, unsigned int height);
......
...@@ -105,7 +105,6 @@ extern void WIN_UnlinkWindow( HWND hwnd ); ...@@ -105,7 +105,6 @@ extern void WIN_UnlinkWindow( HWND hwnd );
extern HWND WIN_SetOwner( HWND hwnd, HWND owner ); extern HWND WIN_SetOwner( HWND hwnd, HWND owner );
extern LONG WIN_SetStyle( HWND hwnd, LONG style ); extern LONG WIN_SetStyle( HWND hwnd, LONG style );
extern LONG WIN_SetExStyle( 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 BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient );
extern LRESULT WIN_DestroyWindow( HWND hwnd ); extern LRESULT WIN_DestroyWindow( HWND hwnd );
extern void WIN_DestroyThreadWindows( HWND hwnd ); extern void WIN_DestroyThreadWindows( HWND hwnd );
......
...@@ -540,49 +540,6 @@ LONG WIN_SetExStyle( HWND hwnd, LONG style ) ...@@ -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 * WIN_GetRectangles
* *
* Get the window and client rectangles. * Get the window and client rectangles.
...@@ -731,7 +688,6 @@ BOOL WIN_CreateDesktopWindow(void) ...@@ -731,7 +688,6 @@ BOOL WIN_CreateDesktopWindow(void)
{ {
HWND hwndDesktop; HWND hwndDesktop;
CREATESTRUCTA cs; CREATESTRUCTA cs;
RECT rect;
TRACE("Creating desktop window\n"); TRACE("Creating desktop window\n");
...@@ -765,9 +721,6 @@ BOOL WIN_CreateDesktopWindow(void) ...@@ -765,9 +721,6 @@ BOOL WIN_CreateDesktopWindow(void)
cs.lpszName = NULL; cs.lpszName = NULL;
cs.lpszClass = DESKTOP_CLASS_ATOM; cs.lpszClass = DESKTOP_CLASS_ATOM;
SetRect( &rect, 0, 0, cs.cx, cs.cy );
WIN_SetRectangles( hwndDesktop, &rect, &rect );
SERVER_START_REQ( set_window_info ) SERVER_START_REQ( set_window_info )
{ {
req->handle = hwndDesktop; req->handle = hwndDesktop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment