[eog] EogScrollView: Allow triggering popup menu via Shift+F10
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] EogScrollView: Allow triggering popup menu via Shift+F10
- Date: Wed, 21 Oct 2015 19:07:13 +0000 (UTC)
commit 6c8285c58cabefec57784af407d1db2e542fc1af
Author: Felix Riemann <friemann gnome org>
Date: Sun Oct 11 16:23:04 2015 +0200
EogScrollView: Allow triggering popup menu via Shift+F10
https://bugzilla.gnome.org/show_bug.cgi?id=754985
src/eog-scroll-view.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 47ba09d..8b7b13d 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -2744,15 +2744,23 @@ static gboolean
view_on_button_press_event_cb (GtkWidget *view, GdkEventButton *event,
gpointer user_data)
{
- /* Ignore double-clicks and triple-clicks */
- if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
- {
- eog_scroll_view_popup_menu (EOG_SCROLL_VIEW (view), event);
+ /* Ignore double-clicks and triple-clicks */
+ if (gdk_event_triggers_context_menu ((const GdkEvent*) event)
+ && event->type == GDK_BUTTON_PRESS)
+ {
+ eog_scroll_view_popup_menu (EOG_SCROLL_VIEW (view), event);
- return TRUE;
- }
+ return TRUE;
+ }
- return FALSE;
+ return FALSE;
+}
+
+static gboolean
+eog_scroll_view_popup_menu_handler (GtkWidget *widget, gpointer user_data)
+{
+ eog_scroll_view_popup_menu (EOG_SCROLL_VIEW (widget), NULL);
+ return TRUE;
}
void
@@ -2770,6 +2778,8 @@ eog_scroll_view_set_popup (EogScrollView *view,
g_signal_connect (G_OBJECT (view), "button_press_event",
G_CALLBACK (view_on_button_press_event_cb), NULL);
+ g_signal_connect (G_OBJECT (view), "popup-menu",
+ G_CALLBACK (eog_scroll_view_popup_menu_handler), NULL);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]