emacs-devel
[Top][All Lists]
Advanced

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

Re: master e465ea816d: Don't unnecessarily call monitor change functions


From: Jashank Jeremy
Subject: Re: master e465ea816d: Don't unnecessarily call monitor change functions
Date: Sun, 22 May 2022 16:42:57 +1000
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

> 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: 20220522-xterm-xrandr-fix.patch
Description: Text document

Attachment: pgpVwwEMTzsaU.pgp
Description: OpenPGP Digital Signature


reply via email to

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