emacs-devel
[Top][All Lists]
Advanced

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

Re: ***SPAM*** Re: (x-display-pixel-height)


From: Po Lu
Subject: Re: ***SPAM*** Re: (x-display-pixel-height)
Date: Sat, 21 May 2022 16:24:03 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

[Removed Perry since his address bounces.]

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.
>
> However, the documentation of this hook IMO falls short of being
> useful to Lisp programs:
>
>   +@defvar display-monitors-changed-functions
>   +This variable is an abnormal hook run when the monitor configuration
>   +changes, which can happen if a monitor is rotated, moved, added or
>   +removed from a multiple-monitor setup, if the primary monitor changes,
>   +or if the resolution of a monitor changes.  It is called with a single
>   +argument consisting of the terminal on which the monitor configuration
>   +changed.
>   +@end defvar
>
> This doesn't give any hints for how should a Lisp program get the
> information about the monitor-configuration changes that triggered the
> hook call, given just the terminal name.  Without knowing how to
> access that information, this hook is not very useful.

That information isn't available in sufficient detail inside the events
that we get from the window system.  The idea is that programs will call
`display-monitor-attributes-list' to retrieve the new monitor
configuration, which is always available after the hook is run.

How about this?

@cindex monitor change functions
@defvar display-monitors-changed-functions
This variable is an abnormal hook run when the monitor configuration
changes, which can happen if a monitor is rotated, moved, added or
removed from a multiple-monitor setup, if the primary monitor changes,
or if the resolution of a monitor changes.  It is called with a single
argument consisting of the terminal on which the monitor configuration
changed.  Programs should call @code{display-monitor-attributes-list}
with the terminal as the argument to retrieve the changed monitor
configuration inside this hook.
@end defvar

> I also notice that this hook was implemented for all the supported GUI
> backends except w32, which is unfortunate and undocumented.

I plan to try implementing it there in the coming days.


reply via email to

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