winex11.drv: Move is_window_rect_mapped to winpos.c where it's used

Dmitry Timoshkov dmitry at codeweavers.com
Wed Apr 16 02:27:00 CDT 2008


Hello,

Changelog:
    winex11.drv: Move is_window_rect_mapped to winpos.c where it's used.
---
 dlls/winex11.drv/window.c |   21 ---------------------
 dlls/winex11.drv/winpos.c |   28 ++++++++++++++++++++++++----
 dlls/winex11.drv/x11drv.h |    1 -
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index ab63f3b..b62da2d 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -107,27 +107,6 @@ BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect )
 
 
 /***********************************************************************
- *		X11DRV_is_window_rect_mapped
- *
- * Check if the X whole window should be mapped based on its rectangle
- */
-BOOL X11DRV_is_window_rect_mapped( const RECT *rect )
-{
-    /* don't map if rect is empty */
-    if (IsRectEmpty( rect )) return FALSE;
-
-    /* don't map if rect is off-screen */
-    if (rect->left >= virtual_screen_rect.right ||
-        rect->top >= virtual_screen_rect.bottom ||
-        rect->right <= virtual_screen_rect.left ||
-        rect->bottom <= virtual_screen_rect.top)
-        return FALSE;
-
-    return TRUE;
-}
-
-
-/***********************************************************************
  *		is_window_resizable
  *
  * Check if window should be made resizable by the window manager
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index f6b75d6..f36bc98 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -287,6 +287,26 @@ void make_window_embedded( Display *display, struct x11drv_win_data *data )
 
 
 /***********************************************************************
+ *      is_window_rect_mapped
+ *
+ * Check if the X whole window should be mapped based on its rectangle
+ */
+static BOOL is_window_rect_mapped( const RECT *rect )
+{
+    /* don't map if rect is empty */
+    if (IsRectEmpty( rect )) return FALSE;
+
+    /* don't map if rect is off-screen */
+    if (rect->left >= virtual_screen_rect.right ||
+        rect->top >= virtual_screen_rect.bottom ||
+        rect->right <= virtual_screen_rect.left ||
+        rect->bottom <= virtual_screen_rect.top)
+        return FALSE;
+
+    return TRUE;
+}
+
+/***********************************************************************
  *		SetWindowStyle   (X11DRV.@)
  *
  * Update the X state of a window to reflect a style change
@@ -307,7 +327,7 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style )
         if (!(data = X11DRV_get_win_data( hwnd )) &&
             !(data = X11DRV_create_win_data( hwnd ))) return;
 
-        if (data->whole_window && X11DRV_is_window_rect_mapped( &data->window_rect ))
+        if (data->whole_window && is_window_rect_mapped( &data->window_rect ))
         {
             X11DRV_set_wm_hints( display, data );
             if (!data->mapped) map_window( display, data, new_style );
@@ -487,7 +507,7 @@ void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags,
         event_type = 0;  /* ignore other events */
 
     if (data->mapped && (!(new_style & WS_VISIBLE) ||
-                         (!event_type && !X11DRV_is_window_rect_mapped( rectWindow ))))
+                         (!event_type && !is_window_rect_mapped( rectWindow ))))
         unmap_window( display, data );
 
     /* don't change position if we are about to minimize or maximize a managed window */
@@ -496,7 +516,7 @@ void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags,
         X11DRV_sync_window_position( display, data, swp_flags, &old_client_rect, &old_whole_rect );
 
     if ((new_style & WS_VISIBLE) &&
-        ((new_style & WS_MINIMIZE) || X11DRV_is_window_rect_mapped( rectWindow )))
+        ((new_style & WS_MINIMIZE) || is_window_rect_mapped( rectWindow )))
     {
         if (!data->mapped || (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)))
             X11DRV_set_wm_hints( display, data );
@@ -512,7 +532,7 @@ void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags,
             wine_tsx11_lock();
             if (data->iconic)
                 XIconifyWindow( display, data->whole_window, DefaultScreen(display) );
-            else if (X11DRV_is_window_rect_mapped( rectWindow ))
+            else if (is_window_rect_mapped( rectWindow ))
                 XMapWindow( display, data->whole_window );
             wine_tsx11_unlock();
             update_net_wm_states( display, data );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index e682f07..9cac175 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -701,7 +701,6 @@ extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd );
 extern struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd );
 extern Window X11DRV_get_whole_window( HWND hwnd );
 extern Window X11DRV_get_client_window( HWND hwnd );
-extern BOOL X11DRV_is_window_rect_mapped( const RECT *rect );
 extern XIC X11DRV_get_ic( HWND hwnd );
 extern BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig );
 
-- 
1.5.4.5






More information about the wine-patches mailing list