aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-06-03 05:56:44 +0000
committerRichard M. Stallman1993-06-03 05:56:44 +0000
commitf5e70acdd4d08692fa00de78d6e85380da4db595 (patch)
tree1919ba6063521bfa9815d1fb8d954d6ce291f9f1
parentebc9936d6a4d80fe69ad492c9b0a8cf654f41afc (diff)
downloademacs-f5e70acdd4d08692fa00de78d6e85380da4db595.tar.gz
emacs-f5e70acdd4d08692fa00de78d6e85380da4db595.zip
(x_set_frame_parameters): Process all parms in reverse order.
-rw-r--r--src/xfns.c51
1 files changed, 35 insertions, 16 deletions
diff --git a/src/xfns.c b/src/xfns.c
index f2d12df3e02..d83c5958c22 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -332,26 +332,51 @@ x_set_frame_parameters (f, alist)
332 /* Same here. */ 332 /* Same here. */
333 Lisp_Object left, top; 333 Lisp_Object left, top;
334 334
335 width = height = top = left = Qnil; 335 /* Record in these vectors all the parms specified. */
336 Lisp_Object *parms;
337 Lisp_Object *values;
338 int i;
339
340 i = 0;
341 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
342 i++;
336 343
344 parms = (Lisp_Object *) alloca (i * sizeof (Lisp_Object));
345 values = (Lisp_Object *) alloca (i * sizeof (Lisp_Object));
346
347 /* Extract parm names and values into those vectors. */
348
349 i = 0;
337 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) 350 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
338 { 351 {
339 Lisp_Object elt, prop, val; 352 Lisp_Object elt, prop, val;
340 353
341 elt = Fcar (tail); 354 elt = Fcar (tail);
342 prop = Fcar (elt); 355 parms[i] = Fcar (elt);
343 val = Fcdr (elt); 356 values[i] = Fcdr (elt);
357 i++;
358 }
344 359
345 /* Ignore all but the first set presented. You're supposed to 360 XSET (width, Lisp_Int, FRAME_WIDTH (f));
346 be able to append two parameter lists and have the first 361 XSET (height, Lisp_Int, FRAME_HEIGHT (f));
347 shadow the second. */ 362 XSET (top, Lisp_Int, f->display.x->top_pos);
348 if (EQ (prop, Qwidth) && NILP (width)) 363 XSET (left, Lisp_Int, f->display.x->left_pos);
364
365 /* Now process them in reverse of specified order. */
366 for (i--; i >= 0; i--)
367 {
368 Lisp_Object prop, val;
369
370 prop = parms[i];
371 val = values[i];
372
373 if (EQ (prop, Qwidth))
349 width = val; 374 width = val;
350 else if (EQ (prop, Qheight) && NILP (height)) 375 else if (EQ (prop, Qheight))
351 height = val; 376 height = val;
352 else if (EQ (prop, Qtop) && NILP (top)) 377 else if (EQ (prop, Qtop))
353 top = val; 378 top = val;
354 else if (EQ (prop, Qleft) && NILP (left)) 379 else if (EQ (prop, Qleft))
355 left = val; 380 left = val;
356 else 381 else
357 { 382 {
@@ -372,12 +397,6 @@ x_set_frame_parameters (f, alist)
372 { 397 {
373 Lisp_Object frame; 398 Lisp_Object frame;
374 399
375 if (NILP (width)) XSET (width, Lisp_Int, FRAME_WIDTH (f));
376 if (NILP (height)) XSET (height, Lisp_Int, FRAME_HEIGHT (f));
377
378 if (NILP (top)) XSET (top, Lisp_Int, f->display.x->top_pos);
379 if (NILP (left)) XSET (left, Lisp_Int, f->display.x->left_pos);
380
381 XSET (frame, Lisp_Frame, f); 400 XSET (frame, Lisp_Frame, f);
382 if (XINT (width) != FRAME_WIDTH (f) 401 if (XINT (width) != FRAME_WIDTH (f)
383 || XINT (height) != FRAME_HEIGHT (f)) 402 || XINT (height) != FRAME_HEIGHT (f))