Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
376 stars 19 forks source link

mouse cursor tracking becomes slow when the SDL window has another window overlapping it #1807

Closed nbriggs closed 3 months ago

nbriggs commented 3 months ago

As reported by @hjellinek --

Further investigation shows that it is only observable when the cursor is tracking over a TEdit window in the exposed section of the Medley SDL window.

SDL passes mouse events through to the client regardless of whether the client window is fully exposed whether or not it has the keyboard input focus.

It's unclear exactly what actions in TEdit are provoking the slowdown, though it might be calls to ADJUSTCURSORPOSITION that bottom out in SDL_WarpMouseInWindow().

The X11 windows do not pass mouse motion events to the client window when it does not have the focus so explicitly implementing that in the SDL code may be a solution.

rmkaplan commented 3 months ago

But Tedit doesn’t do anything with the cursor other than to read it and change its shape. MODERNIZE calls it when calls \CURSORPOSTION when it detects a corner or title click.

On Aug 16, 2024, at 12:05 PM, Nick Briggs @.***> wrote:

As reported by @hjellinek https://github.com/hjellinek --

Further investigation shows that it is only observable when the cursor is tracking over a TEdit window in the exposed section of the Medley SDL window.

SDL passes mouse events through to the client regardless of whether the client window is fully exposed whether or not it has the keyboard input focus.

It's unclear exactly what actions in TEdit are provoking the slowdown, though it might be calls to ADJUSTCURSORPOSITION that bottom out in SDL_WarpMouseInWindow().

The X11 windows do not pass mouse motion events to the client window when it does not have the focus so explicitly implementing that in the SDL code may be a solution.

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1807, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJLKEA2YDI25FPKOF6LZRZEPJAVCNFSM6AAAAABMUSAVTSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TAOBQGYZDQNA. You are receiving this because you are subscribed to this thread.

nbriggs commented 3 months ago

I agree... but try building the maiko SDL version (before the patch for this) and see if it happens for you too. I think it's a system issue, probably having to do with the ADJUSTCURSORPOSITION call that ends up in SDL_WarpMouseInWindow which might cause a screen redraw, which, when the window is mostly obscured either takes a long time or runs so fast it eats all the CPU.