After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 57608 - color picker doesn't work
color picker doesn't work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.3.x
Other other
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-07-16 10:26 UTC by Matthias Clasen
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (623 bytes, patch)
2001-07-16 10:27 UTC, Matthias Clasen
none Details | Review
this (mostly untested) patch tries to address some of the issues (except for bitmaps) (3.12 KB, patch)
2001-07-20 12:24 UTC, Matthias Clasen
none Details | Review
the patch (3.19 KB, patch)
2001-07-30 07:09 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2001-07-16 10:26:56 UTC
Hi,

the color picker of the colorsel dialog doesn't work, because of a 
bug in X11 implementation of gdk_image_get, which would always place
the image data at an offset instead of at (0,0), where it should be. 
The attached patch fixes this and thus makes the color picker work.
Comment 1 Matthias Clasen 2001-07-16 10:27:37 UTC
Created attachment 745 [details] [review]
the patch
Comment 2 Owen Taylor 2001-07-18 23:21:09 UTC
Looking at it _gdk_x11_get_image() has all sorts of problems:

 - It needs to handle bitmaps when visual == NULL

 - It should return an image with undefined contents
   when the window is completely off-screen rather
   than NULL.
 
 - It doesn't properly translate the window to
   root window coordinates before clipping to the screen
   size

 - It doesn't use the results of clipping to the screen
   size.
Comment 3 Matthias Clasen 2001-07-19 07:34:07 UTC
Yes, but I think my patch is nevertheless needed to get get_image
to work properly in the few cases where it has a chance to (ie if 
we're asking for a on-screen rectangle of the root window). 
We don't want to put the subimage we're getting at an offset in 
a large destination image, thus we should use 0,0 as dest_x, dest_y.
Comment 4 Matthias Clasen 2001-07-20 12:24:23 UTC
Created attachment 764 [details] [review]
this (mostly untested) patch tries to address some of the issues (except for bitmaps)
Comment 5 Owen Taylor 2001-07-20 14:52:01 UTC
Looks all good to me. I'd like to see this merged with the  
bitmap patch Ron Steinke is working and get the whole thing
committed as one unit, to avoid excessive conflicts.
Comment 6 Matthias Clasen 2001-07-24 09:53:29 UTC
This has been fixed together with #57604.
Comment 7 Matthias Clasen 2001-07-30 07:08:48 UTC
Testing revealed that the patch didn't work as nicely as intended.
Here is an additional (tested) patch which makes _gtk_x11_get_image actually work.
Comment 8 Matthias Clasen 2001-07-30 07:09:37 UTC
Created attachment 813 [details] [review]
the patch
Comment 9 Owen Taylor 2001-08-06 18:21:02 UTC
Sorry for missing the second patch - Havoc committed a 
change this morning that is almost identical to this,
though it fixes one extra thing - the code before the
fix still had a bit of window/screen coordinate confusion.
It translated the screen position to window coordinate
and window position to to screen coordinates...