From: Richard M. Stallman Date: Thu, 23 Dec 1993 00:39:25 +0000 (+0000) Subject: (kbd_buffer_get_event): For delete-window-event, do count iconified frames. X-Git-Tag: emacs-19.34~10627 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58f6c8ab02edf5ef1cfeed57eda7aa73cb6c02de;p=emacs.git (kbd_buffer_get_event): For delete-window-event, do count iconified frames. --- diff --git a/src/keyboard.c b/src/keyboard.c index d82ae463ce3..f28c4dccfca 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1942,11 +1942,22 @@ kbd_buffer_get_event () #ifdef HAVE_X11 else if (event->kind == delete_window_event) { - Lisp_Object value; + 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 the user destroys the only frame, Emacs should exit. */ - value = Fvisible_frame_list (); - if (! CONSP (value) || ! CONSP (XCONS (value)->cdr)) + if (! CONSP (tail)) kill (getpid (), SIGHUP); Fdelete_frame (event->frame_or_window, Qt);