Browse Source

x11display: bypass compositor when switching to fullscreen mode

rdb 7 years ago
parent
commit
73083127bf

+ 1 - 0
panda/src/x11display/x11GraphicsPipe.cxx

@@ -241,6 +241,7 @@ x11GraphicsPipe(const std::string &display) :
   _net_wm_state_below = XInternAtom(_display, "_NET_WM_STATE_BELOW", false);
   _net_wm_state_add = XInternAtom(_display, "_NET_WM_STATE_ADD", false);
   _net_wm_state_remove = XInternAtom(_display, "_NET_WM_STATE_REMOVE", false);
+  _net_wm_bypass_compositor = XInternAtom(_display, "_NET_WM_BYPASS_COMPOSITOR", false);
 }
 
 /**

+ 1 - 0
panda/src/x11display/x11GraphicsPipe.h

@@ -80,6 +80,7 @@ public:
   Atom _net_wm_state_below;
   Atom _net_wm_state_add;
   Atom _net_wm_state_remove;
+  Atom _net_wm_bypass_compositor;
 
   // Extension functions.
   typedef int (*pfn_XcursorGetDefaultSize)(X11_Display *);

+ 8 - 0
panda/src/x11display/x11GraphicsWindow.cxx

@@ -1272,6 +1272,14 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
                   XA_CARDINAL, 32, PropModeReplace,
                   (unsigned char *)&pid, 1);
 
+  // Disable compositing effects in fullscreen mode.
+  if (properties.has_fullscreen()) {
+    int32_t compositor = properties.get_fullscreen() ? 1 : 0;
+    XChangeProperty(_display, _xwindow, x11_pipe->_net_wm_bypass_compositor,
+                    XA_CARDINAL, 32, PropModeReplace,
+                    (unsigned char *)&compositor, 1);
+  }
+
   XChangeProperty(_display, _xwindow, x11_pipe->_net_wm_window_type,
                   XA_ATOM, 32, PropModeReplace,
                   (unsigned char *)type_data, next_type_data);