Mercurial > emacs
changeset 5224:5831f83a0afe
(kbd_buffer_get_event): For delete-window-event, do count iconified frames.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 23 Dec 1993 00:39:25 +0000 |
parents | db2e7e6a488e |
children | 95a44cfa9e17 |
files | src/keyboard.c |
diffstat | 1 files changed, 16 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keyboard.c Thu Dec 23 00:22:10 1993 +0000 +++ b/src/keyboard.c Thu Dec 23 00:39:25 1993 +0000 @@ -1942,11 +1942,22 @@ #ifdef HAVE_X11 else if (event->kind == delete_window_event) { - Lisp_Object value; - - /* If the user destroys the only frame, Emacs should exit. */ - value = Fvisible_frame_list (); - if (! CONSP (value) || ! CONSP (XCONS (value)->cdr)) + Lisp_Object tail, frame; + struct frame *f; + + /* If the user destroys the only frame, Emacs should exit. + Count visible frames and iconified frames. */ + for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) + { + frame = XCONS (tail)->car; + if (XTYPE (frame) != Lisp_Frame || EQ (frame, event->frame_or_window)) + continue; + f = XFRAME (frame); + if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) + break; + } + + if (! CONSP (tail)) kill (getpid (), SIGHUP); Fdelete_frame (event->frame_or_window, Qt);