[XForms] Re: [PATCH] Double clicking doesn't work in file selectors

Mike Heffner mheffner at vt.edu
Wed Dec 3 09:45:47 EST 2003

On 03-Dec-2003 Angus Leeming wrote:
| On Wednesday 03 December 2003 12:16 am, Mike Heffner wrote:
|> Try the attached patch. This appears to work and is much 
|> simpler than the current version, but I'll have to look further
|> into the xforms event handling code to see whether this causes
|> a race condition. Anyone know?
| Oohhh! I like this kind of patch ;-)
| What sort of problems are you tinking about?

Well, the patch adds two callbacks for the browser object in the file

     fl_set_object_callback(obj, select_cb, 0);
+    fl_set_browser_dblclick_callback(obj, select_cb, 1);

On a double click we'll want the first call back (single click) to always
be called first, (possibly two times, once for each click), then the double
click callback to be called. However, if it happened the other way around
it might do something weird like select a file in the list right after
moving to a new directory. The question is, is there a race condition here
that we should handle better, or just depend on the callback's be called
in the correct order?

Actually though, now that I look at it more closely, even if the single
click callback is called after the double click, it will most likely be
invalidated. Once we've double clicked and entered a new directory there
shouldn't be anything selected so the test against fl_get_browser()>0
at the beginning of the callback would fail and the callback would do


  Mike Heffner       <mheffner@[acm.]vt.edu>
                         <mikeh at FreeBSD.org>

More information about the Xforms mailing list