[balsa/wip/gtk4] balsa-mime-widget-image: Simplify popping up menu
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gtk4] balsa-mime-widget-image: Simplify popping up menu
- Date: Sat, 28 Jul 2018 13:43:18 +0000 (UTC)
commit ea4813fd2de8bd463d585764b4be00e51f5fb7dc
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Fri Jul 27 21:52:53 2018 -0400
balsa-mime-widget-image: Simplify popping up menu
src/balsa-mime-widget-image.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index 3d28e4081..78e6c3b2c 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -72,25 +72,19 @@ balsa_mime_widget_image_class_init(BalsaMimeWidgetImageClass * klass)
*/
static void
-balsa_mime_widget_image_gesture_pressed_cb(GtkGestureMultiPress *multi_press,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+balsa_mime_widget_image_gesture_pressed_cb(GtkGesture *gesture,
+ GdkEventSequence *sequence,
+ gpointer user_data)
{
GtkMenu *menu = user_data;
- GtkGesture *gesture;
- GdkEventSequence *sequence;
const GdkEvent *event;
- gesture = GTK_GESTURE(multi_press);
- sequence = gtk_gesture_get_last_updated_sequence(gesture);
event = gtk_gesture_get_last_event(gesture, sequence);
+
g_return_if_fail(event != NULL);
- if (gdk_event_triggers_context_menu(event)) {
+ if (gdk_event_triggers_context_menu(event))
gtk_menu_popup_at_pointer(menu, event);
- }
}
static gboolean
@@ -202,7 +196,7 @@ balsa_mime_widget_new_image(BalsaMessage * bm,
gesture = gtk_gesture_multi_press_new();
gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 0);
- g_signal_connect(gesture, "pressed",
+ g_signal_connect(gesture, "begin",
G_CALLBACK(balsa_mime_widget_image_gesture_pressed_cb), data);
gtk_widget_add_controller(image, GTK_EVENT_CONTROLLER(gesture));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]