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

Button does not show "hover" StyleBox when project started in fullscreen on MacOS until cmd-tabbing out and back in #94944

Closed
paskausks opened this issue Jul 30, 2024 · 7 comments

Comments

@paskausks
Copy link

paskausks commented Jul 30, 2024

Tested versions

Reproduced in 4.2.2 stable from both, an Intel i5 MacBook Pro (Monterey 12.6) and a 2021 M1 Macbook Pro (Monterey 12.2.1), as well as:

  • 4.2.1
  • 4.3dev1
  • 4.3dev2
  • 4.3dev3
  • 4.3dev4
  • 4.3dev5

Not reproduced in 4.3dev6 and 4.3.rc1 on an Intel i5 MacBook Pro (Monterey 12.6)

System information

Godot v4.2.2.stable - macOS 12.6.0 - Vulkan (Forward+) - integrated Intel(R) Iris(TM) Plus Graphics 640 - Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz (4 Threads)

Issue description

There seems to be an issue on MacOS, on Godot 4 when launching a project in full screen or exclusive fullscreen modes
buttons don't show the StyleBox set in its theme for hovering until you either:

  • Cmd+Tab out and back in the game
  • Move out and back in via workspace switching (e.g. using Control + side arrow buttons)
  • If your application supports it, switching into windowed mode and back into full screen.

This happens when the project is launched from both - the editor and exported out.

There seems to be no issue when the application is launched directly in windowed mode.

Changing the renderer (forward+, compatibility, mobile) seems to have no effect. Turning VSync on/off has no effect. I didn't notice this issue on Windows or Linux systems.

This is probably related - playing in full screen on MacOS without having done any of the mentioned things above also seems to bug out logic which uses InputEventMouseMotion#position, but I haven't narrowed down what exactly is wrong there, so that's why I present it as a Button bug which is way easier to explain and reproduce, even though this bug is probably not an issue with the Button itself.

Steps to reproduce

  • Launch the included MRP (or create a new project which has a button that has a theme with a configured StyleBox for hovering over. Then set this project to launch fullscreen or exclusive fullscreen on a MacOS computer)
  • Hover your mouse over the button in the middle
  • Observe that the button does not change its background color
  • Either cmd+tab out and back in OR move between virtual desktops (ctrl+side arrows) to a adjacent one and then back again
  • Observe that hovering on the button now changes its background color as expected.

Minimal reproduction project (MRP)

mac-hover-MRP.zip

@paskausks paskausks changed the title Button does not show "hover" StyleBox when project started in fullscreen on MacOS until cmd-tabbing in and out Button does not show "hover" StyleBox when project started in fullscreen on MacOS until cmd-tabbing iout and back in Jul 30, 2024
@paskausks paskausks changed the title Button does not show "hover" StyleBox when project started in fullscreen on MacOS until cmd-tabbing iout and back in Button does not show "hover" StyleBox when project started in fullscreen on MacOS until cmd-tabbing out and back in Jul 30, 2024
@coppolaemilio
Copy link
Member

@paskausks have you tested it with the latest 4.3 build?

@paskausks
Copy link
Author

paskausks commented Jul 30, 2024

@paskausks have you tested it with the latest 4.3 build?

@coppolaemilio Just tried the MRP on 4.3.rc1 and couldn't reproduce it, so this seems to already be fixed!

Now I'm curious to try and launch my main project from 4.3 and see what happens, so please don't close this yet.

@bruvzg
Copy link
Member

bruvzg commented Jul 30, 2024

Also, make sure you are using the bundled .app, not a standalone executable, and you are not running it from the terminal, see #68745. We have workarounds for activation issues, but terminal is not an intended way to run UI apps on macOS, and it's constantly breaking.

@paskausks
Copy link
Author

@bruvzg hey!

This issue was occuring when launching from the edditor itself, but in my attemps to run it from an exported app, i opened it via the bundled app pulled out from the dmg. But thanks for letting me know, this is useful information!

@paskausks
Copy link
Author

I converted my main project to 4.3 to try and see, if I can reproduce this, and I can't seem to reproduce the issues (including the bugs related with InputEventMouseMotion#position I mentioned in the issue description) on that version. I do get a visual hover, issue on a button, but that might as well be a regression from the conversion to 4.3, so I'll ignore that, for now.

I'm happy to know that all I have to do is for 4.3 stable to come out, but, yet I am curious what the underlying was in the first place.

This can probably be closed then. I'll reopen it, if it crops up again with 4.3 stable.

@akien-mga
Copy link
Member

akien-mga commented Jul 30, 2024

I'm happy to know that all I have to do is for 4.3 stable to come out, but, yet I am curious what the underlying was in the first place.

If you have time to test some earlier beta/dev snapshots of 4.3 (on a copy of your project) to pinpoint which is the first snapshot that fixed the bug, that might help identify the PR and see if it's suitable for cherry-picking to 4.2.x.

For now, closing as fixed in 4.3.

@akien-mga akien-mga added this to the 4.3 milestone Jul 30, 2024
@paskausks
Copy link
Author

@akien-mga hey!

I unfortunately couldn't launch my main project on the 4.3 dev snapshots but, I took the reproduction project I posted and tried that. I could repro the issue up until and including 4.3.dev5. With the 4.3.dev6 snapshot the issue didn't seem to occur anymore, so the fix probably can be found somewhere between those two.

Updated the tested version list accordingly.

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

4 participants