From 3af039fd8a0a26851d4ff758a72df703fe2dc2a5 Mon Sep 17 00:00:00 2001 From: "david.cheng" Date: Mon, 13 Feb 2023 15:05:44 +0800 Subject: [PATCH] =?UTF-8?q?resolve=20the=20compiling=20error:=20=E2=80=98S?= =?UTF-8?q?DL=5FHINT=5FVIDEO=5FX11=5FNET=5FWM=5FBYPASS=5FCOMPOSITOR?= =?UTF-8?q?=E2=80=99=20undeclared=20(first=20use=20in=20this=20function)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: david.cheng --- examples/mnist/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/mnist/main.c b/examples/mnist/main.c index ff8849cf..7b0ad4fa 100644 --- a/examples/mnist/main.c +++ b/examples/mnist/main.c @@ -2238,8 +2238,13 @@ static struct window_context_t * window_context_alloc(void) SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS); SDL_EnableScreenSaver(); SDL_EventState(SDL_DROPFILE, SDL_ENABLE); - SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); +#ifdef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR + SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); +#endif + +#ifdef SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); +#endif wctx->window = SDL_CreateWindow("The mnist handwritten digit prediction (https://github.com/xboot/libonnx)", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_MOUSE_FOCUS); wctx->screen = SDL_GetWindowSurface(wctx->window);