mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
Check for XSetIOErrorExitHandler so old Xlib versions can work just fine
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
6808f31cd6
commit
28f0868caa
@ -19,6 +19,7 @@ find_package(LZ4 REQUIRED)
|
|||||||
find_package(FFMPEG REQUIRED)
|
find_package(FFMPEG REQUIRED)
|
||||||
find_package(FreeImage REQUIRED)
|
find_package(FreeImage REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${X11_INCLUDE_DIR}
|
${X11_INCLUDE_DIR}
|
||||||
${XRANDR_INCLUDE_DIR}
|
${XRANDR_INCLUDE_DIR}
|
||||||
@ -204,4 +205,13 @@ target_link_libraries(wallengine
|
|||||||
${SDL_MIXER_LIBRARIES}
|
${SDL_MIXER_LIBRARIES}
|
||||||
${FFMPEG_LIBRARIES}
|
${FFMPEG_LIBRARIES}
|
||||||
${FREEIMAGE_LIBRARIES}
|
${FREEIMAGE_LIBRARIES}
|
||||||
glfw)
|
glfw)
|
||||||
|
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES})
|
||||||
|
|
||||||
|
# make sure some of the X11 functions we'll use are available
|
||||||
|
check_function_exists(XSetIOErrorExitHandler HAVE_XSETIOERROREXITHANDLER)
|
||||||
|
|
||||||
|
if(HAVE_XSETIOERROREXITHANDLER)
|
||||||
|
add_compile_definitions(HAVE_XSETIOERROREXITHANDLER=1)
|
||||||
|
endif()
|
@ -62,7 +62,9 @@ void CContext::initializeViewports ()
|
|||||||
this->m_display = XOpenDisplay (nullptr);
|
this->m_display = XOpenDisplay (nullptr);
|
||||||
|
|
||||||
// set the error handling to try and recover from X disconnections
|
// set the error handling to try and recover from X disconnections
|
||||||
|
#ifdef HAVE_XSETIOERROREXITHANDLER
|
||||||
XSetIOErrorExitHandler (this->m_display, CustomXIOErrorExitHandler, this);
|
XSetIOErrorExitHandler (this->m_display, CustomXIOErrorExitHandler, this);
|
||||||
|
#endif /* HAVE_XSETIOERROREXITHANDLER */
|
||||||
XSetErrorHandler (CustomXErrorHandler);
|
XSetErrorHandler (CustomXErrorHandler);
|
||||||
XSetIOErrorHandler (CustomXIOErrorHandler);
|
XSetIOErrorHandler (CustomXIOErrorHandler);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user