Skip to content

Commit 8ddebfa

Browse files
committed
Fixed bug 4085 - X11: Allow configuring _NET_WM_BYPASS_COMPOSITOR through SDL hints
Callum McGing This patch allows the user to disable the behaviour that blocks the compositor through a new hint: SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR. This allows tools or other windowed applications to behave properly under KWin.
1 parent 926d803 commit 8ddebfa

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

include/SDL_hints.h

+12
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,18 @@ extern "C" {
211211
*/
212212
#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING"
213213

214+
/**
215+
* \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
216+
*
217+
* This variable can be set to the following values:
218+
* "0" - Disable _NET_WM_BYPASS_COMPOSITOR
219+
* "1" - Enable _NET_WM_BYPASS_COMPOSITOR
220+
*
221+
* By default SDL will use _NET_WM_BYPASS_COMPOSITOR
222+
*
223+
*/
224+
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
225+
214226
/**
215227
* \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
216228
*

src/video/x11/SDL_x11window.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,12 @@ X11_CreateWindow(_THIS, SDL_Window * window)
579579
wintype = X11_XInternAtom(display, wintype_name, False);
580580
X11_XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
581581
PropModeReplace, (unsigned char *)&wintype, 1);
582-
583-
_NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False);
584-
X11_XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
585-
PropModeReplace,
586-
(unsigned char *)&compositor, 1);
582+
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, SDL_TRUE)) {
583+
_NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False);
584+
X11_XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
585+
PropModeReplace,
586+
(unsigned char *)&compositor, 1);
587+
}
587588

588589
{
589590
Atom protocols[3];

0 commit comments

Comments
 (0)