comparison src/window.c @ 34819:7fcb09b535b4

(delete_window): Simplify somewhat. (Fset_window_configuration): Don't SET_FRAME_GARBAGED after freeing window matrices. The flag windows_or_buffers_changed is set, so the next redisplay will consider all windows; this should suffice.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 22 Dec 2000 10:51:11 +0000
parents a9b2c624a8a2
children 5a5be14316ae
comparison
equal deleted inserted replaced
34818:2c66e24f2398 34819:7fcb09b535b4
1162 register Lisp_Object window; 1162 register Lisp_Object window;
1163 { 1163 {
1164 register Lisp_Object tem, parent, sib; 1164 register Lisp_Object tem, parent, sib;
1165 register struct window *p; 1165 register struct window *p;
1166 register struct window *par; 1166 register struct window *par;
1167 FRAME_PTR frame; 1167 struct frame *f;
1168 1168
1169 /* Because this function is called by other C code on non-leaf 1169 /* Because this function is called by other C code on non-leaf
1170 windows, the CHECK_LIVE_WINDOW macro would choke inappropriately, 1170 windows, the CHECK_LIVE_WINDOW macro would choke inappropriately,
1171 so we can't decode_window here. */ 1171 so we can't decode_window here. */
1172 if (NILP (window)) 1172 if (NILP (window))
1186 error ("Attempt to delete minibuffer or sole ordinary window"); 1186 error ("Attempt to delete minibuffer or sole ordinary window");
1187 par = XWINDOW (parent); 1187 par = XWINDOW (parent);
1188 1188
1189 windows_or_buffers_changed++; 1189 windows_or_buffers_changed++;
1190 Vwindow_list = Qnil; 1190 Vwindow_list = Qnil;
1191 frame = XFRAME (WINDOW_FRAME (p)); 1191 f = XFRAME (WINDOW_FRAME (p));
1192 FRAME_WINDOW_SIZES_CHANGED (frame) = 1; 1192 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
1193 1193
1194 /* Are we trying to delete any frame's selected window? */ 1194 /* Are we trying to delete any frame's selected window? */
1195 { 1195 {
1196 Lisp_Object frame, pwindow; 1196 Lisp_Object pwindow;
1197 1197
1198 /* See if the frame's selected window is either WINDOW 1198 /* See if the frame's selected window is either WINDOW
1199 or any subwindow of it, by finding all that window's parents 1199 or any subwindow of it, by finding all that window's parents
1200 and comparing each one with WINDOW. */ 1200 and comparing each one with WINDOW. */
1201 frame = WINDOW_FRAME (XWINDOW (window)); 1201 pwindow = FRAME_SELECTED_WINDOW (f);
1202 pwindow = FRAME_SELECTED_WINDOW (XFRAME (frame));
1203 1202
1204 while (!NILP (pwindow)) 1203 while (!NILP (pwindow))
1205 { 1204 {
1206 if (EQ (window, pwindow)) 1205 if (EQ (window, pwindow))
1207 break; 1206 break;
1219 delete the selected window on any other frame, we shouldn't do 1218 delete the selected window on any other frame, we shouldn't do
1220 anything but set the frame's selected_window slot. */ 1219 anything but set the frame's selected_window slot. */
1221 if (EQ (window, selected_window)) 1220 if (EQ (window, selected_window))
1222 Fselect_window (alternative); 1221 Fselect_window (alternative);
1223 else 1222 else
1224 FRAME_SELECTED_WINDOW (XFRAME (frame)) = alternative; 1223 FRAME_SELECTED_WINDOW (f) = alternative;
1225 } 1224 }
1226 } 1225 }
1227 1226
1228 tem = p->buffer; 1227 tem = p->buffer;
1229 /* tem is null for dummy parent windows 1228 /* tem is null for dummy parent windows
1238 /* Free window glyph matrices. It is sure that they are allocated 1237 /* Free window glyph matrices. It is sure that they are allocated
1239 again when ADJUST_GLYPHS is called. Block input so that expose 1238 again when ADJUST_GLYPHS is called. Block input so that expose
1240 events and other events that access glyph matrices are not 1239 events and other events that access glyph matrices are not
1241 processed while we are changing them. */ 1240 processed while we are changing them. */
1242 BLOCK_INPUT; 1241 BLOCK_INPUT;
1243 free_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (frame))); 1242 free_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (f)));
1244 1243
1245 tem = p->next; 1244 tem = p->next;
1246 if (!NILP (tem)) 1245 if (!NILP (tem))
1247 XWINDOW (tem)->prev = p->prev; 1246 XWINDOW (tem)->prev = p->prev;
1248 1247
1295 1294
1296 /* Mark this window as deleted. */ 1295 /* Mark this window as deleted. */
1297 p->buffer = p->hchild = p->vchild = Qnil; 1296 p->buffer = p->hchild = p->vchild = Qnil;
1298 1297
1299 /* Adjust glyph matrices. */ 1298 /* Adjust glyph matrices. */
1300 adjust_glyphs (frame); 1299 adjust_glyphs (f);
1301 UNBLOCK_INPUT; 1300 UNBLOCK_INPUT;
1302 } 1301 }
1303 1302
1304 1303
1305 1304
4929 { 4928 {
4930 /* Assert it's not reused as a combination. */ 4929 /* Assert it's not reused as a combination. */
4931 xassert (NILP (leaf_windows[i]->hchild) 4930 xassert (NILP (leaf_windows[i]->hchild)
4932 && NILP (leaf_windows[i]->vchild)); 4931 && NILP (leaf_windows[i]->vchild));
4933 free_window_matrices (leaf_windows[i]); 4932 free_window_matrices (leaf_windows[i]);
4934 SET_FRAME_GARBAGED (f);
4935 } 4933 }
4936 else if (EQ (leaf_windows[i]->buffer, new_current_buffer)) 4934 else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
4937 ++n; 4935 ++n;
4938 } 4936 }
4939 4937