-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
[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
base: 3.x
Are you sure you want to change the base?
Conversation
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). |
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; |
There was a problem hiding this comment.
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. 🤷
There was a problem hiding this comment.
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.
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 existingfullscreen
property (since there's no mode concept in 3.x).Fixes #107140