aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-01 09:16:11 +0000
committerRichard M. Stallman1994-05-01 09:16:11 +0000
commit4fe1de1272b657e687889dbf1f47d954b1d14278 (patch)
treeeb5803f4182e53d251e1bd1ebb2af832362d0a2a /src
parent3c6bc7d07a6b5ff37a9b96c59a954dc1000b9b65 (diff)
downloademacs-4fe1de1272b657e687889dbf1f47d954b1d14278.tar.gz
emacs-4fe1de1272b657e687889dbf1f47d954b1d14278.zip
(x_figure_window_size): Set USPosition only if user-position
is non-nil; otherwise, if pos is specified, set PPosition. Likewise for USSize and PSize.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 20c82a79582..9e6c257d108 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -230,6 +230,8 @@ Lisp_Object Qvisibility;
230Lisp_Object Qwindow_id; 230Lisp_Object Qwindow_id;
231Lisp_Object Qx_frame_parameter; 231Lisp_Object Qx_frame_parameter;
232Lisp_Object Qx_resource_name; 232Lisp_Object Qx_resource_name;
233Lisp_Object Quser_position;
234Lisp_Object Quser_size;
233 235
234/* The below are defined in frame.c. */ 236/* The below are defined in frame.c. */
235extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; 237extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
@@ -1602,7 +1604,7 @@ x_figure_window_size (f, parms)
1602 struct frame *f; 1604 struct frame *f;
1603 Lisp_Object parms; 1605 Lisp_Object parms;
1604{ 1606{
1605 register Lisp_Object tem0, tem1; 1607 register Lisp_Object tem0, tem1, tem2;
1606 int height, width, left, top; 1608 int height, width, left, top;
1607 register int geometry; 1609 register int geometry;
1608 long window_prompting = 0; 1610 long window_prompting = 0;
@@ -1619,13 +1621,17 @@ x_figure_window_size (f, parms)
1619 1621
1620 tem0 = x_get_arg (parms, Qheight, 0, 0, number); 1622 tem0 = x_get_arg (parms, Qheight, 0, 0, number);
1621 tem1 = x_get_arg (parms, Qwidth, 0, 0, number); 1623 tem1 = x_get_arg (parms, Qwidth, 0, 0, number);
1624 tem2 = x_get_arg (parms, Quser_size, 0, 0, number);
1622 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) 1625 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound))
1623 { 1626 {
1624 CHECK_NUMBER (tem0, 0); 1627 CHECK_NUMBER (tem0, 0);
1625 CHECK_NUMBER (tem1, 0); 1628 CHECK_NUMBER (tem1, 0);
1626 f->height = XINT (tem0); 1629 f->height = XINT (tem0);
1627 f->width = XINT (tem1); 1630 f->width = XINT (tem1);
1628 window_prompting |= USSize; 1631 if (!NILP (tem2))
1632 window_prompting |= USSize;
1633 else
1634 window_prompting |= PSize;
1629 } 1635 }
1630 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) 1636 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
1631 error ("Must specify *both* height and width"); 1637 error ("Must specify *both* height and width");
@@ -1639,6 +1645,7 @@ x_figure_window_size (f, parms)
1639 1645
1640 tem0 = x_get_arg (parms, Qtop, 0, 0, number); 1646 tem0 = x_get_arg (parms, Qtop, 0, 0, number);
1641 tem1 = x_get_arg (parms, Qleft, 0, 0, number); 1647 tem1 = x_get_arg (parms, Qleft, 0, 0, number);
1648 tem2 = x_get_arg (parms, Quser_position, 0, 0, number);
1642 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) 1649 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound))
1643 { 1650 {
1644 CHECK_NUMBER (tem0, 0); 1651 CHECK_NUMBER (tem0, 0);
@@ -1649,41 +1656,13 @@ x_figure_window_size (f, parms)
1649 window_prompting |= YNegative; 1656 window_prompting |= YNegative;
1650 if (f->display.x->left_pos < 0) 1657 if (f->display.x->left_pos < 0)
1651 window_prompting |= XNegative; 1658 window_prompting |= XNegative;
1652 window_prompting |= USPosition; 1659 if (!NILP (tem2))
1660 window_prompting |= USPosition;
1661 else
1662 window_prompting |= PPosition;
1653 } 1663 }
1654 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) 1664 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
1655 error ("Must specify *both* top and left corners"); 1665 error ("Must specify *both* top and left corners");
1656
1657#if 0 /* PPosition and PSize mean "specified explicitly,
1658 by the program rather than by the user". So it is wrong to
1659 set them if nothing was specified. */
1660 switch (window_prompting)
1661 {
1662 case USSize | USPosition:
1663 return window_prompting;
1664 break;
1665
1666 case USSize: /* Got the size, need the position. */
1667 window_prompting |= PPosition;
1668 return window_prompting;
1669 break;
1670
1671 case USPosition: /* Got the position, need the size. */
1672 window_prompting |= PSize;
1673 return window_prompting;
1674 break;
1675
1676 case 0: /* Got nothing, take both from geometry. */
1677 window_prompting |= PPosition | PSize;
1678 return window_prompting;
1679 break;
1680
1681 default:
1682 /* Somehow a bit got set in window_prompting that we didn't
1683 put there. */
1684 abort ();
1685 }
1686#endif
1687 return window_prompting; 1666 return window_prompting;
1688} 1667}
1689 1668
@@ -4231,6 +4210,10 @@ syms_of_xfns ()
4231 staticpro (&Qx_frame_parameter); 4210 staticpro (&Qx_frame_parameter);
4232 Qx_resource_name = intern ("x-resource-name"); 4211 Qx_resource_name = intern ("x-resource-name");
4233 staticpro (&Qx_resource_name); 4212 staticpro (&Qx_resource_name);
4213 Quser_position = intern ("user-position");
4214 staticpro (&Quser_position);
4215 Quser_size = intern ("user-size");
4216 staticpro (&Quser_size);
4234 /* This is the end of symbol initialization. */ 4217 /* This is the end of symbol initialization. */
4235 4218
4236 Fput (Qundefined_color, Qerror_conditions, 4219 Fput (Qundefined_color, Qerror_conditions,