diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-23 03:44:18 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-23 03:44:18 +0000 |
| commit | bb5a07b3e1d5b2fc3f37e5261c8867bb05814041 (patch) | |
| tree | 779d15297436280f8259c12efa1b1072b947ec0a /src | |
| parent | 6266b9e0c1228f862f166b08607e6c420f83f88a (diff) | |
check if the window exists before trying to focus it
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc index b36ba9af..f12e643a 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1196,6 +1196,14 @@ bool Client::focus() const 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); |
