aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-19 00:49:20 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-19 00:49:20 +0800
commit7afd0f35a920d5a47088327dc69e7d861bef9693 (patch)
tree772e26590ce7a1e604b8bf8deeee23f69c16d692
parentec55d4f9308a0eb65c6ea5de7e9757e9d8b0b70f (diff)
downloadgsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar.gz
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar.bz2
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar.lz
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar.xz
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.tar.zst
gsoc2013-empathy-7afd0f35a920d5a47088327dc69e7d861bef9693.zip
Popup context menu when menu key is pressed. Fixes bug #531414 (Baptiste Mille-Mathias).
svn path=/trunk/; revision=1109
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 3c4d234b7..1b44d50ce 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
@@ -440,6 +441,24 @@ contact_list_view_button_press_event_cb (EmpathyContactListView *view,
return FALSE;
}
+static gboolean
+contact_list_view_key_press_event_cb (EmpathyContactListView *view,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Menu) {
+ MenuPopupData *data;
+
+ data = g_slice_new (MenuPopupData);
+ data->view = view;
+ data->button = event->keyval;
+ data->time = event->time;
+ g_idle_add (contact_list_view_popup_menu_idle_cb, data);
+ }
+
+ return FALSE;
+}
+
static void
contact_list_view_row_activated_cb (EmpathyContactListView *view,
GtkTreePath *path,
@@ -1031,6 +1050,10 @@ empathy_contact_list_view_init (EmpathyContactListView *view)
G_CALLBACK (contact_list_view_button_press_event_cb),
NULL);
g_signal_connect (view,
+ "key-press-event",
+ G_CALLBACK (contact_list_view_key_press_event_cb),
+ NULL);
+ g_signal_connect (view,
"row-activated",
G_CALLBACK (contact_list_view_row_activated_cb),
NULL);