Add support for the _NET_WM_BYPASS_COMPOSITOR hint
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 21 Jul 2013 00:57:31 -0400
changeset 7490 fc864efbc1a6
parent 7489 30ec6dae748b
child 7492 98de3e4f1c36
Add support for the _NET_WM_BYPASS_COMPOSITOR hint This hints to window managers to unredirect the window to improve performance.
src/video/x11/SDL_x11window.c
--- a/src/video/x11/SDL_x11window.c	Sun Jul 21 00:07:43 2013 -0400
+++ b/src/video/x11/SDL_x11window.c	Sun Jul 21 00:57:31 2013 -0400
@@ -339,6 +339,8 @@
     XSizeHints *sizehints;
     XWMHints *wmhints;
     XClassHint *classhints;
+    const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
+    Atom _NET_WM_BYPASS_COMPOSITOR;
     Atom _NET_WM_WINDOW_TYPE;
     Atom _NET_WM_WINDOW_TYPE_NORMAL;
     Atom _NET_WM_PID;
@@ -532,6 +534,10 @@
                     PropModeReplace,
                     (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1);
 
+    _NET_WM_BYPASS_COMPOSITOR = XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False);
+    XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
+                    PropModeReplace,
+                    (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
 
     {
         Atom protocols[] = {