Mercurial > emacs
comparison src/w32fns.c @ 16106:fdd1b2ade15d
(x_set_frame_parameters): Make height and width ints.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 04 Sep 1996 03:55:07 +0000 |
parents | 784c007800c5 |
children | f54af1701a5f |
comparison
equal
deleted
inserted
replaced
16105:1712db4a1709 | 16106:fdd1b2ade15d |
---|---|
585 Lisp_Object tail; | 585 Lisp_Object tail; |
586 | 586 |
587 /* If both of these parameters are present, it's more efficient to | 587 /* If both of these parameters are present, it's more efficient to |
588 set them both at once. So we wait until we've looked at the | 588 set them both at once. So we wait until we've looked at the |
589 entire list before we set them. */ | 589 entire list before we set them. */ |
590 Lisp_Object width, height; | 590 int width, height; |
591 | 591 |
592 /* Same here. */ | 592 /* Same here. */ |
593 Lisp_Object left, top; | 593 Lisp_Object left, top; |
594 | 594 |
595 /* Same with these. */ | 595 /* Same with these. */ |
620 parms[i] = Fcar (elt); | 620 parms[i] = Fcar (elt); |
621 values[i] = Fcdr (elt); | 621 values[i] = Fcdr (elt); |
622 i++; | 622 i++; |
623 } | 623 } |
624 | 624 |
625 width = height = top = left = Qunbound; | 625 top = left = Qunbound; |
626 icon_left = icon_top = Qunbound; | 626 icon_left = icon_top = Qunbound; |
627 | |
628 /* Provide default values for HEIGHT and WIDTH. */ | |
629 width = FRAME_WIDTH (f); | |
630 height = FRAME_HEIGHT (f); | |
627 | 631 |
628 /* Now process them in reverse of specified order. */ | 632 /* Now process them in reverse of specified order. */ |
629 for (i--; i >= 0; i--) | 633 for (i--; i >= 0; i--) |
630 { | 634 { |
631 Lisp_Object prop, val; | 635 Lisp_Object prop, val; |
632 | 636 |
633 prop = parms[i]; | 637 prop = parms[i]; |
634 val = values[i]; | 638 val = values[i]; |
635 | 639 |
636 if (EQ (prop, Qwidth)) | 640 if (EQ (prop, Qwidth) && NUMBERP (val)) |
637 width = val; | 641 width = XFASTINT (val); |
638 else if (EQ (prop, Qheight)) | 642 else if (EQ (prop, Qheight) && NUMBERP (val)) |
639 height = val; | 643 height = XFASTINT (val); |
640 else if (EQ (prop, Qtop)) | 644 else if (EQ (prop, Qtop)) |
641 top = val; | 645 top = val; |
642 else if (EQ (prop, Qleft)) | 646 else if (EQ (prop, Qleft)) |
643 left = val; | 647 left = val; |
644 else if (EQ (prop, Qicon_top)) | 648 else if (EQ (prop, Qicon_top)) |
691 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); | 695 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); |
692 if (NILP (icon_top)) | 696 if (NILP (icon_top)) |
693 XSETINT (icon_top, 0); | 697 XSETINT (icon_top, 0); |
694 } | 698 } |
695 | 699 |
696 /* Don't die if just one of these was set. */ | |
697 if (EQ (width, Qunbound)) | |
698 XSETINT (width, FRAME_WIDTH (f)); | |
699 if (EQ (height, Qunbound)) | |
700 XSETINT (height, FRAME_HEIGHT (f)); | |
701 | |
702 /* Don't set these parameters unless they've been explicitly | 700 /* Don't set these parameters unless they've been explicitly |
703 specified. The window might be mapped or resized while we're in | 701 specified. The window might be mapped or resized while we're in |
704 this function, and we don't want to override that unless the lisp | 702 this function, and we don't want to override that unless the lisp |
705 code has asked for it. | 703 code has asked for it. |
706 | 704 |
712 | 710 |
713 check_frame_size (f, &height, &width); | 711 check_frame_size (f, &height, &width); |
714 | 712 |
715 XSETFRAME (frame, f); | 713 XSETFRAME (frame, f); |
716 | 714 |
717 if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f)) | 715 if (XINT (width) != FRAME_WIDTH (f) |
718 || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f))) | 716 || XINT (height) != FRAME_HEIGHT (f)) |
719 Fset_frame_size (frame, width, height); | 717 Fset_frame_size (frame, make_number (width), make_number (height)); |
720 | 718 |
721 if ((!NILP (left) || !NILP (top)) | 719 if ((!NILP (left) || !NILP (top)) |
722 && ! (left_no_change && top_no_change) | 720 && ! (left_no_change && top_no_change) |
723 && ! (NUMBERP (left) && XINT (left) == f->output_data.win32->left_pos | 721 && ! (NUMBERP (left) && XINT (left) == f->output_data.win32->left_pos |
724 && NUMBERP (top) && XINT (top) == f->output_data.win32->top_pos)) | 722 && NUMBERP (top) && XINT (top) == f->output_data.win32->top_pos)) |