-
Notifications
You must be signed in to change notification settings - Fork 360
Fix mouse cursor stuck if new window created after colgrow right window #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I've tested it locally and identified an inconsistency. While I agree that
To address these issues, I've added a call to
Please, review the change and, if you agree, push it. |
Yes thanks @spektrokalter , current fix have regressions. Now we have 2 ways remove regressions
First way simple and garanty fix bug + save previous behaviors. I'll do the first one a little later (or maybe other make in first) :) |
Im read code again the new bug case from @spektrokalter is not regression, this similar bug, I'll try to work on this and add commits, but the solution here is complex and depends on intersecting particular cases. |
Last commit fix similar bug
There are a lot of special cases and things connected with each other by implicit logic in the code. Please check them before using the fixes. I could only allocate a little time for all this. The main problem with window getting stuck is that in some places the mouse position data changes before it is saved for subsequent restoration, a pointer to the window is used as just an additional condition, and in some places the saved pointer is simply erased without taking into account that to return the mouse pointer it is checked, the window is alive, the pointer to it too, the mouse position is saved, but the buffer variable is simply erased, in some places this needs to be done, for example, after closing all the windows, there is simply nowhere for the cursor to jump back, but this is not always necessary. Sometimes one logic and one behavior simply conflict with other logic and behavior. I just wrote down my thoughts and observations, I really hope that the current fixes did not introduce problems. Since these are also special cases of trying to return the cursor back as the user expects. People write that the cursor getting stuck is annoying, and it happens all the time and is very annoying, so I tried to fix it. Maybe no need accept this changes. But maybe it will be useful to simply study the problem and possibly solve it in a more comprehensive way. |
@blogdron Thanks a lot of your patience and effort. @0intro @rsc Hello! We'd appreciate your time to review this request. Apologies if I tagged a wrong person, I'm not familiar with the review process. For convenience, here's a short summary. Initially, we addressed the issue of the mouse not retuning after deleting a new window, which was caused by other windows shrinking. It's a very annoying inconsistency, given Acme's heavy reliance on cursor automation. It clearly breaks user's expecations. The fix had a problem but it was resolved (I've tested it locally). @blogdron has also addressed a related problem where the mouse doesn't return after deleting an existing window whose dimension changes attract the mouse. While fixing this issue for "+Errors" windows is straightforward (even intended, it seems), other cases (e.g. writing "show" to "ctl") are far more complex. These cases seem to be incompatible with the simple jump-return mechanics of the mouse, requiring a significant rewrite. This could disrupt other people's familiarity with the existing codebase, so we're unsure if it's the right approach. Nonetheless, the major problem is solved. Here's a one-minute silent demo of everything stated in this post: screenrecording2025-09-16at12.53.06am.mp4Again, thank you for your time and consideration. |
@blogdron There's another small regression (I hope). Previously, when a user changed a font, the mouse would stay in place, but now it jumps. Here's a quick video demonstrating the issue: screenrecording2025-09-17at2.45.25pm.mp4It seems like |
@spektrokalter regression by this #730 (comment) fixed. |
In the forum user kaldeon show me a bug https://www.linux.org.ru/forum/talks/17709316?cid=18077919
Im read source code and found problem. If for new window
coladd
no have place in colomn, for previos bottom window docolgrow
for make more space. Problem, aftercolgrow
calledwinmousebut
and one more times override mouse position to growed window before save mouse positionsavemouse
for callrestoremouse
in future and if we close new window, mouse cursor dont jump back to previos window, and stay on last colomn growed window. Just no need every time change mouse pose value, to autogrow window. Moreover in thisplan9port/src/cmd/acme/cols.c
Lines 506 to 509 in bafcddd
This is what is done, which confirms that call
winmousebut
insidecolgrow
is a bugIm not user plan9port and acme, and use acme first time, I've double-checked many times to see if this change changes behavior anywhere, but as far as I could examine the code, and as far as I could test it all in the editor, there are no regressions.
P.S. Sorry for my English, I wrote half of it myself and just translated some of the text into English :D