From 1474914cb55657253ffbbe8737bff7086dd2ed05 Mon Sep 17 00:00:00 2001 From: corvid Date: Wed, 2 Jan 2013 21:12:44 +0000 Subject: ctrl-tab navigation fix; show new tab before hiding old one http://lists.auriga.wearlab.de/pipermail/dillo-dev/2013-January/009722.html (focus can go from main->location, and location can get its value selected) --- src/uicmd.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/uicmd.cc') diff --git a/src/uicmd.cc b/src/uicmd.cc index 34a467f5..ea813425 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -416,6 +416,16 @@ void CustTabs::switch_tab(CustTabButton *cbtn) btn->labelcolor(fl_contrast(FL_FOREGROUND_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->labelcolor(fl_contrast(FL_FOREGROUND_COLOR, tabcolor_active)); -- cgit v1.2.3