all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()
@ 2023-05-09 18:22 Tobias Bading
  2023-09-06 11:05 ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Tobias Bading @ 2023-05-09 18:22 UTC (permalink / raw)
  To: 63395

It looks like

--- %< ---

commit 401ccb0b9c697fd3af026a72b6621a692e206aea
Author:     Po Lu <luangruo@yahoo.com>
AuthorDate: Wed Jan 26 13:53:20 2022 +0800
Commit:     Po Lu <luangruo@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@web.de>
AuthorDate: Wed Nov 27 16:51:26 2019 +0100
Commit:     Robert Pluim <rpluim@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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()
  2023-05-09 18:22 bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar() Tobias Bading
@ 2023-09-06 11:05 ` Stefan Kangas
  2023-09-06 11:43   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-07  0:59   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Kangas @ 2023-09-06 11:05 UTC (permalink / raw)
  To: Tobias Bading; +Cc: Po Lu, 63395

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

Tobias Bading <tbading@web.de> writes:

> It looks like
>
> --- %< ---
>
> commit 401ccb0b9c697fd3af026a72b6621a692e206aea
> Author:     Po Lu <luangruo@yahoo.com>
> AuthorDate: Wed Jan 26 13:53:20 2022 +0800
> Commit:     Po Lu <luangruo@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@web.de>
> AuthorDate: Wed Nov 27 16:51:26 2019 +0100
> Commit:     Robert Pluim <rpluim@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()
  2023-09-06 11:05 ` Stefan Kangas
@ 2023-09-06 11:43   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-07  0:59   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 4+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-06 11:43 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 63395, Tobias Bading

Stefan Kangas <stefankangas@gmail.com> writes:

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

I will tomorrow, thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar()
  2023-09-06 11:05 ` Stefan Kangas
  2023-09-06 11:43   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-07  0:59   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 4+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-07  0:59 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 63395, Tobias Bading

Stefan Kangas <stefankangas@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?





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-07  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09 18:22 bug#63395: HiDPI/GTK: menubar height scaled twice in xg_update_frame_menubar() Tobias Bading
2023-09-06 11:05 ` Stefan Kangas
2023-09-06 11:43   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07  0:59   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.