diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a96e3b..0955f4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,61 +1,62 @@ project(khotkeys) set(PROJECT_VERSION "5.15.0") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.11.0") set(KF5_MIN_VERSION "5.54.0") include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libkhotkeysprivate ${CMAKE_CURRENT_BINARY_DIR}/libkhotkeysprivate ${CMAKE_CURRENT_BINARY_DIR} ) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMPackageConfigHelpers) include(ECMOptionalAddSubdirectory) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS GlobalAccel I18n KIO XmlGui KDELibs4Support DBusAddons KCMUtils Plasma ) find_package(X11 REQUIRED) find_package(LibKWorkspace CONFIG REQUIRED) if(X11_FOUND) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras ) set(HAVE_XTEST ${X11_XTest_FOUND}) + set(HAVE_X11 1) endif() configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) # Set KI18n translation domain add_definitions(-DTRANSLATION_DOMAIN=\"khotkeys\") # Convenience library add_subdirectory( libkhotkeysprivate ) # has to be before kcm_hotkeys add_subdirectory( app ) # kcm module to configure hotkeys add_subdirectory( kcm_hotkeys ) # kdedmodule and standalone demon for hotkeys add_subdirectory( data ) add_subdirectory( test ) add_subdirectory( doc ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/config-X11.h.cmake b/config-X11.h.cmake index 60286dd..ae8978a 100644 --- a/config-X11.h.cmake +++ b/config-X11.h.cmake @@ -1,44 +1,44 @@ /* Define if you have the XRandR extension */ #cmakedefine HAVE_XRANDR 1 /* Define if you have the XDamage extension */ #cmakedefine HAVE_XDAMAGE 1 /* Define if you have the XKB extension */ #cmakedefine HAVE_XKB 1 /* Define if you have the Xinerama extension */ #cmakedefine HAVE_XINERAMA 1 /* Define if you have the XSHM (MIT SHM) extension */ #cmakedefine HAVE_XSHM 1 /* Define if you have the XComposite extension */ #cmakedefine HAVE_XCOMPOSITE 1 /* Define to 1 if you have Xcursor */ #cmakedefine HAVE_XCURSOR 1 /* Define if you have the xf86misc extension */ #cmakedefine HAVE_XF86MISC 1 /* Define if you have the XFixes extension */ #cmakedefine HAVE_XFIXES 1 /* Define if you have the XTest extension */ #cmakedefine HAVE_XTEST 1 /* Define if your system has XRender support */ #cmakedefine HAVE_XRENDER 1 /* Define if you have OpenGL */ #cmakedefine HAVE_OPENGL 1 /* Define if you have the XSync extension */ #cmakedefine HAVE_XSYNC 1 /* Define if you have XRandR 1.3 */ #cmakedefine HAS_RANDR_1_3 1 /* Define if you have X11 at all */ -#define HAVE_X11 ${X11_FOUND} +#cmakedefine01 HAVE_X11 diff --git a/libkhotkeysprivate/conditions/existing_window_condition.h b/libkhotkeysprivate/conditions/existing_window_condition.h index 92815eb..b6a4278 100644 --- a/libkhotkeysprivate/conditions/existing_window_condition.h +++ b/libkhotkeysprivate/conditions/existing_window_condition.h @@ -1,77 +1,76 @@ #ifndef EXISTING_WINDOW_CONDITION_H #define EXISTING_WINDOW_CONDITION_H /* Copyright (C) 2009 Michael Jansen Copyright (C) 1999-2001 Lubos Lunak This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "conditions/condition.h" #include #include #include #include // Needed because of some Qt Status redefinitions #include // Needed because of some Qt Status redefinitions -#include // Needed for HAVE_X11 #include #include #if HAVE_X11 #include #include #else #define None 0 #endif namespace KHotKeys { class Condition_list_base; class Windowdef_list; /** * @author Michael Jansen */ class Q_DECL_EXPORT Existing_window_condition : public QObject, public Condition { Q_OBJECT typedef Condition base; public: Existing_window_condition( Windowdef_list* window_P, Condition_list_base* parent = nullptr ); Existing_window_condition( KConfigGroup& cfg_P, Condition_list_base* parent_P ); virtual ~Existing_window_condition(); bool match() const Q_DECL_OVERRIDE; void cfg_write( KConfigGroup& cfg_P ) const Q_DECL_OVERRIDE; const Windowdef_list* window() const; Windowdef_list* window(); Existing_window_condition* copy() const Q_DECL_OVERRIDE; const QString description() const Q_DECL_OVERRIDE; public Q_SLOTS: void window_added( WId w_P ); void window_removed( WId w_P ); private: void init(); void set_match( WId w_P = None ); Windowdef_list* _window; bool is_match; }; } // namespace KHotKeys #endif /* #ifndef EXISTING_WINDOW_CONDITION_H */