emacs-devel
[Top][All Lists]
Advanced

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

Re: (x-display-pixel-height)


From: Po Lu
Subject: Re: (x-display-pixel-height)
Date: Thu, 19 May 2022 09:05:58 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Perry Smith <pedz@easesoftware.com> writes:

> However, the X11 version does not do this.  I always get 2025.  The
> output from `(display-monitor-attributes-list)` changes.  With the
> monitor attached, there are two entries roughly like the one above and
> when the monitor is not attached, the output is a single entry.
>
> The 2025 appears to be the value when the first window is opened
> perhaps?  It is the same value as the sum of the heights when the
> monitor is attached.  And it appears that it is not getting updated
> when the monitor is detached.  Is this a bug?  If so, I can report it
> but thought I would check here first.  (I also can’t follow how
> x_display_pixel_height works but that’s a detail.)

Xlib determines the height of the core protocol screen statically upon
connecting to an X server.  It cannot change as monitors are hotplugged.

In X, there are about 3 or 4 different ways to fetch screen and/or
monitor dimensions.  Each of them behave differently.

`x-display-pixel-height' uses the core HeightOfScreen, while
`display-monitor-attributes-list' defaults to using the RandR extension,
which can change dynamically as the screen dimensions are updated.
(That will be fixed in Emacs 29.)

As for why you always get 2025 instead of 2062, I think your X server is
only including the "workarea" of the macOS display in its screen
dimensions.

In general, every X server that doesn't run on actual hardware or a
Wayland compositor reports screen dimensions and input devices
incorrectly.  That cannot be helped.

> My question pertains to the name of the monitors.  Can I somehow give
> the monitors names that will last for the life of Emacs?

No, unfortunately not.



reply via email to

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