diff --git a/midori/midori-view.c b/midori/midori-view.c index 92608720..570e329e 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1821,6 +1821,18 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view, return FALSE; } +static gboolean +midori_view_inspector_window_key_press_event_cb (GtkWidget* window, + GdkEventKey* event, + gpointer user_data) +{ + /* Close window on Ctrl+W */ + if (event->keyval == 'w' && (event->state & GDK_CONTROL_MASK)) + gtk_widget_destroy (window); + + return FALSE; +} + static gboolean gtk_widget_key_press_event_cb (WebKitWebView* web_view, GdkEventKey* event, @@ -3422,6 +3434,9 @@ midori_view_web_inspector_construct_window (gpointer inspector, gtk_container_add (GTK_CONTAINER (window), inspector_view); gtk_widget_show_all (window); + g_signal_connect (window, "key-press-event", + G_CALLBACK (midori_view_inspector_window_key_press_event_cb), NULL); + /* FIXME: Update window title with URI */ }