Skip to content
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

Fix cursor style when resizing window #11596

Closed
wants to merge 7 commits into from

Conversation

JunkuiZhang
Copy link
Contributor

@JunkuiZhang JunkuiZhang commented May 9, 2024

Before:

Recording.2024-05-09.165756.mp4

After:

Recording.2024-05-09.165632.mp4

Note:

It's not completely fixed; sometimes (like when moving the mouse quickly), it still changes from resize to arrow.
Also, I'm not sure if this modification has affected #9289.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 9, 2024
@LoganDark
Copy link
Contributor

I think this is a good idea but rather than simply not resetting the cursor style while dragging, shouldn't it be set explicitly to the cursor style of whatever you're dragging, and that way it won't randomly change back to arrow? AFAIK this basically relies on the cursor staying the same if you simply don't set it, but IMHO the cursor should be actively set properly during the drag.

@JunkuiZhang
Copy link
Contributor Author

I think this is a good idea but rather than simply not resetting the cursor style while dragging, shouldn't it be set explicitly to the cursor style of whatever you're dragging, and that way it won't randomly change back to arrow?

For some reason, Zed decided to reset the cursor #9289 . Without understanding the intent of the Zed team, I decided to minimize the scope of impact in this PR.

@LoganDark
Copy link
Contributor

LoganDark commented May 9, 2024

I think this is a good idea but rather than simply not resetting the cursor style while dragging, shouldn't it be set explicitly to the cursor style of whatever you're dragging, and that way it won't randomly change back to arrow?

For some reason, Zed decided to reset the cursor #9289 . Without understanding the intent of the Zed team, I decided to minimize the scope of impact in this PR.

Doesn't that just prove the method you're using is flaky? The cursor should be set every frame. You actually wouldn't have to avoid resetting the cursor at all if you made the reset pick the correct one when you're currently dragging something.

I'll probably take a crack at this after I'm done fixing language servers.

@JunkuiZhang
Copy link
Contributor Author

I think this is a good idea but rather than simply not resetting the cursor style while dragging, shouldn't it be set explicitly to the cursor style of whatever you're dragging, and that way it won't randomly change back to arrow?

For some reason, Zed decided to reset the cursor #9289 . Without understanding the intent of the Zed team, I decided to minimize the scope of impact in this PR.

Doesn't that just prove the method you're using is flaky? The cursor should be set every frame. You actually wouldn't have to avoid resetting the cursor at all if you made the reset pick the correct one when you're currently dragging something.

I'll probably take a crack at this after I'm done fixing language servers.

Makes sense. I'm busy with another unpublished PR may conduct a more in-depth investigation after completing it.

@JunkuiZhang JunkuiZhang marked this pull request as draft May 9, 2024 14:25
@JunkuiZhang JunkuiZhang marked this pull request as ready for review May 10, 2024 02:37
@mikayla-maki
Copy link
Contributor

I think the problems here are deeper than this PR, so I'm going to close this for now.

I think a full solution would require either figuring out what is clobbering the cursor, or adjusting how set_cursor works to block changes when dragging, or associate the drag and cursor more closely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants