Skip to content

[3.x] Backport nonexclusive fullscreen mode. #107583

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

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jun 16, 2025

Adds equivalent of 4.x non-exclusive fullscreen mode, that forces composition to be enabled, allowing multiple windows on the screen and interactions with other apps always work. Mode added as a separate use_nonexclusive_fullscreen property that work in conjunction with existing fullscreen property (since there's no mode concept in 3.x).

Fixes #107140

@bruvzg bruvzg added this to the 3.x milestone Jun 16, 2025
@bruvzg bruvzg marked this pull request as ready for review June 17, 2025 07:11
@bruvzg bruvzg requested review from a team as code owners June 17, 2025 07:11
@Mickeon Mickeon requested a review from lawnjelly June 17, 2025 07:12
@lawnjelly
Copy link
Member

lawnjelly commented Jun 17, 2025

Note that I can review to an extent, but it would benefit from testing / review by contributors that have windows (I have no windows machines, and haven't used windows for 8 years or so, so am not up to date on that OS).

@bruvzg
Copy link
Member Author

bruvzg commented Jun 17, 2025

For the reference, current 4.x implementation PR - #88852

Ideally, it should be tested on all vendor GPUs (I have done only limited tests with one NVIDIA and one integrated AMD GPUs).

@@ -107,6 +107,7 @@ class OS {
struct VideoMode {
int width, height;
bool fullscreen;
bool non_ex_fs;
Copy link
Member

@lawnjelly lawnjelly Jun 17, 2025

Choose a reason for hiding this comment

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

While this works, it seems a pity that all this wasn't done as a bitfield, with an enum for setting / disabling the various flags (especially as this one seems windows only for now). If we need in the future to increase this number of flags (to deal with e.g. special modes on Android with slots etc), and adding specific setter / getters to OS for each is kind of messy.

Whether this can be changed at this stage and maintaining backward compatibility I'm not sure.

We could switch to a bitfield internal system, and add the new functionality by using enums, e.g.:

enum DisplayFeature
{
DF_MAXIMIZED,
DF_RESIZABLE,
DF_BORDERLESS,
DF_NON_EXCLUSIVE_FULLSCREEN,
};

uint32_t _display_features = 0;

OS::set_display_feature(DisplayFeature p_feature, bool p_enable)
{
if (p_enable)
{
_display_features |= p_feature;
}
else
{
_display_feature &= ~p_feature;
}
... etc
}

Have the existing functions work through this backend, and mark them deprecated or something.

Depends what others think. Maybe on the other hand we are too far down this road to bother changing in 3.x. 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

4.x system with separate mode enum (windowed, minimized, maximized, fullscreen, since all are mutually exclusive) and flags bitfield (resizable, borderless) make more sense. But I'm not how many changes in 3.x we should introduce, it's probably better to keep API fully backward compatible.

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.

2 participants