Skip to content

Focus events when embedding game in editor behaves differently on macOS #110170

@mihe

Description

@mihe

Tested versions

  • Reproducible in: 4.5.beta7

System information

Godot v4.5.beta7 - macOS Sequoia (15.5.0) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M2 Pro (Apple8) - Apple M2 Pro (10 threads) - 32.00 GiB memory

Issue description

This is an off-shoot from #109633, which was partially addressed in #109724.

On Windows and Linux (X11) the focus events are emitted as follows:

  • When in either mode, both application and window enter events are emitted when the user first hovers over the game viewport.
  • When in either mode, both application and window exit events are emitted when the user clicks outside of the game viewport.
  • When in floating mode, both application and window exit events are emitted when focus of the floating workspace window is lost.

However, on macOS, it now behaves as follows after #109724 was merged:

  • When in either mode, only window focus events are emitted based on mouse input within the editor, and only when clicking, not when hovering1.
  • When in floating mode, window exit events are emitted when focus of the floating workspace window is lost.
  • When in non-floating mode, losing focus of the editor window will emit both application and window exit events.
  • When in non-floating mode, gaining focus of the editor window will emit both application and window enter events.

It's unclear what the correct behavior should be in this case, and I would argue both have some weird quirks, but the fact that the behavior is different between different desktop platforms would seem to be somewhat problematic.

Steps to reproduce

  1. Open the MRP on macOS.
  2. Try both the floating and non-floating embedded mode.
  3. Open the MRP on Windows or Linux/X11.
  4. Try both the floating and non-floating embedded mode.
  5. Note the difference in behavior.

Minimal reproduction project (MRP)

focus-events.zip

Footnotes

  1. InputEventMouseMotion is still sent to the application when unfocused though.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

For team assessment

Status

For team assessment

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions