GNU bug report logs - #63395
HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()

Previous Next

Package: emacs;

Reported by: Tobias Bading <tbading <at> web.de>

Date: Tue, 9 May 2023 18:24:02 UTC

Severity: normal

Tags: fixed

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63395 in the body.
You can then email your comments to 63395 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63395; Package emacs. (Tue, 09 May 2023 18:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Bading <tbading <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 May 2023 18:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Bading <tbading <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()
Date: Tue, 9 May 2023 20:22:53 +0200
It looks like

--- %< ---

commit 401ccb0b9c697fd3af026a72b6621a692e206aea
Author:     Po Lu <luangruo <at> yahoo.com>
AuthorDate: Wed Jan 26 13:53:20 2022 +0800
Commit:     Po Lu <luangruo <at> yahoo.com>
CommitDate: Wed Jan 26 13:53:20 2022 +0800

    Fix GTK menu bar height reporting when scaled

    * src/gtkutil.c (xg_update_frame_menubar): Multiply requisition
    height by GDK scale.

M       src/gtkutil.c

--- >% ---

tried to correct a problem that was already fixed by

--- %< ---

commit a05bafffdcb88df74408a8402cafc9829407c1e5
Author:     Tobias Bading <tbading <at> web.de>
AuthorDate: Wed Nov 27 16:51:26 2019 +0100
Commit:     Robert Pluim <rpluim <at> gmail.com>
CommitDate: Tue Dec 3 08:54:31 2019 +0100

    Fix incorrect GTK menus on HiDPI monitors with scaling factor > 1

    This should fix Bug#31223, Bug#28106, Bug#23672 as well as Ubuntu bug
    https://bugs.launchpad.net/ubuntu/+source/emacs25/+bug/1695228

    Also fixes the formerly unscaled Y value returned by
    frame-monitor-workarea (and display-monitor-attributes-list).

    For details on why some GTK menus were empty please see thread
    https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg01061.html

    * src/gtkutil.c (menubar_map_cb, xg_update_frame_menubar): Scale up
    req.height so that the menu bar's height is in device pixels as
    expected.
    (xg_event_is_for_menubar): Scale down rec.x and rec.y so that
    gtk_widget_intersect() works as intended.
    * src/xfns.c (Fx_display_monitor_attributes_list): Scale work.x and
    work.y up to be in device pixels.

    Copyright-paperwork-exempt: yes

M       src/gtkutil.c
M       src/xfns.c

--- >% ---

In emacs-29 as well as master req.height in xg_update_frame_menubar() is now
multiplied with xg_get_scale(f) twice. As a result my window manager (Compiz
from Ubuntu 20.04.6 LTS) assumes that the Emacs frame wouldn’t fit into the
monitor’s workarea and ignores my requested position.

Reverting 401ccb0b9c697fd3af026a72b6621a692e206aea fixes this for me.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63395; Package emacs. (Wed, 06 Sep 2023 11:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 63395 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Tobias Bading <tbading <at> web.de>
Cc: Po Lu <luangruo <at> yahoo.com>, 63395 <at> debbugs.gnu.org
Subject: Re: bug#63395: HiDPI/GTK: menubar height scaled twice in
 xg_update_frame_menubar()
Date: Wed, 6 Sep 2023 04:05:05 -0700
Po Lu, could you please take a look at the below bug report?

Tobias Bading <tbading <at> web.de> writes:

> It looks like
>
> --- %< ---
>
> commit 401ccb0b9c697fd3af026a72b6621a692e206aea
> Author:     Po Lu <luangruo <at> yahoo.com>
> AuthorDate: Wed Jan 26 13:53:20 2022 +0800
> Commit:     Po Lu <luangruo <at> yahoo.com>
> CommitDate: Wed Jan 26 13:53:20 2022 +0800
>
>     Fix GTK menu bar height reporting when scaled
>
>     * src/gtkutil.c (xg_update_frame_menubar): Multiply requisition
>     height by GDK scale.
>
> M       src/gtkutil.c
>
> --- >% ---
>
> tried to correct a problem that was already fixed by
>
> --- %< ---
>
> commit a05bafffdcb88df74408a8402cafc9829407c1e5
> Author:     Tobias Bading <tbading <at> web.de>
> AuthorDate: Wed Nov 27 16:51:26 2019 +0100
> Commit:     Robert Pluim <rpluim <at> gmail.com>
> CommitDate: Tue Dec 3 08:54:31 2019 +0100
>
>     Fix incorrect GTK menus on HiDPI monitors with scaling factor > 1
>
>     This should fix Bug#31223, Bug#28106, Bug#23672 as well as Ubuntu bug
>     https://bugs.launchpad.net/ubuntu/+source/emacs25/+bug/1695228
>
>     Also fixes the formerly unscaled Y value returned by
>     frame-monitor-workarea (and display-monitor-attributes-list).
>
>     For details on why some GTK menus were empty please see thread
>     https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg01061.html
>
>     * src/gtkutil.c (menubar_map_cb, xg_update_frame_menubar): Scale up
>     req.height so that the menu bar's height is in device pixels as
>     expected.
>     (xg_event_is_for_menubar): Scale down rec.x and rec.y so that
>     gtk_widget_intersect() works as intended.
>     * src/xfns.c (Fx_display_monitor_attributes_list): Scale work.x and
>     work.y up to be in device pixels.
>
>     Copyright-paperwork-exempt: yes
>
> M       src/gtkutil.c
> M       src/xfns.c
>
> --- >% ---
>
> In emacs-29 as well as master req.height in xg_update_frame_menubar() is now
> multiplied with xg_get_scale(f) twice. As a result my window manager (Compiz
> from Ubuntu 20.04.6 LTS) assumes that the Emacs frame wouldn’t fit into the
> monitor’s workarea and ignores my requested position.
>
> Reverting 401ccb0b9c697fd3af026a72b6621a692e206aea fixes this for me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63395; Package emacs. (Wed, 06 Sep 2023 11:44:02 GMT) Full text and rfc822 format available.

Message #11 received at 63395 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 63395 <at> debbugs.gnu.org, Tobias Bading <tbading <at> web.de>
Subject: Re: bug#63395: HiDPI/GTK: menubar height scaled twice in
 xg_update_frame_menubar()
Date: Wed, 06 Sep 2023 19:43:07 +0800
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Po Lu, could you please take a look at the below bug report?

I will tomorrow, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63395; Package emacs. (Thu, 07 Sep 2023 01:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 63395 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 63395 <at> debbugs.gnu.org, Tobias Bading <tbading <at> web.de>
Subject: Re: bug#63395: HiDPI/GTK: menubar height scaled twice in
 xg_update_frame_menubar()
Date: Thu, 07 Sep 2023 08:59:30 +0800
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Po Lu, could you please take a look at the below bug report?

Yes.  Tobin, I corrected this on master; would you please try again?




Added tag(s) fixed. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 07 Sep 2023 16:27:02 GMT) Full text and rfc822 format available.

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Sat, 22 Feb 2025 12:30:02 GMT) Full text and rfc822 format available.

Notification sent to Tobias Bading <tbading <at> web.de>:
bug acknowledged by developer. (Sat, 22 Feb 2025 12:30:03 GMT) Full text and rfc822 format available.

Message #21 received at 63395-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Tobias Bading <tbading <at> web.de>, 63395-done <at> debbugs.gnu.org,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#63395: HiDPI/GTK: menubar height scaled twice in
 xg_update_frame_menubar()
Date: Sat, 22 Feb 2025 21:29:05 +0900
Hi,

Po Lu <luangruo <at> yahoo.com> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> Po Lu, could you please take a look at the below bug report?
>
> Yes.  Tobin, I corrected this on master; would you please try again?

Assuming this is fixed; as committed in
241616831024c9c9fe2b2378b611db0a560b9675, found in master and the
emacs-30 branch.

Closing.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Mar 2025 11:24:56 GMT) Full text and rfc822 format available.

This bug report was last modified 47 days ago.

Previous Next


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