unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: ***SPAM***  Re: (x-display-pixel-height)
Date: Sat, 21 May 2022 16:24:03 +0800	[thread overview]
Message-ID: <87o7zrthss.fsf@yahoo.com> (raw)
In-Reply-To: <837d6f9v3z.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 May 2022 10:56:48 +0300")

[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	other threads:[~2022-05-21  8:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 22:56 (x-display-pixel-height) Perry Smith
2022-05-19  1:05 ` (x-display-pixel-height) Po Lu
2022-05-19 14:52   ` (x-display-pixel-height) Perry Smith
2022-05-20  1:04     ` (x-display-pixel-height) Po Lu
2022-05-20 16:43       ` ***SPAM*** (x-display-pixel-height) Perry Smith
2022-05-21  1:33         ` Po Lu
2022-05-21  3:19           ` Po Lu
2022-05-21  7:56             ` Eli Zaretskii
2022-05-21  8:24               ` Po Lu [this message]
2022-05-21  8:33                 ` Eli Zaretskii
2022-05-21  8:39                   ` Po Lu
2022-05-22  1:35                 ` Po Lu
2022-05-22  5:57                   ` Eli Zaretskii
2022-05-22  6:18                     ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7zrthss.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).