Skip to content

macOS: Additional improvements and fixes for embedded window support#106134

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
stuartcarnie:macos_embedded_followup
May 7, 2025
Merged

macOS: Additional improvements and fixes for embedded window support#106134
Repiteo merged 1 commit intogodotengine:masterfrom
stuartcarnie:macos_embedded_followup

Conversation

@stuartcarnie
Copy link
Copy Markdown
Contributor

This PR includes the following PR feedback and improvements for #105884

  • Disables embedded support in single-window mode, as it won't work properly, given the macOS window server composites the embedded layer over the Godot rendered content.
  • Fixes for mouse capture, particularly when debugging
  • Improves the launch arguments, so --embedded is all that is required, and works like an alias to --display-server embedded.

@stuartcarnie stuartcarnie marked this pull request as ready for review May 6, 2025 20:14
@stuartcarnie stuartcarnie requested review from a team as code owners May 6, 2025 20:14
@akien-mga akien-mga requested a review from Calinou May 6, 2025 20:55
@Calinou Calinou added this to the 4.5 milestone May 6, 2025
@akien-mga akien-mga changed the title MacOS: Additional improvements and fixes for embedded window support macOS: Additional improvements and fixes for embedded window support May 6, 2025
Copy link
Copy Markdown
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Code looks good to me.

I can confirm the mouse capture issues I mentioned in the original PR are gone. I've also checked that the single window mode makes the warning message appear correctly (and disables the feature).

Note that I still can't close the game by pressing the X button when game embedding in a floating window is enabled though. I can do that when game embedding is disabled.

@Repiteo Repiteo merged commit 02206f4 into godotengine:master May 7, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented May 7, 2025

Thanks!

@stuartcarnie stuartcarnie deleted the macos_embedded_followup branch May 7, 2025 20:44
@stuartcarnie
Copy link
Copy Markdown
Contributor Author

stuartcarnie commented May 7, 2025

Thanks @Calinou. I'm working on the following items, which weren't included in this:

  • Clicking the X button to close the floating game window has no effect.
  • Closing the editor using Ctrl + C in the terminal won't always stop the running project
  • In Compatibility, using window embedding will break V-Sync (FPS will be uncapped).
  • When using Metal in Truck Town (Forward+/Mobile), the sky takes the background color of the game window

@danielgpinheiro
Copy link
Copy Markdown

Hi @stuartcarnie,
I compiled Godot from the master branch (with your changes), and the game window looks like this. I’m not sure if this is specific to my personal project or due to some window configuration I set up earlier, resulting in this behavior.

Screen.Recording.2025-05-07.at.18.42.39.mov

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

Are you running any special settings for your display? Is it a high-DPI display?

I have been unable to reproduce that – though it was an issue in much earlier builds. If you can create an MRP, that would help.

@danielgpinheiro
Copy link
Copy Markdown

danielgpinheiro commented May 8, 2025

My display is 2560x1080 ultrawide. Would sending you my personal Project.godot help?

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

My display is 2560x1080 ultrawide. Would sending you my personal Project.godot help?

Yes, your personal project.godot would work.

@danielgpinheiro
Copy link
Copy Markdown

Yes, your personal project.godot would work.

Here, the gist of my personal project.godot.

If you need anything else to debug this issue, just let me know.

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

@danielgpinheiro thanks – can you tell me more about the Project Resolution plugin?

When you captured your video, were you using any special settings from that? I tried it, and I was able to change resolutions on the fly without issue.

@danielgpinheiro
Copy link
Copy Markdown

danielgpinheiro commented May 8, 2025

@stuartcarnie So, this Project Resolution Plugin is supposed to change resolutions more easily without having to go into project settings... but I tested it without the plugin activated, and it yielded the same result.

I'll build Godot again, try another project—like Truck Town, for example—and see how it behaves.

EDIT: I tested the Truck Town project with no plugins enabled, and the issue is still occurring. I changed the resolution to 1920x1080, but it produced the same behavior. My machine is a Mac Mini M4 connected to an external monitor. I suspect that testing it on the built-in screen of an Air/Pro (which I assume is Retina) works normally, but on an external display, like here on the Mac Mini, it does not. I checked the Editor settings and found nothing unusual aside from themes, fonts, etc.

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

@danielgpinheiro I am unable to reproduce the issue. Is there anything else you can tell me about your environment?

Could you possibly download an official binary and try that? Here is one from commit 8f78e75 on the main branch:

https://github.com/godotengine/godot/actions/runs/14906404221/artifacts/3086161985

@danielgpinheiro
Copy link
Copy Markdown

@danielgpinheiro I am unable to reproduce the issue. Is there anything else you can tell me about your environment?

Could you possibly download an official binary and try that? Here is one from commit 8f78e75 on the main branch:

https://github.com/godotengine/godot/actions/runs/14906404221/artifacts/3086161985

Same behavior... I don’t know what it could be... My OS version is 15.5 Beta 4 (24F5068b), if that helps at all.

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

I can't imagine the OS version would make a difference, but it is RC, so the release will be imminent and I'll test. If you are experiencing it, then others will too, so I'd like to get to the bottom of it.

I have tried setting my scale factor to 1x by setting my resolution to 3456x2231, and that was fine too, so I'm at a loss as to what might be causing it.

I have a Mac Mini, so I will try that, as perhaps it is a single display 🤷🏻

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

@danielgpinheiro could you send me your Godot editor settings, which would likely be /Users/<username>/Library/Application Support/Godot/editor_settings-4.5.tres

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

@danielgpinheiro no need to send me that, as I've replicated it and determined it is to do with macOS display scaling (resolution). Working on a fix.

@stuartcarnie stuartcarnie mentioned this pull request May 10, 2025
5 tasks
@stuartcarnie
Copy link
Copy Markdown
Contributor Author

Working on a fix that will be included in #106166

@danielgpinheiro
Copy link
Copy Markdown

@stuartcarnie Good to hear you identified the issue. I am currently away and will only return on Monday. If you need the file you mentioned or any others, I can provide them as soon as I am back on Monday

@stuartcarnie
Copy link
Copy Markdown
Contributor Author

@danielgpinheiro no need for the file, thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants