summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-25 12:16:57 +0000
committerManolo Gouy <Manolo>2011-03-25 12:16:57 +0000
commitf8b645f614271ca48c7454bd86be77478ec58c63 (patch)
treeae61eac462863ff07e7999a6a4a91e678acee55e
parentedd848aa9cb602d2b54f5ceccdcacbd7c57c876a (diff)
Fl::focus(): allows the focus to be set to an Fl_Window widget.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8532 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 58f492c87..96fdb4db4 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -813,7 +813,8 @@ void Fl::focus(Fl_Widget *o) {
// make sure that fl_xfocus is set to the top level window
// of this widget, or fl_fix_focus will clear our focus again
if (o) {
- Fl_Window *win = 0, *w1 = o->window();
+ Fl_Window *win = 0, *w1 = o->as_window();
+ if (!w1) w1 = o->window();
while (w1) { win=w1; w1=win->window(); }
if (win) fl_xfocus = win;
}