From 4b0e0a937fb526b3216acd04d5912bc3b95e857f Mon Sep 17 00:00:00 2001 From: sabetts Date: Fri, 20 Oct 2000 01:49:48 +0000 Subject: fixed badwindow errors when deleting windows by ignoring badwindow errors in destroy_window --- src/events.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/events.c') 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) -- cgit v1.2.3