From 969f9a2be5e7c8abfb362d89fedb6b1f3e768155 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 31 Mar 2012 16:31:27 +0200 Subject: roi: Use GDK_BUTTON_PRIMARY in button_release --- roi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roi.c b/roi.c index d278502..173832c 100644 --- a/roi.c +++ b/roi.c @@ -5,6 +5,11 @@ #include #include +/* Only available as of GTK 3.4 */ +#ifndef GDK_BUTTON_PRIMARY +#define GDK_BUTTON_PRIMARY 1 +#endif + struct roi { GtkWidget *window; GtkWidget *drawing_area; @@ -122,9 +127,6 @@ button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer userdata) struct roi *roi = userdata; switch (event->button) { -#ifndef GDK_BUTTON_PRIMARY -#define GDK_BUTTON_PRIMARY 1 -#endif case GDK_BUTTON_PRIMARY: roi->rubberband.x1 = event->x; roi->rubberband.x2 = event->x; @@ -154,7 +156,7 @@ button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer userdata { struct roi *roi = userdata; - if (event->button != 1) + if (event->button != GDK_BUTTON_PRIMARY) return TRUE; calc_rubberband_rect(roi, &roi->area.x, &roi->area.y, -- cgit