Use GDK symbolic names for button numbers

This commit is contained in:
Javier Jardón 2012-03-12 14:47:02 +00:00
parent 35af127530
commit 45f660ef75
3 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;