Browse Source

Added support for _NET_WM_BYPASS_COMPOSITOR.

Camilla Berglund 12 years ago
parent
commit
5ef4f77fb5
4 changed files with 22 additions and 0 deletions
  1. 1 0
      README.md
  2. 2 0
      src/x11_init.c
  3. 1 0
      src/x11_platform.h
  4. 18 0
      src/x11_window.c

+ 1 - 0
README.md

@@ -71,6 +71,7 @@ guide in the GLFW documentation.
  - [Cocoa] Bugfix: Controllers were reported as having zero buttons and axes
  - [Cocoa] Bugfix: Controllers were reported as having zero buttons and axes
  - [Cocoa] Bugfix: Removed joystick axis value negation left over from GLFW 2
  - [Cocoa] Bugfix: Removed joystick axis value negation left over from GLFW 2
  - [X11] Added setting of the `WM_CLASS` property to the initial window title
  - [X11] Added setting of the `WM_CLASS` property to the initial window title
+ - [X11] Added support for `_NET_WM_BYPASS_COMPOSITOR`
  - [X11] Bugfix: Removed joystick axis value negation left over from GLFW 2
  - [X11] Bugfix: Removed joystick axis value negation left over from GLFW 2
  - [X11] Bugfix: The position of hidden windows was ignored by Metacity
  - [X11] Bugfix: The position of hidden windows was ignored by Metacity
                  and Compiz
                  and Compiz

+ 2 - 0
src/x11_init.c

@@ -409,6 +409,8 @@ static void detectEWMH(void)
         getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING");
         getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING");
     _glfw.x11.NET_ACTIVE_WINDOW =
     _glfw.x11.NET_ACTIVE_WINDOW =
         getSupportedAtom(supportedAtoms, atomCount, "_NET_ACTIVE_WINDOW");
         getSupportedAtom(supportedAtoms, atomCount, "_NET_ACTIVE_WINDOW");
+    _glfw.x11.NET_WM_BYPASS_COMPOSITOR =
+        getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_BYPASS_COMPOSITOR");
 
 
     XFree(supportedAtoms);
     XFree(supportedAtoms);
 
 

+ 1 - 0
src/x11_platform.h

@@ -117,6 +117,7 @@ typedef struct _GLFWlibraryX11
     Atom            NET_WM_PING;
     Atom            NET_WM_PING;
     Atom            NET_WM_STATE;
     Atom            NET_WM_STATE;
     Atom            NET_WM_STATE_FULLSCREEN;
     Atom            NET_WM_STATE_FULLSCREEN;
+    Atom            NET_WM_BYPASS_COMPOSITOR;
     Atom            NET_ACTIVE_WINDOW;
     Atom            NET_ACTIVE_WINDOW;
     Atom            MOTIF_WM_HINTS;
     Atom            MOTIF_WM_HINTS;
 
 

+ 18 - 0
src/x11_window.c

@@ -399,6 +399,15 @@ static void enterFullscreenMode(_GLFWwindow* window)
 
 
     _glfwSetVideoMode(window->monitor, &window->videoMode);
     _glfwSetVideoMode(window->monitor, &window->videoMode);
 
 
+    if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR != None)
+    {
+        const unsigned long value = 1;
+
+        XChangeProperty(_glfw.x11.display,  window->x11.handle,
+                        _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
+                        PropModeReplace, (unsigned char*) &value, 1);
+    }
+
     if (_glfw.x11.hasEWMH &&
     if (_glfw.x11.hasEWMH &&
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)
@@ -487,6 +496,15 @@ static void leaveFullscreenMode(_GLFWwindow* window)
                         _glfw.x11.saver.exposure);
                         _glfw.x11.saver.exposure);
     }
     }
 
 
+    if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR != None)
+    {
+        const unsigned long value = 0;
+
+        XChangeProperty(_glfw.x11.display,  window->x11.handle,
+                        _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
+                        PropModeReplace, (unsigned char*) &value, 1);
+    }
+
     if (_glfw.x11.hasEWMH &&
     if (_glfw.x11.hasEWMH &&
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)