# Black screen when setting window to transparent and size to 1920x1080

**URL:** <https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585>\
**Category:** support\
**Created:** [March 29, 2024, 12:42am UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585 "2024-03-29T00:42:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![awdoiunauiwdn](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@awdoiunauiwdn](https://discourse.glfw.org/u/awdoiunauiwdn)\
**Post date:** [March 29, 2024, 12:42am UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585/1 "2024-03-29T00:42:53Z")

</div>

Hello,

I looked through some posts and found that this could be a GPU issue, but as long as the window isn’t my entire monitor’s resolution it works as intended - the window is transparent.

I am on an NVIDIA GPU and have tried running in compatability mode for windows 8 + disabled fullscreen optimizations - nothing works! Maybe its a setting?

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [March 29, 2024, 5:01pm UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585/2 "2024-03-29T17:01:30Z")

</div>

Hi @awdoiunauiwdn,

Welcome to the GLFW forum.

Are you using the `GLFW_TRANSPARENT_FRAMEBUFFER` window hint or the `glfwSetWindowOpacity` function for this?  
See [GLFW: Window guide](https://www.glfw.org/docs/3.3/window_guide.html#window_transparency)

Additionally, when you say `the window isn’t my entire monitor’s resolution` do you mean going fullscreen?

I am not sure what might cause this issue but it could indeed be a driver problem, though I if it is a fullscreen window then I’m not sure transparency is supported when fullscreen.

---

<div class="post-metadata">

**Author:** ![awdoiunauiwdn](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@awdoiunauiwdn](https://discourse.glfw.org/u/awdoiunauiwdn)\
**Post date:** [March 31, 2024, 7:56pm UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585/3 "2024-03-31T19:56:44Z")

</div>

Hello, thank you so much for your response!

I am using the GLFW\_TRANSPARENT\_FRAMEBUFFER flag. I am not sure why this is happening, but I asked my friend to download the program and it is happening to him as well.

I don’t mean fullscreen as in GLFW\_FULLSCREEN, but I mean seting the window resolution to the monitors resolution.

Thanks again!

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [April 1, 2024, 3:13pm UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585/4 "2024-04-01T15:13:10Z")

</div>

I tried a quick experiment and on my Windows 11 system with AMD GPU I found that transparency won’t work if the undecorated window is set to the same size and position as the monitor.

I suspect this is due to the driver switching to a fullscreen mode. Since OpenGL doesn’t have an actual method for setting a fullscreen framebuffer this is done at the driver level, and GLFW has no control over this.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [April 2, 2024, 8:52am UTC](https://discourse.glfw.org/t/black-screen-when-setting-window-to-transparent-and-size-to-1920x1080/2585/5 "2024-04-02T08:52:42Z")

</div>

There is a solution to this problem which I forgot when I last posted.

Basically instead of making a window of the exact size of the monitor you make it slightly larger, but then only draw to the part which overlaps your monitor. This ‘fools’ the driver into not engaging the fullscreen path and you can get a transparent overlay over the monitor. I tried this and it appears to work.

I multimonitor situations you might need to try not to overlap other monitors, though in some very rare cases this won’t be possible.
