summaryrefslogtreecommitdiff
path: root/src/caja-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/caja-window.c')
-rw-r--r--src/caja-window.c27
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)