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

[MacOS] Caret is offset on second monitor #454

Open
MrStevns opened this issue Oct 28, 2024 · 11 comments
Open

[MacOS] Caret is offset on second monitor #454

MrStevns opened this issue Oct 28, 2024 · 11 comments

Comments

@MrStevns
Copy link

MrStevns commented Oct 28, 2024

Describe the bug
When I move a focus window onto a second monitor and start selecting something or just click on a line, the caret is offset from the cursor.

To Reproduce

  1. Open Focus and start a file with multiple lines
  2. Move the focus window to a second monitor
  3. Select or click somewhere

Expected behavior
Caret position matches the cursor position

Actual behavior
Caret position is offset from the cursor position.

Video

Screen.Recording.2024-10-28.at.18.20.39.mp4
  • OS: MacOS Monterey
  • Focus Version: 0.3.7
@MrStevns MrStevns changed the title [MacOS] Caret is offset vertically on second monitor [MacOS] Caret is offset on second monitor Oct 28, 2024
@focus-editor
Copy link
Owner

Does it happen every time?

It doesn't reproduce on my mac, hmmm

@MrStevns
Copy link
Author

Yes it happens consistently.
I have tried to close and reopen focus too, it happens every time for me.

Ah another thing, my macbook is retina (2560x1600) while my second monitor is 1080p. Maybe the issue is caused by the difference in resolution.

@focus-editor
Copy link
Owner

focus-editor commented Oct 28, 2024 via email

@focus-editor
Copy link
Owner

focus-editor commented Oct 28, 2024 via email

@MrStevns
Copy link
Author

MrStevns commented Oct 28, 2024

Yep, In nightly too.

I however just discovered that when you put the application in fullscreen, the problem gets resolved temporarily for that monitor and i can now also go back to windowed mode and it still works as expected.

When I move the window back to first monitor, the caret has been offset again but only for that monitor.

So the workaround for now is to put the application In fullscreen, whenever I move the window between monitors.

@focus-editor
Copy link
Owner

I have tried it on my macOS Sequoia with different monitors and different display resolutions, can't reproduce. Could be an older macOS issue, but unfortunately I don't have a Monterey machine to test it on.

@caztanj
Copy link
Contributor

caztanj commented Nov 13, 2024

I am able to reproduce this and it seems to happen when the window is moved to a display with a different backing scale factor. Here is a PR with a fix that at least works for me: #467

@focus-editor
Copy link
Owner

On my mac there seems to be no way to select a scaling factor for a display, but I played with different resolutions and wasn't able to reproduce it.
Maybe they "fixed" it in newer macOS's, but your fix seems reasonable, so we'll merge it, thanks!

@focus-editor
Copy link
Owner

@caztanj
Copy link
Contributor

caztanj commented Nov 13, 2024

I have macOS Sequoia 15.1 so I don't think it is "fixed" in newer versions. It is a 16 inch MacBook Pro with an external display with the resolution 2560x1440. I have not changed any other settings.

I also noticed the same issue when I "mirrored" my screen on a couple of different TVs. Not sure about the resolution of those.

@caztanj
Copy link
Contributor

caztanj commented Nov 13, 2024

(contd.) The MacBook screen reports a backing scale factor of 2 and the external display 1 with that configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants