[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/tty-child-frames 0012e555d96 07/10: Don't set internal_last_even
From: |
Gerd Moellmann |
Subject: |
scratch/tty-child-frames 0012e555d96 07/10: Don't set internal_last_event_frame to nil |
Date: |
Tue, 22 Oct 2024 00:43:41 -0400 (EDT) |
branch: scratch/tty-child-frames
commit 0012e555d963b1df2d2c8be9f515ddf09417e110
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>
Don't set internal_last_event_frame to nil
* src/frame.c (do_switch_frame): Do not set internal_last_event_frame to
nil on ttys.
---
src/frame.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/frame.c b/src/frame.c
index 69ffc53ebbf..1cdd923150d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1792,8 +1792,29 @@ do_switch_frame (Lisp_Object frame, int track, int
for_deletion, Lisp_Object nor
(select-window (frame-root-window (make-frame))) doesn't end up
with your typing being interpreted in the new frame instead of
the one you're actually typing in. */
- if (!frame_ancestor_p (f, sf))
- internal_last_event_frame = Qnil;
+
+ /* FIXME/tty: I don't understand this. Setting the last event
+ frame to nil leads to switch-frame events being generated even
+ if they normally wouldn't because the frame in question equals
+ selected-frame. This leads to problems at least on ttys.
+
+ Imagine that we have functions on post-command-hook that use
+ with-selected-window (which is the case with Vertico-Posframe),
+ Secondly, let these functions select/restore windows on different
+ frames, so there will be select-frame calls with different frames
+ during the execution of post-command-hook. Setting
+ internal_last_event_frame to nil makes these select-frame calls
+ potentially generate switch-frame events (but only in one direction
+ (frame_ancestor_p), which I also don't understand).
+
+ These switch-frame events form an endless loop in command_loop_1 by
+ running post-command-hook, which generates switch-frame events,
+ which command_loop_1 finds (bound to '#ignore) and executes, which
+ again runs post-command-hook etc. ad infinitum. */
+
+ if (!is_tty_frame (f))
+ if (!frame_ancestor_p (f, sf))
+ internal_last_event_frame = Qnil;
return frame;
}
- branch scratch/tty-child-frames created (now 55af24a1c29), Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 5445062fabc 02/10: Check for tty-child-frames feature in show-paren, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 0012e555d96 07/10: Don't set internal_last_event_frame to nil,
Gerd Moellmann <=
- scratch/tty-child-frames 4a3ba42e6f8 08/10: Comment, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 23409041b13 05/10: Accept frame param width/height of 0, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames fbe63a33f1a 09/10: Comment, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 55b72ad8755 03/10: Set top terminal frame also to children, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 55af24a1c29 10/10: Don't ignore .patch files, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 6aa203bb04f 06/10: Minor refactoring, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames 414de92a562 01/10: Initial child frames based on master, Gerd Moellmann, 2024/10/22
- scratch/tty-child-frames e0ca1256a57 04/10: Don't check for child frame support, Gerd Moellmann, 2024/10/22