summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roi.c10
1 files 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 <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
+/* 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,