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

Fullscreen mode's border color does not update when transparent background is disabled #93873

Open
gokiburikin opened this issue Jul 2, 2024 · 4 comments

Comments

@gokiburikin
Copy link

Tested versions

v4.3.dev6.official [89850d5]
v4.3.beta2.official [b75f048]

System information

Godot v4.3.dev6 - Windows 10.0.19044 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 31.0.15.5161) - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 Threads)

Issue description

I have transparency and borderless enabled on my main window for a splash screen which I then disable when the game loads, but Fullscreen mode which normally draws a 1 pixel border of clear color draws a transparent border instead despite disabling transparency.

I would expect the 1 pixel border to be the solid default clear color.

Steps to reproduce

  1. Enable Transparency, Per Pixel Transparency, Borderless, and a transparent PNG splash screen in the project settings.
  2. Run a script that disables Window.transparency and switches Window.mode to Fullscreen when the game loads.

The 1 pixel border is transparent instead of the clear color.

Oddly, if Transparency is disabled in the project settings and enabled when the game loads the border is also transparent even though I'd expect it to be black if it weren't being updated.

Minimal reproduction project (MRP)

transparent-splash-fullscreen-mrp.zip

@Calinou
Copy link
Member

Calinou commented Jul 2, 2024

Can you check if #88734 fixes this issue?

@gokiburikin
Copy link
Author

gokiburikin commented Jul 2, 2024

It does make the border black when transparent is disabled, but does not fix the issue. The border is still transparent if transparent is enabled in the project settings regardless of when I set it to false during runtime. Tried waiting frames, minimizing, maximizing, switching between modes, etc. It just never seems to draw the border again while in Fullscreen mode.

@gokiburikin
Copy link
Author

A bit of an update here. I'm messing around with code I don't understand to try to figure out what might be happening and what I said isn't entirely accurate; a border is being drawn, but it's being drawn in a weird mode perhaps? If I change the black border to not-black it can clearly be seen, but it doesn't draw over stuff? Hard to explain so here are some examples.

My vertical taskbar with a Fullscreen, Transparent = false, Color(0,0,0,0) default clear color Godot window drawn over it

CreatePen border with these colors RGB(0, 0, 255), RGB(255, 0, 0), RGB(31, 63, 31), and RGB(0, 0, 0)
mrp_1

The screenshot above shows a transparent window for context, but this is what I see when transparency starts enabled, the default clear color is black, and I disable transparency before making the window Fullscreen:

Visual example of the issue with an RGB(31, 63, 31) border

mrp_2

@gokiburikin
Copy link
Author

gokiburikin commented Jul 3, 2024

After more testing it appears as though changing HRGN hRgn = CreateRectRgn(0, 0, -1, -1); to HRGN hRgn = CreateRectRgn(0, 0, 0, 0); fixes the issue I'm experiencing. This only seems to work for setting Window.transparent = false though; Window.transparent_bg = false still leaves one of these weird borders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants