wizard, switching between UIs
"corvid" <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <20121229212131.GA27161@local> |
Yesterday I was playing with ctrl-tab, of course, and I noticed how the state of the focused tab would sometimes change. I went through a few rounds of fixing this in different ways before finding something that didn't seem icky. Detailed comment in patch. _______________________________________________ Dillo-dev mailing list [email protected] http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
show_ui.diff
(text/plain, 923 B)
diff -r 8e10859b2aab src/uicmd.cc
--- a/src/uicmd.cc Fri Dec 28 21:02:13 2012 +0000
+++ b/src/uicmd.cc Sat Dec 29 21:08:58 2012 +0000
@@ -413,6 +413,16 @@
btn->color(tabcolor_inactive);
btn->redraw();
}
+ /* We make a point of calling show() before value() is changed because
+ * the wizard may hide the old one before showing the new one. In that
+ * case, the new UI gets focus with Fl::e_keysym set to whatever
+ * triggered the switch, and this is a problem when it's Tab/Left/Right/
+ * Up/Down because some widgets (notably Fl_Group and Fl_Input) exhibit
+ * unwelcome behaviour in that case. If the new widgets are already
+ * shown, fl_fix_focus will fix everything with Fl::e_keysym temporarily
+ * cleared.
+ */
+ cbtn->ui()->show();
Wizard->value(cbtn->ui());
cbtn->color(tabcolor_active);
cbtn->redraw();