FLTK logo

STR #2006

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]

STR #2006

Application:FLTK Library
Status:2 - Closed w/o Resolution
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Subsystem:Core Library
Summary:Fix for XTranslateCoordinates in fl_read_image.cxx
Version:1.3-current
Created By:markcw
Assigned To:fabien
Fix Version:1.3-current
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 markcw
17:20 Jul 15, 2008
fl_read_image.cxx
15k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 markcw
17:20 Jul 15, 2008
A check added to fl_read_image.cxx not by me but by Sebastian Hollington. It is a window-bounding check added on top of the screen-bounding check for images read from the screen which fixed an X-server crash. It is tested in Ubuntu and is probably Linux-specific.

The fix is shown below and the modified fl_read_image.cxx is attached.

// Line 125 in fl_read_image

if (!image) {
  // fetch absolute coordinates
  int dx, dy, sx, sy, sw, sh, ww, wh; //Seb was here
  Window child_win;
  Fl_Window *win = fl_find(fl_window);
  if (win) {
    //Seb was here
    XTranslateCoordinates(fl_display, fl_window, RootWindow(fl_display, fl_screen), win->w(), win->h(), &ww, &wh, &child_win);
    //Seb gone
    XTranslateCoordinates(fl_display, fl_window, RootWindow(fl_display, fl_screen), X, Y, &dx, &dy, &child_win);
    // screen dimensions
    Fl::screen_xywh(sx, sy, sw, sh, fl_screen);
    if (ww < sw) sw = ww;
    if (wh < sh) sh = wh;
}
 
 
#2 matt
08:31 Jul 18, 2008
Should be applied to 1.3 because 1.1.9 is final.  
 
#3 fabien
03:58 Dec 11, 2008
Um, this looks odd:
First the real modification is the bounding test which is sadly not commented as a change, I guess that's why diff file are better to post as much as possible.
Second, XTranslateCoordinates translates here absolute screen coordinates from the fl_window relative coordinates.
So this api should _not_ be used to translate width/height that don't depend on abs/rel coordinates by definition.
As an example the side effect of ww,hh test would likely be erroneous when x()/y() of fl_window is not 0.
I believe it may (partially) fix a problem but it's not acceptable as is IMHO.

Fabien
 
 
#4 markcw
14:20 Dec 11, 2008
Hi Fabien, Seb writes:

I should have mentioned that that patch is now obselete after matt committed the more water-tight error handling patch here:
http://www.fltk.org/str.php?L2021
 
 
#5 fabien
14:25 Dec 11, 2008
Obsolete, a different fix was achieved in STR#2021.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.