aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-29 21:38:34 +0000
committerRichard M. Stallman1994-06-29 21:38:34 +0000
commitf10f0b79a4eb314542a6425a976d0bbb24a372d0 (patch)
tree47a961182300c419d810f4f0995feedcdbeeabf6 /src
parentfc9cce4ec4d5ea6c24106c09efa5e3a8204dc994 (diff)
downloademacs-f10f0b79a4eb314542a6425a976d0bbb24a372d0.tar.gz
emacs-f10f0b79a4eb314542a6425a976d0bbb24a372d0.zip
(x_set_frame_parameters): Call x_set_offset directly.
Handle `-' for position parameters. (x_set_name): If no change needed, avoid consing.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 1d513c806af..c73af713a1c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -552,9 +552,29 @@ x_set_frame_parameters (f, alist)
552 if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f)) 552 if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f))
553 || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f))) 553 || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f)))
554 Fset_frame_size (frame, width, height); 554 Fset_frame_size (frame, width, height);
555 if ((NUMBERP (left) && XINT (left) != f->display.x->left_pos) 555
556 || (NUMBERP (top) && XINT (top) != f->display.x->top_pos)) 556 if ((!NILP (left) || !NILP (top))
557 Fset_frame_position (frame, left, top); 557 && ! (NUMBERP (left) && XINT (left) == f->display.x->left_pos
558 && NUMBERP (top) && XINT (top) == f->display.x->top_pos))
559 {
560 int leftpos = (NUMBERP (left) ? XINT (left) : 0);
561 int toppos = (NUMBERP (top) ? XINT (top) : 0);
562
563 /* Store the numeric value of the position. */
564 f->display.x->top_pos = toppos;
565 f->display.x->left_pos = leftpos;
566
567 /* Record the signs. */
568 f->display.x->size_hint_flags &= ~ (XNegative | YNegative);
569 if (EQ (left, Qminus) || (NUMBERP (left) && XINT (left) < 0))
570 f->display.x->size_hint_flags |= XNegative;
571 if (EQ (top, Qminus) || (NUMBERP (top) && XINT (top) < 0))
572 f->display.x->size_hint_flags |= YNegative;
573 f->display.x->win_gravity = NorthWestGravity;
574
575 /* Actually set that position, and convert to absolute. */
576 x_set_offset (f, leftpos, toppos, 0);
577 }
558 } 578 }
559} 579}
560 580
@@ -1255,7 +1275,13 @@ x_set_name (f, name, explicit)
1255 1275
1256 /* If NAME is nil, set the name to the x_id_name. */ 1276 /* If NAME is nil, set the name to the x_id_name. */
1257 if (NILP (name)) 1277 if (NILP (name))
1258 name = build_string (x_id_name); 1278 {
1279 /* Check for no change needed in this very common case
1280 before we do any consing. */
1281 if (!strcmp (x_id_name, XSTRING (f->name)->data))
1282 return;
1283 name = build_string (x_id_name);
1284 }
1259 else 1285 else
1260 CHECK_STRING (name, 0); 1286 CHECK_STRING (name, 0);
1261 1287