With fltk 1.1.7 (and probably other versions), the menu wraps from top to bottom but not from bottom to top. This can make alt-tab switching annoying.
The problem is actually in fltk 1.1.7 not in flwm. Here's the simple fix (it adds processing to tab that's very similar to the processing for back-tab). Just a one-line change:
--- Fl_Menu.cxx 2008/01/01 06:47:03 1.1
+++ Fl_Menu.cxx 2008/01/01 06:48:13 1.2
@@ -533,36 +533,37 @@ int menuwindow::handle(int e) {
case FL_KEYBOARD:
switch (Fl::event_key()) {
case FL_BackSpace:
case 0xFE20: // backtab
BACKTAB:
if (!backward(pp.menu_number)) {pp.item_number = -1;backward(pp.menu_number);}
return 1;
case FL_Up:
if (pp.menubar && pp.menu_number == 0) {
// Do nothing...
} else if (backward(pp.menu_number)) {
// Do nothing...
} else if (pp.menubar && pp.menu_number==1) {
setitem(0, pp.p[0]->selected);
}
return 1;
case FL_Tab:
if (Fl::event_shift()) goto BACKTAB;
+ if (!forward(pp.menu_number)) {pp.item_number = -1;forward(pp.menu_number);}
return 1;
case FL_Down:
if (pp.menu_number || !pp.menubar) forward(pp.menu_number);
else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1);
return 1;
case FL_Right:
if (pp.menubar && (pp.menu_number<=0 || pp.menu_number==1 && pp.nummenus==2))
forward(0);
else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1);
return 1;
case FL_Left:
if (pp.menubar && pp.menu_number<=1) backward(0);
else if (pp.menu_number>0)
setitem(pp.menu_number-1, pp.p[pp.menu_number-1]->selected);
return 1;
case FL_Enter:
case FL_KP_Enter:
case ' ':
Logged In: YES
user_id=1967298
Originator: YES
I see the post mangled the patch somewhat. I'm attaching it as a file now.
File Added: fltk1.1.7.Fl_Menu.cxx.wrap-fix.patch
patch for fltk 1.1.7 Fl_Menu.cxx to fix tab wrapping
Logged In: YES
user_id=1967298
Originator: YES
File Added: fltk1.1.7.Fl_Menu.cxx.tab-wrap-fix.patch
Logged In: YES
user_id=1967298
Originator: YES
Note: the patch I uploaded first failed to apply when I tested it on another machine. There were actually two changed lines not just the one. So, I deleted the first and uploaded a corrected patch which should apply cleanly to a freshly cracked fltk 1.1.7 tarball.
BTW, I suspect this tab-wrap problem might not exist if you link flwm with the latest fltk 2.x, but I've only tested with 1.1.7.
Logged In: NO
A modified version of this patch has been incorporated into the latest 1.1.x SVN and will be in the 1.1.8 FLTK coming soon.