*/
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 ||
}
+/***********************************************************************
+ * 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
*/
{
style = GetWindowLongW( data->hwnd, GWL_STYLE );
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
- owner = GetWindow( data->hwnd, GW_OWNER );
+ owner = get_window_owner( data->hwnd );
}
/* transient for hint */
new_state |= (1 << NET_WM_STATE_ABOVE);
if (ex_style & WS_EX_TOOLWINDOW)
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 */