diff --git a/CMakeLists.txt b/CMakeLists.txt index f579bb7b9..7766ed1b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -599,9 +599,8 @@ elseif(TARGET_OS STREQUAL "android") else() find_package(Notify) find_package(OpenGL) - find_package(X11) - set(PLATFORM_CLIENT_LIBS ${OPENGL_gl_LIBRARY} ${X11_X11_LIB} ${NOTIFY_LIBRARIES}) - set(PLATFORM_CLIENT_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH} ${NOTIFY_INCLUDE_DIRS}) + set(PLATFORM_CLIENT_LIBS ${OPENGL_gl_LIBRARY} ${NOTIFY_LIBRARIES}) + set(PLATFORM_CLIENT_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${NOTIFY_INCLUDE_DIRS}) set(PLATFORM_CLIENT) if(TARGET_OS STREQUAL "linux") set(PLATFORM_LIBS rt) # clock_gettime for glibc < 2.17 diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 27ad7e19a..ce883ab24 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -24,11 +24,6 @@ #include "SDL_pixels.h" #include "SDL_video.h" -#if defined(SDL_VIDEO_DRIVER_X11) -#include -#include -#endif - #include #include @@ -1213,41 +1208,12 @@ void CGraphicsBackend_SDL_OpenGL::GetViewportSize(int &w, int &h) void CGraphicsBackend_SDL_OpenGL::NotifyWindow() { - // get window handle - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if(!SDL_GetWindowWMInfo(m_pWindow, &info)) +#if SDL_MAJOR_VERSION > 2 || (SDL_MAJOR_VERSION == 2 && SDL_PATCHLEVEL >= 16) + if(SDL_FlashWindow(m_pWindow, SDL_FlashOperation::SDL_FLASH_BRIEFLY) != 0) { - dbg_msg("gfx", "unable to obtain window handle"); + // fails if SDL hasn't implemented it return; } - -#if defined(CONF_FAMILY_WINDOWS) - FLASHWINFO desc; - desc.cbSize = sizeof(desc); - desc.hwnd = info.info.win.window; - desc.dwFlags = FLASHW_TRAY; - desc.uCount = 3; // flash 3 times - desc.dwTimeout = 0; - - FlashWindowEx(&desc); -#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOS) - Display *pX11Dpy = info.info.x11.display; - Window X11Win = info.info.x11.window; - - static Atom s_DemandsAttention = XInternAtom(pX11Dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", true); - static Atom s_WmState = XInternAtom(pX11Dpy, "_NET_WM_STATE", true); - - XEvent SndNtfyEvent = {ClientMessage}; - SndNtfyEvent.xclient.window = X11Win; - SndNtfyEvent.xclient.message_type = s_WmState; - SndNtfyEvent.xclient.format = 32; - SndNtfyEvent.xclient.data.l[0] = 1; // _NET_WM_STATE_ADD - SndNtfyEvent.xclient.data.l[1] = s_DemandsAttention; - SndNtfyEvent.xclient.data.l[2] = 0; - SndNtfyEvent.xclient.data.l[3] = 1; // normal application - SndNtfyEvent.xclient.data.l[4] = 0; - XSendEvent(pX11Dpy, XDefaultRootWindow(pX11Dpy), False, SubstructureNotifyMask | SubstructureRedirectMask, &SndNtfyEvent); #endif } diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 4b1fd1a1f..cc9132b7c 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1,7 +1,5 @@ /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ /* If you are missing that file, acquire a complete release at teeworlds.com. */ -#include "SDL.h" // SDL_VIDEO_DRIVER_X11 - #include #include