Add support for the _NET_WM_BYPASS_COMPOSITOR hint
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 21 Jul 2013 00:57:31 -0400
changeset 7490fc864efbc1a6
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
     1.1 --- a/src/video/x11/SDL_x11window.c	Sun Jul 21 00:07:43 2013 -0400
     1.2 +++ b/src/video/x11/SDL_x11window.c	Sun Jul 21 00:57:31 2013 -0400
     1.3 @@ -339,6 +339,8 @@
     1.4      XSizeHints *sizehints;
     1.5      XWMHints *wmhints;
     1.6      XClassHint *classhints;
     1.7 +    const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
     1.8 +    Atom _NET_WM_BYPASS_COMPOSITOR;
     1.9      Atom _NET_WM_WINDOW_TYPE;
    1.10      Atom _NET_WM_WINDOW_TYPE_NORMAL;
    1.11      Atom _NET_WM_PID;
    1.12 @@ -532,6 +534,10 @@
    1.13                      PropModeReplace,
    1.14                      (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1);
    1.15  
    1.16 +    _NET_WM_BYPASS_COMPOSITOR = XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False);
    1.17 +    XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
    1.18 +                    PropModeReplace,
    1.19 +                    (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
    1.20  
    1.21      {
    1.22          Atom protocols[] = {