check if the window exists before trying to focus it
Dana Jansens danakj@orodu.net
1 files changed,
8 insertions(+),
0 deletions(-)
jump to
M
src/client.cc
→
src/client.cc
@@ -1196,6 +1196,14 @@ if (!(frame->isVisible() && (_can_focus || _focus_notify))) return false;
if (_focused) return true; + // do a check to see if the window has already been unmapped or destroyed + XEvent ev; + if (XCheckTypedWindowEvent(**otk::display, _window, UnmapNotify, &ev) || + XCheckTypedWindowEvent(**otk::display, _window, DestroyNotify, &ev)) { + XPutBackEvent(**otk::display, &ev); + return false; + } + if (_can_focus) XSetInputFocus(**otk::display, _window, RevertToNone, CurrentTime);