bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-f


From: Andy Moreton
Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame
Date: Sat, 03 Oct 2015 12:28:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

On Fri 02 Oct 2015, martin rudalics wrote:
> Find attached the most recent version of the patch.  Fixes are mainly
> for Lucid/Motif but something might change for other platforms as well.
>
> @@ -3166,15 +3171,25 @@ x_set_frame_parameters (struct frame *f, Lisp_Object 
> alist)
>        prop = parms[i];
>        val = values[i];
>
> -      if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX))
> +      if (EQ (prop, Qwidth))
>          {
>         width_change = 1;
> -          width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ;
> +       if (RANGED_INTEGERP (0, val, INT_MAX))
> +         width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ;
> +       else if (FLOATP (val)
> +                && XFLOAT_DATA (val) >= 0
> +                && (int) XFLOAT_DATA (val) <= INT_MAX)
> +         width = (int) XFLOAT_DATA (val);
>          }

This changes the logic to set width_change even when Qwidth is an
out of range integer: is that intended ?

> -      else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX))
> +      else if (EQ (prop, Qheight))
>          {
>         height_change = 1;
> -          height = XFASTINT (val) * FRAME_LINE_HEIGHT (f);
> +       if (RANGED_INTEGERP (0, val, INT_MAX))
> +         height = XFASTINT (val) * FRAME_LINE_HEIGHT (f);
> +       else if (FLOATP (val)
> +                && XFLOAT_DATA (val) >= 0
> +                && (int) XFLOAT_DATA (val) <= INT_MAX)
> +         height = (int) XFLOAT_DATA (val);

Similarly for height_change.

    AndyM






reply via email to

[Prev in Thread] Current Thread [Next in Thread]