From 523c657f2ec9af4606ff55417d423c67eaa50275 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 5 Sep 2014 13:14:16 +0000 Subject: Robustness fix for the first window git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10278 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_x.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Fl_x.cxx') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 7869791d7..c3f2ea2a3 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2213,12 +2213,17 @@ void Fl_X::activate_window(Window w) { if (!ewmh_supported()) return; - Fl_X *x = Fl_X::i(fl_xfocus); - if (!x) - return; + Window prev = 0; + + if (fl_xfocus) { + Fl_X *x = Fl_X::i(fl_xfocus); + if (!x) + return; + prev = x->xid; + } send_wm_event(w, fl_NET_ACTIVE_WINDOW, 1 /* application */, - 0 /* timestamp */, x->xid /* previously active window */); + 0 /* timestamp */, prev /* previously active window */); } /* Change an existing window to fullscreen */ -- cgit v1.2.3