[gtk+] Use GDK symbolic names for button numbers
- From: Javier JardÃn <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use GDK symbolic names for button numbers
- Date: Tue, 13 Mar 2012 13:10:53 +0000 (UTC)
commit 45f660ef750457e0ba08052f1800c35c218cc426
Author: Javier JardÃn <jjardon gnome org>
Date: Mon Mar 12 14:47:02 2012 +0000
Use GDK symbolic names for button numbers
gtk/deprecated/gtkhandlebox.c | 2 +-
tests/testgtk.c | 4 ++--
tests/testinput.c | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/deprecated/gtkhandlebox.c b/gtk/deprecated/gtkhandlebox.c
index 2fca141..b745200 100644
--- a/gtk/deprecated/gtkhandlebox.c
+++ b/gtk/deprecated/gtkhandlebox.c
@@ -1221,7 +1221,7 @@ gtk_handle_box_button_press (GtkWidget *widget,
handle_position = effective_handle_position (hb);
event_handled = FALSE;
- if ((event->button == 1) &&
+ if ((event->button == GDK_BUTTON_PRIMARY) &&
(event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS))
{
GtkWidget *child;
diff --git a/tests/testgtk.c b/tests/testgtk.c
index d6f13cf..e6310ea 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2119,11 +2119,11 @@ grippy_button_press (GtkWidget *area, GdkEventButton *event, GdkWindowEdge edge)
{
if (event->type == GDK_BUTTON_PRESS)
{
- if (event->button == 1)
+ if (event->button == GDK_BUTTON_PRIMARY)
gtk_window_begin_resize_drag (GTK_WINDOW (gtk_widget_get_toplevel (area)), edge,
event->button, event->x_root, event->y_root,
event->time);
- else if (event->button == 2)
+ else if (event->button == GDK_BUTTON_MIDDLE)
gtk_window_begin_move_drag (GTK_WINDOW (gtk_widget_get_toplevel (area)),
event->button, event->x_root, event->y_root,
event->time);
diff --git a/tests/testinput.c b/tests/testinput.c
index 8bea474..957e6ae 100644
--- a/tests/testinput.c
+++ b/tests/testinput.c
@@ -181,7 +181,8 @@ button_press_event (GtkWidget *widget, GdkEventButton *event)
current_device = event->device;
cursor_proximity = TRUE;
- if (event->button == 1 && surface != NULL)
+ if (event->button == GDK_BUTTON_PRIMARY &&
+ surface != NULL)
{
gdouble pressure = 0.5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]