« Return to Thread: fxscrollwindow

FOX 1.6.36 and 1.7.19 Linux/X11 user-hostile bug

by Hal Brand :: Rate this Message:

Reply to Author | View in Thread

There is a nasty bug in FOX (1.6.36 and 1.7.16 and as best I can tell the whole 1.6.x. and 1.7.x series and maybe before) where, after a key press of a key that is mapped to an accelerator, FOX "grabs" the XServer and then ignores all mouse clicks and mouse motion if the window handles the SEL_KEYPRESS event. This leaves not only the FOX application hung, it leaves the whole desktop hung; completely unresponsive to all mouse movement and clicks! Needless to say, this leaves users beyond angry.

The situation is recoverable - just repeat the key press. But this is a wholly non-obvious recovery step! Application users who encounter the bug often resort to reboots to clear the problem until informed of the work-around.

To see the problem for yourself with FOX's own imageviewer test program and just a very small modification:
  1. Build FOX 1.7.16 - I used: ./configure --enable-debug
  2. cd tests/
  3. Apply the appropriate context diffs attached: patch -p0 < diffs.1.7.19
    • These diffs merely add intercepting SEL_KEYPRESS
    • Note: this isn't "imageviewer" specific, you can do it with "table", "tabbook" and probably others.
  4. make
  5. ./imageviewer
    • Hold "Alt" and press "f" - see the cursor flip around.
    • Now try to do anything with on your desktop with the mouse.
    • Don't panic - to recover, simple hold "Alt" and press "f".
    • Just as interesting, maybe more interesting:
      • press Alt-f, then Alt-e, then Alt-m, and then Alt-v
      • Now press Alt-f to try to recover - the File pop-up drops, but the mouse is still stuck!
      • Now press Alt-v - the View pop-up drops, but the mouse is still stuck!
      • Now press Alt-e - the Edit pop-up drops, but the mouse is still stuck!
      • Finally, press Alt-m - the Manipulation pop-up drops and the mouse is back!
    • For another interesting effect, repeat the steps above, but place the mouse cursor where the pop-up will appear. Note that the newly popped-up menu highlights the item under the mouse cursor. Now move the mouse up and down within the pop-up and note that the item under the mouse cursor highlights just like things are working but ... try pressing the left mouse button to select the highlighted item - no effect! Also, now move the mouse cursor out of the pop-up and then back in. Note that the pop-up now does NOT respond by highlighting the item under the mouse cursor.
    • And, finally, try continuing to hold the Alt key down after pressing "f" - in this case, FOX behaves as expected, tracking the mouse and responding to mouse events - until the Alt key is released; then FOX is hung.
You can do the same with FOX 1.6.36.
-- 
Hal Brand


*** imageviewer.cpp.orig 2009-01-19 18:05:39.000000000 -0800
--- imageviewer.cpp 2009-06-04 15:41:27.000000000 -0700
***************
*** 61,66 ****
--- 61,67 ----
    long onCmdScale(FXObject*,FXSelector,void*);
    long onCmdCrop(FXObject*,FXSelector,void*);
    long onUpdImage(FXObject*,FXSelector,void*);
+   long onKey(FXObject*,FXSelector,void*);
  public:
    enum{
      ID_ABOUT=FXMainWindow::ID_LAST,
***************
*** 220,227 ****
--- 221,234 ----
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_MIRROR_BOTH,ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_SCALE,      ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_CROP,       ImageWindow::onUpdImage),
+   FXMAPFUNC(SEL_KEYPRESS, 0, ImageWindow::onKey)
    };
 
+ long ImageWindow::onKey(FXObject*,FXSelector,void*)
+ {
+   return 0;
+ }
+
 
  // Object implementation
  FXIMPLEMENT(ImageWindow,FXMainWindow,ImageWindowMap,ARRAYNUMBER(ImageWindowMap))

*** imageviewer.cpp.~1~ 2009-03-12 22:45:10.000000000 -0700
--- imageviewer.cpp 2009-06-04 15:33:15.000000000 -0700
***************
*** 74,79 ****
--- 74,80 ----
    long onCmdScale(FXObject*,FXSelector,void*);
    long onCmdCrop(FXObject*,FXSelector,void*);
    long onUpdImage(FXObject*,FXSelector,void*);
+   long onKey(FXObject*,FXSelector,void*);
  public:
    enum{
      ID_ABOUT=FXMainWindow::ID_LAST,
***************
*** 238,245 ****
--- 239,252 ----
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_MIRROR_BOTH,ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_SCALE,      ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_CROP,       ImageWindow::onUpdImage),
+   FXMAPFUNC(SEL_KEYPRESS, 0, ImageWindow::onKey)
    };
 
+ long ImageWindow::onKey(FXObject*,FXSelector,void*)
+ {
+   return 0;
+ }
+
 
  // Object implementation
  FXIMPLEMENT(ImageWindow,FXMainWindow,ImageWindowMap,ARRAYNUMBER(ImageWindowMap))

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

 « Return to Thread: fxscrollwindow