From: Jashank Jeremy <jashank@rulingia.com.au>
To: Po Lu <luangruo@yahoo.com>, Emacs development list <emacs-devel@gnu.org>
Subject: Re: master e465ea816d: Don't unnecessarily call monitor change functions
Date: Sun, 22 May 2022 16:42:57 +1000 [thread overview]
Message-ID: <87wneef4pa.wl-jashank@rulingia.com.au> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1307 bytes --]
> diff --git a/src/xterm.c b/src/xterm.c
> index add0c848db9..05ede2e5803 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -20144,6 +20145,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
> inev.ie.kind = MONITORS_CHANGED_EVENT;
> inev.ie.timestamp = timestamp;
> XSETTERMINAL (inev.ie.arg, dpyinfo->terminal);
> +
> + /* Also don't do anything if the monitor configuration
> + didn't really change. */
> +
> + current_monitors
> + = Fx_display_monitor_attributes_list (inev.ie.arg);
> +
> + if (Fequal (current_monitors,
> + dpyinfo->last_monitor_attributes_list))
> + inev.ie.kind = NO_EVENT;
> +
> + dpyinfo->last_monitor_attributes_list = current_monitors;
> }
> #endif
> OTHER:
On my machine, this introduces a build failure:
.../emacs/src/src/xterm.c:20162:4: error: statement requires expression of scalar type ('Lisp_Object' (aka 'struct Lisp_Object') invalid)
if (Fequal (current_monitors,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
This seems fixable by making this an explicit nil check:
if (!NILP (Fequal (current_monitors,
dpyinfo->last_monitor_attributes_list)))
A patch to that effect is attached.
~jashank
[-- Attachment #1.2: 20220522-xterm-xrandr-fix.patch --]
[-- Type: text/plain, Size: 932 bytes --]
From 77bf0e8434b7c6f8503b9fcb98b9f4e0d730ede2 Mon Sep 17 00:00:00 2001
From: Jashank Jeremy <jashank@rulingia.com.au>
Date: Sun, 22 May 2022 16:37:11 +1000
Subject: [PATCH] ; * src/xterm.c (handle_one_xevent): Fix compile error.
(Fixes e465ea816d6a64a21822549982928c48961fec99.)
---
src/xterm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 0487259bf0..c6c0a2f915 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20159,8 +20159,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
current_monitors
= Fx_display_monitor_attributes_list (inev.ie.arg);
- if (Fequal (current_monitors,
- dpyinfo->last_monitor_attributes_list))
+ if (!NILP (Fequal (current_monitors,
+ dpyinfo->last_monitor_attributes_list)))
inev.ie.kind = NO_EVENT;
dpyinfo->last_monitor_attributes_list = current_monitors;
--
2.36.1
[-- Attachment #2: OpenPGP Digital Signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2022-05-22 6:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-22 6:42 Jashank Jeremy [this message]
2022-05-22 7:32 ` master e465ea816d: Don't unnecessarily call monitor change functions Po Lu
2022-05-22 12:59 ` Stefan Monnier
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=87wneef4pa.wl-jashank@rulingia.com.au \
--to=jashank@rulingia.com.au \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
/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).