From 180aacb96bbb9ef33b35e26c6baa7c14647b726b Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 18 Aug 2003 23:21:44 +0000 Subject: [PATCH] fixed color picking from other screens. 2003-08-19 Sven Neumann * libgimpwidgets/gimppickbutton.c: fixed color picking from other screens. --- ChangeLog | 5 +++++ libgimpwidgets/gimppickbutton.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d5dfb9583..6d28b1080b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-19 Sven Neumann + + * libgimpwidgets/gimppickbutton.c: fixed color picking from other + screens. + 2003-08-18 Manish Singh * plug-ins/pygimp/gimpmodule.c: updated for new gradient sample API, diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c index ce513a9ac4..49d2286c88 100644 --- a/libgimpwidgets/gimppickbutton.c +++ b/libgimpwidgets/gimppickbutton.c @@ -60,7 +60,7 @@ static gboolean gimp_pick_button_mouse_release (GtkWidget *invisible, GdkEventButton *event, GimpPickButton *button); static void gimp_pick_button_shutdown (GimpPickButton *button); -static void gimp_pick_button_grab (GtkWidget *invisible, +static void gimp_pick_button_pick (GdkScreen *screen, gint x_root, gint y_root, GimpPickButton *button); @@ -342,7 +342,8 @@ gimp_pick_button_mouse_motion (GtkWidget *invisible, GdkEventMotion *event, GimpPickButton *button) { - gimp_pick_button_grab (invisible, event->x_root, event->y_root, button); + gimp_pick_button_pick (gdk_event_get_screen ((GdkEvent *) event), + event->x_root, event->y_root, button); return TRUE; } @@ -355,7 +356,8 @@ gimp_pick_button_mouse_release (GtkWidget *invisible, if (event->button != 1) return FALSE; - gimp_pick_button_grab (invisible, event->x_root, event->y_root, button); + gimp_pick_button_pick (gdk_event_get_screen ((GdkEvent *) event), + event->x_root, event->y_root, button); gimp_pick_button_shutdown (button); @@ -379,18 +381,19 @@ gimp_pick_button_shutdown (GimpPickButton *button) } static void -gimp_pick_button_grab (GtkWidget *invisible, +gimp_pick_button_pick (GdkScreen *screen, gint x_root, gint y_root, GimpPickButton *button) { + GdkColormap *colormap = gdk_screen_get_system_colormap (screen); + GdkWindow *root_window = gdk_screen_get_root_window (screen); GdkImage *image; guint32 pixel; - GdkColormap *colormap = gdk_colormap_get_system (); GdkColor color; GimpRGB rgb; - image = gdk_drawable_get_image (GDK_DRAWABLE (gdk_get_default_root_window ()), + image = gdk_drawable_get_image (GDK_DRAWABLE (root_window), x_root, y_root, 1, 1); pixel = gdk_image_get_pixel (image, 0, 0); g_object_unref (image);