diff options
author | infirit <[email protected]> | 2013-09-21 02:18:45 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2013-09-21 03:07:04 +0200 |
commit | 749f7bf29e6c7b04d93eb54f2079455bf730a0c0 (patch) | |
tree | 6b02b25e7fd9c5fa933da8b71f208e2d4c812f1a /src/caja-window.c | |
parent | 6278dcbcd50ce052fa2e7aa5a4b32d96713a2480 (diff) | |
download | caja-749f7bf29e6c7b04d93eb54f2079455bf730a0c0.tar.bz2 caja-749f7bf29e6c7b04d93eb54f2079455bf730a0c0.tar.xz |
Fix ctrl+a behaviour in search field
From: Cosimo Cecchi <[email protected]>
Even when we're not renaming, process events for focused GtkEditables
before activating the menu accels and mnemonics.
https://bugzilla.gnome.org/show_bug.cgi?id=619529
Caja bug: https://github.com/mate-desktop/mate-file-manager/issues/97
Diffstat (limited to 'src/caja-window.c')
-rw-r--r-- | src/caja-window.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/caja-window.c b/src/caja-window.c index 782e2607..28e1ea35 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -1094,10 +1094,37 @@ caja_window_key_press_event (GtkWidget *widget, GdkEventKey *event) { CajaWindow *window; + CajaWindowSlot *active_slot; + CajaView *view; + GtkWidget *focus_widget; int i; window = CAJA_WINDOW (widget); + active_slot = caja_window_get_active_slot (window); + view = active_slot->content_view; + + if (view != NULL && focus_widget != NULL && + GTK_IS_EDITABLE (focus_widget)) { + /* if we have input focus on a GtkEditable (e.g. a GtkEntry), forward + * the event to it before activating accelerator bindings too. + */ + if (gtk_window_propagate_key_event (GTK_WINDOW (window), event)) { + return TRUE; + } + } + + focus_widget = gtk_window_get_focus (GTK_WINDOW (window)); + if (view != NULL && focus_widget != NULL && + GTK_IS_EDITABLE (focus_widget)) { + /* if we have input focus on a GtkEditable (e.g. a GtkEntry), forward + * the event to it before activating accelerator bindings too. + */ + if (gtk_window_propagate_key_event (GTK_WINDOW (window), event)) { + return TRUE; + } + } + for (i = 0; i < G_N_ELEMENTS (extra_window_keybindings); i++) { if (extra_window_keybindings[i].keyval == event->keyval) |