window-actor: Use meta_window_is_monitor_sized

Use meta_window_is_monitor_sized in should_unredirect instead of doing
the checks directly.
This commit is contained in:
Adel Gadllah 2013-02-17 21:18:44 +01:00
parent a6a9d3f448
commit 034ab77c30

View File

@ -1238,8 +1238,6 @@ meta_window_actor_should_unredirect (MetaWindowActor *self)
MetaWindow *metaWindow = meta_window_actor_get_meta_window (self);
MetaWindowActorPrivate *priv = self->priv;
gboolean occupies_full_monitors = FALSE;
if (meta_window_requested_dont_bypass_compositor (metaWindow))
return FALSE;
@ -1252,33 +1250,7 @@ meta_window_actor_should_unredirect (MetaWindowActor *self)
if (priv->argb32 && !meta_window_requested_bypass_compositor (metaWindow))
return FALSE;
if (meta_window_is_fullscreen (metaWindow))
occupies_full_monitors = TRUE;
else if (meta_window_is_override_redirect (metaWindow))
{
MetaScreen *screen = meta_window_get_screen (metaWindow);
MetaRectangle window_rect, monitor_rect;
int num_monitors = meta_screen_get_n_monitors (screen);
int screen_width, screen_height, i;
meta_screen_get_size (screen, &screen_width, &screen_height);
meta_window_get_outer_rect (priv->window, &window_rect);
if (window_rect.x == 0 && window_rect.y == 0 &&
window_rect.width == screen_width && window_rect.height == screen_height)
occupies_full_monitors = TRUE;
for (i = 0; i < num_monitors; i++)
{
meta_screen_get_monitor_geometry (screen , i, &monitor_rect);
if (monitor_rect.x == window_rect.x && monitor_rect.y == window_rect.y &&
monitor_rect.width == window_rect.width && monitor_rect.height == window_rect.height)
occupies_full_monitors = TRUE;
}
}
if (!occupies_full_monitors)
if (!meta_window_is_monitor_sized (metaWindow))
return FALSE;
if (meta_window_requested_bypass_compositor (metaWindow))