x11display: bypass compositor when switching to fullscreen mode

This commit is contained in:
rdb 2018-12-30 16:59:32 +01:00
parent cedd4172c4
commit 73083127bf
3 changed files with 10 additions and 0 deletions

View File

@ -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);
}
/**

View File

@ -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 *);

View File

@ -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);