window: Export a bunch of state flags as accessor methods

This is necessary to reimplement window menus in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=726352
This commit is contained in:
Jasper St. Pierre 2014-03-13 18:15:26 -04:00
parent 24e12053ea
commit 4f9872c037
3 changed files with 58 additions and 9 deletions

View File

@ -607,9 +607,6 @@ void meta_window_show_menu (MetaWindow *window,
int button,
guint32 timestamp);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
void meta_window_set_gravity (MetaWindow *window,
int gravity);

View File

@ -11403,12 +11403,6 @@ meta_window_compute_tile_match (MetaWindow *window)
}
}
gboolean
meta_window_can_close (MetaWindow *window)
{
return window->has_close_func;
}
Window
meta_window_get_toplevel_xwindow (MetaWindow *window)
{
@ -11424,3 +11418,51 @@ meta_window_set_opacity (MetaWindow *window,
if (window->display->compositor)
meta_compositor_window_opacity_changed (window->display->compositor, window);
}
gboolean
meta_window_can_maximize (MetaWindow *window)
{
return window->has_maximize_func;
}
gboolean
meta_window_can_minimize (MetaWindow *window)
{
return window->has_minimize_func;
}
gboolean
meta_window_can_shade (MetaWindow *window)
{
return window->has_shade_func;
}
gboolean
meta_window_can_close (MetaWindow *window)
{
return window->has_close_func;
}
gboolean
meta_window_is_always_on_all_workspaces (MetaWindow *window)
{
return window->always_sticky;
}
gboolean
meta_window_is_above (MetaWindow *window)
{
return window->wm_state_above;
}
gboolean
meta_window_allows_move (MetaWindow *window)
{
return META_WINDOW_ALLOWS_MOVE (window);
}
gboolean
meta_window_allows_resize (MetaWindow *window)
{
return META_WINDOW_ALLOWS_RESIZE (window);
}

View File

@ -244,6 +244,16 @@ void meta_window_begin_grab_op (MetaWindow *window,
gboolean frame_action,
guint32 timestamp);
gboolean meta_window_can_maximize (MetaWindow *window);
gboolean meta_window_can_minimize (MetaWindow *window);
gboolean meta_window_can_shade (MetaWindow *window);
gboolean meta_window_can_close (MetaWindow *window);
gboolean meta_window_is_always_on_all_workspaces (MetaWindow *window);
gboolean meta_window_is_above (MetaWindow *window);
gboolean meta_window_allows_move (MetaWindow *window);
gboolean meta_window_allows_resize (MetaWindow *window);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
#endif