summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index f3d62b9c2..dbde5010c 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -847,7 +847,10 @@ void Fl::focus(Fl_Widget *o) {
while (w1) { win=w1; w1=win->window(); }
if (win) {
#ifdef __APPLE__
- if (fl_xfocus != win) Fl_X::i(win)->set_key_window();
+ if (fl_xfocus != win) {
+ Fl_X *x = Fl_X::i(win);
+ if (x) x->set_key_window();
+ }
#endif
fl_xfocus = win;
}