From 942bda7db4b7b9e5bae6ad1ad81295b1f346a9f6 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 22 Sep 2018 14:09:42 +0200 Subject: Use XCB and SelectSelectionInput instead of GTK+ As it happens, there is no real need to constantly poll for changes, since XFixes can inform us of updates as they happen. With GTK+ gone we've got dependencies and error handling under control. XCB is a truly awful thing to learn, though. Our method will never work on Wayland or Windows, so we don't miss out on anything by abandoning the huge toolkit. --- CMakeLists.txt | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 4990a51..c13754f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,19 +74,18 @@ else (USE_SYSTEM_TERMO) set (Termo_LIBRARIES termo-static) endif (USE_SYSTEM_TERMO) -# We actually don't care about the specific version -pkg_search_module (gtk gtk+-3.0 gtk+-2.0) -option (WITH_GTK "Compile with GTK+ support" ${gtk_FOUND}) - -if (WITH_GTK) - if (NOT gtk_FOUND) - message (FATAL_ERROR "GTK+ library not found") - endif (NOT gtk_FOUND) - - list (APPEND dependencies_INCLUDE_DIRS ${gtk_INCLUDE_DIRS}) - list (APPEND dependencies_LIBRARY_DIRS ${gtk_LIBRARY_DIRS}) - list (APPEND dependencies_LIBRARIES ${gtk_LIBRARIES}) -endif (WITH_GTK) +pkg_check_modules (xcb xcb xcb-xfixes) +option (WITH_X11 "Compile with X11 selection support using XCB" ${xcb_FOUND}) + +if (WITH_X11) + if (NOT xcb_FOUND) + message (FATAL_ERROR "XCB not found") + endif (NOT xcb_FOUND) + + list (APPEND dependencies_INCLUDE_DIRS ${xcb_INCLUDE_DIRS}) + list (APPEND dependencies_LIBRARY_DIRS ${xcb_LIBRARY_DIRS}) + list (APPEND dependencies_LIBRARIES ${xcb_LIBRARIES}) +endif (WITH_X11) link_directories (${dependencies_LIBRARY_DIRS}) include_directories (${ZLIB_INCLUDE_DIRS} ${icu_INCLUDE_DIRS} -- cgit v1.2.3-70-g09d2