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 Full screen mouse alignment #21973

Open
utechtl opened this issue May 6, 2024 · 11 comments
Open

MacOS Full screen mouse alignment #21973

utechtl opened this issue May 6, 2024 · 11 comments
Labels
bug Something went wrong. macOS (OS) Related to the macOS version of OpenRCT2.

Comments

@utechtl
Copy link

utechtl commented May 6, 2024

Operating System

MacOS 14.4.1

OpenRCT2 build

OpenRCT2, v0.4.11 (18d2b5e on HEAD)

Base game

RollerCoaster Tycoon 2

Area(s) with this issue?

This bug is a graphical glitch or error

Describe the issue

When launching the game from previously being in full screen (green mac full screen button, not the in-game full screen mode) the highlight doesn't match the cursor.

Steps to reproduce

  1. Make game full screen via the green mac full screen window.
  2. close game
  3. relaunch later

Attachments

Link to video of issue, too big for github

@utechtl utechtl added the bug Something went wrong. label May 6, 2024
@AaronVanGeffen
Copy link
Member

I'm having the same issue. Wonder if it's related to SDL having been updated in #21771 (cc @janisozaur)

Screenshot 2024-05-10 at 17 04 14

@AaronVanGeffen AaronVanGeffen added the macOS (OS) Related to the macOS version of OpenRCT2. label May 10, 2024
@astraylife1
Copy link

astraylife1 commented May 10, 2024

This happened to me after making it full screen. Cannot fix it, even after deleting and downloading latest release again.

@janisozaur
Copy link
Member

Is the offset constant?

@AaronVanGeffen
Copy link
Member

AaronVanGeffen commented May 10, 2024

No, it appears to vary depending on how far into the window you are. Happens regardless of window scaling though.

@janisozaur janisozaur pinned this issue May 11, 2024
@janisozaur
Copy link
Member

I think this is a showstopper and I'm trying to fix it.

So far I tried inspecting what changed between https://github.com/microsoft/vcpkg/compare/c9f906558f9bb12ee9811d6edc98ec9255c6cda5..11ed79186fe850bd3a98cfbf1854514d2b3070a2 and create a libraries release on each "interesting" version:

git lol c9f906558f9bb12ee9811d6edc98ec9255c6cda5..11ed79186fe850bd3a98cfbf1854514d2b3070a2 ports/sdl2/ ports/breakpad/ ports/libressl
SDL2 is primary suspect for this regression
breakpad is for #22003
libressl did not initially support arm and broke builds. I have eventually disabled networking in my OpenRCT2 trial builds.

Unfortunately, building OpenRCT2 with all the libraries that got built (not all commits have) fails due to libicu not providing required components.

Next steps: figure out if I can just redirect vcpkg to an older version of port. The overall idea is to find release that introduced regression and then perform bisect. I hope to learn what changed in SDL code and then either adapt our code to new version or send the fix upstream if necessary.

@AaronVanGeffen
Copy link
Member

It's already present in openrct2-macos-sdl2-2.26.5.zip for me??

@AaronVanGeffen
Copy link
Member

AaronVanGeffen commented May 12, 2024

I renamed my config.ini to config_bad.ini, restarted OpenRCT2, and had no problems. Moving settings back in, I narrowed it down to the following issue:

 $ diff -u config_{bad,good}.ini
--- config_bad.ini	2024-05-12 20:26:11
+++ config_good.ini	2024-05-12 22:35:20
@@ -22,7 +22,7 @@
 debugging_tools = true
 show_height_as_units = false
 temperature_format = CELSIUS
-window_height = 945
+window_height = 940
 window_snap_proximity = 5
 window_width = 1512
 default_display = 0

Changing 940 to 940 fixed the problem. Changing to 944 did not, so it's not just a factor of two problem. It seems to be related to having a remainder after division.

Question is, how do we prevent the window size to get to these 'bad' values? Perhaps we can keep them clamped to particular factors, somehow?

@janisozaur
Copy link
Member

My guess this is because the height (what about width?) is not a multiple of the scaling factor that OS uses. Maybe it's not the window size, but renderer size which then gets squished or something? If we asked SDL or the system about then maybe we could stick to save values

@utechtl
Copy link
Author

utechtl commented May 13, 2024

Sorry, I was out of town for the weekend. Thanks for taking a look at this already.

I've found a few quirks while poking at this;

  1. The issue persists between the 6 test builds.
  2. It appears that the offset between cursor and where the game thinks it is scales with the height but not width of the screen, ie purely offset in the vertical direction.
  3. The issue happens regardless of the OS screen resolution (1024x666, 1280x832, 1470x956, and 1710x1112).
  4. Changing from Windowed mac full screen (Green button) to the full screen ORCT fullscreen dropdown crashes the game instantly but un-maximzing it first doesn't. It's probably a separate issue.
  5. For sure another separate issue but once every ~20 launches maybe, I get the Beach ball of death while I wait for the game to load. Normally the game launches almost instantly.

@janisozaur
Copy link
Member

So does this issue happen with 0.4.10 as well then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong. macOS (OS) Related to the macOS version of OpenRCT2.
Projects
None yet
Development

No branches or pull requests

4 participants