diff options
-rw-r--r-- | src/empathy-debug-window.c | 3 | ||||
-rw-r--r-- | src/empathy-map-view.c | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c index b0bce622f..ee91939e6 100644 --- a/src/empathy-debug-window.c +++ b/src/empathy-debug-window.c @@ -1074,7 +1074,8 @@ debug_window_key_press_event_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - if (event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) + if ((event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) + || event->keyval == GDK_Escape) { gtk_widget_destroy (widget); return TRUE; diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index 95fdabd44..b7b37549f 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -23,6 +23,7 @@ #include <sys/stat.h> #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> #include <champlain/champlain.h> #include <champlain-gtk/champlain-gtk.h> @@ -306,6 +307,21 @@ map_view_destroy_cb (GtkWidget *widget, } static gboolean +map_view_key_press_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + if ((event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) + || event->keyval == GDK_Escape) + { + gtk_widget_destroy (widget); + return TRUE; + } + + return FALSE; +} + +static gboolean map_view_tick (EmpathyMapView *window) { GList *marker; @@ -352,6 +368,7 @@ empathy_map_view_show (void) empathy_builder_connect (gui, window, "map_view", "destroy", map_view_destroy_cb, + "map_view", "key-press-event", map_view_key_press_cb, "zoom_in", "clicked", map_view_zoom_in_cb, "zoom_out", "clicked", map_view_zoom_out_cb, "zoom_fit", "clicked", map_view_zoom_fit_cb, |