summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-25 12:31:51 +0000
committerManolo Gouy <Manolo>2011-03-25 12:31:51 +0000
commitf088e583a173cfd6cd80df7719a1a7ce9324ca2e (patch)
tree7020b8fac0f1cbadcf159625792151b9354aa4ea
parentf8b645f614271ca48c7454bd86be77478ec58c63 (diff)
Fix 2nd issue of STR #2594: Fl::focus() now informs Mac OS when the focus
changes window. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8533 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 96fdb4db4..a5b3061ce 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -816,7 +816,12 @@ void Fl::focus(Fl_Widget *o) {
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;
+ if (win) {
+#ifdef __APPLE__
+ if (fl_xfocus != win) Fl_X::i(win)->set_key_window();
+#endif
+ fl_xfocus = win;
+ }
}
// take focus from the old focused window
fl_oldfocus = 0;