diff options
| author | Richard M. Stallman | 1993-12-23 00:39:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-23 00:39:25 +0000 |
| commit | 58f6c8ab02edf5ef1cfeed57eda7aa73cb6c02de (patch) | |
| tree | ff6e828fa6c2752fd6c15e3e53abbb33dd5801dd | |
| parent | ea0d86af5b290a3cd41a88c9e02e1b654fa44fe0 (diff) | |
| download | emacs-58f6c8ab02edf5ef1cfeed57eda7aa73cb6c02de.tar.gz emacs-58f6c8ab02edf5ef1cfeed57eda7aa73cb6c02de.zip | |
(kbd_buffer_get_event): For delete-window-event, do count iconified frames.
| -rw-r--r-- | src/keyboard.c | 19 |
1 files changed, 15 insertions, 4 deletions
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 () | |||
| 1942 | #ifdef HAVE_X11 | 1942 | #ifdef HAVE_X11 |
| 1943 | else if (event->kind == delete_window_event) | 1943 | else if (event->kind == delete_window_event) |
| 1944 | { | 1944 | { |
| 1945 | Lisp_Object value; | 1945 | Lisp_Object tail, frame; |
| 1946 | struct frame *f; | ||
| 1947 | |||
| 1948 | /* If the user destroys the only frame, Emacs should exit. | ||
| 1949 | Count visible frames and iconified frames. */ | ||
| 1950 | for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) | ||
| 1951 | { | ||
| 1952 | frame = XCONS (tail)->car; | ||
| 1953 | if (XTYPE (frame) != Lisp_Frame || EQ (frame, event->frame_or_window)) | ||
| 1954 | continue; | ||
| 1955 | f = XFRAME (frame); | ||
| 1956 | if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) | ||
| 1957 | break; | ||
| 1958 | } | ||
| 1946 | 1959 | ||
| 1947 | /* If the user destroys the only frame, Emacs should exit. */ | 1960 | if (! CONSP (tail)) |
| 1948 | value = Fvisible_frame_list (); | ||
| 1949 | if (! CONSP (value) || ! CONSP (XCONS (value)->cdr)) | ||
| 1950 | kill (getpid (), SIGHUP); | 1961 | kill (getpid (), SIGHUP); |
| 1951 | 1962 | ||
| 1952 | Fdelete_frame (event->frame_or_window, Qt); | 1963 | Fdelete_frame (event->frame_or_window, Qt); |