winex11: Moved the ConfigureNotify handler to event.c.
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index adbf585..2cb8cc8 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -77,6 +77,7 @@
static void X11DRV_FocusOut( HWND hwnd, XEvent *event );
static void X11DRV_Expose( HWND hwnd, XEvent *event );
static void X11DRV_MapNotify( HWND hwnd, XEvent *event );
+static void X11DRV_ConfigureNotify( HWND hwnd, XEvent *event );
static void X11DRV_PropertyNotify( HWND hwnd, XEvent *event );
static void X11DRV_ClientMessage( HWND hwnd, XEvent *event );
@@ -731,6 +732,69 @@
/***********************************************************************
+ * X11DRV_ConfigureNotify
+ */
+void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
+{
+ XConfigureEvent *event = &xev->xconfigure;
+ struct x11drv_win_data *data;
+ RECT rect;
+ UINT flags;
+ int cx, cy, x = event->x, y = event->y;
+
+ if (!hwnd) return;
+ if (!(data = X11DRV_get_win_data( hwnd ))) return;
+ if (!data->mapped || data->iconic) return;
+
+ /* Get geometry */
+
+ if (!event->send_event) /* normal event, need to map coordinates to the root */
+ {
+ Window child;
+ wine_tsx11_lock();
+ XTranslateCoordinates( event->display, data->whole_window, root_window,
+ 0, 0, &x, &y, &child );
+ wine_tsx11_unlock();
+ }
+ rect.left = x;
+ rect.top = y;
+ rect.right = x + event->width;
+ rect.bottom = y + event->height;
+ OffsetRect( &rect, virtual_screen_rect.left, virtual_screen_rect.top );
+ TRACE( "win %p new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n",
+ hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
+ event->x, event->y, event->width, event->height );
+ X11DRV_X_to_window_rect( data, &rect );
+
+ x = rect.left;
+ y = rect.top;
+ cx = rect.right - rect.left;
+ cy = rect.bottom - rect.top;
+ flags = SWP_NOACTIVATE | SWP_NOZORDER;
+
+ /* Compare what has changed */
+
+ GetWindowRect( hwnd, &rect );
+ if (rect.left == x && rect.top == y) flags |= SWP_NOMOVE;
+ else
+ TRACE( "%p moving from (%d,%d) to (%d,%d)\n",
+ hwnd, rect.left, rect.top, x, y );
+
+ if ((rect.right - rect.left == cx && rect.bottom - rect.top == cy) ||
+ (IsRectEmpty( &rect ) && event->width == 1 && event->height == 1))
+ {
+ if (flags & SWP_NOMOVE) return; /* if nothing changed, don't do anything */
+ flags |= SWP_NOSIZE;
+ }
+ else
+ TRACE( "%p resizing from (%dx%d) to (%dx%d)\n",
+ hwnd, rect.right - rect.left, rect.bottom - rect.top, cx, cy );
+
+ SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
+}
+
+
+/***********************************************************************
* get_window_wm_state
*/
int get_window_wm_state( Display *display, struct x11drv_win_data *data )
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 2f7ab13..5348ec6 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -534,66 +534,3 @@
EnumWindows( update_windows_on_desktop_resize, (LPARAM)&resize_data );
}
-
-
-/***********************************************************************
- * X11DRV_ConfigureNotify
- */
-void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
-{
- XConfigureEvent *event = &xev->xconfigure;
- struct x11drv_win_data *data;
- RECT rect;
- UINT flags;
- int cx, cy, x = event->x, y = event->y;
-
- if (!hwnd) return;
- if (!(data = X11DRV_get_win_data( hwnd ))) return;
- if (!data->mapped || data->iconic) return;
-
- /* Get geometry */
-
- if (!event->send_event) /* normal event, need to map coordinates to the root */
- {
- Window child;
- wine_tsx11_lock();
- XTranslateCoordinates( event->display, data->whole_window, root_window,
- 0, 0, &x, &y, &child );
- wine_tsx11_unlock();
- }
- rect.left = x;
- rect.top = y;
- rect.right = x + event->width;
- rect.bottom = y + event->height;
- OffsetRect( &rect, virtual_screen_rect.left, virtual_screen_rect.top );
- TRACE( "win %p new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n",
- hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
- event->x, event->y, event->width, event->height );
- X11DRV_X_to_window_rect( data, &rect );
-
- x = rect.left;
- y = rect.top;
- cx = rect.right - rect.left;
- cy = rect.bottom - rect.top;
- flags = SWP_NOACTIVATE | SWP_NOZORDER;
-
- /* Compare what has changed */
-
- GetWindowRect( hwnd, &rect );
- if (rect.left == x && rect.top == y) flags |= SWP_NOMOVE;
- else
- TRACE( "%p moving from (%d,%d) to (%d,%d)\n",
- hwnd, rect.left, rect.top, x, y );
-
- if ((rect.right - rect.left == cx && rect.bottom - rect.top == cy) ||
- (IsRectEmpty( &rect ) && event->width == 1 && event->height == 1))
- {
- if (flags & SWP_NOMOVE) return; /* if nothing changed, don't do anything */
- flags |= SWP_NOSIZE;
- }
- else
- TRACE( "%p resizing from (%dx%d) to (%dx%d)\n",
- hwnd, rect.right - rect.left, rect.bottom - rect.top, cx, cy );
-
- SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
-}
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 450153b..287acbb 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -643,7 +643,6 @@
extern void X11DRV_KeyEvent( HWND hwnd, XEvent *event );
extern void X11DRV_KeymapNotify( HWND hwnd, XEvent *event );
extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event );
-extern void X11DRV_ConfigureNotify( HWND hwnd, XEvent *event );
extern void X11DRV_SelectionRequest( HWND hWnd, XEvent *event );
extern void X11DRV_SelectionClear( HWND hWnd, XEvent *event );
extern void X11DRV_MappingNotify( HWND hWnd, XEvent *event );