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 blurry cursor on Wayland at a scale other than 100% #17496

Merged

Conversation

senonide
Copy link
Contributor

@senonide senonide commented Sep 6, 2024

Closes #13258

Release Notes:

  • Fixed blurry mouse cursor on wayland when the screen scale is other than 100%

Before:
Screenshot from 2024-09-06 14-38-30

After:
Screenshot from 2024-09-06 14-38-56

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 6, 2024
@maxdeviant maxdeviant changed the title fix: blurry cursor on wayland at a scale other than 100% Fix blurry cursor on Wayland at a scale other than 100% Sep 6, 2024
@mikayla-maki
Copy link
Contributor

Thanks!

@mikayla-maki mikayla-maki merged commit c119387 into zed-industries:main Sep 9, 2024
9 checks passed
@CharlesChen0823
Copy link
Contributor

// FIXME: Determine the scaling factor dynamically by the compositor

this should fix, because when scaling factor is 100%, the display cursor is too big.

@notpeter notpeter mentioned this pull request Sep 16, 2024
1 task
apricotbucket28 added a commit to apricotbucket28/zed that referenced this pull request Sep 19, 2024
@notpeter
Copy link
Member

@senonide Don't know if you saw this:

Likely caused by this:

// FIXME: Determine the scaling factor dynamically by the compositor
let mut cursor = Cursor::new(&conn, &globals, 24, 2);

@apricotbucket28
Copy link
Contributor

apricotbucket28 commented Sep 20, 2024

This code in here is wrong, the cursor's scale must be determined by the scale of the current wl_surface. Here's some code where this is already being done. Basically:

  1. Use PreferredBufferScale event if available (surface.version() >= wl_surface::EVT_PREFERRED_BUFFER_SCALE_SINCE)
  2. Else, use the scale in wl_surface::Event::Enter/Leave.

The PreferredScale event doesn't work for this since it sends a fractional scale.

Maybe there should be a cursor theme cache like SCTK does, and the current window's scale should passed when calling cursor.set_icon(): https://github.com/Smithay/client-toolkit/blob/c583de8dd5651f8168c6513cd282137c42aae049/src/seat/pointer/mod.rs#L612-L635

mikayla-maki added a commit that referenced this pull request Oct 2, 2024
mikayla-maki added a commit that referenced this pull request Oct 2, 2024
)

Closes #17771

Reverts #17496

This PR turns out to need more work than I thought when I merged it. 

Release Notes:

- Linux: Fix a bug where the cursor would be the wrong size on Wayland
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…es#17496)

Closes zed-industries#13258

Release Notes:

- Fixed blurry mouse cursor on wayland when the screen scale is other
than 100%

Before:
![Screenshot from 2024-09-06
14-38-30](https://github.com/user-attachments/assets/e4553503-ecea-4b53-b80d-43732d34fa62)

After:
![Screenshot from 2024-09-06
14-38-56](https://github.com/user-attachments/assets/ce563d3a-2b44-44b9-9f59-f0042609924e)
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…-industries#18642)

Closes zed-industries#17771

Reverts zed-industries#17496

This PR turns out to need more work than I thought when I merged it. 

Release Notes:

- Linux: Fix a bug where the cursor would be the wrong size on Wayland
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.

Blurry mouse pointer on Wayland
6 participants