Skip to content
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

[Windows] Try to use "borderless fullscreen" is "borderless" flag is set. #88735

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Feb 23, 2024

Partially addresses #63500, by allowing to set both WINDOW_FLAG_BORDERLESS and WINDOW_MODE_EXCLUSIVE_FULLSCREEN.

  • Test on NVIDIA GPU (works as expected, tested on Windows 11 with RTX 2070 SUPER).
  • Test on AMD GPU (most likely WINDOW_FLAG_BORDERLESS will have no effect and still enter exclusive mode).
  • Test on Intel GPU.

@Maran23
Copy link
Contributor

Maran23 commented Feb 23, 2024

If needed, I can test this on my AMD GPU. :)
Should I execute the code linked in the issue?

get_tree().root.mode = Window.MODE_FULLSCREEN # or WINDOW_MODE_EXCLUSIVE_FULLSCREEN
get_tree().root.borderless = true

@bruvzg
Copy link
Member Author

bruvzg commented Feb 24, 2024

Tested on AMD APU as well (as expected there's no difference, but unlike NVidia multiwindow support is not completely broken even in exclusive fs, it's just switched to non-exclusive mode when another window is open).

@bruvzg
Copy link
Member Author

bruvzg commented Feb 24, 2024

Should I execute the code linked in the issue?

Yes, but set the borderless flag first.

For the reference behavior on NVidia is:

  • FS mode - with single pixel border, non exclusive (screen is not going black, other windows can be used).
  • EX_FS with borderless - no border, non exclusive
  • EX_FS w/o borderless - no border, exclusive

@bruvzg bruvzg marked this pull request as ready for review February 26, 2024 08:58
@bruvzg bruvzg requested review from a team as code owners February 26, 2024 08:58
@bruvzg
Copy link
Member Author

bruvzg commented Feb 26, 2024

It's not a perfect solution, but I did not find any issues, and should not be compatibility breaking.

@akien-mga akien-mga requested a review from Calinou February 26, 2024 09:31
@Calinou
Copy link
Member

Calinou commented Feb 26, 2024

  • EX_FS w/o borderless - no border, non exclusive
  • EX_FS with borderless - no border, exclusive

Shouldn't it be the other way around? I thought WINDOW_MODE_EXCLUSIVE_FULLSCREEN would keep its current behavior in most projects where borderless is disabled in the Project Settings.

In other words, I'd expect this instead:

  • EX_FS w/o borderless - no border, exclusive (forced exclusive fullscreen)
  • EX_FS with borderless - no border, non exclusive ("best effort" borderless fullscreen, may be converted to exclusive by the driver)

@bruvzg
Copy link
Member Author

bruvzg commented Feb 26, 2024

Shouldn't it be the other way around?

It is the other way.

Copy link
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 (rebased on top of master 23191b8), I can't see any difference on Windows 11 22H2 with a GeForce RTX 4090 (NVIDIA 551.61). Alt-tabbing doesn't cause flickering when in exclusive fullscreen mode, but that's also the case on master without this PR.

I'd typically use Special K to diagnose the actual window mode seen by the OS but I can't get it to work with Godot (pressing Ctrl + Shift + Backspace to show its overlay does nothing).

@RedMser
Copy link
Contributor

RedMser commented Feb 28, 2024

@Calinou You could try FrameView, its overlay also includes into about fullscreen mode.

@akien-mga akien-mga modified the milestones: 4.3, 4.x May 29, 2024
@alvinhochun
Copy link
Contributor

I tested this locally on Windows 10, Intel + NVIDIA (Optimus, Intel as primary GPU), no noticeable differences between both modes on either GPU with OpenGL, Vulkan or D3D12.

@alvinhochun
Copy link
Contributor

Oh no, you probably should only swap WS_POPUP with WS_OVERLAPPED for fullscreen windows, not all borderless windows. (It breaks rendering of menus and dropdowns on Intel + OpenGL.)

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