diff options
author | sabetts <sabetts> | 2003-05-20 07:20:14 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-05-20 07:20:14 +0000 |
commit | 671419ebfb5a6fa0937fd410b0b419f39cf7b25d (patch) | |
tree | 4c58fc662167d071ab6da1640a05886d082ebca9 /src/events.c | |
parent | b8ffe22a70e1285740341e4dc83d003aad86a133 (diff) | |
download | ratpoison-671419ebfb5a6fa0937fd410b0b419f39cf7b25d.zip |
* src/linkedlist.h: Move all C function to linkedlist.c
* src/window.c (find_window): add debugging output describing
which window list the window was found in.
* src/group.c (group_new): assign the group's number the number
passed as an argument.
* src/events.c (destroy_window): withdraw iconified and normal
windows before unmanaging them.
(handle_signals): delete the node from the list before freeing it.
* src/bar.h (message): remove define.
(marked_wrapped_message): remove prototype
(message): new prototype
* src/bar.c (message): new function
(marked_wrapped_message): renamed to marked_message. remove
marked_message.
Diffstat (limited to 'src/events.c')
-rw-r--r-- | src/events.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/events.c b/src/events.c index b827751..02a30d7 100644 --- a/src/events.c +++ b/src/events.c @@ -176,7 +176,33 @@ destroy_window (XDestroyWindowEvent *ev) win = find_window (ev->window); if (win == NULL) return; - ignore_badwindow++; + ignore_badwindow++; + + /* If, somehow, the window is not withdrawn before it is destroyed, + perform the necessary steps to withdraw the window before it is + unmanaged. */ + if (win->state == IconicState) + { + PRINT_DEBUG (("Destroying Iconic Window (%s)\n", window_name (win))); + withdraw_window (win); + } + else if (win->state == NormalState) + { + rp_frame *frame; + + PRINT_DEBUG (("Destroying Normal Window (%s)\n", window_name (win))); + frame = find_windows_frame (win); + if (frame) + { + cleanup_frame (frame); + if (frame->number == win->scr->current_frame) + set_active_frame (frame); + } + withdraw_window (win); + } + + /* Now that the window is guaranteed to be in the unmapped window + list, we can safely stop managing it. */ unmanage (win); ignore_badwindow--; } @@ -787,9 +813,9 @@ handle_signals () if (cur->status != 0) marked_message_printf (0,0, " /bin/sh -c \"%s\" finished (%d) ", cur->cmd, cur->status); + list_del (&cur->node); free (cur->cmd); free (cur); - list_del (&cur->node); } } |