diff options
| author | Lauri Kasanen <cand@gmx.com> | 2014-09-05 12:33:35 +0000 |
|---|---|---|
| committer | Lauri Kasanen <cand@gmx.com> | 2014-09-05 12:33:35 +0000 |
| commit | 005bfa42940f69d4bad9d4fc22dc64a694869137 (patch) | |
| tree | fca051fc1eecacc53893ed21bd0bf7863b66f3ba /src/Fl.cxx | |
| parent | d1d203ca57d39af952478d8b174975d410a38899 (diff) | |
Fix cross-window focus throwing on X11, similar to the Mac case. STR #3129
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10276 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 714c8deee..61263b44d 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -922,10 +922,17 @@ void Fl::focus(Fl_Widget *o) { if (fl_xfocus != win) { Fl_X *x = Fl_X::i(win); if (x) x->set_key_window(); - } + } +#elif defined(USE_X11) + if (fl_xfocus != win) { + Fl_X *x = Fl_X::i(win); + win->show(); // Old WMs, XMapRaised + // New WMs use the NETWM attribute: + if (x) Fl_X::activate_window(x->xid); + } #endif fl_xfocus = win; - } + } } // take focus from the old focused window fl_oldfocus = 0; |
