When testing for shadow, test for window shape before override redirect.

This commit is contained in:
Tomas Frydrych 2008-09-25 09:30:13 +01:00
parent 33ae559eca
commit c58ade6600

View File

@ -626,19 +626,11 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
*/
if (priv->argb32 || priv->opacity != 0xff)
{
meta_verbose ("Window has no shadow as it is ARGB\n");
meta_verbose ("Window 0x%x has no shadow as it is ARGB\n",
(guint)priv->xwindow);
return FALSE;
}
/*
* Add shadows to override redirect windows (e.g., Gtk menus).
*/
if (priv->attrs.override_redirect)
{
meta_verbose ("Window has shadow because it is override redirect.\n");
return TRUE;
}
/*
* Always put a shadow around windows with a frame - This should override
* the restriction about not putting a shadow around shaped windows
@ -648,7 +640,8 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
{
if (meta_window_get_frame (priv->window))
{
meta_verbose ("Window has shadow because it has a frame\n");
meta_verbose ("Window 0x%x has shadow because it has a frame\n",
(guint)priv->xwindow);
return TRUE;
}
}
@ -658,17 +651,30 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
*/
if (priv->shaped)
{
meta_verbose ("Window has no shadow as it is shaped\n");
meta_verbose ("Window 0x%x has no shadow as it is shaped\n",
(guint)priv->xwindow);
return FALSE;
}
/*
* Add shadows to override redirect windows (e.g., Gtk menus).
* This must have lower priority than window shape test.
*/
if (priv->attrs.override_redirect)
{
meta_verbose ("Window 0x%x has shadow because it is override redirect.\n",
(guint)priv->xwindow);
return TRUE;
}
/*
* Don't put shadow around DND icon windows
*/
if (priv->type == META_COMP_WINDOW_DND ||
priv->type == META_COMP_WINDOW_DESKTOP)
{
meta_verbose ("Window has no shadow as it is DND or Desktop\n");
meta_verbose ("Window 0x%x has no shadow as it is DND or Desktop\n",
(guint)priv->xwindow);
return FALSE;
}
@ -678,19 +684,22 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
#endif
)
{
meta_verbose ("Window has shadow as it is a menu\n");
meta_verbose ("Window 0x%x has shadow as it is a menu\n",
(guint)priv->xwindow);
return TRUE;
}
#if 0
if (priv->type == META_COMP_WINDOW_TOOLTIP)
{
meta_verbose ("Window has shadow as it is a tooltip\n");
meta_verbose ("Window 0x%x has shadow as it is a tooltip\n",
(guint)priv->xwindow);
return TRUE;
}
#endif
meta_verbose ("Window has no shadow as it fell through\n");
meta_verbose ("Window 0x%x has no shadow as it fell through\n",
(guint)priv->xwindow);
return FALSE;
}