From 005bfa42940f69d4bad9d4fc22dc64a694869137 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 5 Sep 2014 12:33:35 +0000 Subject: 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 --- src/Fl.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Fl.cxx') 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; -- cgit v1.2.3