From 9c2ac01ec28fe2d7d96e181a07be5d4e9398b669 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 27 May 2004 15:12:31 +0000 Subject: [PATCH] applied patch from Philip Lafleur that fixes color picking for XInput 2004-05-27 Sven Neumann * libgimpwidgets/gimppickbutton.c: applied patch from Philip Lafleur that fixes color picking for XInput devices (bug #143166). --- ChangeLog | 5 +++++ libgimpwidgets/gimppickbutton.c | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbaf97f9a7..b92776b60a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-05-27 Sven Neumann + + * libgimpwidgets/gimppickbutton.c: applied patch from Philip + Lafleur that fixes color picking for XInput devices (bug #143166). + 2004-05-27 Sven Neumann * app/display/gimpdisplayshell-draw.c (gimp_display_shell_draw_grid): diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c index cc13f7bc6e..1eaa60bc35 100644 --- a/libgimpwidgets/gimppickbutton.c +++ b/libgimpwidgets/gimppickbutton.c @@ -342,8 +342,15 @@ gimp_pick_button_mouse_motion (GtkWidget *invisible, GdkEventMotion *event, GimpPickButton *button) { + gint x_root; + gint y_root; + + gdk_window_get_origin (event->window, &x_root, &y_root); + x_root += event->x; + y_root += event->y; + gimp_pick_button_pick (gdk_event_get_screen ((GdkEvent *) event), - event->x_root, event->y_root, button); + x_root, y_root, button); return TRUE; } @@ -353,11 +360,18 @@ gimp_pick_button_mouse_release (GtkWidget *invisible, GdkEventButton *event, GimpPickButton *button) { + gint x_root; + gint y_root; + if (event->button != 1) return FALSE; + gdk_window_get_origin (event->window, &x_root, &y_root); + x_root += event->x; + y_root += event->y; + gimp_pick_button_pick (gdk_event_get_screen ((GdkEvent *) event), - event->x_root, event->y_root, button); + x_root, y_root, button); gimp_pick_button_shutdown (button);