window: Add get_default_layer() helper

Most of the layer computation that the stack does actually depends
on the windowing backend, so we will move it to a vfunc.

However before we do that, split out the bit that will be shared.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/949
This commit is contained in:
Florian Müllner 2019-11-26 21:01:37 +01:00
parent 599d8e3287
commit b753213f9b
3 changed files with 13 additions and 6 deletions

View File

@ -480,12 +480,7 @@ get_standalone_layer (MetaWindow *window)
}
break;
default:
if (window->wm_state_below)
layer = META_LAYER_BOTTOM;
else if (window->wm_state_above && !META_WINDOW_MAXIMIZED (window))
layer = META_LAYER_TOP;
else
layer = META_LAYER_NORMAL;
layer = meta_window_get_default_layer (window);
break;
}

View File

@ -737,6 +737,7 @@ void meta_window_update_keyboard_resize (MetaWindow *window,
gboolean update_cursor);
void meta_window_update_keyboard_move (MetaWindow *window);
MetaStackLayer meta_window_get_default_layer (MetaWindow *window);
void meta_window_update_layer (MetaWindow *window);
void meta_window_recalc_features (MetaWindow *window);

View File

@ -6946,6 +6946,17 @@ meta_window_update_keyboard_move (MetaWindow *window)
&x, &y);
}
MetaStackLayer
meta_window_get_default_layer (MetaWindow *window)
{
if (window->wm_state_below)
return META_LAYER_BOTTOM;
else if (window->wm_state_above && !META_WINDOW_MAXIMIZED (window))
return META_LAYER_TOP;
else
return META_LAYER_NORMAL;
}
void
meta_window_update_layer (MetaWindow *window)
{