GNU bug report logs - #31223
25.3; New menus are empty with GTK3

Previous Next

Package: emacs;

Reported by: Thomas Schneider <qsx <at> chaotikum.eu>

Date: Fri, 20 Apr 2018 14:57:01 UTC

Severity: normal

Tags: help

Merged with 23672, 28106

Found in versions 25.0.94, 25.2, 25.3

Fixed in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tobias Bading <tbading <at> web.de>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 31223 <at> debbugs.gnu.org
Subject: bug#31223: [PATCH] Fix empty/incorrect GTK menus on HiDPI monitors with window scaling factor > 1
Date: Thu, 28 Nov 2019 10:32:39 +0100
On 28.11.19 09:20, Robert Pluim wrote:
>>>>>> On Wed, 27 Nov 2019 17:03:32 +0100, Tobias Bading
<tbading <at> web.de> said:
>
>     Tobias> This should fix Bug#31223, Bug#28106, Bug#23672 as well
as Ubuntu bug
>     Tobias>
https://bugs.launchpad.net/ubuntu/+source/emacs25/+bug/1695228
>
> If those are all the same bug we should merge them.

Noam Postavsky already did that over a year ago, although I have no idea
what
"merging" means in this bug tracker. The new comments don't appear in the
merged reports and there's no indication as to which report became kind
of the
leading one after the merged. I simply chose 31223 because that's the
one Noam
sent his "merge 23672 28106 31223" command to, if I'm reading it right.

> Yes. You need this as well, I think:
>
> diff --git a/src/gtkutil.c b/src/gtkutil.c
> index cf5c31aa20..4f8b06941b 100644
> --- a/src/gtkutil.c
> +++ b/src/gtkutil.c
> @@ -3503,6 +3503,8 @@ xg_update_frame_menubar (struct frame *f)
>    gtk_widget_show_all (x->menubar_widget);
>    gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req);
>
> +  req.height *= xg_get_scale (f);
>    if (FRAME_MENUBAR_HEIGHT (f) != req.height)
>      {
>        FRAME_MENUBAR_HEIGHT (f) = req.height;

This change in xg_update_frame_menubar is already a part of my patch,
with the
only difference that I replaced the empty line. Or am I reading this hunk
wrong?

>     Tobias> diff --git a/src/xfns.c b/src/xfns.c
>     Tobias> index b1b40702c2..47aa19607f 100644
>     Tobias> --- a/src/xfns.c
>     Tobias> +++ b/src/xfns.c
>     Tobias> @@ -5093,6 +5093,8 @@ DEFUN
("x-display-monitor-attributes-list", Fx_display_monitor_attributes_list,
>     Tobias>  #endif
>     Tobias>        rec.width *= scale;
>     Tobias>        rec.height *= scale;
>     Tobias> +      work.x *= scale;
>     Tobias> +      work.y *= scale;
>     Tobias>        work.width *= scale;
>     Tobias>        work.height *= scale;
>
> This seems correct as well. Probably rec.x and rec.y need scaling as
well, for
> the multi-monitor case, which will require some cabling for me to test.

Good point. The documentation of gdk_monitor_get_geometry() says

"Retrieves the size and position of an individual monitor within the display
coordinate space. The returned geometry is in "application pixels", not in
"device pixels" (see gdk_monitor_get_scale_factor())."

Unfortunately, I don't have a second monitor at hand to test this.

Tobias





This bug report was last modified 5 years and 140 days ago.

Previous Next


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