[epiphany] window: properly propagate keys to the page



commit ebbc2351b76fd1644685a800ef0ffb635f92deb2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Sep 26 09:48:11 2015 -0300

    window: properly propagate keys to the page
    
    Sometimes Epiphany wrongly steals the keyboard events
    when they were supposed to be handled by the web view.
    This is very clear on text editor pages such as Google
    Drive's documents, where we can't set e.g. bold text
    using Ctrl + B shortcut.
    
    Fix that by trying to propagate events with the form of
    (Ctrl|Alt|Shift)+letter to the focused widget.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=113449

 src/ephy-window.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index de9ba9f..9bca864 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -802,7 +802,15 @@ ephy_window_key_press_event (GtkWidget *widget,
         * widget), otherwise the event follows the normal handling path.
         */
 
-       if (event->keyval == GDK_KEY_Escape && modifier == 0)
+       if ((event->state & GDK_CONTROL_MASK ||
+            event->state & GDK_MOD1_MASK ||
+             event->state & GDK_SHIFT_MASK) &&
+             event->length > 0)
+        {
+               /* Pass (CTRL|ALT|SHIFT)+letter characters to the widget */
+               shortcircuit = TRUE;
+        }
+       else if (event->keyval == GDK_KEY_Escape && modifier == 0)
        {
                /* Always pass Escape to both the widget, and the parent */
                shortcircuit = TRUE;


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