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

on macos, clicking "down" on the UI scale feature will crash the application #50

Closed
cmr624 opened this issue Mar 19, 2024 · 8 comments · Fixed by #51
Closed

on macos, clicking "down" on the UI scale feature will crash the application #50

cmr624 opened this issue Mar 19, 2024 · 8 comments · Fixed by #51

Comments

@cmr624
Copy link

cmr624 commented Mar 19, 2024

  1. Download and run Godot Version Manager v1.16.1 OSX
  2. Click the "down" arrow next to UI Scale
  3. Observe crash

Using:

macos Ventura 13.2.1 (22D68)

Apple M1 Max

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

When I run it from the command line and click on the scale down button, I get the following error message. It seems that the size of something is set to 0.

-[MTLTextureDescriptorInternal validateWithDevice:]:1357: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor has width of zero.
'

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

It does not crash when the scale value is changed directly.

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

For some reason, SpinBox.value_changed seems to be called many times on macOS, causing it to go to 0 and crash. As a temporary measure, setting SpinBox.min_value to a value greater than 0 seems to prevent the crash.

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

I think value_changed should be called only once on a mouse click, but value_changed is being called on the frame during mouse down.

@noidexe
Copy link
Owner

noidexe commented Mar 27, 2024

Thanks @cmr624 for the report and @shiena for debugging the issue. I've set the minimum value to 0.25 to prevent the crash. What I see is that SpinBox reacts to holding the mouse down and dragging up and down to change the value. This, combined with the UI scaling must be causing problems on OSX. I cannot reproduce it on Windows. Since that's related to the way a native Godot node works it should be reported here: https://github.com/godotengine/godot/issues

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

@noidexe
I created a new project with Godot 3.5.3 on mac and added SpinBox for verification, but value_changed was called only once when I clicked the up/down button. I wonder why value_changed is called so many times by godot-version-manager.

@noidexe
Copy link
Owner

noidexe commented Mar 27, 2024

@noidexe I created a new project with Godot 3.5.3 on mac and added SpinBox for verification, but value_changed was called only once when I clicked the up/down button. I wonder why value_changed is called so many times by godot-version-manager.

GVM is not doing anything special other than connecting to value_changed. I suspect what triggers the issue is the resizing of the window. On Windows I see the cursor being repositioned so it's exactly in the same position relative to the SpinBox. It might be that on mac it doesn't happen, and Godot interprets that as a drag motion, which triggers another UI resize, and so on

@shiena
Copy link
Contributor

shiena commented Mar 27, 2024

If I comment out OS.center_window() in the UIScale._rescale_ui method, value_changed was called only once.
The window resize did indeed have an effect.

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

Successfully merging a pull request may close this issue.

3 participants