diff --git a/src/core/stack.c b/src/core/stack.c index 7a9669020..f97909a58 100644 --- a/src/core/stack.c +++ b/src/core/stack.c @@ -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; } diff --git a/src/core/window-private.h b/src/core/window-private.h index 8b853b3cb..3fd9f146e 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -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); diff --git a/src/core/window.c b/src/core/window.c index 75f62fb24..45c9c6ca6 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -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) {