Subject: Re: bug#49997: 27.2; idle-time reset when switching desktop-page

From: Eli Zaretskii <[email-masked]>
Date: Sun, 15 Aug 2021 17:29:51 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: Peter Münster <[email-masked]>,  [email-masked]
> Date: Sun, 15 Aug 2021 16:18:30 +0200
> 
> 16:12:06 starting (move-frame (#<frame ba.el - GNU Emacs at elva 0x55dd37bbcea0>))  backtrace-to-string()
>   internal-timer-start-idle((move-frame (#<frame GNU Emacs at elva 0x55dd37bbcea0>)))
>   read-event(nil nil 0.001)
> 
> So we're getting a move-frame event so this is being triggered, I guess?
> 
>       if (!end_time)
> 	timer_stop_idle ();
> 
> I guess the question then is...  can we distinguish between real
> move-frame events and these virtual desktop things?  I'm guessing not:
> 
>     case MOVE_FRAME_EVENT:
>       /* Make an event (move-frame (FRAME)).  */
>       return list2 (Qmove_frame, list1 (event->frame_or_window));
> 
> So the window manager is sending us a MOVE_FRAME_EVENT here.

The code you show is in keyboard.c, where we interpret the events
we've received.  To see whether we can distinguish between these
events and "real" move-frame events, we need to look in xterm.c, where
the events come in from the window-system.  Maybe they are different
in their raw form?

> Then the question becomes: Should one of these events stop Emacs idleness?

If you move the frame, I think the answer is yes.  But if this problem
is really very annoying, and we cannot distinguish between these
pseudo-moves and real moves, we could perhaps have a variable to
control whether this event stops idleness,so people could decide
what's more important for them?