winex11.drv: Ignore the zero-size owners used by Delphi apps when deciding whether to add NET_WM_STATE_SKIP_TASKBAR.

Dmitry Timoshkov dmitry at codeweavers.com
Thu Apr 21 03:25:33 CDT 2011


This patch reverts a part of 61e50e15ba45ad54655f98619f5ef33917033165 and
fixes the regression reported in the bug 26670.
---
 dlls/winex11.drv/window.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index acbafde..2e05f7c 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -257,6 +257,19 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl
 
 
 /***********************************************************************
+ *              get_window_owner
+ */
+static HWND get_window_owner( HWND hwnd )
+{
+    RECT rect;
+    HWND owner = GetWindow( hwnd, GW_OWNER );
+    /* ignore the zero-size owners used by Delphi apps */
+    if (owner && GetWindowRect( owner, &rect ) && IsRectEmpty( &rect )) owner = 0;
+    return owner;
+}
+
+
+/***********************************************************************
  *              get_mwm_decorations
  */
 static unsigned long get_mwm_decorations( struct x11drv_win_data *data,
@@ -1287,7 +1300,7 @@ void update_net_wm_states( Display *display, struct x11drv_win_data *data )
         new_state |= (1 << NET_WM_STATE_ABOVE);
     if (ex_style & (WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE))
         new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR) | (1 << NET_WM_STATE_SKIP_PAGER);
-    if (!(ex_style & WS_EX_APPWINDOW) && GetWindow( data->hwnd, GW_OWNER ))
+    if (!(ex_style & WS_EX_APPWINDOW) && get_window_owner( data->hwnd ))
         new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR);
 
     if (!data->mapped)  /* set the _NET_WM_STATE atom directly */
-- 
1.7.4.3




More information about the wine-patches mailing list