diff options
author | sabetts <sabetts> | 2000-10-20 01:49:48 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-10-20 01:49:48 +0000 |
commit | 4b0e0a937fb526b3216acd04d5912bc3b95e857f (patch) | |
tree | 2e87548a30051057cf10e65aad9853aa28591d32 /src | |
parent | c39cc3ec4777d92ddfdfc2963bd42e6af3b0d779 (diff) | |
download | ratpoison-4b0e0a937fb526b3216acd04d5912bc3b95e857f.zip |
fixed badwindow errors when deleting windows by ignoring badwindow errors in destroy_window
Diffstat (limited to 'src')
-rw-r--r-- | src/events.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/events.c b/src/events.c index b46be25..5f2e11d 100644 --- a/src/events.c +++ b/src/events.c @@ -129,16 +129,10 @@ more_destroy_events () void destroy_window (XDestroyWindowEvent *ev) { - /* if there are multiple destroy events queued, and a mapped window - is deleted then switch_window_pending is set to 1 and the window - switch is done after all destroy events have been done. */ - static int switch_window_pending = 0; - int last_destroy_event; rp_window *win; win = find_window (ev->window); - last_destroy_event = !more_destroy_events(); if (win) { /* Goto the last accessed window. */ @@ -146,10 +140,12 @@ destroy_window (XDestroyWindowEvent *ev) { PRINT_DEBUG ("Destroying current window.\n"); - /* tell ratpoison to switch to the last window when all the - destroy events have been delt with. */ - switch_window_pending = 1; unmanage (win); + + /* Switch to last viewed window */ + ignore_badwindow = 1; + last_window (NULL); + ignore_badwindow = 0; } else { @@ -157,12 +153,6 @@ destroy_window (XDestroyWindowEvent *ev) unmanage (win); } } - - if (last_destroy_event && switch_window_pending) - { - last_window (NULL); - switch_window_pending = 0; - } } void @@ -249,6 +239,9 @@ handle_key (screen_info *s) PRINT_DEBUG ("handling key.\n"); + /* All functions hide the program bar. */ + if (BAR_TIMEOUT > 0) hide_bar (s); + XGetInputFocus (dpy, &fwin, &revert); XSetInputFocus (dpy, s->key_window, RevertToPointerRoot, CurrentTime); @@ -283,9 +276,6 @@ handle_key (screen_info *s) return; } - /* All functions hide the program bar. */ - hide_bar (s); - for (i = key_actions; i->key != 0; i++) { if (keysym == i->key) |