Alexandre Julliard : winex11.drv: Always drag the full window for top-level windows to avoid having to grab the server .
Alexandre Julliard
julliard at winehq.org
Thu Sep 27 14:48:51 CDT 2007
Module: wine
Branch: master
Commit: e36ed76139a37aa1439048ee642acfdbfd25c28c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e36ed76139a37aa1439048ee642acfdbfd25c28c
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Sep 27 20:13:57 2007 +0200
winex11.drv: Always drag the full window for top-level windows to avoid having to grab the server.
---
dlls/winex11.drv/winpos.c | 30 +++++-------------------------
1 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 330a31e..1e7da13 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -1244,10 +1244,8 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
BOOL iconic = style & WS_MINIMIZE;
BOOL moved = FALSE;
DWORD dwPoint = GetMessagePos ();
- BOOL DragFullWindows = FALSE;
- BOOL grab;
+ BOOL DragFullWindows = TRUE;
Window parent_win, whole_win;
- Display *old_gdi_display = NULL;
struct x11drv_thread_data *thread_data = x11drv_thread_data();
struct x11drv_win_data *data;
@@ -1265,8 +1263,6 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
/* if we are managed then we let the WM do all the work */
if (data->managed && X11DRV_WMMoveResizeWindow( hwnd, pt.x, pt.y, wParam )) return;
- SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0);
-
if (syscommand == SC_MOVE)
{
if (!hittest) hittest = start_size_move( hwnd, wParam, &capturePoint, style );
@@ -1344,20 +1340,11 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
SendMessageW( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
set_movesize_capture( hwnd );
- /* grab the server only when moving top-level windows without desktop */
- grab = (!DragFullWindows && !parent && (root_window == DefaultRootWindow(gdi_display)));
+ /* we only allow disabling the full window drag for child windows, or in desktop mode */
+ /* otherwise we'd need to grab the server and we want to avoid that */
+ if (parent || (root_window != DefaultRootWindow(gdi_display)))
+ SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0);
- if (grab)
- {
- wine_tsx11_lock();
- XSync( gdi_display, False );
- XGrabServer( thread_data->display );
- XSync( thread_data->display, False );
- /* switch gdi display to the thread display, since the server is grabbed */
- old_gdi_display = gdi_display;
- gdi_display = thread_data->display;
- wine_tsx11_unlock();
- }
whole_win = X11DRV_get_whole_window( GetAncestor(hwnd,GA_ROOT) );
parent_win = parent ? X11DRV_get_whole_window( GetAncestor(parent,GA_ROOT) ) : root_window;
@@ -1467,13 +1454,6 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
wine_tsx11_lock();
XUngrabPointer( thread_data->display, CurrentTime );
- if (grab)
- {
- XSync( thread_data->display, False );
- XUngrabServer( thread_data->display );
- XSync( thread_data->display, False );
- gdi_display = old_gdi_display;
- }
wine_tsx11_unlock();
thread_data->grab_window = None;
More information about the wine-cvs
mailing list