GNU bug report logs - #46827
Broken initial size of GTK3 frame

Previous Next

Package: emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Sun, 28 Feb 2021 09:32:01 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 46827 <at> debbugs.gnu.org
Subject: bug#46827: Broken initial size of GTK3 frame
Date: Fri, 14 May 2021 09:08:20 +0200
>> The lines are calculated correctly by rounding up when we divide the
>> object's pixel height by the default character height of the frame.  But
>> that calculated value is useless on a GUI.
>
> Accoring to window-total-height, the currently used rounding
> in x_change_tab_bar_height corresponds to 'ceiling':
>
>        return make_fixnum (EQ (round, Qceiling)
> 			  ? ((w->pixel_height + unit - 1) /unit)
>
> On a TTY where the frame line height is 1, this gives the correct result.
> But not on a GUI where the frame line height is measured in pixels.
>
> When the argument 'round' of window-total-height is 'floor',
> it uses the formula without subtracting 1 that works on a GUI too:
>
> 			  : (w->pixel_height / unit));
>
> This patch fixes this in x_change_tab_bar_height.  Do you think the same
> fix should be applied to x_change_tool_bar_height as well?

What does your patch fix?  With a sufficiently small default font this
will still return a value > 1.  In either case, the height of the
frame's inner rectangle plus those of internal tab, tool and menu bar
should equal the height of the native rectangle in lines.  Did you check
that?

In my experience, there's no way to make column/line based variables and
functions always DTRT on a GUI.  Code should avoid them.

martin




This bug report was last modified 4 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.