|
From: | Jared Finder |
Subject: | Re: "Final" version of tty child frames |
Date: | Sun, 12 Jan 2025 22:32:03 -0800 |
On 2025-01-04 19:48, Gerd Möllmann wrote:
Jared Finder <jared@finder.org> writes:Unfortunately, the redisplay code in Emacs is super hard for me to understand and I can't figure out where or how the cursor gets positioned. If someone could give me some pointers here, I'd love to investigate further.I think you want to take a look at dispnew.c, functions combine_updates_for_frame, and there at this part /* If a child is displayed, and the cursor is displayed in another frame, the child might lay above the cursor, so that it appears to "shine through" the child. Avoid that because it's confusing. */ if (topmost_child) terminal_cursor_magic (root, topmost_child); flush_terminal (root
Thanks for the pointer. There's definitely something strange going on here, like Emacs is writing the entire row and not restoring the cursor to the previous location.
The good news is that this seems to affect both xterm as well as Linux terminals, so hopefully someone more familiar with this code can debug. A simple repro case (with posframe installed):
1. Evaluate (posframe-show " *test*" :string (concat "A\nB\n*long text*\nC\nD")) 2. Now try to place the cursor on some text after one of the single letter lines while still being in the root frame. (I've been using M-x info since the directory node has lots of nice text)
When I do this, my cursor always appears at the end of the line so long as it is after the posframe. When the cursor is before the posframe, the cursor is displayed fine.
I confirmed via debugging code that tty_cursor_to and tty_raw_cursor_to were being called with the expected values, so the cursor must be moving after that.
-- MJF
[Prev in Thread] | Current Thread | [Next in Thread] |