STR #2857

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 ]

STR #2857

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:screen_xywh mouse pointer functions initially returns wrong data
Created By:astrand
Assigned To:manolo
Fix Version:1.3-current (SVN: v9701)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Name/Time/Date Filename/Size top right image
#1 astrand
05:04 Jun 26, 2012
bottom left image   bottom right image

Trouble Report Comments:

Name/Time/Date Text top right image
#1 astrand
05:04 Jun 26, 2012
There are two helper functions in screen_xywh that returns the "work area" and "screen" where the mouse pointer is located. However, these initially returns incorrect data when the application starts on a secondary screen. This is because they are using the e_x_root/e_y_root variables, but these cannot be trusted until a mouse or keyboard event has happened. As the comment in Fl.H points out:

  Return where the mouse is on the screen by doing a round-trip query to
    the server.  You should use Fl::event_x_root() and
    Fl::event_y_root() if possible, but this is necessary if you are
    not sure if a mouse event has been processed recently (such as to
    position your first window).  If the display is not open, this will
    open it.
  static void get_mouse(int &,int &); // platform dependent

The bug is visible with the "fullscreen" test program. When starting it on a secondary screen, you have to press "Update" to get the correct values for "Mouse screen work area". Attaching patch.
#2 manolo
06:00 Oct 18, 2012
Fixed in Subversion repository.

Thanks for the patch.
bottom left image   bottom right image

Return to Bugs & Features ]


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