unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master e465ea816d: Don't unnecessarily call monitor change functions
@ 2022-05-22  6:42 Jashank Jeremy
  2022-05-22  7:32 ` Po Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Jashank Jeremy @ 2022-05-22  6:42 UTC (permalink / raw)
  To: Po Lu, Emacs development list


[-- 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 --]

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

* Re: master e465ea816d: Don't unnecessarily call monitor change functions
  2022-05-22  6:42 master e465ea816d: Don't unnecessarily call monitor change functions Jashank Jeremy
@ 2022-05-22  7:32 ` Po Lu
  2022-05-22 12:59   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2022-05-22  7:32 UTC (permalink / raw)
  To: Jashank Jeremy; +Cc: Emacs development list

Jashank Jeremy <jashank@rulingia.com.au> writes:

> .../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,
>           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks for catching the bug.



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

* Re: master e465ea816d: Don't unnecessarily call monitor change functions
  2022-05-22  7:32 ` Po Lu
@ 2022-05-22 12:59   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-05-22 12:59 UTC (permalink / raw)
  To: Po Lu; +Cc: Jashank Jeremy, Emacs development list

Po Lu [2022-05-22 15:32:58] wrote:
> Jashank Jeremy <jashank@rulingia.com.au> writes:
>> .../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,
>>           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~
> Thanks for catching the bug.

I recommend to anyone working on the C code to compile with
`--enable-check-lisp-object-type` so they'll see those errors before
they push them to `master`.


        Stefan




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

end of thread, other threads:[~2022-05-22 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22  6:42 master e465ea816d: Don't unnecessarily call monitor change functions Jashank Jeremy
2022-05-22  7:32 ` Po Lu
2022-05-22 12:59   ` Stefan Monnier

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).