Skip to content

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jan 19, 2022

I'm not entirely sure if this is the intended way to handle it.

I assume exclusive window should stay on top of it's parent and prevent focusing of the parent, and transient just mean it won't exist longer than a parent.

There's a limitation with macOS windowing system which (in some configs) prevents "child window" (which always stay on top of the parent) to be on the other screen (or virtual desktop) than its parent window.
Which should be OK for the exclusive dialogs (like file open), but is not OK for transient windows (e.g., undocked property inspector, etc.).

This PR adds function to set exclusive mode to the DisplayServer, changes behavior on Windows to keep only exclusive children windows on top of the parent (instead of all transient), and adds the same functionality to the macOS.

Fixes #57152
Fixes #57831

@bruvzg bruvzg added this to the 4.0 milestone Jan 19, 2022
@bruvzg bruvzg marked this pull request as ready for review January 20, 2022 06:00
@bruvzg bruvzg requested review from a team as code owners January 20, 2022 06:00
@bruvzg bruvzg marked this pull request as draft January 27, 2022 21:20
@bruvzg bruvzg force-pushed the ex_wnd branch 2 times, most recently from 9f61a64 to 404c69e Compare February 11, 2022 21:20
@bruvzg bruvzg marked this pull request as ready for review February 11, 2022 21:32
@bruvzg
Copy link
Member Author

bruvzg commented Feb 11, 2022

With this, window types should have the same (as much as it's possible) set of traits on Windows and macOS.

  • Normal window:

    • can become full-screen window.
    • can not be displayed on top of another non-exclusive full-screen window.
  • Transient window:

    • can be displayed on top of non-exclusive full-screen parent window.
    • can't become full-screen window itself.
    • if it has focus, returns it to the parent window when it's closed.
  • Exclusive window (should be also transient and have same properties):

    • always on top of its parent.
    • blocks input to the parent.
    • on macOS (because of system limitations) it's limited to the same screen as parent and moved when the parent is moved.

Copy link
Member

@mhilbrunner mhilbrunner left a comment

Choose a reason for hiding this comment

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

Looks good, and I can confirm this works and fixes the linked issues on Windows.

@akien-mga akien-mga merged commit d3a6b6d into godotengine:master Feb 12, 2022
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the ex_wnd branch February 12, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants