aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-06-08 01:23:09 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-06-08 01:23:09 +0800
commit9162afac50cc420698877f76756a47256e333f14 (patch)
treecdbb9862dbf6d4b028f862bfd16150f6a035dac8 /src
parentc7135b35e2c58808fad11b7c5781834255682ea4 (diff)
downloadgsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar.gz
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar.bz2
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar.lz
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar.xz
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.tar.zst
gsoc2013-empathy-9162afac50cc420698877f76756a47256e333f14.zip
Close contact list when Escape is pressed. Fixes bug #536628 (Ross Burton).
svn path=/trunk/; revision=1151
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index c030a5887..15695d8fb 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
#include <telepathy-glib/util.h>
@@ -275,7 +276,7 @@ status_icon_set_visibility (EmpathyStatusIcon *icon,
GList *accounts;
empathy_window_present (GTK_WINDOW (priv->window), TRUE);
-
+
/* Show the accounts dialog if there is no enabled accounts */
accounts = mc_accounts_list_by_enabled (TRUE);
if (accounts) {
@@ -326,6 +327,17 @@ status_icon_delete_event_cb (GtkWidget *widget,
return TRUE;
}
+static gboolean
+status_icon_key_press_event_cb (GtkWidget *window,
+ GdkEventKey *event,
+ EmpathyStatusIcon *icon)
+{
+ if (event->keyval == GDK_Escape) {
+ status_icon_set_visibility (icon, FALSE, TRUE);
+ }
+ return FALSE;
+}
+
static void
status_icon_activate_cb (GtkStatusIcon *status_icon,
EmpathyStatusIcon *icon)
@@ -752,6 +764,10 @@ empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
priv->window = g_object_ref (window);
+ g_signal_connect (priv->window, "key-press-event",
+ G_CALLBACK (status_icon_key_press_event_cb),
+ icon);
+
g_signal_connect (priv->window, "delete-event",
G_CALLBACK (status_icon_delete_event_cb),
icon);