aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-05-19 00:49:20 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-05-19 00:49:20 +0800
commit027f21a100093fb92f77de8853b54bd0ffca8684 (patch)
tree772e26590ce7a1e604b8bf8deeee23f69c16d692
parentbd3c27a88cfd62c59017471b01dd9489f3b9145a (diff)
downloadgsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar.gz
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar.bz2
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar.lz
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar.xz
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.tar.zst
gsoc2013-empathy-027f21a100093fb92f77de8853b54bd0ffca8684.zip
Popup context menu when menu key is pressed. Fixes bug #531414 (Baptiste Mille-Mathias).
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1109 4ee84921-47dd-4033-b63a-18d7a039a3e4
-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);