all repos — openbox @ bb5a07b3e1d5b2fc3f37e5261c8867bb05814041

openbox fork - make it a bit more like ryudo

check if the window exists before trying to focus it
Dana Jansens danakj@orodu.net
commit

bb5a07b3e1d5b2fc3f37e5261c8867bb05814041

parent

6266b9e0c1228f862f166b08607e6c420f83f88a

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M src/client.ccsrc/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);