mirror of
https://github.com/brl/mutter.git
synced 2024-11-10 07:56:14 -05:00
wayland/xdg-shell: Add helper for adding state enum values
This commit is contained in:
parent
640a04d0e4
commit
27fee69ca4
@ -573,31 +573,27 @@ on_parent_surface_unmapped (MetaWaylandSurface *parent_surface,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fill_states (struct wl_array *states,
|
add_state_value (struct wl_array *states,
|
||||||
MetaWindow *window)
|
enum xdg_toplevel_state state)
|
||||||
{
|
{
|
||||||
uint32_t *s;
|
uint32_t *s;
|
||||||
|
|
||||||
|
s = wl_array_add (states, sizeof *s);
|
||||||
|
*s = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fill_states (struct wl_array *states,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
if (META_WINDOW_MAXIMIZED (window))
|
if (META_WINDOW_MAXIMIZED (window))
|
||||||
{
|
add_state_value (states, XDG_TOPLEVEL_STATE_MAXIMIZED);
|
||||||
s = wl_array_add (states, sizeof *s);
|
|
||||||
*s = XDG_TOPLEVEL_STATE_MAXIMIZED;
|
|
||||||
}
|
|
||||||
if (meta_window_is_fullscreen (window))
|
if (meta_window_is_fullscreen (window))
|
||||||
{
|
add_state_value (states, XDG_TOPLEVEL_STATE_FULLSCREEN);
|
||||||
s = wl_array_add (states, sizeof *s);
|
|
||||||
*s = XDG_TOPLEVEL_STATE_FULLSCREEN;
|
|
||||||
}
|
|
||||||
if (meta_grab_op_is_resizing (window->display->grab_op))
|
if (meta_grab_op_is_resizing (window->display->grab_op))
|
||||||
{
|
add_state_value (states, XDG_TOPLEVEL_STATE_RESIZING);
|
||||||
s = wl_array_add (states, sizeof *s);
|
|
||||||
*s = XDG_TOPLEVEL_STATE_RESIZING;
|
|
||||||
}
|
|
||||||
if (meta_window_appears_focused (window))
|
if (meta_window_appears_focused (window))
|
||||||
{
|
add_state_value (states, XDG_TOPLEVEL_STATE_ACTIVATED);
|
||||||
s = wl_array_add (states, sizeof *s);
|
|
||||||
*s = XDG_TOPLEVEL_STATE_ACTIVATED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user