mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 09:46:08 -05:00
window: Add meta_window_is_monitor_sized
We duplicate this checks in multiple places so lets add this to avoid code duplication.
This commit is contained in:
parent
a215852d3c
commit
a6a9d3f448
@ -3646,6 +3646,39 @@ meta_window_is_fullscreen (MetaWindow *window)
|
||||
return window->fullscreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_is_monitor_sized:
|
||||
*
|
||||
* Return value: %TRUE if the window is occupies an entire monitor or
|
||||
* the whole screen.
|
||||
*/
|
||||
gboolean
|
||||
meta_window_is_monitor_sized (MetaWindow *window)
|
||||
{
|
||||
if (window->fullscreen)
|
||||
return TRUE;
|
||||
|
||||
if (window->override_redirect)
|
||||
{
|
||||
MetaRectangle window_rect, monitor_rect;
|
||||
int screen_width, screen_height;
|
||||
|
||||
meta_screen_get_size (window->screen, &screen_width, &screen_height);
|
||||
meta_window_get_outer_rect (window, &window_rect);
|
||||
|
||||
if (window_rect.x == 0 && window_rect.y == 0 &&
|
||||
window_rect.width == screen_width && window_rect.height == screen_height)
|
||||
return TRUE;
|
||||
|
||||
meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
|
||||
|
||||
if (meta_rectangle_equal (&window_rect, &monitor_rect))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_is_on_primary_monitor:
|
||||
*
|
||||
|
@ -141,6 +141,7 @@ void meta_window_foreach_ancestor (MetaWindow *window,
|
||||
|
||||
MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window);
|
||||
gboolean meta_window_is_fullscreen (MetaWindow *window);
|
||||
gboolean meta_window_is_monitor_sized (MetaWindow *window);
|
||||
gboolean meta_window_is_on_primary_monitor (MetaWindow *window);
|
||||
gboolean meta_window_requested_bypass_compositor (MetaWindow *window);
|
||||
gboolean meta_window_requested_dont_bypass_compositor (MetaWindow *window);
|
||||
|
Loading…
Reference in New Issue
Block a user