From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 40 +++++----- dlls/winex11.drv/mouse.c | 6 +- dlls/winex11.drv/window.c | 157 ++++++++++++++++++-------------------- dlls/winex11.drv/x11drv.h | 4 +- dlls/winex11.drv/xim.c | 6 +- 5 files changed, 101 insertions(+), 112 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 635025aff97..ca9ab4b8aed 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -896,13 +896,13 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) rect.bottom = pos.y + event->height;
if (event->window != data->client_window) - OffsetRect( &rect, data->whole_rect.left - data->client_rect.left, - data->whole_rect.top - data->client_rect.top ); + OffsetRect( &rect, data->rects.visible.left - data->rects.client.left, + data->rects.visible.top - data->rects.client.top );
if (event->window != root_window) { if (NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) - mirror_rect( &data->client_rect, &rect ); + mirror_rect( &data->rects.client, &rect ); abs_rect = rect; NtUserMapWindowPoints( hwnd, 0, (POINT *)&abs_rect, 2, 0 /* per-monitor DPI */ );
@@ -1091,22 +1091,22 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
if (!data->whole_window) flags |= SWP_NOCOPYBITS; /* we can't copy bits of foreign windows */
- if (data->window_rect.left == x && data->window_rect.top == y) flags |= SWP_NOMOVE; + if (data->rects.window.left == x && data->rects.window.top == y) flags |= SWP_NOMOVE; else TRACE( "%p moving from (%d,%d) to (%d,%d)\n", - hwnd, (int)data->window_rect.left, (int)data->window_rect.top, x, y ); + hwnd, (int)data->rects.window.left, (int)data->rects.window.top, x, y );
- if ((data->window_rect.right - data->window_rect.left == cx && - data->window_rect.bottom - data->window_rect.top == cy) || - IsRectEmpty( &data->window_rect )) + if ((data->rects.window.right - data->rects.window.left == cx && + data->rects.window.bottom - data->rects.window.top == cy) || + IsRectEmpty( &data->rects.window )) flags |= SWP_NOSIZE; else TRACE( "%p resizing from (%dx%d) to (%dx%d)\n", - hwnd, (int)(data->window_rect.right - data->window_rect.left), - (int)(data->window_rect.bottom - data->window_rect.top), cx, cy ); + hwnd, (int)(data->rects.window.right - data->rects.window.left), + (int)(data->rects.window.bottom - data->rects.window.top), cx, cy );
style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); - if ((style & WS_CAPTION) == WS_CAPTION || !NtUserIsWindowRectFullScreen( &data->whole_rect, dpi )) + if ((style & WS_CAPTION) == WS_CAPTION || !NtUserIsWindowRectFullScreen( &data->rects.visible, dpi )) { read_net_wm_states( event->display, data ); if ((data->net_wm_state & (1 << NET_WM_STATE_MAXIMIZED))) @@ -1159,13 +1159,13 @@ static BOOL X11DRV_GravityNotify( HWND hwnd, XEvent *xev ) return FALSE; }
- x = event->x + data->window_rect.left - data->whole_rect.left; - y = event->y + data->window_rect.top - data->whole_rect.top; + x = event->x + data->rects.window.left - data->rects.visible.left; + y = event->y + data->rects.window.top - data->rects.visible.top;
TRACE( "win %p/%lx new X pos %d,%d (event %d,%d)\n", hwnd, data->whole_window, x, y, event->x, event->y );
- window_rect = data->window_rect; + window_rect = data->rects.window; release_win_data( data );
if (window_rect.left != x || window_rect.top != y) @@ -1448,8 +1448,8 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event ) Window win, w_aux_root, w_aux_child;
if (!(data = get_win_data( hWnd ))) return; - cx = data->whole_rect.right - data->whole_rect.left; - cy = data->whole_rect.bottom - data->whole_rect.top; + cx = data->rects.visible.right - data->rects.visible.left; + cy = data->rects.visible.bottom - data->rects.visible.top; win = data->whole_window; release_win_data( data );
@@ -1537,10 +1537,10 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) if ((win_data = get_win_data( hWnd ))) { drop->fNC = - (drop->pt.x < (win_data->client_rect.left - win_data->whole_rect.left) || - drop->pt.y < (win_data->client_rect.top - win_data->whole_rect.top) || - drop->pt.x > (win_data->client_rect.right - win_data->whole_rect.left) || - drop->pt.y > (win_data->client_rect.bottom - win_data->whole_rect.top) ); + (drop->pt.x < (win_data->rects.client.left - win_data->rects.visible.left) || + drop->pt.y < (win_data->rects.client.top - win_data->rects.visible.top) || + drop->pt.x > (win_data->rects.client.right - win_data->rects.visible.left) || + drop->pt.y > (win_data->rects.client.bottom - win_data->rects.visible.top) ); release_win_data( win_data ); }
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 30444de0cdf..ee0191630f7 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -513,12 +513,12 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x { if (window == data->whole_window) { - pt.x += data->whole_rect.left - data->client_rect.left; - pt.y += data->whole_rect.top - data->client_rect.top; + pt.x += data->rects.visible.left - data->rects.client.left; + pt.y += data->rects.visible.top - data->rects.client.top; }
if (NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) - pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x; + pt.x = data->rects.client.right - data->rects.client.left - 1 - pt.x; NtUserMapWindowPoints( hwnd, 0, &pt, 1, 0 /* per-monitor DPI */ ); } release_win_data( data ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c7c785d2510..6b0329418cf 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -297,7 +297,7 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl { if (style & WS_THICKFRAME) return TRUE; /* Metacity needs the window to be resizable to make it fullscreen */ - return NtUserIsWindowRectFullScreen( &data->whole_rect, get_win_monitor_dpi( data->hwnd ) ); + return NtUserIsWindowRectFullScreen( &data->rects.visible, get_win_monitor_dpi( data->hwnd ) ); }
/*********************************************************************** @@ -388,7 +388,7 @@ static void sync_window_style( struct x11drv_win_data *data ) static void sync_empty_window_shape( struct x11drv_win_data *data, struct window_surface *surface ) { #ifdef HAVE_LIBXSHAPE - if (IsRectEmpty( &data->window_rect )) /* set an empty shape */ + if (IsRectEmpty( &data->rects.window )) /* set an empty shape */ { static XRectangle empty_rect; XShapeCombineRectangles( data->display, data->whole_window, ShapeBounding, 0, 0, @@ -440,8 +440,8 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region ) if ((pRegionData = X11DRV_GetRegionData( hrgn, 0 ))) { XShapeCombineRectangles( data->display, data->whole_window, ShapeBounding, - data->window_rect.left - data->whole_rect.left, - data->window_rect.top - data->whole_rect.top, + data->rects.window.left - data->rects.visible.left, + data->rects.window.top - data->rects.visible.top, (XRectangle *)pRegionData->Buffer, pRegionData->rdh.nCount, ShapeSet, YXBanded ); free( pRegionData ); @@ -745,7 +745,7 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style ) { if (data->hwnd != NtUserGetDesktopWindow()) /* don't force position of desktop */ { - POINT pt = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + POINT pt = virtual_screen_to_root( data->rects.visible.left, data->rects.visible.top ); size_hints->x = pt.x; size_hints->y = pt.y; size_hints->flags |= PPosition; @@ -754,8 +754,8 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style )
if (!is_window_resizable( data, style )) { - size_hints->max_width = data->whole_rect.right - data->whole_rect.left; - size_hints->max_height = data->whole_rect.bottom - data->whole_rect.top; + size_hints->max_width = data->rects.visible.right - data->rects.visible.left; + size_hints->max_height = data->rects.visible.bottom - data->rects.visible.top; if (size_hints->max_width <= 0 ||size_hints->max_height <= 0) size_hints->max_width = size_hints->max_height = 1; size_hints->min_width = size_hints->max_width; @@ -787,7 +787,7 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty } else { - mwm_hints.decorations = get_mwm_decorations( data, style, ex_style, &data->window_rect, &data->client_rect ); + mwm_hints.decorations = get_mwm_decorations( data, style, ex_style, &data->rects.window, &data->rects.client ); mwm_hints.functions = MWM_FUNC_MOVE; if (is_window_resizable( data, style )) mwm_hints.functions |= MWM_FUNC_RESIZE; if (!(style & WS_DISABLED)) @@ -1053,7 +1053,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) if (!X11DRV_DisplayDevices_SupportEventHandlers()) return;
- if (!xinerama_get_fullscreen_monitors( &data->whole_rect, monitors )) + if (!xinerama_get_fullscreen_monitors( &data->rects.visible, monitors )) return;
/* If _NET_WM_FULLSCREEN_MONITORS is not set and the fullscreen monitors are spanning only one @@ -1109,7 +1109,7 @@ void update_net_wm_states( struct x11drv_win_data *data ) style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); - if (NtUserIsWindowRectFullScreen( &data->whole_rect, get_win_monitor_dpi( data->hwnd ) )) + if (NtUserIsWindowRectFullScreen( &data->rects.visible, get_win_monitor_dpi( data->hwnd ) )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) new_state |= (1 << NET_WM_STATE_MAXIMIZED); @@ -1357,14 +1357,14 @@ void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, i { RECT rc;
- get_decoration_rect( data, &rc, &data->window_rect, &data->client_rect ); + get_decoration_rect( data, &rc, &data->rects.window, &data->rects.client );
- x += min( data->window_rect.left - data->whole_rect.left, rc.left ); - y += min( data->window_rect.top - data->whole_rect.top, rc.top ); - cx += max( (data->window_rect.right - data->window_rect.left) - - (data->whole_rect.right - data->whole_rect.left), rc.right - rc.left ); - cy += max( (data->window_rect.bottom - data->window_rect.top) - - (data->whole_rect.bottom - data->whole_rect.top), rc.bottom - rc.top ); + x += min( data->rects.window.left - data->rects.visible.left, rc.left ); + y += min( data->rects.window.top - data->rects.visible.top, rc.top ); + cx += max( (data->rects.window.right - data->rects.window.left) - + (data->rects.visible.right - data->rects.visible.left), rc.right - rc.left ); + cy += max( (data->rects.window.bottom - data->rects.window.top) - + (data->rects.visible.bottom - data->rects.visible.top), rc.bottom - rc.top ); SetRect( rect, x, y, x + cx, y + cy ); }
@@ -1374,9 +1374,7 @@ void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, i * * Synchronize the X window position with the Windows one */ -static void sync_window_position( struct x11drv_win_data *data, - UINT swp_flags, const RECT *old_window_rect, - const RECT *old_whole_rect, const RECT *old_client_rect ) +static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags ) { DWORD style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); DWORD ex_style = NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ); @@ -1388,8 +1386,8 @@ static void sync_window_position( struct x11drv_win_data *data, /* resizing a managed maximized window is not allowed */ if (!(style & WS_MAXIMIZE) || !data->managed) { - changes.width = data->whole_rect.right - data->whole_rect.left; - changes.height = data->whole_rect.bottom - data->whole_rect.top; + changes.width = data->rects.visible.right - data->rects.visible.left; + changes.height = data->rects.visible.bottom - data->rects.visible.top; /* if window rect is empty force size to 1x1 */ if (changes.width <= 0 || changes.height <= 0) changes.width = changes.height = 1; if (changes.width > 65535) changes.width = 65535; @@ -1400,7 +1398,7 @@ static void sync_window_position( struct x11drv_win_data *data, /* only the size is allowed to change for the desktop window or systray docked windows */ if (data->whole_window != root_window && !data->embedded) { - POINT pt = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + POINT pt = virtual_screen_to_root( data->rects.visible.left, data->rects.visible.top ); changes.x = pt.x; changes.y = pt.y; mask |= CWX | CWY; @@ -1428,9 +1426,9 @@ static void sync_window_position( struct x11drv_win_data *data, XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes );
TRACE( "win %p/%lx pos %d,%d,%dx%d after %lx changes=%x serial=%lu\n", - data->hwnd, data->whole_window, (int)data->whole_rect.left, (int)data->whole_rect.top, - (int)(data->whole_rect.right - data->whole_rect.left), - (int)(data->whole_rect.bottom - data->whole_rect.top), + data->hwnd, data->whole_window, (int)data->rects.visible.left, (int)data->rects.visible.top, + (int)(data->rects.visible.right - data->rects.visible.left), + (int)(data->rects.visible.bottom - data->rects.visible.top), changes.sibling, mask, data->configure_serial ); }
@@ -1440,23 +1438,22 @@ static void sync_window_position( struct x11drv_win_data *data, * * Synchronize the X client window position with the Windows one */ -static void sync_client_position( struct x11drv_win_data *data, - const RECT *old_client_rect, const RECT *old_whole_rect ) +static void sync_client_position( struct x11drv_win_data *data, const struct window_rects *old_rects ) { int mask = 0; XWindowChanges changes;
if (!data->client_window) return;
- changes.x = data->client_rect.left - data->whole_rect.left; - changes.y = data->client_rect.top - data->whole_rect.top; - changes.width = min( max( 1, data->client_rect.right - data->client_rect.left ), 65535 ); - changes.height = min( max( 1, data->client_rect.bottom - data->client_rect.top ), 65535 ); + changes.x = data->rects.client.left - data->rects.visible.left; + changes.y = data->rects.client.top - data->rects.visible.top; + changes.width = min( max( 1, data->rects.client.right - data->rects.client.left ), 65535 ); + changes.height = min( max( 1, data->rects.client.bottom - data->rects.client.top ), 65535 );
- if (changes.x != old_client_rect->left - old_whole_rect->left) mask |= CWX; - if (changes.y != old_client_rect->top - old_whole_rect->top) mask |= CWY; - if (changes.width != old_client_rect->right - old_client_rect->left) mask |= CWWidth; - if (changes.height != old_client_rect->bottom - old_client_rect->top) mask |= CWHeight; + if (changes.x != old_rects->client.left - old_rects->visible.left) mask |= CWX; + if (changes.y != old_rects->client.top - old_rects->visible.top) mask |= CWY; + if (changes.width != old_rects->client.right - old_rects->client.left) mask |= CWWidth; + if (changes.height != old_rects->client.bottom - old_rects->client.top) mask |= CWHeight;
if (mask) { @@ -1625,8 +1622,8 @@ static void attach_client_window( struct x11drv_win_data *data, Window client_wi if (data->whole_window) { client_window_events_enable( data, client_window ); - XReparentWindow( gdi_display, client_window, data->whole_window, data->client_rect.left - data->whole_rect.left, - data->client_rect.top - data->whole_rect.top ); + XReparentWindow( gdi_display, client_window, data->whole_window, data->rects.client.left - data->rects.visible.left, + data->rects.client.top - data->rects.visible.top ); }
data->client_window = client_window; @@ -1673,8 +1670,8 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); if (parent == NtUserGetDesktopWindow() || NtUserGetAncestor( parent, GA_PARENT )) return 0; if (!(data = alloc_win_data( thread_init_display(), hwnd ))) return 0; - NtUserGetClientRect( hwnd, &data->client_rect, get_win_monitor_dpi( hwnd ) ); - data->window_rect = data->whole_rect = data->client_rect; + NtUserGetClientRect( hwnd, &data->rects.client, get_win_monitor_dpi( hwnd ) ); + data->rects.window = data->rects.visible = data->rects.client; }
detach_client_window( data, data->client_window ); @@ -1685,10 +1682,10 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo attr.backing_store = NotUseful; attr.border_pixel = 0;
- x = data->client_rect.left - data->whole_rect.left; - y = data->client_rect.top - data->whole_rect.top; - cx = min( max( 1, data->client_rect.right - data->client_rect.left ), 65535 ); - cy = min( max( 1, data->client_rect.bottom - data->client_rect.top ), 65535 ); + x = data->rects.client.left - data->rects.visible.left; + y = data->rects.client.top - data->rects.visible.top; + cx = min( max( 1, data->rects.client.right - data->rects.client.left ), 65535 ); + cy = min( max( 1, data->rects.client.bottom - data->rects.client.top ), 65535 );
XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */ ret = data->client_window = XCreateWindow( gdi_display, @@ -1727,7 +1724,7 @@ static void create_whole_window( struct x11drv_win_data *data ) HRGN win_rgn; POINT pos;
- if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->window_rect )) + if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) { TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); data->managed = TRUE; @@ -1746,12 +1743,12 @@ static void create_whole_window( struct x11drv_win_data *data )
mask = get_window_attributes( data, &attr );
- if (!(cx = data->whole_rect.right - data->whole_rect.left)) cx = 1; + if (!(cx = data->rects.visible.right - data->rects.visible.left)) cx = 1; else if (cx > 65535) cx = 65535; - if (!(cy = data->whole_rect.bottom - data->whole_rect.top)) cy = 1; + if (!(cy = data->rects.visible.bottom - data->rects.visible.top)) cy = 1; else if (cy > 65535) cy = 65535;
- pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + pos = virtual_screen_to_root( data->rects.visible.left, data->rects.visible.top ); data->whole_window = XCreateWindow( data->display, root_window, pos.x, pos.y, cx, cy, 0, data->vis.depth, InputOutput, data->vis.visual, mask, &attr ); @@ -1769,7 +1766,7 @@ static void create_whole_window( struct x11drv_win_data *data ) sync_window_text( data->display, data->whole_window, text );
/* set the window region */ - if (IsRectEmpty( &data->window_rect )) sync_empty_window_shape( data, NULL ); + if (IsRectEmpty( &data->rects.window )) sync_empty_window_shape( data, NULL ); else if (win_rgn) sync_window_region( data, win_rgn );
/* set the window opacity */ @@ -2108,8 +2105,7 @@ void release_win_data( struct x11drv_win_data *data ) * * Create an X11 data window structure for an existing window. */ -static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *window_rect, - const RECT *client_rect ) +static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const struct window_rects *rects ) { Display *display; struct x11drv_win_data *data; @@ -2131,15 +2127,14 @@ static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *wi init_clip_window(); /* make sure the clip window is initialized in this thread */
if (!(data = alloc_win_data( display, hwnd ))) return NULL; + data->rects = *rects;
- data->whole_rect = data->window_rect = *window_rect; - data->client_rect = *client_rect; if (parent == NtUserGetDesktopWindow()) { create_whole_window( data ); TRACE( "win %p/%lx window %s whole %s client %s\n", - hwnd, data->whole_window, wine_dbgstr_rect( &data->window_rect ), - wine_dbgstr_rect( &data->whole_rect ), wine_dbgstr_rect( &data->client_rect )); + hwnd, data->whole_window, wine_dbgstr_rect( &data->rects.window ), + wine_dbgstr_rect( &data->rects.visible ), wine_dbgstr_rect( &data->rects.client )); } return data; } @@ -2223,7 +2218,7 @@ HWND create_foreign_window( Display *display, Window xwin ) XSaveContext( display, xwin, winContext, (char *)data->hwnd );
TRACE( "win %lx parent %p style %08x %s -> hwnd %p\n", - xwin, parent, style, wine_dbgstr_rect(&data->window_rect), hwnd ); + xwin, parent, style, wine_dbgstr_rect(&data->rects.window), hwnd );
release_win_data( data );
@@ -2565,7 +2560,7 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str
TRACE( "hwnd %p, swp_flags %#x, shaped %u, rects %s\n", hwnd, swp_flags, shaped, debugstr_window_rects( rects ) );
- if (!data && !(data = X11DRV_create_win_data( hwnd, &rects->window, &rects->client ))) return FALSE; /* use default surface */ + if (!data && !(data = X11DRV_create_win_data( hwnd, rects ))) return FALSE; /* use default surface */ data->shaped = shaped;
/* check if we need to switch the window to managed */ @@ -2594,8 +2589,8 @@ void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, con Window window;
if (!(data = get_win_data( hwnd ))) return; - old_visible_rect = data->whole_rect; - old_client_rect = data->client_rect; + old_visible_rect = data->rects.visible; + old_client_rect = data->rects.client; window = data->whole_window; release_win_data( data );
@@ -2648,34 +2643,30 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons struct x11drv_thread_data *thread_data; struct x11drv_win_data *data; UINT new_style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); - RECT old_window_rect, old_whole_rect, old_client_rect; + struct window_rects old_rects; int event_type;
if (!(data = get_win_data( hwnd ))) return;
thread_data = x11drv_thread_data();
- old_window_rect = data->window_rect; - old_whole_rect = data->whole_rect; - old_client_rect = data->client_rect; - data->window_rect = new_rects->window; - data->whole_rect = new_rects->visible; - data->client_rect = new_rects->client; + old_rects = data->rects; + data->rects = *new_rects;
TRACE( "win %p/%lx new_rects %s style %08x flags %08x\n", hwnd, data->whole_window, debugstr_window_rects(new_rects), new_style, swp_flags );
XFlush( gdi_display ); /* make sure painting is done before we move the window */
- sync_client_position( data, &old_client_rect, &old_whole_rect ); + sync_client_position( data, &old_rects );
if (!data->whole_window) { BOOL needs_resize = (!data->client_window && - (data->client_rect.right - data->client_rect.left != - old_client_rect.right - old_client_rect.left || - data->client_rect.bottom - data->client_rect.top != - old_client_rect.bottom - old_client_rect.top)); + (data->rects.client.right - data->rects.client.left != + old_rects.client.right - old_rects.client.left || + data->rects.client.bottom - data->rects.client.top != + old_rects.client.bottom - old_rects.client.top)); release_win_data( data ); if (needs_resize) sync_gl_drawable( hwnd, FALSE ); return; @@ -2697,11 +2688,11 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons { if (((swp_flags & SWP_HIDEWINDOW) && !(new_style & WS_VISIBLE)) || (!event_type && !(new_style & WS_MINIMIZE) && - !is_window_rect_mapped( &new_rects->window ) && is_window_rect_mapped( &old_window_rect ))) + !is_window_rect_mapped( &new_rects->window ) && is_window_rect_mapped( &old_rects.window ))) { release_win_data( data ); unmap_window( hwnd ); - if (NtUserIsWindowRectFullScreen( &old_window_rect, get_win_monitor_dpi( hwnd ) )) + if (NtUserIsWindowRectFullScreen( &old_rects.window, get_win_monitor_dpi( hwnd ) )) NtUserClipCursor( NULL ); if (!(data = get_win_data( hwnd ))) return; } @@ -2711,16 +2702,16 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons if (!event_type && !(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) { - sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); + sync_window_position( data, swp_flags ); #ifdef HAVE_LIBXSHAPE - if (IsRectEmpty( &old_window_rect ) != IsRectEmpty( &data->window_rect )) + if (IsRectEmpty( &old_rects.window ) != IsRectEmpty( &new_rects->window )) sync_empty_window_shape( data, surface ); if (data->shaped) { - int old_x_offset = old_window_rect.left - old_whole_rect.left; - int old_y_offset = old_window_rect.top - old_whole_rect.top; - int new_x_offset = data->window_rect.left - data->whole_rect.left; - int new_y_offset = data->window_rect.top - data->whole_rect.top; + int old_x_offset = old_rects.window.left - old_rects.visible.left; + int old_y_offset = old_rects.window.top - old_rects.visible.top; + int new_x_offset = new_rects->window.left - new_rects->visible.left; + int new_y_offset = new_rects->window.top - new_rects->visible.top; if (old_x_offset != new_x_offset || old_y_offset != new_y_offset) XShapeOffsetShape( data->display, data->whole_window, ShapeBounding, new_x_offset - old_x_offset, new_y_offset - old_y_offset ); @@ -2896,7 +2887,7 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO DWORD style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE );
if ((style & WS_VISIBLE) && - ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->window_rect ))) + ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->rects.window ))) { release_win_data( data ); map_window( hwnd, style ); @@ -2935,7 +2926,7 @@ void X11DRV_UpdateLayeredWindow( HWND hwnd, UINT flags ) { DWORD style = NtUserGetWindowLongW( hwnd, GWL_STYLE );
- if ((style & WS_VISIBLE) && ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->window_rect ))) + if ((style & WS_VISIBLE) && ((style & WS_MINIMIZE) || is_window_rect_mapped( &data->rects.window ))) map_window( hwnd, style ); } } @@ -3002,8 +2993,8 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) if (data->whole_window) { /* sync window position with the new virtual screen rect */ - POINT old_pos = {.x = data->whole_rect.left - wp, .y = data->whole_rect.top - lp}; - POINT pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + POINT old_pos = {.x = data->rects.visible.left - wp, .y = data->rects.visible.top - lp}; + POINT pos = virtual_screen_to_root( data->rects.visible.left, data->rects.visible.top ); XWindowChanges changes = {.x = pos.x, .y = pos.y}; UINT mask = 0;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c0cf020067e..947eb1a10e3 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -600,9 +600,7 @@ struct x11drv_win_data HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ Window client_window; /* X window for the client area */ - RECT window_rect; /* USER window rectangle relative to win32 parent window client area */ - RECT whole_rect; /* X window rectangle for the whole window relative to win32 parent window client area */ - RECT client_rect; /* client area relative to win32 parent window client area */ + struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ XIC xic; /* X input context */ UINT managed : 1; /* is window managed? */ UINT mapped : 1; /* is window mapped? (in either normal or iconic state) */ diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 1bb20c845f3..732a55a978a 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -507,10 +507,10 @@ BOOL X11DRV_SetIMECompositionWindowPos( HWND hwnd, const POINT *point )
pt = *point; if (NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) - pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x; + pt.x = data->rects.client.right - data->rects.client.left - 1 - pt.x;
- xpoint.x = pt.x + data->client_rect.left - data->whole_rect.left; - xpoint.y = pt.y + data->client_rect.top - data->whole_rect.top; + xpoint.x = pt.x + data->rects.client.left - data->rects.visible.left; + xpoint.y = pt.y + data->rects.client.top - data->rects.visible.top; attr = XVaCreateNestedList( 0, XNSpotLocation, &xpoint, NULL ); if (attr) {