Skip to content

Commit df9afef

Browse files
authored
SDL: don't bypass X11 WM compositor (koreader#1158)
1 parent 7b05d5a commit df9afef

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

ffi-cdecl/SDL2_0_decl.c

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ cdecl_func(SDL_GetClipboardText)
146146
cdecl_func(SDL_SetClipboardText)
147147
cdecl_func(SDL_GetError)
148148

149+
cdecl_func(SDL_SetHint)
150+
149151
cdecl_func(SDL_NumJoysticks)
150152
cdecl_func(SDL_JoystickNameForIndex)
151153
cdecl_func(SDL_JoystickOpen)

ffi/SDL2_0.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ function S.open(w, h, x, y)
104104
S.h = tonumber(os.getenv("EMULATE_READER_H")) or h or 800
105105
end
106106

107-
-- default behaviour of SDL 2.0 is to disable the screensaver. This turns it back on
107+
-- Enable screensaver and X11 composition.
108108
SDL.SDL_EnableScreenSaver()
109+
if SDL_Linked_Version_AtLeast(2, 0, 8) then
110+
SDL.SDL_SetHint("SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR", "0")
111+
end
112+
109113
-- set up screen (window)
110114
S.screen = SDL.SDL_CreateWindow("KOReader",
111115
tonumber(os.getenv("KOREADER_WINDOW_POS_X")) or x or SDL.SDL_WINDOWPOS_UNDEFINED,

ffi/SDL2_0_h.lua

+1
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ SDL_bool SDL_HasClipboardText(void) __attribute__((visibility("default")));
745745
char *SDL_GetClipboardText(void) __attribute__((visibility("default")));
746746
int SDL_SetClipboardText(const char *) __attribute__((visibility("default")));
747747
const char *SDL_GetError(void) __attribute__((visibility("default")));
748+
SDL_bool SDL_SetHint(const char *, const char *) __attribute__((visibility("default")));
748749
int SDL_NumJoysticks(void) __attribute__((visibility("default")));
749750
const char *SDL_JoystickNameForIndex(int) __attribute__((visibility("default")));
750751
SDL_Joystick *SDL_JoystickOpen(int) __attribute__((visibility("default")));

0 commit comments

Comments
 (0)