diff options
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/frame.c b/src/frame.c index 8505398a260..1db24cc80e7 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1118,41 +1118,32 @@ Otherwise, include all frames. */) | |||
| 1118 | static int | 1118 | static int |
| 1119 | other_visible_frames (FRAME_PTR f) | 1119 | other_visible_frames (FRAME_PTR f) |
| 1120 | { | 1120 | { |
| 1121 | /* We know the selected frame is visible, | 1121 | Lisp_Object frames; |
| 1122 | so if F is some other frame, it can't be the sole visible one. */ | ||
| 1123 | if (f == SELECTED_FRAME ()) | ||
| 1124 | { | ||
| 1125 | Lisp_Object frames; | ||
| 1126 | int count = 0; | ||
| 1127 | 1122 | ||
| 1128 | for (frames = Vframe_list; | 1123 | for (frames = Vframe_list; CONSP (frames); frames = XCDR (frames)) |
| 1129 | CONSP (frames); | 1124 | { |
| 1130 | frames = XCDR (frames)) | 1125 | Lisp_Object this = XCAR (frames); |
| 1131 | { | 1126 | if (f == XFRAME (this)) |
| 1132 | Lisp_Object this; | 1127 | continue; |
| 1133 | 1128 | ||
| 1134 | this = XCAR (frames); | 1129 | /* Verify that we can still talk to the frame's X window, |
| 1135 | /* Verify that the frame's window still exists | 1130 | and note any recent change in visibility. */ |
| 1136 | and we can still talk to it. And note any recent change | ||
| 1137 | in visibility. */ | ||
| 1138 | #ifdef HAVE_WINDOW_SYSTEM | 1131 | #ifdef HAVE_WINDOW_SYSTEM |
| 1139 | if (FRAME_WINDOW_P (XFRAME (this))) | 1132 | if (FRAME_WINDOW_P (XFRAME (this))) |
| 1140 | { | 1133 | { |
| 1141 | x_sync (XFRAME (this)); | 1134 | x_sync (XFRAME (this)); |
| 1142 | FRAME_SAMPLE_VISIBILITY (XFRAME (this)); | 1135 | FRAME_SAMPLE_VISIBILITY (XFRAME (this)); |
| 1143 | } | 1136 | } |
| 1144 | #endif | 1137 | #endif |
| 1145 | 1138 | ||
| 1146 | if (FRAME_VISIBLE_P (XFRAME (this)) | 1139 | if (FRAME_VISIBLE_P (XFRAME (this)) |
| 1147 | || FRAME_ICONIFIED_P (XFRAME (this)) | 1140 | || FRAME_ICONIFIED_P (XFRAME (this)) |
| 1148 | /* Allow deleting the terminal frame when at least | 1141 | /* Allow deleting the terminal frame when at least one X |
| 1149 | one X frame exists! */ | 1142 | frame exists. */ |
| 1150 | || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f))) | 1143 | || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f))) |
| 1151 | count++; | 1144 | return 1; |
| 1152 | } | ||
| 1153 | return count > 1; | ||
| 1154 | } | 1145 | } |
| 1155 | return 1; | 1146 | return 0; |
| 1156 | } | 1147 | } |
| 1157 | 1148 | ||
| 1158 | /* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME | 1149 | /* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME |