[gnome-boxes/a-winner-dont-quit-on-themselves] app-window: Don't quit on Ctrl+Q while on Display page



commit 533d2398866b2abb397305fab915b98746943a22
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Dec 17 12:41:51 2018 +0100

    app-window: Don't quit on Ctrl+Q while on Display page
    
    In Gtk the key event handling is top-down in the widget hierarchy.
    Therefore the AppWindow object would handle Ctrl+Q before any
    widget under it. This is unwanted because most of the time while
    on Display mode, users are actually intenting to use the Ctrl+Q
    shortcut against the guest, not the host. This would close the
    Boxes window and suspend the currently running VMs (very
    annoying).
    
    Since we can't guarantee whether the guest properly handled the
    key press event as desired, lets just not handle it all in Display
    mode/view.
    
    Related #244

 src/app-window.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 005723bb..0f5ebc75 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -411,6 +411,9 @@ public bool on_key_pressed (Widget widget, Gdk.EventKey event) {
             return true;
         } else if (event.keyval == Gdk.Key.q &&
                    (event.state & default_modifiers) == Gdk.ModifierType.CONTROL_MASK) {
+            if (ui_state == UIState.DISPLAY)
+                return false;
+
             App.app.quit_app ();
 
             return true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]