diff --git a/src/Widgets/WindowOverview.vala b/src/Widgets/WindowOverview.vala index b5a1c383..b969ba4f 100644 --- a/src/Widgets/WindowOverview.vala +++ b/src/Widgets/WindowOverview.vala @@ -207,8 +207,7 @@ namespace Gala bool keybinding_filter (KeyBinding binding) { var name = binding.get_name (); - return name != "expose-windows" - && name != "expose-all-windows"; + return (name != "expose-windows" && name != "expose-all-windows"); } void restack_windows (Screen screen) diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 5a23b9d8..15df05e6 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -451,7 +451,7 @@ namespace Gala modal_stack.offer_head (proxy); // modal already active - if (modal_stack.size > 2) + if (modal_stack.size >= 2) return proxy; var screen = get_screen (); @@ -479,7 +479,7 @@ namespace Gala return; } - if (modal_stack.size > 0) + if (is_modal ()) return; update_input_area (); @@ -495,7 +495,7 @@ namespace Gala */ public bool is_modal () { - return modal_stack.size > 0; + return (modal_stack.size > 0); } /** @@ -503,7 +503,7 @@ namespace Gala */ public bool modal_proxy_valid (ModalProxy proxy) { - return proxy in modal_stack; + return (proxy in modal_stack); } public void get_current_cursor_position (out int x, out int y) @@ -1238,11 +1238,14 @@ namespace Gala public override bool keybinding_filter (Meta.KeyBinding binding) { + if (!is_modal ()) + return false; + var modal_proxy = modal_stack.peek_head (); - return is_modal () + return (modal_proxy != null && modal_proxy.keybinding_filter != null - && modal_proxy.keybinding_filter (binding); + && modal_proxy.keybinding_filter (binding)); } #if HAS_MUTTER310