FLTK logo

STR #209

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.1 | SVN ⇄ GIT ]

STR #209

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Subsystem:MacOS
Summary:Fltk interferes with Tk on Mac OS X 10.2, 10.3.
Version:1.1.4
Created By:justin.ks.d0t.uiuc.d0t.edu
Assigned To:mike
Fix Version:1.1.5rc1
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 justin.ks.d0t.uiuc.d0t.edu
12:04 Nov 14, 2003
Hi,

Fltk 1.1.x seems to squash or otherwise interfere with events meant for windows from other toolkits when both are present in the same application.  Our program (VMD) uses both Fltk and Tk.  On OS X 10.2.x, the problem could be worked around by only calling Fl::flush() from the VMD event loop instead of Fl::wait(0); Tk was kind enough to forward events occurring in Fltk windows to the Fltk event handler.  However, on OS X 10.3.x, this workaround  isn't completely successful: once events have been handled in an Fltk window for the first time, popup menus in Tk windows no longer work.  In fact, if a Tk popup menu is activated, no mouse events can be processed by either Fltk or Tk until one switches to a new application.  The immediate problem in this case seems to be that MouseUp events are no longer delivered to Tk.

I have discovered a very simple fix for Fl_mac.cxx that seems to cure this problem on Mac OS X 10.3.  As far as I can tell this one-line change completely cures the problems we've been seeing with Fltk preventing Tk from working properly.  In the file src/Fl_mac.cxx, find the function carbonDispatchHandler and change the lines:

      else if ( fl_os_capture )
        ret = SendEventToEventTarget( event, GetWindowEventTarget( fl_os_capture ) );

to

      else if ( fl_os_capture ) {
        ret = SendEventToEventTarget( event, GetWindowEventTarget( fl_os_capture ) );
        fl_os_capture = 0;
      }

After making this change to Fltk 1.1.4 I could not get the Tk pulldown menus to malfunction anymore.

I don't know whether this is the "proper" fix, but it seems that there's no other mechanism for switching fl_os_capture back to zero.  

Cheers,
Justin
justin at ks d0t uiuc d0t edu
 
 
#2 geuzaine.acm.caltech
13:45 Dec 02, 2003

FYI: this patch also fixes the problem with FL_Sys_Menu_Bar not receiving mouse events on Panther.

Christophe
 
 
#3 johns.ks.uiuc
11:06 Jan 22, 2004
I've been using the patch Justin suggests in the VMD builds on MacOS X and it has been performing well for a couple months now.  It has been an effective solution to the problem thus far.  Any chance of an official release with this fix in it?  Anyone wanting to build VMD from source code
for MacOS X 10.3 will currently run into serious problems if they use the latest official release of FLTK without the patch.
 
 
#4 mike
20:28 Mar 10, 2004
Fix commited to CVS for 1.1.5.  Thanks!  
     

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'.