# 'glfwCreateWindow' not returning NULL as it should?

**URL:** <https://discourse.glfw.org/t/glfwcreatewindow-not-returning-null-as-it-should/3000>\
**Category:** support\
**Created:** [May 17, 2026, 3:49pm UTC](https://discourse.glfw.org/t/glfwcreatewindow-not-returning-null-as-it-should/3000 "2026-05-17T15:49:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ragnar\_the\_Red](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/ragnar_the_red/32/1075_2.png) [@Ragnar\_the\_Red](https://discourse.glfw.org/u/Ragnar_the_Red)\
**Post date:** [May 17, 2026, 3:49pm UTC](https://discourse.glfw.org/t/glfwcreatewindow-not-returning-null-as-it-should/3000/1 "2026-05-17T15:49:13Z")

</div>

Hello there 🙂  
I have a somewhat strange problem when trying to `glfwInit` a window on my CachyOS. I am getting:

`Failed to load plugin ‘libdecor-gtk.so’: failed to init`

with the description:  
`EGL: Failed to clear current context: An EGLDisplay argument does not name a valid EGL display connection`

Now, the error is **not** actually my problem and can be fixed by providing the explicit platform hint X11 before calling `glfwInit`. What I find extremely strange is that my code keeps executing because the method does not return `NULL` as specified in the description.

In other words, my `if` here does not trigger:

```auto
windowHandle = glfwCreateWindow(widthInPixels, heightInPixels, windowIdentifier, isTrueWindow ? NULL : glfwGetPrimaryMonitor(), NULL);
if (windowHandle == NULL) throw new IllegalStateException("Unable to create GLFW-Window.");

```

Now, I am using LWJGL (the Java-thingy) and thus there is a native translation layer, but it seems unlikely to me that said layer would normally transfer values correctly except this particular error one.

Does someone have experience with this?

EDIT: Probably related to [this](https://github.com/LWJGL/lwjgl3/issues/1071).
