Skip to content

Instantly share code, notes, and snippets.

@csssuf
Created September 20, 2017 20:36
Show Gist options
  • Save csssuf/8c51c2459210aa6afa7149c9d9527057 to your computer and use it in GitHub Desktop.
Save csssuf/8c51c2459210aa6afa7149c9d9527057 to your computer and use it in GitHub Desktop.
GLFW patch to fix GLFW_FLOATING windows in i3
diff --git a/src/x11_init.c b/src/x11_init.c
index f7a06c1..5be293f 100644
--- a/src/x11_init.c
+++ b/src/x11_init.c
@@ -436,6 +436,8 @@ static void detectEWMH(void)
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE");
_glfw.x11.NET_WM_STATE_ABOVE =
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_ABOVE");
+ _glfw.x11.NET_WM_STATE_MODAL =
+ getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_MODAL");
_glfw.x11.NET_WM_STATE_FULLSCREEN =
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN");
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT =
diff --git a/src/x11_platform.h b/src/x11_platform.h
index 3304306..5c7469b 100644
--- a/src/x11_platform.h
+++ b/src/x11_platform.h
@@ -170,6 +170,7 @@ typedef struct _GLFWlibraryX11
Atom NET_WM_WINDOW_TYPE_NORMAL;
Atom NET_WM_STATE;
Atom NET_WM_STATE_ABOVE;
+ Atom NET_WM_STATE_MODAL;
Atom NET_WM_STATE_FULLSCREEN;
Atom NET_WM_STATE_MAXIMIZED_VERT;
Atom NET_WM_STATE_MAXIMIZED_HORZ;
diff --git a/src/x11_window.c b/src/x11_window.c
index 077eebb..c8edaba 100644
--- a/src/x11_window.c
+++ b/src/x11_window.c
@@ -542,8 +542,8 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
if (wndconfig->floating)
{
- if (_glfw.x11.NET_WM_STATE_ABOVE)
- states[count++] = _glfw.x11.NET_WM_STATE_ABOVE;
+ if (_glfw.x11.NET_WM_STATE_MODAL)
+ states[count++] = _glfw.x11.NET_WM_STATE_MODAL;
}
if (wndconfig->maximized)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment