summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-10-20 01:49:48 +0000
committersabetts <sabetts>2000-10-20 01:49:48 +0000
commit4b0e0a937fb526b3216acd04d5912bc3b95e857f (patch)
tree2e87548a30051057cf10e65aad9853aa28591d32 /src/events.c
parentc39cc3ec4777d92ddfdfc2963bd42e6af3b0d779 (diff)
downloadratpoison-4b0e0a937fb526b3216acd04d5912bc3b95e857f.zip
fixed badwindow errors when deleting windows by ignoring badwindow errors in destroy_window
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c26
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)