Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AaronBPaden/64a54f8751b55b1e69bad7a625d3e980 to your computer and use it in GitHub Desktop.
Save AaronBPaden/64a54f8751b55b1e69bad7a625d3e980 to your computer and use it in GitHub Desktop.
Ask the desktop to bypass the compositor when in windowed fullscreen mode.
From ea01627e138dae91a5401f735aa283376a2077f0 Mon Sep 17 00:00:00 2001
From: Aaron Paden <[email protected]>
Date: Sun, 31 Dec 2017 10:30:31 -0600
Subject: [PATCH] Support _NET_WM_BYPASS_COMPOSITOR
---
gfx/common/x11_common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c
index 3107da4aa8..79bdda05d0 100644
--- a/gfx/common/x11_common.c
+++ b/gfx/common/x11_common.c
@@ -68,8 +68,10 @@ unsigned g_x11_screen = 0;
Colormap g_x11_cmap;
Window g_x11_win;
+const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
static Atom XA_NET_WM_STATE;
static Atom XA_NET_WM_STATE_FULLSCREEN;
+static Atom XA_NET_WM_BYPASS_COMPOSITOR;
static Atom XA_NET_MOVERESIZE_WINDOW;
static Atom g_x11_quit_atom;
@@ -113,6 +115,7 @@ void x11_windowed_fullscreen(Display *dpy, Window win)
XA_NET_WM_STATE = XInternAtom(dpy, "_NET_WM_STATE", False);
XA_NET_WM_STATE_FULLSCREEN = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
+ XA_NET_WM_BYPASS_COMPOSITOR = XInternAtom(dpy, "_NET_WM_BYPASS_COMPOSITOR", False);
xev.xclient.type = ClientMessage;
xev.xclient.send_event = True;
@@ -125,6 +128,7 @@ void x11_windowed_fullscreen(Display *dpy, Window win)
XSendEvent(dpy, DefaultRootWindow(dpy), False,
SubstructureRedirectMask | SubstructureNotifyMask,
&xev);
+ XChangeProperty(dpy, win, XA_NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32, PropModeReplace, (uint8_t *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
}
/* Try to be nice to tiling WMs if possible. */
--
2.15.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment