diff options
author | sabetts <sabetts> | 2000-08-30 05:14:52 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-08-30 05:14:52 +0000 |
commit | a334f42803a72d2bcc2f64b7f734df8b5ece165e (patch) | |
tree | f44e516343e19a44734c048101443080371c7f7d /events.c | |
parent | 6cd6ecb80db16d4d44b92635dde4efa984f18b3d (diff) | |
download | ratpoison-a334f42803a72d2bcc2f64b7f734df8b5ece165e.zip |
fixed a bug in destroy_window() where last_window wasn't being called
if the only destroy event was on a mapped window.
Diffstat (limited to 'events.c')
-rw-r--r-- | events.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -131,12 +131,23 @@ more_destroy_events () void destroy_window (XDestroyWindowEvent *ev) { - screen_info *s; + /* 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; - s = find_screen (ev->event); win = find_window (ev->window); - if (s && win) + + last_destroy_event = !more_destroy_events(); + if (last_destroy_event && (switch_window_pending || win)) + { + last_window (); + switch_window_pending = 0; + } + + if (win) { /* Goto the last accessed window. */ if (win == rp_current_window) @@ -147,7 +158,7 @@ destroy_window (XDestroyWindowEvent *ev) to go to the last window since it could be deleted. Therefore, wait until the last DestroyNotify event and then switch windows. */ - if (!more_destroy_events ()) last_window (); + if (!last_destroy_event) switch_window_pending = 1; unmanage (win); } else |