From 441277995f4f4ee5e78941ad92cd8a5eb6b0add3 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 22:12:16 +0800 Subject: [PATCH 001/254] modified: CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf006d3..99f6339 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(QT Core Gui Widgets Quick QuickControls2 DBus Xml X11Extras LinguistTools) -find_package(Qt5 REQUIRED ${QT}) +find_package(Qt6 REQUIRED ${QT}) # find_package(LingmoUI REQUIRED) find_package(PkgConfig REQUIRED) From bca376f2a9d1846896a1db7db8a35bf7dc63901d Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 22:41:33 +0800 Subject: [PATCH 002/254] modified: CMakeLists.txt modified: notificationd/CMakeLists.txt modified: polkit-agent/CMakeLists.txt modified: session/CMakeLists.txt modified: settings-daemon/CMakeLists.txt --- CMakeLists.txt | 2 +- notificationd/CMakeLists.txt | 14 +++++++------- polkit-agent/CMakeLists.txt | 12 ++++++------ session/CMakeLists.txt | 17 ++++++++--------- settings-daemon/CMakeLists.txt | 27 +++++++++++++-------------- 5 files changed, 35 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99f6339..d82ff22 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) -set(QT Core Gui Widgets Quick QuickControls2 DBus Xml X11Extras LinguistTools) +set(QT Core Gui Widgets Quick QuickControls2 DBus Xml LinguistTools) find_package(Qt6 REQUIRED ${QT}) # find_package(LingmoUI REQUIRED) find_package(PkgConfig REQUIRED) diff --git a/notificationd/CMakeLists.txt b/notificationd/CMakeLists.txt index 258cc5d..e0edf09 100755 --- a/notificationd/CMakeLists.txt +++ b/notificationd/CMakeLists.txt @@ -20,7 +20,7 @@ set(SRCS main.cpp qt5_add_dbus_adaptor(DBUS_SOURCES com.lingmo.Notification.xml application.h Application) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) add_executable(lingmo-notificationd ${SRCS} ${DBUS_SOURCES}) @@ -29,14 +29,14 @@ foreach(filepath ${TS_FILES}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) list(APPEND ts_files_replaced ${filename}) endforeach() -qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) +qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(lingmo-notificationd - Qt5::Core - Qt5::DBus - Qt5::Quick - Qt5::Widgets - KF5::WindowSystem + Qt6::Core + Qt6::DBus + Qt6::Quick + Qt6::Widgets + KF6::WindowSystem ) install(TARGETS lingmo-notificationd diff --git a/polkit-agent/CMakeLists.txt b/polkit-agent/CMakeLists.txt index 665005c..65d9d27 100755 --- a/polkit-agent/CMakeLists.txt +++ b/polkit-agent/CMakeLists.txt @@ -2,7 +2,7 @@ find_package(PkgConfig) pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1) message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}") -find_package(PolkitQt5-1 REQUIRED) +find_package(PolkitQt6-1 REQUIRED) include_directories( ${POLKIT_AGENT_INCLUDE_DIRS} @@ -21,13 +21,13 @@ foreach(filepath ${TS_FILES}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) list(APPEND ts_files_replaced ${filename}) endforeach() -qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) +qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(lingmo-polkit-agent - Qt5::Core - Qt5::Widgets - Qt5::Quick - Qt5::QuickControls2 + Qt6::Core + Qt6::Widgets + Qt6::Quick + Qt6::QuickControls2 # LingmoUI diff --git a/session/CMakeLists.txt b/session/CMakeLists.txt index 58dfe4f..43c1c18 100755 --- a/session/CMakeLists.txt +++ b/session/CMakeLists.txt @@ -15,24 +15,23 @@ set(SOURCES daemon-helper.h ) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES com.lingmo.Session.xml application.h Application sessionadaptor SessionAdaptor) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) find_package(Threads) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Quick - Qt5::DBus - Qt5::X11Extras - KF5::WindowSystem + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::Quick + Qt6::DBus + KF6::WindowSystem ${CMAKE_THREAD_LIBS_INIT} ) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index af13393..850c3b7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -39,25 +39,25 @@ set(HEADERS "") set(FORMS "") set(RESOURCES "") -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES brightness/com.lingmo.Brightness.xml brightness/brightnessmanager.h BrightnessManager) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES theme/com.lingmo.Theme.xml theme/thememanager.h ThemeManager) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES battery/com.lingmo.PrimaryBattery.xml battery/battery.h Battery) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES language/com.lingmo.Language.xml language/language.h Language) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES dock/com.lingmo.Dock.xml dock/dock.h Dock) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES touchpad/com.lingmo.Touchpad.xml touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) @@ -69,15 +69,14 @@ foreach(filepath ${TS_FILES}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) list(APPEND ts_files_replaced ${filename}) endforeach() -qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) +qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::DBus - Qt5::X11Extras - Qt5::Xml + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::DBus + Qt6::Xml ${X11_LIBRARIES} X11::X11 X11::Xi From 508c2c8195b7155a8044f35677dc674153a13017 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 22:50:30 +0800 Subject: [PATCH 003/254] modified: shutdown-ui/CMakeLists.txt modified: xembed-sni-proxy/CMakeLists.txt --- shutdown-ui/CMakeLists.txt | 12 ++++++------ xembed-sni-proxy/CMakeLists.txt | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/shutdown-ui/CMakeLists.txt b/shutdown-ui/CMakeLists.txt index 27d087f..45b428e 100755 --- a/shutdown-ui/CMakeLists.txt +++ b/shutdown-ui/CMakeLists.txt @@ -11,14 +11,14 @@ foreach(filepath ${TS_FILES}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) list(APPEND ts_files_replaced ${filename}) endforeach() -qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) +qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(lingmo-shutdown - Qt5::Core - Qt5::Widgets - Qt5::Quick - Qt5::QuickControls2 - Qt5::DBus + Qt6::Core + Qt6::Widgets + Qt6::Quick + Qt6::QuickControls2 + Qt6::DBus ) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 00720a9..b904688 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -62,20 +62,19 @@ set(XEMBED_SNI_PROXY_SOURCES xtestsender.cpp ) -qt5_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml +qt_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml sniproxy.h SNIProxy) set(statusnotifierwatcher_xml org.kde.StatusNotifierWatcher.xml) -qt5_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) +qt_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(lingmo-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES}) set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(lingmo-xembedsniproxy - Qt5::Core - Qt5::X11Extras - Qt5::DBus - KF5::WindowSystem + Qt6::Core + Qt6::DBus + KF6::WindowSystem ${XCB_LIBS} ${X11_XTest_LIB} ) From d741319e779de89b979d8a8daa9367b5f9e538dc Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:01:44 +0800 Subject: [PATCH 004/254] modified: xembed-sni-proxy/CMakeLists.txt --- xembed-sni-proxy/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index b904688..2a5def7 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -21,7 +21,7 @@ if(X11_FOUND) message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") endif(NOT X11_SM_FOUND) - find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) + find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) endif() if(X11_FOUND AND XCB_XCB_FOUND) @@ -40,7 +40,7 @@ find_package(XCB IMAGE ) -find_package(KF5WindowSystem) +find_package(KF6WindowSystem) set(XCB_LIBS XCB::XCB From 8f4744692fbab5f87323e2f6f27dc4425009b515 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:14:07 +0800 Subject: [PATCH 005/254] modified: xembed-sni-proxy/CMakeLists.txt --- xembed-sni-proxy/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 2a5def7..d3c124c 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -21,7 +21,7 @@ if(X11_FOUND) message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") endif(NOT X11_SM_FOUND) - find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) + find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS) endif() if(X11_FOUND AND XCB_XCB_FOUND) From 290b8ce716d1a40a184ad4d0531c139a2923b063 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:17:03 +0800 Subject: [PATCH 006/254] modified: powerman/CMakeLists.txt --- powerman/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 2d4028b..f8cf318 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -28,10 +28,10 @@ set(SOURCES cpu/cpumanagement.cpp ) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES cpu/com.lingmo.CPUManagement.xml cpu/cpumanagement.h CPUManagement) -qt5_add_dbus_adaptor(DBUS_SOURCES +qt_add_dbus_adaptor(DBUS_SOURCES com.lingmo.PowerManager.xml application.h Application) qt_add_dbus_interface(DBUS_SOURCES org.freedesktop.ScreenSaver.xml screenlocker_interface) @@ -39,14 +39,14 @@ set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Quick - Qt5::DBus - Qt5::X11Extras - - KF5::IdleTime + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::Quick + Qt6::DBus + Qt6::X11Extras + + KF6::IdleTime ${XCB_LIBS} ${X11_LIBRARIES} ) From cf892f19e5d18009d0bd035ba2f5f28ac233ebc7 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:24:56 +0800 Subject: [PATCH 007/254] modified: notificationd/CMakeLists.txt --- notificationd/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notificationd/CMakeLists.txt b/notificationd/CMakeLists.txt index e0edf09..25ced55 100755 --- a/notificationd/CMakeLists.txt +++ b/notificationd/CMakeLists.txt @@ -17,7 +17,7 @@ set(SRCS main.cpp # for Ubuntu # qt_add_dbus_adaptor(SRCS org.freedesktop.Notifications.xml notificationserver.h NotificationServer) -qt5_add_dbus_adaptor(DBUS_SOURCES com.lingmo.Notification.xml application.h Application) +qt_add_dbus_adaptor(DBUS_SOURCES com.lingmo.Notification.xml application.h Application) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) find_package(KF6WindowSystem) From b6eae265d32c6184264e22d505a5bb03276dc167 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:29:18 +0800 Subject: [PATCH 008/254] modified: cpufreq/CMakeLists.txt modified: gmenuproxy/CMakeLists.txt modified: powerman/CMakeLists.txt modified: screen-brightness/CMakeLists.txt modified: sddm-helper/CMakeLists.txt --- cpufreq/CMakeLists.txt | 7 +++---- gmenuproxy/CMakeLists.txt | 11 +++++------ powerman/CMakeLists.txt | 1 - screen-brightness/CMakeLists.txt | 6 +++--- sddm-helper/CMakeLists.txt | 4 ++-- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/cpufreq/CMakeLists.txt b/cpufreq/CMakeLists.txt index 2fcf6e6..17e8e59 100755 --- a/cpufreq/CMakeLists.txt +++ b/cpufreq/CMakeLists.txt @@ -7,10 +7,9 @@ set(SOURCES add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES}) target_link_libraries(${TARGET} - Qt5::Core - Qt5::Quick - Qt5::DBus - Qt5::X11Extras + Qt6::Core + Qt6::Quick + Qt6::DBus ) configure_file( diff --git a/gmenuproxy/CMakeLists.txt b/gmenuproxy/CMakeLists.txt index 7676968..2b43b37 100755 --- a/gmenuproxy/CMakeLists.txt +++ b/gmenuproxy/CMakeLists.txt @@ -38,12 +38,11 @@ add_executable(lingmo-gmenuproxy ${GMENU_DBUSMENU_PROXY_SRCS}) set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(lingmo-gmenuproxy - Qt5::Core - Qt5::X11Extras - Qt5::DBus - Qt5::Widgets - KF5::CoreAddons - KF5::WindowSystem + Qt6::Core + Qt6::DBus + Qt6::Widgets + KF6::CoreAddons + KF6::WindowSystem XCB::XCB ${AppMenuGtkModule} ) diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index f8cf318..1e3a8a7 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -44,7 +44,6 @@ target_link_libraries(${TARGET} Qt6::Widgets Qt6::Quick Qt6::DBus - Qt6::X11Extras KF6::IdleTime ${XCB_LIBS} diff --git a/screen-brightness/CMakeLists.txt b/screen-brightness/CMakeLists.txt index b0ea86c..de2f873 100755 --- a/screen-brightness/CMakeLists.txt +++ b/screen-brightness/CMakeLists.txt @@ -12,9 +12,9 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - Qt5::Core - Qt5::Gui - Qt5::Widgets + Qt6::Core + Qt6::Gui + Qt6::Widgets ) configure_file( diff --git a/sddm-helper/CMakeLists.txt b/sddm-helper/CMakeLists.txt index 07c0d75..302e652 100755 --- a/sddm-helper/CMakeLists.txt +++ b/sddm-helper/CMakeLists.txt @@ -10,8 +10,8 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - Qt5::Core - Qt5::Gui + Qt6::Core + Qt6::Gui ) configure_file( From 154640d381478fe7cf6ac677f20b9c8975e7b597 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:36:30 +0800 Subject: [PATCH 009/254] modified: powerman/CMakeLists.txt --- powerman/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 1e3a8a7..583a9f8 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -4,7 +4,7 @@ set(TARGET lingmo-powerman) find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) -find_package(KF5IdleTime) +find_package(KIdleTime) find_package(X11) find_package(XCB REQUIRED COMPONENTS From b90a433de9fbb10970d3f4afdc89b68ed0aade10 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:46:01 +0800 Subject: [PATCH 010/254] modified: gmenuproxy/CMakeLists.txt modified: powerman/CMakeLists.txt --- gmenuproxy/CMakeLists.txt | 2 +- powerman/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/CMakeLists.txt b/gmenuproxy/CMakeLists.txt index 2b43b37..8169fcc 100755 --- a/gmenuproxy/CMakeLists.txt +++ b/gmenuproxy/CMakeLists.txt @@ -41,7 +41,7 @@ target_link_libraries(lingmo-gmenuproxy Qt6::Core Qt6::DBus Qt6::Widgets - KF6::CoreAddons + KF6::KCoreAddons KF6::WindowSystem XCB::XCB ${AppMenuGtkModule} diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 583a9f8..04c748d 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -45,7 +45,7 @@ target_link_libraries(${TARGET} Qt6::Quick Qt6::DBus - KF6::IdleTime + KF6::KIdleTime ${XCB_LIBS} ${X11_LIBRARIES} ) From 6ad98283f058944794e4e495621bd15b5b132108 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:53:35 +0800 Subject: [PATCH 011/254] modified: gmenuproxy/CMakeLists.txt modified: powerman/CMakeLists.txt --- gmenuproxy/CMakeLists.txt | 2 +- powerman/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/CMakeLists.txt b/gmenuproxy/CMakeLists.txt index 8169fcc..2b43b37 100755 --- a/gmenuproxy/CMakeLists.txt +++ b/gmenuproxy/CMakeLists.txt @@ -41,7 +41,7 @@ target_link_libraries(lingmo-gmenuproxy Qt6::Core Qt6::DBus Qt6::Widgets - KF6::KCoreAddons + KF6::CoreAddons KF6::WindowSystem XCB::XCB ${AppMenuGtkModule} diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 04c748d..583a9f8 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -45,7 +45,7 @@ target_link_libraries(${TARGET} Qt6::Quick Qt6::DBus - KF6::KIdleTime + KF6::IdleTime ${XCB_LIBS} ${X11_LIBRARIES} ) From 3f2d436374d5c88a2facc4ac5d3f6865603b91e7 Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:56:05 +0800 Subject: [PATCH 012/254] modified: gmenuproxy/CMakeLists.txt modified: powerman/CMakeLists.txt --- gmenuproxy/CMakeLists.txt | 4 ++-- powerman/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/CMakeLists.txt b/gmenuproxy/CMakeLists.txt index 2b43b37..115c8ba 100755 --- a/gmenuproxy/CMakeLists.txt +++ b/gmenuproxy/CMakeLists.txt @@ -3,8 +3,8 @@ list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(AppMenuGtkModule) -find_package(KF5WindowSystem) -find_package(KF5CoreAddons) +find_package(KF6WindowSystem) +find_package(KF6CoreAddons) set_package_properties(AppMenuGtkModule PROPERTIES TYPE RUNTIME) add_definitions(-DQT_NO_CAST_TO_ASCII diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 583a9f8..1b44703 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -4,7 +4,7 @@ set(TARGET lingmo-powerman) find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) -find_package(KIdleTime) +find_package(KF6IdleTime) find_package(X11) find_package(XCB REQUIRED COMPONENTS From 611d2603cee00133b464b0fb7666d7f56043b0cf Mon Sep 17 00:00:00 2001 From: Intro Date: Tue, 18 Jun 2024 23:59:24 +0800 Subject: [PATCH 013/254] modified: powerman/dimdisplayaction.cpp modified: session/processmanager.h --- powerman/dimdisplayaction.cpp | 1 - session/processmanager.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 6606cd5..df76396 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/session/processmanager.h b/session/processmanager.h index 1ad266b..5b451d6 100755 --- a/session/processmanager.h +++ b/session/processmanager.h @@ -50,7 +50,7 @@ class ProcessManager : public QObject, public QAbstractNativeEventFilter */ void loadAutoStartProcess(); - bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override; + bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); private: Application *m_app; From 15a41f5bbe7e11d5cad0c58d68aa752f01b20b70 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:41:00 +0800 Subject: [PATCH 014/254] modified: powerman/dimdisplayaction.cpp modified: session/processmanager.cpp modified: xembed-sni-proxy/xcbutils.h --- powerman/dimdisplayaction.cpp | 16 ++++++++++++---- session/processmanager.cpp | 1 - xembed-sni-proxy/xcbutils.h | 1 - 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index df76396..452f41a 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -34,11 +34,19 @@ DimDisplayAction::DimDisplayAction(QObject *parent) "/Brightness", "com.lingmo.Brightness", QDBusConnection::sessionBus()) { - if (QX11Info::isPlatformX11()) { - // Disable a default timeout, if any - xcb_dpms_set_timeouts(QX11Info::connection(), 0, 0, 0); + auto isPlatformX11 = qGuiApp->nativeInterface(); + if (isPlatformX11) { + auto *x11App = qApp->nativeInterface(); - XSetScreenSaver(QX11Info::display(), 0, 0, 0, 0); + // 获取Display类型的显示指针 + auto *displayID = x11App->display(); + + // 从Display转换为xcb_connection_t类型的连接 + auto *connection = XGetXCBConnection(displayID); + + xcb_dpms_set_timeouts(connection, 0, 0, 0); + + XSetScreenSaver(displayID, 0, 0, 0, 0); } } diff --git a/session/processmanager.cpp b/session/processmanager.cpp index f2364b7..09583aa 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index b3288ab..9fdbc95 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,6 @@ #include #include -#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From c7bbee72d60148b9c6593e53f5d6464f576bd6fc Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:46:19 +0800 Subject: [PATCH 015/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 09583aa..03632f5 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "daemon-helper.h" From de07c22b937239fd1644271a61c726bab438c364 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:47:00 +0800 Subject: [PATCH 016/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 03632f5..3f40fb6 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -19,7 +19,7 @@ #include #include -#include +// #include #include "daemon-helper.h" From 282a59f473b6d28505ca19e6586bb4d1b10cac49 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:52:53 +0800 Subject: [PATCH 017/254] modified: xembed-sni-proxy/fdoselectionmanager.h modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- xembed-sni-proxy/xcbutils.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 16695e2..750c438 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); private Q_SLOTS: void onClaimedOwnership(); diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 9fdbc95..9e7cc5d 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,6 +17,7 @@ #include #include +#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 @@ -38,7 +39,13 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = QX11Info::connection()) + auto *x11App = qApp->nativeInterface(); + // 获取Display类型的显示指针 + auto *displayID = x11App->display(); + // 从Display转换为xcb_connection_t类型的连接 + auto *connection = XGetXCBConnection(displayID); + + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = connection) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) @@ -101,7 +108,7 @@ class Atoms public: Atoms() : xembedAtom("_XEMBED") - , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QX11Info::appScreen())) + , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QNativeInterface::QX11Application::screen())) , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") , visualAtom("_NET_SYSTEM_TRAY_VISUAL") From bf57f1be25fb9b152d7674e8acd01ce5a4b8652b Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:54:48 +0800 Subject: [PATCH 018/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 - xembed-sni-proxy/xcbutils.h | 1 - 2 files changed, 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 495b880..4aae0ca 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,7 +11,6 @@ #include #include -#include #include diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 9e7cc5d..03ccc27 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,6 @@ #include #include -#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From af56cd44e86352745d64fddb6f8062f29ed88c73 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 00:57:24 +0800 Subject: [PATCH 019/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 03ccc27..ead2c32 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -38,13 +38,7 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - auto *x11App = qApp->nativeInterface(); - // 获取Display类型的显示指针 - auto *displayID = x11App->display(); - // 从Display转换为xcb_connection_t类型的连接 - auto *connection = XGetXCBConnection(displayID); - - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = connection) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From 86b31bd1112b824067bbc367fbe35e7f33ec66c2 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:03:48 +0800 Subject: [PATCH 020/254] modified: session/processmanager.h modified: xembed-sni-proxy/fdoselectionmanager.h modified: xembed-sni-proxy/xcbutils.h --- session/processmanager.h | 2 +- xembed-sni-proxy/fdoselectionmanager.h | 2 +- xembed-sni-proxy/xcbutils.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/session/processmanager.h b/session/processmanager.h index 5b451d6..1ad266b 100755 --- a/session/processmanager.h +++ b/session/processmanager.h @@ -50,7 +50,7 @@ class ProcessManager : public QObject, public QAbstractNativeEventFilter */ void loadAutoStartProcess(); - bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); + bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override; private: Application *m_app; diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 750c438..16695e2 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; private Q_SLOTS: void onClaimedOwnership(); diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index ead2c32..39aa301 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,6 +17,7 @@ #include #include +#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From 820f9fd518235a0e27b8190968288c6f686dca55 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:07:47 +0800 Subject: [PATCH 021/254] modified: powerman/dimdisplayaction.cpp --- powerman/dimdisplayaction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 452f41a..272017b 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include From 8a17020640bd3d76af1956223972267f92000db6 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:09:25 +0800 Subject: [PATCH 022/254] modified: session/processmanager.h modified: xembed-sni-proxy/fdoselectionmanager.h --- session/processmanager.h | 2 +- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/session/processmanager.h b/session/processmanager.h index 1ad266b..5b451d6 100755 --- a/session/processmanager.h +++ b/session/processmanager.h @@ -50,7 +50,7 @@ class ProcessManager : public QObject, public QAbstractNativeEventFilter */ void loadAutoStartProcess(); - bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override; + bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); private: Application *m_app; diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 16695e2..750c438 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); private Q_SLOTS: void onClaimedOwnership(); From 7801f00607e131bf59d753541c8662ff31819107 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:10:30 +0800 Subject: [PATCH 023/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 39aa301..ead2c32 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,6 @@ #include #include -#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From 5a2e81f547000fa0805a18e2694ea12db496f383 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:11:23 +0800 Subject: [PATCH 024/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index ead2c32..fcda3fb 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -16,6 +16,7 @@ #include #include +#include #include /** XEMBED messages */ From 357e83523756f933099b9c200a9e48dac7ededb8 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:12:43 +0800 Subject: [PATCH 025/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index fcda3fb..3301e85 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -39,7 +39,15 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) + auto *x11App = qApp->nativeInterface(); + + // 获取Display类型的显示指针 + auto *displayID = x11App->display(); + + // 从Display转换为xcb_connection_t类型的连接 + auto *connection = XGetXCBConnection(displayID); + + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = QX11Info::connection()) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From 3901a8db55fe0d11ff3be70471ff69d0e6aefa8f Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:16:14 +0800 Subject: [PATCH 026/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 3301e85..3f89bc8 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -16,7 +16,6 @@ #include #include -#include #include /** XEMBED messages */ @@ -39,15 +38,7 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - auto *x11App = qApp->nativeInterface(); - - // 获取Display类型的显示指针 - auto *displayID = x11App->display(); - - // 从Display转换为xcb_connection_t类型的连接 - auto *connection = XGetXCBConnection(displayID); - - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = QX11Info::connection()) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = QNativeInterface::QX11Application::connection()) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From a29c2062c229f083ec68482443e8a8b4400b3dd4 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:23:15 +0800 Subject: [PATCH 027/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 3f89bc8..946ace7 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -16,6 +16,7 @@ #include #include +#include #include /** XEMBED messages */ From 663eb92eb9547034f71e5092438a2aec5f4f7efe Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:35:18 +0800 Subject: [PATCH 028/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 946ace7..9f583c6 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -39,7 +39,7 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = QNativeInterface::QX11Application::connection()) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display());) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From 54d448dd7604fcc7cd96f2d5005cb20cb2264cbb Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:35:59 +0800 Subject: [PATCH 029/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 9f583c6..fcda3fb 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -39,7 +39,7 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display());) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From 1937d2e2fb6b7442c2d7131cf99e382ac585deb7 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:37:39 +0800 Subject: [PATCH 030/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index fcda3fb..b449bf4 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include From c620ed1d79779b394f3c64bc8baf21a2653c4b4a Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:43:55 +0800 Subject: [PATCH 031/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index b449bf4..e3d66e4 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -103,7 +103,7 @@ class Atoms public: Atoms() : xembedAtom("_XEMBED") - , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QNativeInterface::QX11Application::screen())) + , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QNativeInterface::QX11Application::display())) , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") , visualAtom("_NET_SYSTEM_TRAY_VISUAL") From 1c6168d4b4c45d3c68ea4e9dc5e484a44e0eca64 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 01:52:00 +0800 Subject: [PATCH 032/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index e3d66e4..b42bb76 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,8 @@ #include #include -#include +#include +#include #include /** XEMBED messages */ @@ -102,12 +103,23 @@ class Atoms { public: Atoms() - : xembedAtom("_XEMBED") - , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QNativeInterface::QX11Application::display())) - , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") - , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") - , visualAtom("_NET_SYSTEM_TRAY_VISUAL") { + xcb_connection_t *connection = QNativeInterface::QX11Application::connection(); + + xembedAtom = internAtom(connection, "_XEMBED"); + selectionAtom = internAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(QApplication::primaryScreen()->geometry().x())); + opcodeAtom = internAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); + messageData = internAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); + visualAtom = internAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); + } + + Atom internAtom(xcb_connection_t *connection, const std::string &atomName) + { + xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.length(), atomName.c_str()); + xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, nullptr); + Atom atom = reply ? reply->atom : XCB_ATOM_NONE; + free(reply); + return atom; } Atom xembedAtom; @@ -119,4 +131,4 @@ class Atoms extern Atoms *atoms; -} // namespace Xcb +}// namespace Xcb From 499eb873a6a7b6ac5961bd91ca817eb6c215278d Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:02:48 +0800 Subject: [PATCH 033/254] modified: gmenuproxy/actions.h modified: xembed-sni-proxy/xcbutils.h --- gmenuproxy/actions.h | 2 +- xembed-sni-proxy/xcbutils.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gmenuproxy/actions.h b/gmenuproxy/actions.h index a0de1c4..6f4e02c 100755 --- a/gmenuproxy/actions.h +++ b/gmenuproxy/actions.h @@ -11,7 +11,7 @@ #include "gdbusmenutypes_p.h" -class QStringList; +// class QStringList; class Actions : public QObject { diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index b42bb76..a4182f5 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,6 @@ #include #include -#include #include #include From b6582d4e2591a29ce962bafa96e328339cdce138 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:04:57 +0800 Subject: [PATCH 034/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index a4182f5..3f83201 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,6 @@ #include #include -#include #include /** XEMBED messages */ From 6beea8202850c3e7ce832d671eaf76e6ba509108 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:16:02 +0800 Subject: [PATCH 035/254] modified: CMakeLists.txt modified: xembed-sni-proxy/CMakeLists.txt modified: xembed-sni-proxy/xcbutils.h --- CMakeLists.txt | 2 +- xembed-sni-proxy/CMakeLists.txt | 1 + xembed-sni-proxy/xcbutils.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d82ff22..5768bae 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(QT Core Gui Widgets Quick QuickControls2 DBus Xml LinguistTools) -find_package(Qt6 REQUIRED ${QT}) +find_package(Qt6 COMPONENTS ${QT} REQUIRED ) # find_package(LingmoUI REQUIRED) find_package(PkgConfig REQUIRED) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index d3c124c..12e8cf1 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -73,6 +73,7 @@ add_executable(lingmo-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES} set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(lingmo-xembedsniproxy Qt6::Core + Qt6::Gui Qt6::DBus KF6::WindowSystem ${XCB_LIBS} diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 3f83201..a4182f5 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,6 +17,7 @@ #include #include +#include #include /** XEMBED messages */ From e96ab89851cde5adc50188742c713008d8943ecd Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:26:21 +0800 Subject: [PATCH 036/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index a4182f5..f1cf463 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include /** XEMBED messages */ From 7c5bb1cb78959a777945e59ded05d041d2b09ea9 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:28:08 +0800 Subject: [PATCH 037/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index f1cf463..15d3372 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -102,23 +102,12 @@ class Atoms { public: Atoms() + : xembedAtom("_XEMBED") + , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QX11Info::appScreen())) + , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") + , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") + , visualAtom("_NET_SYSTEM_TRAY_VISUAL") { - xcb_connection_t *connection = QNativeInterface::QX11Application::connection(); - - xembedAtom = internAtom(connection, "_XEMBED"); - selectionAtom = internAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(QApplication::primaryScreen()->geometry().x())); - opcodeAtom = internAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); - messageData = internAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); - visualAtom = internAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); - } - - Atom internAtom(xcb_connection_t *connection, const std::string &atomName) - { - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.length(), atomName.c_str()); - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, nullptr); - Atom atom = reply ? reply->atom : XCB_ATOM_NONE; - free(reply); - return atom; } Atom xembedAtom; @@ -128,6 +117,4 @@ class Atoms Atom visualAtom; }; -extern Atoms *atoms; - }// namespace Xcb From 43e18e2cbd50b3934e9f5df951672520563da987 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:30:08 +0800 Subject: [PATCH 038/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 15d3372..8cdbdcb 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -98,23 +98,28 @@ class Atom QByteArray m_name; }; -class Atoms -{ +class Atoms { public: Atoms() : xembedAtom("_XEMBED") - , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QX11Info::appScreen())) + , selectionAtom("_NET_SYSTEM_TRAY_S" + QByteArray::number(screenIndex)) , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") , visualAtom("_NET_SYSTEM_TRAY_VISUAL") { + if (QGuiApplication::platformName() == QLatin1String("xcb")) { + void* display = QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("display"); + // ... 使用display和screenIndex ... + } } - Atom xembedAtom; - Atom selectionAtom; - Atom opcodeAtom; - Atom messageData; - Atom visualAtom; +private: + QByteArray xembedAtom; + QByteArray selectionAtom; + QByteArray opcodeAtom; + QByteArray messageData; + QByteArray visualAtom; + int screenIndex = QGuiApplication::primaryScreen()->virtualSiblings().indexOf(QGuiApplication::primaryScreen()); }; }// namespace Xcb From e26404cb28a97bcc0e7a2f2dc3825864123c8f12 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:34:27 +0800 Subject: [PATCH 039/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 51 ++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 8cdbdcb..81b7d7b 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -98,28 +98,45 @@ class Atom QByteArray m_name; }; -class Atoms { +class Atoms +{ public: Atoms() - : xembedAtom("_XEMBED") - , selectionAtom("_NET_SYSTEM_TRAY_S" + QByteArray::number(screenIndex)) - , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") - , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") - , visualAtom("_NET_SYSTEM_TRAY_VISUAL") { - if (QGuiApplication::platformName() == QLatin1String("xcb")) { - void* display = QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("display"); - // ... 使用display和screenIndex ... - } + xcb_connection_t *connection = QX11Info::connection(); + + xembedAtom = getAtom(connection, "_XEMBED"); + selectionAtom = getAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(defaultScreen())); + opcodeAtom = getAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); + messageData = getAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); + visualAtom = getAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); } + xcb_atom_t xembedAtom; + xcb_atom_t selectionAtom; + xcb_atom_t opcodeAtom; + xcb_atom_t messageData; + xcb_atom_t visualAtom; + private: - QByteArray xembedAtom; - QByteArray selectionAtom; - QByteArray opcodeAtom; - QByteArray messageData; - QByteArray visualAtom; - int screenIndex = QGuiApplication::primaryScreen()->virtualSiblings().indexOf(QGuiApplication::primaryScreen()); + int defaultScreen() const + { + QScreen *screen = QGuiApplication::primaryScreen(); + return screen ? screen->virtualSiblings().indexOf(screen) : 0; + } + + xcb_atom_t getAtom(xcb_connection_t *connection, const std::string &atomName) + { + xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.size(), atomName.c_str()); + xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, nullptr); + + xcb_atom_t atom = reply ? reply->atom : XCB_ATOM_NONE; + free(reply); + + return atom; + } }; -}// namespace Xcb +extern xcb_atom_t *atoms; + +} // namespace Xcb From fbfe75ba69d5ead572a68aaaf7fdcf53f70ac4d1 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:37:14 +0800 Subject: [PATCH 040/254] modified: cupdatecursor/CMakeLists.txt --- cupdatecursor/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cupdatecursor/CMakeLists.txt b/cupdatecursor/CMakeLists.txt index d88080d..075b08a 100755 --- a/cupdatecursor/CMakeLists.txt +++ b/cupdatecursor/CMakeLists.txt @@ -1,13 +1,13 @@ -find_package(Qt5 COMPONENTS Core Gui X11Extras REQUIRED) +find_package(Qt6 COMPONENTS Core Gui REQUIRED) find_package(X11) add_executable(cupdatecursor main.cpp ) target_link_libraries(cupdatecursor - Qt5::Core - Qt5::Gui - Qt5::X11Extras + Qt6::Core + Qt6::Gui + Qt6::X11Extras ${X11_LIBRARIES} X11::X11 X11::Xi From ca6dae4a556ea0c896f86ecf9c50eff1fae13200 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:39:31 +0800 Subject: [PATCH 041/254] modified: cupdatecursor/CMakeLists.txt --- cupdatecursor/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/cupdatecursor/CMakeLists.txt b/cupdatecursor/CMakeLists.txt index 075b08a..45e0555 100755 --- a/cupdatecursor/CMakeLists.txt +++ b/cupdatecursor/CMakeLists.txt @@ -7,7 +7,6 @@ add_executable(cupdatecursor target_link_libraries(cupdatecursor Qt6::Core Qt6::Gui - Qt6::X11Extras ${X11_LIBRARIES} X11::X11 X11::Xi From 281f0189e3670ca637a7831acbc1256ac55cfe86 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:41:56 +0800 Subject: [PATCH 042/254] modified: cupdatecursor/main.cpp modified: xembed-sni-proxy/xcbutils.h --- cupdatecursor/main.cpp | 1 - xembed-sni-proxy/xcbutils.h | 47 +++++++++++++++---------------------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/cupdatecursor/main.cpp b/cupdatecursor/main.cpp index 2c5b44f..c49ef8a 100755 --- a/cupdatecursor/main.cpp +++ b/cupdatecursor/main.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 81b7d7b..a4182f5 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include /** XEMBED messages */ @@ -103,40 +103,31 @@ class Atoms public: Atoms() { - xcb_connection_t *connection = QX11Info::connection(); - - xembedAtom = getAtom(connection, "_XEMBED"); - selectionAtom = getAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(defaultScreen())); - opcodeAtom = getAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); - messageData = getAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); - visualAtom = getAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); + xcb_connection_t *connection = QNativeInterface::QX11Application::connection(); + + xembedAtom = internAtom(connection, "_XEMBED"); + selectionAtom = internAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(QApplication::primaryScreen()->geometry().x())); + opcodeAtom = internAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); + messageData = internAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); + visualAtom = internAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); } - xcb_atom_t xembedAtom; - xcb_atom_t selectionAtom; - xcb_atom_t opcodeAtom; - xcb_atom_t messageData; - xcb_atom_t visualAtom; - -private: - int defaultScreen() const + Atom internAtom(xcb_connection_t *connection, const std::string &atomName) { - QScreen *screen = QGuiApplication::primaryScreen(); - return screen ? screen->virtualSiblings().indexOf(screen) : 0; - } - - xcb_atom_t getAtom(xcb_connection_t *connection, const std::string &atomName) - { - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.size(), atomName.c_str()); + xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.length(), atomName.c_str()); xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, nullptr); - - xcb_atom_t atom = reply ? reply->atom : XCB_ATOM_NONE; + Atom atom = reply ? reply->atom : XCB_ATOM_NONE; free(reply); - return atom; } + + Atom xembedAtom; + Atom selectionAtom; + Atom opcodeAtom; + Atom messageData; + Atom visualAtom; }; -extern xcb_atom_t *atoms; +extern Atoms *atoms; -} // namespace Xcb +}// namespace Xcb From fe452cf57a2e9cdf7671b5d0a432b9aeb7370611 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:42:32 +0800 Subject: [PATCH 043/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index a4182f5..f1cf463 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include /** XEMBED messages */ From 1ef8cbf7855227ac9633b23b5523107b052f95fd Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:50:11 +0800 Subject: [PATCH 044/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index f1cf463..323b8a4 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -40,10 +40,10 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) - : m_connection(c) + explicit Atom(const QByteArray &name, bool onlyIfExists = false) + : m_connection(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("xcb_connection")) , m_retrieved(false) - , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) + , m_cookie(xcb_intern_atom_unchecked(static_cast(m_connection), onlyIfExists, name.length(), name.constData())) , m_atom(XCB_ATOM_NONE) , m_name(name) { @@ -102,23 +102,12 @@ class Atoms { public: Atoms() + : xembedAtom("_XEMBED") + , selectionAtom(xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", QGuiApplication::primaryScreen()->name().toInt())) + , opcodeAtom("_NET_SYSTEM_TRAY_OPCODE") + , messageData("_NET_SYSTEM_TRAY_MESSAGE_DATA") + , visualAtom("_NET_SYSTEM_TRAY_VISUAL") { - xcb_connection_t *connection = QNativeInterface::QX11Application::connection(); - - xembedAtom = internAtom(connection, "_XEMBED"); - selectionAtom = internAtom(connection, "_NET_SYSTEM_TRAY_S" + std::to_string(QApplication::primaryScreen()->geometry().x())); - opcodeAtom = internAtom(connection, "_NET_SYSTEM_TRAY_OPCODE"); - messageData = internAtom(connection, "_NET_SYSTEM_TRAY_MESSAGE_DATA"); - visualAtom = internAtom(connection, "_NET_SYSTEM_TRAY_VISUAL"); - } - - Atom internAtom(xcb_connection_t *connection, const std::string &atomName) - { - xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, 0, atomName.length(), atomName.c_str()); - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, nullptr); - Atom atom = reply ? reply->atom : XCB_ATOM_NONE; - free(reply); - return atom; } Atom xembedAtom; From 0281875c40318ec89884030af3e0f037b295f740 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:50:56 +0800 Subject: [PATCH 045/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 323b8a4..6c98d64 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -40,10 +40,10 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false) - : m_connection(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("xcb_connection")) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) + : m_connection(c) , m_retrieved(false) - , m_cookie(xcb_intern_atom_unchecked(static_cast(m_connection), onlyIfExists, name.length(), name.constData())) + , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) , m_atom(XCB_ATOM_NONE) , m_name(name) { From 2a059b0a02a98bb870fbca60eeccd805384da112 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:53:21 +0800 Subject: [PATCH 046/254] modified: xembed-sni-proxy/sniproxy.cpp modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/sniproxy.cpp | 1 - xembed-sni-proxy/xcbutils.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index 6faeb8e..d24e467 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 6c98d64..7c7feff 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -19,6 +19,7 @@ #include #include #include +#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From 9f59197d16cc76e70df23440d0c3f314c2522e16 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:55:28 +0800 Subject: [PATCH 047/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 750c438..16695e2 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; private Q_SLOTS: void onClaimedOwnership(); From 653f9842035c13230144be1bfddcecd51f30c9c2 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 02:56:09 +0800 Subject: [PATCH 048/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 16695e2..750c438 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); private Q_SLOTS: void onClaimedOwnership(); From 416d3a0f903297461ed578b36bd820dac98e0482 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:07:38 +0800 Subject: [PATCH 049/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 750c438..6225b2a 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); + bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; private Q_SLOTS: void onClaimedOwnership(); From e0b79e16d4b694276188ebd39bfcbc25ab5bf4b8 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:08:28 +0800 Subject: [PATCH 050/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 6225b2a..1a2a090 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result); private Q_SLOTS: void onClaimedOwnership(); From fb508e8fe94b66bff442cdf78d2c5359f746fd6b Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:10:43 +0800 Subject: [PATCH 051/254] modified: cupdatecursor/main.cpp --- cupdatecursor/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cupdatecursor/main.cpp b/cupdatecursor/main.cpp index c49ef8a..e298129 100755 --- a/cupdatecursor/main.cpp +++ b/cupdatecursor/main.cpp @@ -9,7 +9,10 @@ inline void applyTheme(const QString &theme, int size) { - Display *display = QX11Info::display(); + + auto *x11App = qApp->nativeInterface(); + auto *display = x11App->display(); + if (!theme.isEmpty()) XcursorSetTheme(display, QFile::encodeName(theme)); From fa4c2848f7d7a2e7c3a672a680592269938b3b43 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:13:49 +0800 Subject: [PATCH 052/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 2 +- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 4aae0ca..a7e0c65 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -99,7 +99,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) return true; } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override { Q_UNUSED(result) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 1a2a090..6225b2a 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result); + bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; private Q_SLOTS: void onClaimedOwnership(); From eee5345f253481ad2c6435ab15fbe42884f44ee5 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:21:56 +0800 Subject: [PATCH 053/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 2 +- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index a7e0c65..705a363 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -99,7 +99,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) return true; } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(result) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 6225b2a..16695e2 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; private Q_SLOTS: void onClaimedOwnership(); From 026de0d58e0e3970d02faad69718bb632a241aff Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:22:58 +0800 Subject: [PATCH 054/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 16695e2..750c438 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); private Q_SLOTS: void onClaimedOwnership(); From 375aeaf0a4eca279f9240bc253488c5c9e165dce Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:30:49 +0800 Subject: [PATCH 055/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 240 ++--------------------- xembed-sni-proxy/fdoselectionmanager.h | 46 +---- 2 files changed, 25 insertions(+), 261 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 705a363..db1ebb5 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -1,234 +1,26 @@ -/* - Registers as a embed container - SPDX-FileCopyrightText: 2015 David Edmundson - SPDX-FileCopyrightText: 2019 Konrad Materka - - SPDX-License-Identifier: LGPL-2.1-or-later -*/ #include "fdoselectionmanager.h" +#include -#include "debug.h" - -#include -#include - -#include - -#include -#include -#include -#include - -#include "sniproxy.h" -#include "xcbutils.h" - -#define SYSTEM_TRAY_REQUEST_DOCK 0 -#define SYSTEM_TRAY_BEGIN_MESSAGE 1 -#define SYSTEM_TRAY_CANCEL_MESSAGE 2 - -FdoSelectionManager::FdoSelectionManager() - : QObject() - , m_selectionOwner(new KSelectionOwner(Xcb::atoms->selectionAtom, -1, this)) -{ - qCDebug(SNIPROXY) << "starting"; - - // we may end up calling QCoreApplication::quit() in this method, at which point we need the event loop running - QTimer::singleShot(0, this, &FdoSelectionManager::init); -} - -FdoSelectionManager::~FdoSelectionManager() -{ - qCDebug(SNIPROXY) << "closing"; - m_selectionOwner->release(); -} - -void FdoSelectionManager::init() -{ - // load damage extension - xcb_connection_t *c = QX11Info::connection(); - xcb_prefetch_extension_data(c, &xcb_damage_id); - const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); - if (reply && reply->present) { - m_damageEventBase = reply->first_event; - xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); - } else { - // no XDamage means - qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; - qApp->exit(-1); - } - - qApp->installNativeEventFilter(this); - - connect(m_selectionOwner, &KSelectionOwner::claimedOwnership, this, &FdoSelectionManager::onClaimedOwnership); - connect(m_selectionOwner, &KSelectionOwner::failedToClaimOwnership, this, &FdoSelectionManager::onFailedToClaimOwnership); - connect(m_selectionOwner, &KSelectionOwner::lostOwnership, this, &FdoSelectionManager::onLostOwnership); - m_selectionOwner->claim(false); -} - -bool FdoSelectionManager::addDamageWatch(xcb_window_t client) +FdoSelectionManager::FdoSelectionManager(QObject *parent) + : QObject(parent) + , m_trayIcon(new QSystemTrayIcon(this)) { - qCDebug(SNIPROXY) << "adding damage watch for " << client; + // 设置系统托盘图标 + m_trayIcon->setIcon(QIcon(":/icons/tray_icon.png")); - xcb_connection_t *c = QX11Info::connection(); - const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); + // 创建上下文菜单 + QMenu *trayIconMenu = new QMenu; + QAction *quitAction = trayIconMenu->addAction("退出"); + connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); - const auto damageId = xcb_generate_id(c); - m_damageWatches[client] = damageId; - xcb_damage_create(c, damageId, client, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); + m_trayIcon->setContextMenu(trayIconMenu); - xcb_generic_error_t *error = nullptr; - QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, &error)); - QScopedPointer getAttrError(error); - uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; - if (!attr.isNull()) { - events = events | attr->your_event_mask; - } - // if window is already gone, there is no need to handle it. - if (getAttrError && getAttrError->error_code == XCB_WINDOW) { - return false; - } - // the event mask will not be removed again. We cannot track whether another component also needs STRUCTURE_NOTIFY (e.g. KWindowSystem). - // if we would remove the event mask again, other areas will break. - const auto changeAttrCookie = xcb_change_window_attributes_checked(c, client, XCB_CW_EVENT_MASK, &events); - QScopedPointer changeAttrError(xcb_request_check(c, changeAttrCookie)); - // if window is gone by this point, it will be caught by eventFilter, so no need to check later errors. - if (changeAttrError && changeAttrError->error_code == XCB_WINDOW) { - return false; - } - - return true; + // 显示系统托盘图标 + m_trayIcon->show(); } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long *result) -{ - Q_UNUSED(result) - - if (eventType != "xcb_generic_event_t") { - return false; - } - - xcb_generic_event_t *ev = static_cast(message); - - const auto responseType = XCB_EVENT_RESPONSE_TYPE(ev); - if (responseType == XCB_CLIENT_MESSAGE) { - const auto ce = reinterpret_cast(ev); - if (ce->type == Xcb::atoms->opcodeAtom) { - switch (ce->data.data32[1]) { - case SYSTEM_TRAY_REQUEST_DOCK: - dock(ce->data.data32[2]); - return true; - } - } - } else if (responseType == XCB_UNMAP_NOTIFY) { - const auto unmappedWId = reinterpret_cast(ev)->window; - if (m_proxies.contains(unmappedWId)) { - undock(unmappedWId); - } - } else if (responseType == XCB_DESTROY_NOTIFY) { - const auto destroyedWId = reinterpret_cast(ev)->window; - if (m_proxies.contains(destroyedWId)) { - undock(destroyedWId); - } - } else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { - const auto damagedWId = reinterpret_cast(ev)->drawable; - const auto sniProxy = m_proxies.value(damagedWId); - if (sniProxy) { - sniProxy->update(); - xcb_damage_subtract(QX11Info::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); - } - } else if (responseType == XCB_CONFIGURE_REQUEST) { - const auto event = reinterpret_cast(ev); - const auto sniProxy = m_proxies.value(event->window); - if (sniProxy) { - // The embedded window tries to move or resize. Ignore move, handle resize only. - if ((event->value_mask & XCB_CONFIG_WINDOW_WIDTH) || (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT)) { - sniProxy->resizeWindow(event->width, event->height); - } - } - } else if (responseType == XCB_VISIBILITY_NOTIFY) { - const auto event = reinterpret_cast(ev); - // it's possible that something showed our container window, we have to hide it - // workaround for BUG 357443: when KWin is restarted, container window is shown on top - if (event->state == XCB_VISIBILITY_UNOBSCURED) { - for (auto sniProxy : m_proxies.values()) { - sniProxy->hideContainerWindow(event->window); - } - } - } - - return false; -} - -void FdoSelectionManager::dock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to dock window " << winId; - - if (m_proxies.contains(winId)) { - return; - } - - if (addDamageWatch(winId)) { - m_proxies[winId] = new SNIProxy(winId, this); - } -} - -void FdoSelectionManager::undock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to undock window " << winId; - - if (!m_proxies.contains(winId)) { - return; - } - m_proxies[winId]->deleteLater(); - m_proxies.remove(winId); -} - -void FdoSelectionManager::onClaimedOwnership() -{ - qCDebug(SNIPROXY) << "Manager selection claimed"; - - setSystemTrayVisual(); -} - -void FdoSelectionManager::onFailedToClaimOwnership() -{ - qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; - qApp->exit(-1); -} - -void FdoSelectionManager::onLostOwnership() -{ - qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; - qApp->exit(-1); -} - -void FdoSelectionManager::setSystemTrayVisual() +FdoSelectionManager::~FdoSelectionManager() { - xcb_connection_t *c = QX11Info::connection(); - auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; - auto trayVisual = screen->root_visual; - xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); - xcb_depth_t *depth = nullptr; - - while (depth_iterator.rem) { - if (depth_iterator.data->depth == 32) { - depth = depth_iterator.data; - break; - } - xcb_depth_next(&depth_iterator); - } - - if (depth) { - xcb_visualtype_iterator_t visualtype_iterator = xcb_depth_visuals_iterator(depth); - while (visualtype_iterator.rem) { - xcb_visualtype_t *visualtype = visualtype_iterator.data; - if (visualtype->_class == XCB_VISUAL_CLASS_TRUE_COLOR) { - trayVisual = visualtype->visual_id; - break; - } - xcb_visualtype_next(&visualtype_iterator); - } - } - - xcb_change_property(c, XCB_PROP_MODE_REPLACE, m_selectionOwner->ownerWindow(), Xcb::atoms->visualAtom, XCB_ATOM_VISUALID, 32, 1, &trayVisual); + // 清理资源 + m_trayIcon->hide(); } diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 750c438..563af04 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -1,47 +1,19 @@ -/* - Registers as a embed container - SPDX-FileCopyrightText: 2015 David Edmundson +#ifndef FDOSELECTIONMANAGER_H +#define FDOSELECTIONMANAGER_H - SPDX-License-Identifier: LGPL-2.1-or-later -*/ - -#pragma once - -#include -#include #include +#include -#include - -class KSelectionOwner; -class SNIProxy; - -class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter +class FdoSelectionManager : public QObject { Q_OBJECT public: - FdoSelectionManager(); - ~FdoSelectionManager() override; - -protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); - -private Q_SLOTS: - void onClaimedOwnership(); - void onFailedToClaimOwnership(); - void onLostOwnership(); + explicit FdoSelectionManager(QObject *parent = nullptr); + ~FdoSelectionManager(); private: - void init(); - bool addDamageWatch(xcb_window_t client); - void dock(xcb_window_t embed_win); - void undock(xcb_window_t client); - void setSystemTrayVisual(); - - uint8_t m_damageEventBase; - - QHash m_damageWatches; - QHash m_proxies; - KSelectionOwner *m_selectionOwner; + QSystemTrayIcon *m_trayIcon; }; + +#endif // FDOSELECTIONMANAGER_H From f18026cadd8653476da41a7f9343dae7c25b70d2 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:35:21 +0800 Subject: [PATCH 056/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 239 +++++++++++++++++++++-- xembed-sni-proxy/fdoselectionmanager.h | 27 ++- 2 files changed, 252 insertions(+), 14 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index db1ebb5..2e08d22 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -1,26 +1,241 @@ +/* + Registers as a embed container + SPDX-FileCopyrightText: 2015 David Edmundson + SPDX-FileCopyrightText: 2019 Konrad Materka + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ #include "fdoselectionmanager.h" -#include + +#include "debug.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "sniproxy.h" +#include "xcbutils.h" + +#define SYSTEM_TRAY_REQUEST_DOCK 0 +#define SYSTEM_TRAY_BEGIN_MESSAGE 1 +#define SYSTEM_TRAY_CANCEL_MESSAGE 2 FdoSelectionManager::FdoSelectionManager(QObject *parent) : QObject(parent) , m_trayIcon(new QSystemTrayIcon(this)) + , m_selectionOwner(new KSelectionOwner(Xcb::atoms->selectionAtom, -1, this)) { - // 设置系统托盘图标 + // 初始化系统托盘图标 m_trayIcon->setIcon(QIcon(":/icons/tray_icon.png")); + m_trayIcon->show(); - // 创建上下文菜单 - QMenu *trayIconMenu = new QMenu; - QAction *quitAction = trayIconMenu->addAction("退出"); - connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); + // 其他初始化代码... + init(); +} - m_trayIcon->setContextMenu(trayIconMenu); +FdoSelectionManager::~FdoSelectionManager() +{ + qCDebug(SNIPROXY) << "closing"; + m_selectionOwner->release(); +} - // 显示系统托盘图标 - m_trayIcon->show(); +void FdoSelectionManager::init() +{ + // load damage extension + xcb_connection_t *c = QX11Info::connection(); + xcb_prefetch_extension_data(c, &xcb_damage_id); + const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); + if (reply && reply->present) { + m_damageEventBase = reply->first_event; + xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); + } else { + // no XDamage means + qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; + qApp->exit(-1); + } + + qApp->installNativeEventFilter(this); + + connect(m_selectionOwner, &KSelectionOwner::claimedOwnership, this, &FdoSelectionManager::onClaimedOwnership); + connect(m_selectionOwner, &KSelectionOwner::failedToClaimOwnership, this, &FdoSelectionManager::onFailedToClaimOwnership); + connect(m_selectionOwner, &KSelectionOwner::lostOwnership, this, &FdoSelectionManager::onLostOwnership); + m_selectionOwner->claim(false); } -FdoSelectionManager::~FdoSelectionManager() +bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { - // 清理资源 - m_trayIcon->hide(); + qCDebug(SNIPROXY) << "adding damage watch for " << client; + + xcb_connection_t *c = QX11Info::connection(); + const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); + + const auto damageId = xcb_generate_id(c); + m_damageWatches[client] = damageId; + xcb_damage_create(c, damageId, client, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); + + xcb_generic_error_t *error = nullptr; + QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, &error)); + QScopedPointer getAttrError(error); + uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; + if (!attr.isNull()) { + events = events | attr->your_event_mask; + } + // if window is already gone, there is no need to handle it. + if (getAttrError && getAttrError->error_code == XCB_WINDOW) { + return false; + } + // the event mask will not be removed again. We cannot track whether another component also needs STRUCTURE_NOTIFY (e.g. KWindowSystem). + // if we would remove the event mask again, other areas will break. + const auto changeAttrCookie = xcb_change_window_attributes_checked(c, client, XCB_CW_EVENT_MASK, &events); + QScopedPointer changeAttrError(xcb_request_check(c, changeAttrCookie)); + // if window is gone by this point, it will be caught by eventFilter, so no need to check later errors. + if (changeAttrError && changeAttrError->error_code == XCB_WINDOW) { + return false; + } + + return true; +} + +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) +{ + Q_UNUSED(result) + + if (eventType != "xcb_generic_event_t") { + return false; + } + + xcb_generic_event_t *ev = static_cast(message); + + const auto responseType = XCB_EVENT_RESPONSE_TYPE(ev); + if (responseType == XCB_CLIENT_MESSAGE) { + const auto ce = reinterpret_cast(ev); + if (ce->type == Xcb::atoms->opcodeAtom) { + switch (ce->data.data32[1]) { + case SYSTEM_TRAY_REQUEST_DOCK: + dock(ce->data.data32[2]); + return true; + } + } + } else if (responseType == XCB_UNMAP_NOTIFY) { + const auto unmappedWId = reinterpret_cast(ev)->window; + if (m_proxies.contains(unmappedWId)) { + undock(unmappedWId); + } + } else if (responseType == XCB_DESTROY_NOTIFY) { + const auto destroyedWId = reinterpret_cast(ev)->window; + if (m_proxies.contains(destroyedWId)) { + undock(destroyedWId); + } + } else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { + const auto damagedWId = reinterpret_cast(ev)->drawable; + const auto sniProxy = m_proxies.value(damagedWId); + if (sniProxy) { + sniProxy->update(); + xcb_damage_subtract(QX11Info::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); + } + } else if (responseType == XCB_CONFIGURE_REQUEST) { + const auto event = reinterpret_cast(ev); + const auto sniProxy = m_proxies.value(event->window); + if (sniProxy) { + // The embedded window tries to move or resize. Ignore move, handle resize only. + if ((event->value_mask & XCB_CONFIG_WINDOW_WIDTH) || (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT)) { + sniProxy->resizeWindow(event->width, event->height); + } + } + } else if (responseType == XCB_VISIBILITY_NOTIFY) { + const auto event = reinterpret_cast(ev); + // it's possible that something showed our container window, we have to hide it + // workaround for BUG 357443: when KWin is restarted, container window is shown on top + if (event->state == XCB_VISIBILITY_UNOBSCURED) { + for (auto sniProxy : m_proxies.values()) { + sniProxy->hideContainerWindow(event->window); + } + } + } + + return false; +} + +void FdoSelectionManager::dock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to dock window " << winId; + + if (m_proxies.contains(winId)) { + return; + } + + if (addDamageWatch(winId)) { + m_proxies[winId] = new SNIProxy(winId, this); + } +} + +void FdoSelectionManager::undock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to undock window " << winId; + + if (!m_proxies.contains(winId)) { + return; + } + m_proxies[winId]->deleteLater(); + m_proxies.remove(winId); +} + +void FdoSelectionManager::onClaimedOwnership() +{ + qCDebug(SNIPROXY) << "Manager selection claimed"; + + setSystemTrayVisual(); +} + +void FdoSelectionManager::onFailedToClaimOwnership() +{ + qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; + qApp->exit(-1); +} + +void FdoSelectionManager::onLostOwnership() +{ + qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; + qApp->exit(-1); +} + +void FdoSelectionManager::setSystemTrayVisual() +{ + xcb_connection_t *c = QX11Info::connection(); + auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; + auto trayVisual = screen->root_visual; + xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); + xcb_depth_t *depth = nullptr; + + while (depth_iterator.rem) { + if (depth_iterator.data->depth == 32) { + depth = depth_iterator.data; + break; + } + xcb_depth_next(&depth_iterator); + } + + if (depth) { + xcb_visualtype_iterator_t visualtype_iterator = xcb_depth_visuals_iterator(depth); + while (visualtype_iterator.rem) { + xcb_visualtype_t *visualtype = visualtype_iterator.data; + if (visualtype->_class == XCB_VISUAL_CLASS_TRUE_COLOR) { + trayVisual = visualtype->visual_id; + break; + } + xcb_visualtype_next(&visualtype_iterator); + } + } + + xcb_change_property(c, XCB_PROP_MODE_REPLACE, m_selectionOwner->ownerWindow(), Xcb::atoms->visualAtom, XCB_ATOM_VISUALID, 32, 1, &trayVisual); } diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 563af04..64ce5fc 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -2,18 +2,41 @@ #define FDOSELECTIONMANAGER_H #include +#include +#include #include -class FdoSelectionManager : public QObject +class SNIProxy; // 假设这是处理系统托盘图标的类 +class KSelectionOwner; // 假设这是管理X11选择的类 + +class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter { Q_OBJECT public: explicit FdoSelectionManager(QObject *parent = nullptr); - ~FdoSelectionManager(); + ~FdoSelectionManager() override; + + // 重写QAbstractNativeEventFilter的函数 + bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; + +private slots: + void onClaimedOwnership(); + void onFailedToClaimOwnership(); + void onLostOwnership(); private: + void init(); + bool addDamageWatch(xcb_window_t client); + void dock(xcb_window_t embed_win); + void undock(xcb_window_t client); + void setSystemTrayVisual(); + QSystemTrayIcon *m_trayIcon; + uint8_t m_damageEventBase; + QHash m_damageWatches; + QHash m_proxies; + KSelectionOwner *m_selectionOwner; }; #endif // FDOSELECTIONMANAGER_H From 5a664be721c36c4230c358906a674a18f226b916 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 03:37:51 +0800 Subject: [PATCH 057/254] modified: powerman/dimdisplayaction.cpp --- powerman/dimdisplayaction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 272017b..0e767bd 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -27,6 +27,8 @@ #include #include +#include +#include #include DimDisplayAction::DimDisplayAction(QObject *parent) From 222266cc2cecfdb9d0f8f869efd3e6165e6b2c94 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 18:53:56 +0800 Subject: [PATCH 058/254] modified: session/processmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.h --- session/processmanager.cpp | 2 +- xembed-sni-proxy/fdoselectionmanager.cpp | 24 ++++++------------ xembed-sni-proxy/fdoselectionmanager.h | 32 ++++++++++++++---------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 3f40fb6..09583aa 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -19,7 +19,7 @@ #include #include -// #include +#include #include "daemon-helper.h" diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 2e08d22..c88ab01 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,12 +11,9 @@ #include #include -#include -#include -#include -#include #include +#include #include #include @@ -30,17 +27,14 @@ #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 -FdoSelectionManager::FdoSelectionManager(QObject *parent) - : QObject(parent) - , m_trayIcon(new QSystemTrayIcon(this)) +FdoSelectionManager::FdoSelectionManager() + : QObject() , m_selectionOwner(new KSelectionOwner(Xcb::atoms->selectionAtom, -1, this)) { - // 初始化系统托盘图标 - m_trayIcon->setIcon(QIcon(":/icons/tray_icon.png")); - m_trayIcon->show(); + qCDebug(SNIPROXY) << "starting"; - // 其他初始化代码... - init(); + // we may end up calling QCoreApplication::quit() in this method, at which point we need the event loop running + QTimer::singleShot(0, this, &FdoSelectionManager::init); } FdoSelectionManager::~FdoSelectionManager() @@ -52,7 +46,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QX11Info::connection(); + xcb_connection_t *c = QGuiApplication::QX11Application::connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -106,10 +100,8 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) return true; } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) { - Q_UNUSED(result) - if (eventType != "xcb_generic_event_t") { return false; } diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 64ce5fc..f001137 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -1,26 +1,34 @@ -#ifndef FDOSELECTIONMANAGER_H -#define FDOSELECTIONMANAGER_H +/* + Registers as a embed container + SPDX-FileCopyrightText: 2015 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#pragma once -#include #include #include -#include +#include -class SNIProxy; // 假设这是处理系统托盘图标的类 -class KSelectionOwner; // 假设这是管理X11选择的类 +#include + +class KSelectionOwner; +class SNIProxy; class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter { Q_OBJECT public: - explicit FdoSelectionManager(QObject *parent = nullptr); + FdoSelectionManager(); ~FdoSelectionManager() override; - // 重写QAbstractNativeEventFilter的函数 - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; +protected: + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override + // bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; -private slots: +private Q_SLOTS: void onClaimedOwnership(); void onFailedToClaimOwnership(); void onLostOwnership(); @@ -32,11 +40,9 @@ private slots: void undock(xcb_window_t client); void setSystemTrayVisual(); - QSystemTrayIcon *m_trayIcon; uint8_t m_damageEventBase; + QHash m_damageWatches; QHash m_proxies; KSelectionOwner *m_selectionOwner; }; - -#endif // FDOSELECTIONMANAGER_H From 642b66ad9bbe92c6ebd2801f98a1a50564c48dcf Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 18:57:49 +0800 Subject: [PATCH 059/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index f001137..668981c 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override; // bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; private Q_SLOTS: From 35c3e96bd45134f35b3bd5f70941c36a875d4a3c Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:01:59 +0800 Subject: [PATCH 060/254] modified: session/processmanager.cpp modified: session/processmanager.h --- session/processmanager.cpp | 2 +- session/processmanager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 09583aa..e92e9af 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -167,7 +167,7 @@ void ProcessManager::loadAutoStartProcess() } } -bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) { if (eventType != "xcb_generic_event_t") // We only want to handle XCB events return false; diff --git a/session/processmanager.h b/session/processmanager.h index 5b451d6..6757840 100755 --- a/session/processmanager.h +++ b/session/processmanager.h @@ -50,7 +50,7 @@ class ProcessManager : public QObject, public QAbstractNativeEventFilter */ void loadAutoStartProcess(); - bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); + bool nativeEventFilter(const QByteArray & eventType, void * message, qintptr *) override; private: Application *m_app; From f155e6a8475715fe82ab6614dc99fd19677352dd Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:04:06 +0800 Subject: [PATCH 061/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index e92e9af..6d3f093 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -19,7 +19,7 @@ #include #include -#include +// #include #include "daemon-helper.h" From 816ac5cdc393772402c3c8e36f3b4b54c73f551b Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:08:59 +0800 Subject: [PATCH 062/254] modified: cupdatecursor/main.cpp modified: session/processmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.cpp --- cupdatecursor/main.cpp | 3 ++- session/processmanager.cpp | 2 +- xembed-sni-proxy/fdoselectionmanager.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cupdatecursor/main.cpp b/cupdatecursor/main.cpp index e298129..9e9c979 100755 --- a/cupdatecursor/main.cpp +++ b/cupdatecursor/main.cpp @@ -43,7 +43,8 @@ int main(int argc, char *argv[]) if (argc != 3) return 1; - if (!QX11Info::isPlatformX11()) + auto isPlatformX11 = qGuiApp->nativeInterface(); + if (!isPlatformX11) return 2; QString theme = QFile::decodeName(argv[1]); diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 6d3f093..f1c6502 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -175,7 +175,7 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag // ref: lxqt session if (!m_wmStarted && m_waitLoop) { // all window managers must set their name according to the spec - if (!QString::fromUtf8(NETRootInfo(QX11Info::connection(), NET::SupportingWMCheck).wmName()).isEmpty()) { + if (!QString::fromUtf8(NETRootInfo(QNativeInterface::QX11Application::connection(), NET::SupportingWMCheck).wmName()).isEmpty()) { qDebug() << "Window manager started"; m_wmStarted = true; if (m_waitLoop && m_waitLoop->isRunning()) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index c88ab01..9ee6929 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -46,7 +46,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QGuiApplication::QX11Application::connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -70,7 +70,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = QX11Info::connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -133,7 +133,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m const auto sniProxy = m_proxies.value(damagedWId); if (sniProxy) { sniProxy->update(); - xcb_damage_subtract(QX11Info::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); + xcb_damage_subtract(QNativeInterface::QX11Application::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { const auto event = reinterpret_cast(ev); @@ -203,7 +203,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = QX11Info::connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From b56008e3b2f1496846e850218e5734d623675292 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:14:06 +0800 Subject: [PATCH 063/254] modified: session/processmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.cpp --- session/processmanager.cpp | 8 +++++++- xembed-sni-proxy/fdoselectionmanager.cpp | 19 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index f1c6502..53af3a9 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -6,6 +6,7 @@ #include "application.h" #include +#include #include #include #include @@ -175,7 +176,12 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag // ref: lxqt session if (!m_wmStarted && m_waitLoop) { // all window managers must set their name according to the spec - if (!QString::fromUtf8(NETRootInfo(QNativeInterface::QX11Application::connection(), NET::SupportingWMCheck).wmName()).isEmpty()) { + + QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); + Display *displayID = x11App->display(); + xcb_connection_t *connection = XGetXCBConnection(displayID); + + if (!QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()).isEmpty()) { qDebug() << "Window manager started"; m_wmStarted = true; if (m_waitLoop && m_waitLoop->isRunning()) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 9ee6929..72560a0 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -46,7 +46,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + xcb_connection_t *c = QGuiApplication::QX11Application::connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -70,7 +70,10 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); + Display *displayID = x11App->display(); + xcb_connection_t *c = XGetXCBConnection(displayID); + const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -133,7 +136,12 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m const auto sniProxy = m_proxies.value(damagedWId); if (sniProxy) { sniProxy->update(); - xcb_damage_subtract(QNativeInterface::QX11Application::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); + + QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); + Display *displayID = x11App->display(); + xcb_connection_t *connection = XGetXCBConnection(displayID); + + xcb_damage_subtract(connection, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { const auto event = reinterpret_cast(ev); @@ -203,7 +211,10 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); + Display *displayID = x11App->display(); + xcb_connection_t *c = XGetXCBConnection(displayID); + auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From d0c7462822593fbb6e4cf6bee4b9542b51978e51 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:16:51 +0800 Subject: [PATCH 064/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 72560a0..3604b6a 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -46,7 +46,10 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QGuiApplication::QX11Application::connection(); + QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); + Display *displayID = x11App->display(); + xcb_connection_t *c = XGetXCBConnection(displayID); + xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -214,7 +217,7 @@ void FdoSelectionManager::setSystemTrayVisual() QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); Display *displayID = x11App->display(); xcb_connection_t *c = XGetXCBConnection(displayID); - + auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From 6652fd69881ff3c3cd7c7fab5d00986c2f044910 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:18:54 +0800 Subject: [PATCH 065/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 53af3a9..547f520 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -22,6 +22,8 @@ #include // #include +#include + #include "daemon-helper.h" ProcessManager::ProcessManager(Application *app, QObject *parent) From 035331a35861bf5d49b166095bcb41fa4ad762bb Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:26:51 +0800 Subject: [PATCH 066/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 547f520..1566807 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -23,6 +23,7 @@ // #include #include +#include #include "daemon-helper.h" @@ -138,7 +139,6 @@ void ProcessManager::loadAutoStartProcess() const QStringList fileNames = d.entryList(QStringList() << QStringLiteral("*.desktop")); for (const QString &file : fileNames) { QSettings desktop(d.absoluteFilePath(file), QSettings::IniFormat); - desktop.setIniCodec("UTF-8"); desktop.beginGroup("Desktop Entry"); if (desktop.contains("OnlyShowIn")) From b8323b3d528fa6b99c55a1928da35a919cb56907 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:27:39 +0800 Subject: [PATCH 067/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 1566807..4930e04 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -22,8 +22,7 @@ #include // #include -#include -#include +#include #include "daemon-helper.h" @@ -139,6 +138,7 @@ void ProcessManager::loadAutoStartProcess() const QStringList fileNames = d.entryList(QStringList() << QStringLiteral("*.desktop")); for (const QString &file : fileNames) { QSettings desktop(d.absoluteFilePath(file), QSettings::IniFormat); + desktop.setIniCodec("UTF-8"); desktop.beginGroup("Desktop Entry"); if (desktop.contains("OnlyShowIn")) From 436427b9ccfb4b6cf01605518b887f7af3833f9d Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:28:38 +0800 Subject: [PATCH 068/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 4930e04..23311a0 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -138,7 +138,6 @@ void ProcessManager::loadAutoStartProcess() const QStringList fileNames = d.entryList(QStringList() << QStringLiteral("*.desktop")); for (const QString &file : fileNames) { QSettings desktop(d.absoluteFilePath(file), QSettings::IniFormat); - desktop.setIniCodec("UTF-8"); desktop.beginGroup("Desktop Entry"); if (desktop.contains("OnlyShowIn")) From 2034a360cda63c34d7138695eccdbbdf63acc21d Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:46:36 +0800 Subject: [PATCH 069/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index d24e467..c8480a7 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include From 9923e3bfe2b0525076aadfdb923f4ce69feea9c4 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:50:13 +0800 Subject: [PATCH 070/254] modified: session/processmanager.cpp modified: xembed-sni-proxy/sniproxy.h --- session/processmanager.cpp | 1 + xembed-sni-proxy/sniproxy.h | 1 + 2 files changed, 2 insertions(+) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 23311a0..476c41a 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -20,6 +20,7 @@ #include #include +#include // #include #include diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 1fd69f2..64c2d64 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include From bb6cf85a37b12fc4e85a719e439296b1ca2472c7 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:55:25 +0800 Subject: [PATCH 071/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 5ad98f2..561c466 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -16,13 +16,13 @@ #include #include #include +#include // #include #include // #include #include -#include #include #include "window.h" @@ -48,7 +48,7 @@ static const QString s_appMenuGtkModule = QStringLiteral("appmenu-gtk-module"); MenuProxy::MenuProxy() : QObject() - , m_xConnection(QX11Info::connection()) + , m_xConnection(qApp->nativeInterface()->connection()) , m_serviceWatcher(new QDBusServiceWatcher(this)) , m_gtk2RcWatch(new KDirWatch(this)) , m_writeGtk2SettingsTimer(new QTimer(this)) From 444d68407c9a479803be94d6e503fb66fa6a2ce8 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 19:57:28 +0800 Subject: [PATCH 072/254] modified: gmenuproxy/dbusmenuadaptor.h --- gmenuproxy/dbusmenuadaptor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmenuproxy/dbusmenuadaptor.h b/gmenuproxy/dbusmenuadaptor.h index 2a70ff6..520eb4c 100755 --- a/gmenuproxy/dbusmenuadaptor.h +++ b/gmenuproxy/dbusmenuadaptor.h @@ -20,7 +20,7 @@ class QByteArray; template class QList; template class QMap; class QString; -class QStringList; +// class QStringList; class QVariant; QT_END_NAMESPACE From 2e54134375f7c8e5e1981ae17a9e869f589af81e Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:00:08 +0800 Subject: [PATCH 073/254] modified: session/application.h --- session/application.h | 1 + 1 file changed, 1 insertion(+) diff --git a/session/application.h b/session/application.h index 655cf62..34af9dd 100755 --- a/session/application.h +++ b/session/application.h @@ -21,6 +21,7 @@ #define APPLICATION_H #include +#include #include "processmanager.h" #include "networkproxymanager.h" From e6930776d1aa802e24de20e1642321be3aee84ab Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:02:18 +0800 Subject: [PATCH 074/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 7c7feff..13367bc 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -20,6 +20,7 @@ #include #include #include +#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From 18398637b4170180e3f293054f6697fa2b20424a Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:03:37 +0800 Subject: [PATCH 075/254] modified: cupdatecursor/main.cpp modified: xembed-sni-proxy/sniproxy.h --- cupdatecursor/main.cpp | 1 + xembed-sni-proxy/sniproxy.h | 1 + 2 files changed, 2 insertions(+) diff --git a/cupdatecursor/main.cpp b/cupdatecursor/main.cpp index 9e9c979..ea22439 100755 --- a/cupdatecursor/main.cpp +++ b/cupdatecursor/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 64c2d64..9165cb4 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include From 5d7bf3ea1367241443ec64893118d3f2c183d482 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:05:10 +0800 Subject: [PATCH 076/254] modified: cupdatecursor/main.cpp modified: xembed-sni-proxy/main.cpp --- cupdatecursor/main.cpp | 1 - xembed-sni-proxy/main.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cupdatecursor/main.cpp b/cupdatecursor/main.cpp index ea22439..9e9c979 100755 --- a/cupdatecursor/main.cpp +++ b/cupdatecursor/main.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include diff --git a/xembed-sni-proxy/main.cpp b/xembed-sni-proxy/main.cpp index a95ec36..44d9a91 100755 --- a/xembed-sni-proxy/main.cpp +++ b/xembed-sni-proxy/main.cpp @@ -15,6 +15,7 @@ #include "xcbutils.h" #include +#include #include From d18a752a4b0ef3b067a2fabe144422f877186f6c Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:08:42 +0800 Subject: [PATCH 077/254] modified: session/application.h modified: xembed-sni-proxy/main.cpp modified: xembed-sni-proxy/sniproxy.h modified: xembed-sni-proxy/xcbutils.h --- session/application.h | 1 - xembed-sni-proxy/main.cpp | 1 - xembed-sni-proxy/sniproxy.h | 1 - xembed-sni-proxy/xcbutils.h | 1 - 4 files changed, 4 deletions(-) diff --git a/session/application.h b/session/application.h index 34af9dd..655cf62 100755 --- a/session/application.h +++ b/session/application.h @@ -21,7 +21,6 @@ #define APPLICATION_H #include -#include #include "processmanager.h" #include "networkproxymanager.h" diff --git a/xembed-sni-proxy/main.cpp b/xembed-sni-proxy/main.cpp index 44d9a91..a95ec36 100755 --- a/xembed-sni-proxy/main.cpp +++ b/xembed-sni-proxy/main.cpp @@ -15,7 +15,6 @@ #include "xcbutils.h" #include -#include #include diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 9165cb4..64c2d64 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 13367bc..7c7feff 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -20,7 +20,6 @@ #include #include #include -#include /** XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 From 03319688331e35bc7289f703144bef1c04d7bbc6 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:10:11 +0800 Subject: [PATCH 078/254] modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 64c2d64..9165cb4 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include From 50daec185b5194b91ff98c7d7d442e8666d500af Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:11:53 +0800 Subject: [PATCH 079/254] modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 9165cb4..205c0db 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include From ab34a348365ed2c2385feafed354fab95929cfc0 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:13:52 +0800 Subject: [PATCH 080/254] modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 205c0db..7ca0089 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include From da3c42882a9c446dcb5cc77e046e40f40d33eb7d Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:18:33 +0800 Subject: [PATCH 081/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 561c466..27ab7ef 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -109,8 +109,8 @@ bool MenuProxy::init() enableGtkSettings(true); - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + connect(workspace, &Workspace::windowAdded, this, &MenuProxy::onWindowAdded); + connect(workspace, &Workspace::windowRemoved, this, &MenuProxy::onWindowRemoved); const auto windows = KWindowSystem::windows(); for (WId id : windows) { From ee68545db637c7660a47a51aafa270aeb0d0550a Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:20:53 +0800 Subject: [PATCH 082/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index c8480a7..f53a5ac 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include From 20400dea33573167d9002c2c909e7075838f83a3 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:26:47 +0800 Subject: [PATCH 083/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 27ab7ef..561c466 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -109,8 +109,8 @@ bool MenuProxy::init() enableGtkSettings(true); - connect(workspace, &Workspace::windowAdded, this, &MenuProxy::onWindowAdded); - connect(workspace, &Workspace::windowRemoved, this, &MenuProxy::onWindowRemoved); + connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); + connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); const auto windows = KWindowSystem::windows(); for (WId id : windows) { From c71b316feb145740975af9cf671d7dad6e237b11 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:28:38 +0800 Subject: [PATCH 084/254] modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 7ca0089..4da7350 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include From 6db3ef798d9bcdb29e358b6176e9878aed27b77f Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:30:45 +0800 Subject: [PATCH 085/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index f53a5ac..dfb3268 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -54,7 +54,7 @@ void xembed_message_send(xcb_window_t towin, long message, long d1, long d2, lon ev.data.data32[3] = d2; ev.data.data32[4] = d3; ev.type = Xcb::atoms->xembedAtom; - xcb_send_event(QX11Info::connection(), false, towin, XCB_EVENT_MASK_NO_EVENT, (char *)&ev); + xcb_send_event(qApp->nativeInterface()->connection(), false, towin, XCB_EVENT_MASK_NO_EVENT, (char *)&ev); } SNIProxy::SNIProxy(xcb_window_t wid, QObject *parent) @@ -80,7 +80,7 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject *parent) qCWarning(SNIPROXY) << "could not register SNI:" << reply.error().message(); } - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); // create a container window auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; @@ -179,7 +179,7 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject *parent) SNIProxy::~SNIProxy() { - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); xcb_destroy_window(c, m_containerWid); QDBusConnection::disconnectFromBus(m_dbus.name()); @@ -207,7 +207,7 @@ void SNIProxy::update() void SNIProxy::resizeWindow(const uint16_t width, const uint16_t height) const { - auto connection = QX11Info::connection(); + auto connection = qApp->nativeInterface()->connection(); uint16_t widthNormalized = std::min(width, s_embedSize); uint16_t heighNormalized = std::min(height, s_embedSize); @@ -228,7 +228,7 @@ void SNIProxy::hideContainerWindow(xcb_window_t windowId) const QSize SNIProxy::calculateClientWindowSize() const { - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); auto cookie = xcb_get_geometry(c, m_windowId); QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, nullptr)); @@ -282,7 +282,7 @@ bool SNIProxy::isTransparentImage(const QImage &image) const QImage SNIProxy::getImageNonComposite() const { - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); QSize clientWindowSize = calculateClientWindowSize(); @@ -381,7 +381,7 @@ QPoint SNIProxy::calculateClickPoint() const { QPoint clickPoint = QPoint(0, 0); - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); // request extent to check if shape has been set xcb_shape_query_extents_cookie_t extentsCookie = xcb_shape_query_extents(c, m_windowId); @@ -418,7 +418,7 @@ QPoint SNIProxy::calculateClickPoint() const void SNIProxy::stackContainerWindow(const uint32_t stackMode) const { - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); const uint32_t stackData[] = {stackMode}; xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_STACK_MODE, stackData); } @@ -506,7 +506,7 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) qCDebug(SNIPROXY) << "Received click" << mouseButton << "with passed x*y" << x << y; sendingClickEvent = true; - auto c = QX11Info::connection(); + auto c = qApp->nativeInterface()->connection(); auto cookieSize = xcb_get_geometry(c, m_windowId); QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookieSize, nullptr)); From 36dbddc7adf37eda183126cbe8039968d9dc3b4b Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:32:32 +0800 Subject: [PATCH 086/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index dfb3268..d245b65 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include "statusnotifieritemadaptor.h" From 3c5d95baa9f1433af936c2cd79d94cabbc025fd8 Mon Sep 17 00:00:00 2001 From: Intro Date: Wed, 19 Jun 2024 20:48:16 +0800 Subject: [PATCH 087/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index d245b65..f27cdfb 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -20,12 +20,13 @@ #include #include #include +#include #include #include #include -#include +#include #include "statusnotifieritemadaptor.h" #include "statusnotifierwatcher_interface.h" @@ -507,7 +508,8 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) qCDebug(SNIPROXY) << "Received click" << mouseButton << "with passed x*y" << x << y; sendingClickEvent = true; - auto c = qApp->nativeInterface()->connection(); + auto *x11App = qApp->nativeInterface(); + auto c = x11App->connection(); auto cookieSize = xcb_get_geometry(c, m_windowId); QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookieSize, nullptr)); @@ -544,15 +546,17 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) // pull window up stackContainerWindow(XCB_STACK_MODE_ABOVE); + // mouse down if (m_injectMode == Direct) { xcb_button_press_event_t *event = new xcb_button_press_event_t; memset(event, 0x00, sizeof(xcb_button_press_event_t)); + event->response_type = XCB_BUTTON_PRESS; event->event = m_windowId; - event->time = QX11Info::getTimestamp(); + event->time = QDateTime::currentDateTime().toSecsSinceEpoch(); event->same_screen = 1; - event->root = QX11Info::appRootWindow(); + event->root = DefaultRootWindow(x11App->display()); event->root_x = x; event->root_y = y; event->event_x = static_cast(clickPoint.x()); @@ -564,7 +568,7 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) xcb_send_event(c, false, m_windowId, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event); delete event; } else { - sendXTestPressed(QX11Info::display(), mouseButton); + sendXTestPressed(x11App->display(), mouseButton); } // mouse up @@ -573,9 +577,9 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) memset(event, 0x00, sizeof(xcb_button_release_event_t)); event->response_type = XCB_BUTTON_RELEASE; event->event = m_windowId; - event->time = QX11Info::getTimestamp(); + event->time = QDateTime::currentDateTime().toSecsSinceEpoch(); event->same_screen = 1; - event->root = QX11Info::appRootWindow(); + event->root = DefaultRootWindow(x11App->display()); event->root_x = x; event->root_y = y; event->event_x = static_cast(clickPoint.x()); @@ -587,7 +591,7 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) xcb_send_event(c, false, m_windowId, XCB_EVENT_MASK_BUTTON_RELEASE, (char *)event); delete event; } else { - sendXTestReleased(QX11Info::display(), mouseButton); + sendXTestReleased(x11App->display(), mouseButton); } #ifndef VISUAL_DEBUG From 96a40d72889a6bff780b294ebc541be9dacea7ee Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:08:28 +0800 Subject: [PATCH 088/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 561c466..7659050 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -109,8 +109,8 @@ bool MenuProxy::init() enableGtkSettings(true); - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + connect(KWindowSystem::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); + connect(KWindowSystem::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); const auto windows = KWindowSystem::windows(); for (WId id : windows) { From 12a9491995f784ffc9429d505a7a47b949465bd3 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:12:36 +0800 Subject: [PATCH 089/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 3604b6a..7741226 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -46,9 +46,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); - Display *displayID = x11App->display(); - xcb_connection_t *c = XGetXCBConnection(displayID); + xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); @@ -73,9 +71,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); - Display *displayID = x11App->display(); - xcb_connection_t *c = XGetXCBConnection(displayID); + xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); @@ -140,9 +136,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); - Display *displayID = x11App->display(); - xcb_connection_t *connection = XGetXCBConnection(displayID); + xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()) xcb_damage_subtract(connection, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } @@ -214,9 +208,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); - Display *displayID = x11App->display(); - xcb_connection_t *c = XGetXCBConnection(displayID); + xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; From f0dd66dc2aff3ca21b229b86870ce83cc33770c1 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:14:15 +0800 Subject: [PATCH 090/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 7741226..0d6bf73 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -136,7 +136,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()) + xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()); xcb_damage_subtract(connection, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } From 5c1ef0f6e310e6ad8471b57e56b7efbe92b4aaa4 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:17:02 +0800 Subject: [PATCH 091/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 7659050..e5dd23f 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -22,6 +22,7 @@ #include // #include #include +#include #include From e7cff6836b9dad362847bcb10c6260f9afd7c2bd Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:21:13 +0800 Subject: [PATCH 092/254] modified: gmenuproxy/menu.cpp --- gmenuproxy/menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gmenuproxy/menu.cpp b/gmenuproxy/menu.cpp index ab20049..9a0ca51 100755 --- a/gmenuproxy/menu.cpp +++ b/gmenuproxy/menu.cpp @@ -107,7 +107,8 @@ void Menu::stop(const QList &ids) // TODO is there a nicer algorithm for that? // TODO remove all m_menus also? m_subscriptions.erase( - std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), std::bind(&QList::contains, m_subscriptions, std::placeholders::_1)), + std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), + this{ return m_subscriptions.contains(id); }), m_subscriptions.end()); if (m_subscriptions.isEmpty()) { From 954c2383a3b59a8e3b9b6c3769923fd89f47753e Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:23:24 +0800 Subject: [PATCH 093/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 0d6bf73..deea804 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "sniproxy.h" #include "xcbutils.h" From 9c03790207028682a29251eeebea20f6418071d1 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:24:38 +0800 Subject: [PATCH 094/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index deea804..7729a1f 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include From 396e553f4044c0f085d7679cbef167e228cab173 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:25:47 +0800 Subject: [PATCH 095/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 7729a1f..27d38d0 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include From 27d92240895257b04615c8e6e8f036686fa9be0b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:28:16 +0800 Subject: [PATCH 096/254] modified: session/processmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.cpp --- session/processmanager.cpp | 1 + xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 476c41a..b146c56 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -24,6 +24,7 @@ // #include #include +#include #include "daemon-helper.h" diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 27d38d0..ef0552f 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include From 59e5c4bf102e0d1be5cf7cec4d16fc0fadb2102b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:29:45 +0800 Subject: [PATCH 097/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index ef0552f..30876fa 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include From e627cb64f2348104e5d7060f7304761ab5577a83 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:30:52 +0800 Subject: [PATCH 098/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 30876fa..5f98d96 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include From ffacf44665287249dc7337d415123d9a3705bb5e Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:37:00 +0800 Subject: [PATCH 099/254] modified: gmenuproxy/menu.cpp --- gmenuproxy/menu.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/menu.cpp b/gmenuproxy/menu.cpp index 9a0ca51..eefe52d 100755 --- a/gmenuproxy/menu.cpp +++ b/gmenuproxy/menu.cpp @@ -107,9 +107,13 @@ void Menu::stop(const QList &ids) // TODO is there a nicer algorithm for that? // TODO remove all m_menus also? m_subscriptions.erase( - std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), - this{ return m_subscriptions.contains(id); }), - m_subscriptions.end()); + std::remove_if( m_subscriptions.begin(), m_subscriptions.end(), + this { + return m_subscriptions.contains(id); + } + ), + m_subscriptions.end() + ); if (m_subscriptions.isEmpty()) { emit menuDisappeared(); From 03ba384a57a7423173352d9ec10dda768f4df908 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:44:58 +0800 Subject: [PATCH 100/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index e5dd23f..30736ce 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -109,9 +109,9 @@ bool MenuProxy::init() } enableGtkSettings(true); - - connect(KWindowSystem::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); - connect(KWindowSystem::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); + + connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); + connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); const auto windows = KWindowSystem::windows(); for (WId id : windows) { From 14a085d6ec0b204eb3c83ce0d8c22e7af73e442a Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:50:27 +0800 Subject: [PATCH 101/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 30736ce..6c10284 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -109,9 +109,10 @@ bool MenuProxy::init() } enableGtkSettings(true); - - connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - connect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + + // 使用KX11Extras的windowAdded信号 + connect(KX11Extras::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); + connect(KX11Extras::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); const auto windows = KWindowSystem::windows(); for (WId id : windows) { From 7337918543314613c1ccf542c1ca5b536003209b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 00:52:56 +0800 Subject: [PATCH 102/254] modified: gmenuproxy/menuproxy.cpp --- gmenuproxy/menuproxy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 6c10284..74a1cd6 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -114,7 +114,7 @@ bool MenuProxy::init() connect(KX11Extras::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); connect(KX11Extras::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); - const auto windows = KWindowSystem::windows(); + const auto windows = KX11Extras::windows(); for (WId id : windows) { onWindowAdded(id); } @@ -132,8 +132,8 @@ void MenuProxy::teardown() QDBusConnection::sessionBus().unregisterService(s_ourServiceName); - disconnect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &MenuProxy::onWindowAdded); - disconnect(KWindowSystem::self(), &KWindowSystem::windowRemoved, this, &MenuProxy::onWindowRemoved); + disconnect(KX11Extras::self(), &KX11Extras::windowAdded, this, &MenuProxy::onWindowAdded); + disconnect(KX11Extras::self(), &KX11Extras::windowRemoved, this, &MenuProxy::onWindowRemoved); qDeleteAll(m_windows); m_windows.clear(); From bade133627eb07ae295b5b6af3e4c676eb221a0d Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:02:45 +0800 Subject: [PATCH 103/254] modified: powerman/CMakeLists.txt modified: powerman/dimdisplayaction.cpp modified: session/processmanager.cpp --- powerman/CMakeLists.txt | 14 ++++++++++++++ powerman/dimdisplayaction.cpp | 2 +- session/processmanager.cpp | 4 +--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 1b44703..3b8cb89 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -9,12 +9,26 @@ find_package(X11) find_package(XCB REQUIRED COMPONENTS XCB + XFIXES + DAMAGE + COMPOSITE + RANDR + SHM + UTIL + IMAGE DPMS ) set(XCB_LIBS XCB::XCB XCB::DPMS + XCB::XFIXES + XCB::DAMAGE + XCB::COMPOSITE + XCB::RANDR + XCB::SHM + XCB::UTIL + XCB::IMAGE ) set(SOURCES diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 0e767bd..93aa5a6 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -45,7 +45,7 @@ DimDisplayAction::DimDisplayAction(QObject *parent) auto *displayID = x11App->display(); // 从Display转换为xcb_connection_t类型的连接 - auto *connection = XGetXCBConnection(displayID); + auto *connection = XGetXCBConnection(qApp->nativeInterface()->display()); xcb_dpms_set_timeouts(connection, 0, 0, 0); diff --git a/session/processmanager.cpp b/session/processmanager.cpp index b146c56..c62878b 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -180,9 +180,7 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag if (!m_wmStarted && m_waitLoop) { // all window managers must set their name according to the spec - QNativeInterface::QX11Application *x11App = qApp->nativeInterface(); - Display *displayID = x11App->display(); - xcb_connection_t *connection = XGetXCBConnection(displayID); + xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()); if (!QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()).isEmpty()) { qDebug() << "Window manager started"; From e046b5111d9903a6237d9d5c281aa05cb871d61d Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:05:29 +0800 Subject: [PATCH 104/254] modified: gmenuproxy/menuproxy.cpp modified: powerman/CMakeLists.txt --- gmenuproxy/menuproxy.cpp | 1 + powerman/CMakeLists.txt | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/gmenuproxy/menuproxy.cpp b/gmenuproxy/menuproxy.cpp index 74a1cd6..de33633 100755 --- a/gmenuproxy/menuproxy.cpp +++ b/gmenuproxy/menuproxy.cpp @@ -23,6 +23,7 @@ // #include #include #include +#include #include diff --git a/powerman/CMakeLists.txt b/powerman/CMakeLists.txt index 3b8cb89..1b44703 100755 --- a/powerman/CMakeLists.txt +++ b/powerman/CMakeLists.txt @@ -9,26 +9,12 @@ find_package(X11) find_package(XCB REQUIRED COMPONENTS XCB - XFIXES - DAMAGE - COMPOSITE - RANDR - SHM - UTIL - IMAGE DPMS ) set(XCB_LIBS XCB::XCB XCB::DPMS - XCB::XFIXES - XCB::DAMAGE - XCB::COMPOSITE - XCB::RANDR - XCB::SHM - XCB::UTIL - XCB::IMAGE ) set(SOURCES From 2547cda9d707aaa49d688b304e68fc16353b1a5a Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:11:37 +0800 Subject: [PATCH 105/254] modified: xembed-sni-proxy/sniproxy.cpp modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.cpp | 2 +- xembed-sni-proxy/sniproxy.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index f27cdfb..1f765a2 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -453,7 +453,7 @@ bool SNIProxy::ItemIsMenu() const return false; } -QString SNIProxy::Status() const +QString SNIProxy::getStatus() const { return QStringLiteral("Active"); } diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 4da7350..1ff0747 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -62,9 +62,9 @@ class SNIProxy : public QObject /** * @return The status of this item - * @see Status + * @see getStatus */ - QString Status() const; + QString getStatus() const; /** * @return The id of the main window of the application that controls the item From 50081dd103dcf6fafdaa2170f098ba7a1ff82ef3 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:16:53 +0800 Subject: [PATCH 106/254] modified: xembed-sni-proxy/sniproxy.h --- xembed-sni-proxy/sniproxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/sniproxy.h b/xembed-sni-proxy/sniproxy.h index 1ff0747..d6fa61f 100755 --- a/xembed-sni-proxy/sniproxy.h +++ b/xembed-sni-proxy/sniproxy.h @@ -31,7 +31,7 @@ class SNIProxy : public QObject Q_PROPERTY(QString Category READ Category) Q_PROPERTY(QString Id READ Id) Q_PROPERTY(QString Title READ Title) - Q_PROPERTY(QString Status READ Status) + Q_PROPERTY(QString getStatus READ getStatus) Q_PROPERTY(int WindowId READ WindowId) Q_PROPERTY(bool ItemIsMenu READ ItemIsMenu) Q_PROPERTY(KDbusImageVector IconPixmap READ IconPixmap) From 39963b4f8b2f1eea20d93d01d44e07e695f6e9b7 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:24:11 +0800 Subject: [PATCH 107/254] modified: gmenuproxy/window.cpp modified: gmenuproxy/window.h --- gmenuproxy/window.cpp | 4 ++-- gmenuproxy/window.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/window.cpp b/gmenuproxy/window.cpp index ca5762e..7dda1a7 100755 --- a/gmenuproxy/window.cpp +++ b/gmenuproxy/window.cpp @@ -251,7 +251,7 @@ void Window::menuChanged(const QVector &menuIds) void Window::onMenuSubscribed(uint id) { // When it was a delayed GetLayout request, send the reply now - const auto pendingReplies = m_pendingGetLayouts.values(id); + const auto pendingReplies = m_pendingGetLayouts.values(static_cast(id)); if (!pendingReplies.isEmpty()) { for (const auto &pendingReply : pendingReplies) { if (pendingReply.type() != QDBusMessage::InvalidMessage) { @@ -424,7 +424,7 @@ uint Window::GetLayout(int parentId, int recursionDepth, const QStringList &prop if (!m_currentMenu->hasSubscription(subscription)) { // let's serve multiple similar requests in one go once we've processed them - m_pendingGetLayouts.insertMulti(subscription, message()); + m_pendingGetLayouts.insert(subscription, message()); setDelayedReply(true); m_currentMenu->start(subscription); diff --git a/gmenuproxy/window.h b/gmenuproxy/window.h index d4cadca..784c2a5 100755 --- a/gmenuproxy/window.h +++ b/gmenuproxy/window.h @@ -10,6 +10,7 @@ #include #include #include +#include #include // for WId #include @@ -111,7 +112,7 @@ class Window : public QObject, protected QDBusContext QString m_proxyObjectPath; // our object path on this proxy app - QHash m_pendingGetLayouts; + QMultiHash m_pendingGetLayouts; Menu *m_applicationMenu = nullptr; Menu *m_menuBar = nullptr; From 4a61a6ead25cc13aef73040f6af79555e04cf58b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:26:31 +0800 Subject: [PATCH 108/254] modified: notificationd/dbus/notificationsadaptor.h --- notificationd/dbus/notificationsadaptor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notificationd/dbus/notificationsadaptor.h b/notificationd/dbus/notificationsadaptor.h index 46c15ca..a8be332 100755 --- a/notificationd/dbus/notificationsadaptor.h +++ b/notificationd/dbus/notificationsadaptor.h @@ -20,7 +20,7 @@ class QByteArray; template class QList; template class QMap; class QString; -class QStringList; +// class QStringList; class QVariant; QT_END_NAMESPACE From 5da6da12dab4e6b722369195a09382dff090b111 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:28:38 +0800 Subject: [PATCH 109/254] modified: gmenuproxy/menu.cpp --- gmenuproxy/menu.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gmenuproxy/menu.cpp b/gmenuproxy/menu.cpp index eefe52d..ab20049 100755 --- a/gmenuproxy/menu.cpp +++ b/gmenuproxy/menu.cpp @@ -107,13 +107,8 @@ void Menu::stop(const QList &ids) // TODO is there a nicer algorithm for that? // TODO remove all m_menus also? m_subscriptions.erase( - std::remove_if( m_subscriptions.begin(), m_subscriptions.end(), - this { - return m_subscriptions.contains(id); - } - ), - m_subscriptions.end() - ); + std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), std::bind(&QList::contains, m_subscriptions, std::placeholders::_1)), + m_subscriptions.end()); if (m_subscriptions.isEmpty()) { emit menuDisappeared(); From 2b3f9f4fede60c8c07f0395b4f6ecce168d41fef Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:35:35 +0800 Subject: [PATCH 110/254] modified: gmenuproxy/menu.cpp --- gmenuproxy/menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gmenuproxy/menu.cpp b/gmenuproxy/menu.cpp index ab20049..ea2d074 100755 --- a/gmenuproxy/menu.cpp +++ b/gmenuproxy/menu.cpp @@ -104,10 +104,9 @@ void Menu::stop(const QList &ids) qDebug() << "Failed to stop subscription to" << ids << "on" << m_serviceName << "at" << m_objectPath << reply.error(); } else { // remove all subscriptions that we unsubscribed from - // TODO is there a nicer algorithm for that? - // TODO remove all m_menus also? m_subscriptions.erase( - std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), std::bind(&QList::contains, m_subscriptions, std::placeholders::_1)), + std::remove_if(m_subscriptions.begin(), m_subscriptions.end(), + [this](uint id) { return m_subscriptions.contains(id); }), m_subscriptions.end()); if (m_subscriptions.isEmpty()) { @@ -116,6 +115,7 @@ void Menu::stop(const QList &ids) } watcher->deleteLater(); }); + } bool Menu::hasMenu() const From c57ce46dccc816effe591991e7747537ad5a0d54 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:47:12 +0800 Subject: [PATCH 111/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 5f98d96..4eef179 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include From 4289bf09c136ab6b9dc5296d7cc4b253c52f8cda Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:50:03 +0800 Subject: [PATCH 112/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 4eef179..b923435 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include "sniproxy.h" #include "xcbutils.h" From 7107c1c2c57e397a541ea0493c34f7d1c814a540 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 01:59:10 +0800 Subject: [PATCH 113/254] modified: xembed-sni-proxy/CMakeLists.txt --- xembed-sni-proxy/CMakeLists.txt | 46 +++++++-------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 12e8cf1..7be5d40 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.14) project(lingmo-xembedsniproxy) add_definitions(-DQT_NO_CAST_TO_ASCII @@ -8,39 +9,11 @@ add_definitions(-DQT_NO_CAST_TO_ASCII find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) -find_package(X11) -set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" - URL "http://www.x.org" - TYPE OPTIONAL - PURPOSE "Required for building the X11 based workspace") +find_package(X11 REQUIRED) +find_package(XCB REQUIRED COMPONENTS XCB RANDR XFIXES DAMAGE COMPOSITE SHM UTIL IMAGE) -if(X11_FOUND) - find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR) - set_package_properties(XCB PROPERTIES TYPE REQUIRED) - if(NOT X11_SM_FOUND) - message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") - endif(NOT X11_SM_FOUND) - - find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS) -endif() - -if(X11_FOUND AND XCB_XCB_FOUND) - set(HAVE_X11 1) -endif() - -find_package(XCB - REQUIRED COMPONENTS - XCB - XFIXES - DAMAGE - COMPOSITE - RANDR - SHM - UTIL - IMAGE -) - -find_package(KF6WindowSystem) +find_package(Qt6 REQUIRED COMPONENTS Core Gui DBus Widgets) +find_package(KF6WindowSystem REQUIRED) set(XCB_LIBS XCB::XCB @@ -62,22 +35,23 @@ set(XEMBED_SNI_PROXY_SOURCES xtestsender.cpp ) -qt_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml - sniproxy.h SNIProxy) +qt_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml sniproxy.h SNIProxy) set(statusnotifierwatcher_xml org.kde.StatusNotifierWatcher.xml) qt_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(lingmo-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES}) -set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(lingmo-xembedsniproxy Qt6::Core Qt6::Gui Qt6::DBus + Qt6::Widgets KF6::WindowSystem ${XCB_LIBS} - ${X11_XTest_LIB} + ${X11_X11_LIB} + ${X11_Xext_LIB} + ${X11_Xrandr_LIB} ) install(TARGETS lingmo-xembedsniproxy DESTINATION ${CMAKE_INSTALL_BINDIR}) From 560213708a61d5c4d0e93eb7464894c7d7dd64ea Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:02:57 +0800 Subject: [PATCH 114/254] modified: xembed-sni-proxy/CMakeLists.txt --- xembed-sni-proxy/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 7be5d40..3f72ced 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -2,16 +2,15 @@ cmake_minimum_required(VERSION 3.14) project(lingmo-xembedsniproxy) add_definitions(-DQT_NO_CAST_TO_ASCII --DQT_NO_CAST_FROM_ASCII --DQT_NO_URL_CAST_FROM_STRING --DQT_NO_CAST_FROM_BYTEARRAY) + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_FROM_BYTEARRAY) find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(X11 REQUIRED) find_package(XCB REQUIRED COMPONENTS XCB RANDR XFIXES DAMAGE COMPOSITE SHM UTIL IMAGE) - find_package(Qt6 REQUIRED COMPONENTS Core Gui DBus Widgets) find_package(KF6WindowSystem REQUIRED) @@ -42,6 +41,9 @@ qt_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwa set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(lingmo-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES}) + +message(STATUS "X11 Libraries: ${X11_LIBRARIES}") + target_link_libraries(lingmo-xembedsniproxy Qt6::Core Qt6::Gui @@ -49,9 +51,7 @@ target_link_libraries(lingmo-xembedsniproxy Qt6::Widgets KF6::WindowSystem ${XCB_LIBS} - ${X11_X11_LIB} - ${X11_Xext_LIB} - ${X11_Xrandr_LIB} + ${X11_LIBRARIES} # 添加这个来确保链接X11库 ) install(TARGETS lingmo-xembedsniproxy DESTINATION ${CMAKE_INSTALL_BINDIR}) From 139ba68b9f2752d72b35df6e0d74054972986b57 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:09:08 +0800 Subject: [PATCH 115/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 30 ++++++++++-------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index b923435..7ab02f4 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -13,19 +13,11 @@ #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include -#include #include "sniproxy.h" #include "xcbutils.h" @@ -53,8 +45,8 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); - + auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + xcb_connection_t *c = nativeApp->connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -78,8 +70,8 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); - + auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + xcb_connection_t *c = nativeApp->connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -109,8 +101,10 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) return true; } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) { + Q_UNUSED(result) + if (eventType != "xcb_generic_event_t") { return false; } @@ -143,9 +137,9 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()); - - xcb_damage_subtract(connection, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); + auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + xcb_connection_t *c = nativeApp->connection(); + xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { const auto event = reinterpret_cast(ev); @@ -215,8 +209,8 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display()); - + auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + xcb_connection_t *c = nativeApp->connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From 82c5ec6571f24f9d56d69bcea7a3598126b78e36 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:12:40 +0800 Subject: [PATCH 116/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 7ab02f4..65a299d 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -10,6 +10,7 @@ #include "debug.h" #include +#include #include #include From 23d230c39106fa6c3c36aa7fd511fa860eea75c5 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:14:03 +0800 Subject: [PATCH 117/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 65a299d..ec4f2ff 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,10 +11,12 @@ #include #include +#include #include #include +#include #include #include #include From d1115315eb0a50b9d2b608ebb12f5ca5c879e4e1 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:14:48 +0800 Subject: [PATCH 118/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index ec4f2ff..06ed8b2 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -60,6 +60,7 @@ void FdoSelectionManager::init() qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; qApp->exit(-1); } + qApp->installNativeEventFilter(this); From afa3bd7c79fe9884bb4f5cd00d09e9bc7611c4c8 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:15:57 +0800 Subject: [PATCH 119/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 06ed8b2..f104e35 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include @@ -60,7 +59,7 @@ void FdoSelectionManager::init() qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; qApp->exit(-1); } - + qApp->installNativeEventFilter(this); From bcdee73f0b49ff0a5b77a19f82bbda58ef9e8d84 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:21:45 +0800 Subject: [PATCH 120/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index f104e35..39bfaf3 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,7 +47,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + auto *nativeApp = QGuiApplication::nativeInterface() xcb_connection_t *c = nativeApp->connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); @@ -59,7 +59,7 @@ void FdoSelectionManager::init() qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; qApp->exit(-1); } - + qApp->installNativeEventFilter(this); @@ -73,7 +73,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + auto *nativeApp = QGuiApplication::nativeInterface() xcb_connection_t *c = nativeApp->connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); @@ -140,7 +140,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + auto *nativeApp = QGuiApplication::nativeInterface() xcb_connection_t *c = nativeApp->connection(); xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } @@ -212,7 +212,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - auto *nativeApp = dynamic_cast(QGuiApplication::nativeInterface()); + auto *nativeApp = QGuiApplication::nativeInterface() xcb_connection_t *c = nativeApp->connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; From 47239357935483b9ed009a4cd9936d1aab508f55 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:25:38 +0800 Subject: [PATCH 121/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 39bfaf3..6eca451 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,8 +47,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - auto *nativeApp = QGuiApplication::nativeInterface() - xcb_connection_t *c = nativeApp->connection(); + xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -73,8 +72,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - auto *nativeApp = QGuiApplication::nativeInterface() - xcb_connection_t *c = nativeApp->connection(); + xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -140,8 +138,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - auto *nativeApp = QGuiApplication::nativeInterface() - xcb_connection_t *c = nativeApp->connection(); + xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { @@ -212,8 +209,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - auto *nativeApp = QGuiApplication::nativeInterface() - xcb_connection_t *c = nativeApp->connection(); + xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From 09e4faee6b9982c8f5cdc2a7a5920deb591901d7 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:27:53 +0800 Subject: [PATCH 122/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 6eca451..8745907 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include From 68108a454d29b2915d54da09e61761243d357173 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:29:23 +0800 Subject: [PATCH 123/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 8745907..6eca451 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include From a42f039b98b8436aa9a02bb6342345b3664006c3 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:34:10 +0800 Subject: [PATCH 124/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 6eca451..c6f4063 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,7 +47,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -72,7 +72,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -138,7 +138,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { @@ -209,7 +209,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = QGuiApplication::nativeInterface()->connection(); + xcb_connection_t *c = QNativeInterface::QX11Application::connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From ada36953bc71ab0925f9c9ecb3ae6afe18cd12e7 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:37:58 +0800 Subject: [PATCH 125/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index c6f4063..e44f8f0 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,7 +47,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + xcb_connection_t *c = QX11Application::connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -72,7 +72,7 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + xcb_connection_t *c = QX11Application::connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -138,7 +138,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m if (sniProxy) { sniProxy->update(); - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + xcb_connection_t *c = QX11Application::connection(); xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { @@ -209,7 +209,7 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = QNativeInterface::QX11Application::connection(); + xcb_connection_t *c = QX11Application::connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From c9fa7970a1871a199b4f316b110c3dc6edd0c22f Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:46:58 +0800 Subject: [PATCH 126/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index e44f8f0..ff6f45d 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,7 +47,9 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - xcb_connection_t *c = QX11Application::connection(); + QNativeInterface::QX11Application *x11App = app.nativeInterface(); + xcb_connection_t *c = x11App->connection(); + xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); if (reply && reply->present) { @@ -58,7 +60,6 @@ void FdoSelectionManager::init() qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; qApp->exit(-1); } - qApp->installNativeEventFilter(this); @@ -72,7 +73,9 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - xcb_connection_t *c = QX11Application::connection(); + QNativeInterface::QX11Application *x11App = app.nativeInterface(); + xcb_connection_t *c = x11App->connection(); + const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); const auto damageId = xcb_generate_id(c); @@ -137,9 +140,7 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m const auto sniProxy = m_proxies.value(damagedWId); if (sniProxy) { sniProxy->update(); - - xcb_connection_t *c = QX11Application::connection(); - xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); + xcb_damage_subtract(QX11Info::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); } } else if (responseType == XCB_CONFIGURE_REQUEST) { const auto event = reinterpret_cast(ev); @@ -209,7 +210,9 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - xcb_connection_t *c = QX11Application::connection(); + QNativeInterface::QX11Application *x11App = app.nativeInterface(); + xcb_connection_t *c = x11App->connection(); + auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); From 1a926d1811522bbe7ac8a061322651240879d2ad Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:52:31 +0800 Subject: [PATCH 127/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index ff6f45d..783272c 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,8 +47,8 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - QNativeInterface::QX11Application *x11App = app.nativeInterface(); - xcb_connection_t *c = x11App->connection(); + auto *native = QGuiApplication::nativeInterface() + xcb_connection_t *c = native->connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); @@ -73,8 +73,8 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - QNativeInterface::QX11Application *x11App = app.nativeInterface(); - xcb_connection_t *c = x11App->connection(); + auto *native = QGuiApplication::nativeInterface() + xcb_connection_t *c = native->connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); @@ -210,8 +210,8 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - QNativeInterface::QX11Application *x11App = app.nativeInterface(); - xcb_connection_t *c = x11App->connection(); + auto *native = QGuiApplication::nativeInterface() + xcb_connection_t *c = native->connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; auto trayVisual = screen->root_visual; From 12d7ae89b90187b4463bed94ecf82141f10edafa Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 02:56:41 +0800 Subject: [PATCH 128/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 783272c..a53272d 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -47,7 +47,8 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - auto *native = QGuiApplication::nativeInterface() + QGuiApplication app(argc, argv); + auto *native = app.nativeInterface(); xcb_connection_t *c = native->connection(); xcb_prefetch_extension_data(c, &xcb_damage_id); @@ -73,7 +74,8 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - auto *native = QGuiApplication::nativeInterface() + QGuiApplication app(argc, argv); + auto *native = app.nativeInterface(); xcb_connection_t *c = native->connection(); const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); @@ -210,7 +212,8 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - auto *native = QGuiApplication::nativeInterface() + QGuiApplication app(argc, argv); + auto *native = app.nativeInterface(); xcb_connection_t *c = native->connection(); auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; From cd43c53b07988e3074746b6046a0b305149c15fe Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:06:27 +0800 Subject: [PATCH 129/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 132 ++++++++++++----------- 1 file changed, 68 insertions(+), 64 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index a53272d..6f392cf 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -10,12 +10,10 @@ #include "debug.h" #include -#include #include #include -#include #include #include #include @@ -47,18 +45,20 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { // load damage extension - QGuiApplication app(argc, argv); - auto *native = app.nativeInterface(); - xcb_connection_t *c = native->connection(); - - xcb_prefetch_extension_data(c, &xcb_damage_id); - const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); - if (reply && reply->present) { - m_damageEventBase = reply->first_event; - xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); + if (auto *native = dynamic_cast(qApp)) { + xcb_connection_t *c = native->connection(); // 使用新的接口 + xcb_prefetch_extension_data(c, &xcb_damage_id); + const auto *reply = xcb_get_extension_data(c, &xcb_damage_id); + if (reply && reply->present) { + m_damageEventBase = reply->first_event; + xcb_damage_query_version_unchecked(c, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); + } else { + // no XDamage means + qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; + qApp->exit(-1); + } } else { - // no XDamage means - qCCritical(SNIPROXY) << "could not load damage extension. Quitting"; + qCCritical(SNIPROXY) << "not running under an X11 environment. Quitting"; qApp->exit(-1); } @@ -74,37 +74,39 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) { qCDebug(SNIPROXY) << "adding damage watch for " << client; - QGuiApplication app(argc, argv); - auto *native = app.nativeInterface(); - xcb_connection_t *c = native->connection(); + if (auto *native = dynamic_cast(qApp)) { + xcb_connection_t *c = native->connection(); + const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); - const auto attribsCookie = xcb_get_window_attributes_unchecked(c, client); + const auto damageId = xcb_generate_id(c); + m_damageWatches[client] = damageId; + xcb_damage_create(c, damageId, client, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); - const auto damageId = xcb_generate_id(c); - m_damageWatches[client] = damageId; - xcb_damage_create(c, damageId, client, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); + xcb_generic_error_t *error = nullptr; + QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, &error)); + QScopedPointer getAttrError(error); + uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; + if (!attr.isNull()) { + events = events | attr->your_event_mask; + } + // if window is already gone, there is no need to handle it. + if (getAttrError && getAttrError->error_code == XCB_WINDOW) { + return false; + } + // the event mask will not be removed again. We cannot track whether another component also needs STRUCTURE_NOTIFY (e.g. KWindowSystem). + // if we would remove the event mask again, other areas will break. + const auto changeAttrCookie = xcb_change_window_attributes_checked(c, client, XCB_CW_EVENT_MASK, &events); + QScopedPointer changeAttrError(xcb_request_check(c, changeAttrCookie)); + // if window is gone by this point, it will be caught by eventFilter, so no need to check later errors. + if (changeAttrError && changeAttrError->error_code == XCB_WINDOW) { + return false; + } - xcb_generic_error_t *error = nullptr; - QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, &error)); - QScopedPointer getAttrError(error); - uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; - if (!attr.isNull()) { - events = events | attr->your_event_mask; - } - // if window is already gone, there is no need to handle it. - if (getAttrError && getAttrError->error_code == XCB_WINDOW) { - return false; - } - // the event mask will not be removed again. We cannot track whether another component also needs STRUCTURE_NOTIFY (e.g. KWindowSystem). - // if we would remove the event mask again, other areas will break. - const auto changeAttrCookie = xcb_change_window_attributes_checked(c, client, XCB_CW_EVENT_MASK, &events); - QScopedPointer changeAttrError(xcb_request_check(c, changeAttrCookie)); - // if window is gone by this point, it will be caught by eventFilter, so no need to check later errors. - if (changeAttrError && changeAttrError->error_code == XCB_WINDOW) { + return true; + } else { + qCCritical(SNIPROXY) << "not running under an X11 environment. Quitting"; return false; } - - return true; } bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) @@ -212,34 +214,36 @@ void FdoSelectionManager::onLostOwnership() void FdoSelectionManager::setSystemTrayVisual() { - QGuiApplication app(argc, argv); - auto *native = app.nativeInterface(); - xcb_connection_t *c = native->connection(); - - auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; - auto trayVisual = screen->root_visual; - xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); - xcb_depth_t *depth = nullptr; - - while (depth_iterator.rem) { - if (depth_iterator.data->depth == 32) { - depth = depth_iterator.data; - break; + if (auto *native = dynamic_cast(qApp)) { + xcb_connection_t *c = native->connection(); + auto screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; + auto trayVisual = screen->root_visual; + xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); + xcb_depth_t *depth = nullptr; + + while (depth_iterator.rem) { + if (depth_iterator.data->depth == 32) { + depth = depth_iterator.data; + break; + } + xcb_depth_next(&depth_iterator); } - xcb_depth_next(&depth_iterator); - } - if (depth) { - xcb_visualtype_iterator_t visualtype_iterator = xcb_depth_visuals_iterator(depth); - while (visualtype_iterator.rem) { - xcb_visualtype_t *visualtype = visualtype_iterator.data; - if (visualtype->_class == XCB_VISUAL_CLASS_TRUE_COLOR) { - trayVisual = visualtype->visual_id; - break; + if (depth) { + xcb_visualtype_iterator_t visualtype_iterator = xcb_depth_visuals_iterator(depth); + while (visualtype_iterator.rem) { + xcb_visualtype_t *visualtype = visualtype_iterator.data; + if (visualtype->_class == XCB_VISUAL_CLASS_TRUE_COLOR) { + trayVisual = visualtype->visual_id; + break; + } + xcb_visualtype_next(&visualtype_iterator); } - xcb_visualtype_next(&visualtype_iterator); } - } - xcb_change_property(c, XCB_PROP_MODE_REPLACE, m_selectionOwner->ownerWindow(), Xcb::atoms->visualAtom, XCB_ATOM_VISUALID, 32, 1, &trayVisual); + xcb_change_property(c, XCB_PROP_MODE_REPLACE, m_selectionOwner->ownerWindow(), Xcb::atoms->visualAtom, XCB_ATOM_VISUALID, 32, 1, &trayVisual); + } else { + qCCritical(SNIPROXY) << "not running under an X11 environment. Quitting"; + return; + } } From 64e95fa19124dd8ac9b7048fae3fb9980a5ef48b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:06:43 +0800 Subject: [PATCH 130/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 6f392cf..5c8d145 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -9,6 +9,7 @@ #include "debug.h" +#include #include #include From 4ce4765548d661f4a42ec399b4dd51717f3b5efe Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:10:23 +0800 Subject: [PATCH 131/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 50 +----------------------- 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 5c8d145..59fd2f0 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -9,7 +9,6 @@ #include "debug.h" -#include #include #include @@ -110,10 +109,8 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) } } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) { - Q_UNUSED(result) - if (eventType != "xcb_generic_event_t") { return false; } @@ -170,49 +167,6 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m return false; } -void FdoSelectionManager::dock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to dock window " << winId; - - if (m_proxies.contains(winId)) { - return; - } - - if (addDamageWatch(winId)) { - m_proxies[winId] = new SNIProxy(winId, this); - } -} - -void FdoSelectionManager::undock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to undock window " << winId; - - if (!m_proxies.contains(winId)) { - return; - } - m_proxies[winId]->deleteLater(); - m_proxies.remove(winId); -} - -void FdoSelectionManager::onClaimedOwnership() -{ - qCDebug(SNIPROXY) << "Manager selection claimed"; - - setSystemTrayVisual(); -} - -void FdoSelectionManager::onFailedToClaimOwnership() -{ - qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; - qApp->exit(-1); -} - -void FdoSelectionManager::onLostOwnership() -{ - qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; - qApp->exit(-1); -} - void FdoSelectionManager::setSystemTrayVisual() { if (auto *native = dynamic_cast(qApp)) { @@ -247,4 +201,4 @@ void FdoSelectionManager::setSystemTrayVisual() qCCritical(SNIPROXY) << "not running under an X11 environment. Quitting"; return; } -} +} \ No newline at end of file From dcc08cf706cfbcc7ba1f4f5b85631231c0b7be22 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:13:39 +0800 Subject: [PATCH 132/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 94 +++++++++++++----------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 59fd2f0..30dd394 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -109,64 +109,74 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) } } -bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) +bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { + Q_UNUSED(result) if (eventType != "xcb_generic_event_t") { return false; } xcb_generic_event_t *ev = static_cast(message); - const auto responseType = XCB_EVENT_RESPONSE_TYPE(ev); - if (responseType == XCB_CLIENT_MESSAGE) { - const auto ce = reinterpret_cast(ev); - if (ce->type == Xcb::atoms->opcodeAtom) { - switch (ce->data.data32[1]) { - case SYSTEM_TRAY_REQUEST_DOCK: - dock(ce->data.data32[2]); - return true; + + if (auto *native = dynamic_cast(qApp)) { + xcb_connection_t *c = native->connection(); // 使用新的接口获取X11连接 + + if (responseType == XCB_CLIENT_MESSAGE) { + const auto ce = reinterpret_cast(ev); + if (ce->type == Xcb::atoms->opcodeAtom) { + switch (ce->data.data32[1]) { + case SYSTEM_TRAY_REQUEST_DOCK: + dock(ce->data.data32[2]); + return true; + } } - } - } else if (responseType == XCB_UNMAP_NOTIFY) { - const auto unmappedWId = reinterpret_cast(ev)->window; - if (m_proxies.contains(unmappedWId)) { - undock(unmappedWId); - } - } else if (responseType == XCB_DESTROY_NOTIFY) { - const auto destroyedWId = reinterpret_cast(ev)->window; - if (m_proxies.contains(destroyedWId)) { - undock(destroyedWId); - } - } else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { - const auto damagedWId = reinterpret_cast(ev)->drawable; - const auto sniProxy = m_proxies.value(damagedWId); - if (sniProxy) { - sniProxy->update(); - xcb_damage_subtract(QX11Info::connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); - } - } else if (responseType == XCB_CONFIGURE_REQUEST) { - const auto event = reinterpret_cast(ev); - const auto sniProxy = m_proxies.value(event->window); - if (sniProxy) { - // The embedded window tries to move or resize. Ignore move, handle resize only. - if ((event->value_mask & XCB_CONFIG_WINDOW_WIDTH) || (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT)) { - sniProxy->resizeWindow(event->width, event->height); + } else if (responseType == XCB_UNMAP_NOTIFY) { + const auto unmappedWId = reinterpret_cast(ev)->window; + if (m_proxies.contains(unmappedWId)) { + undock(unmappedWId); } - } - } else if (responseType == XCB_VISIBILITY_NOTIFY) { - const auto event = reinterpret_cast(ev); - // it's possible that something showed our container window, we have to hide it - // workaround for BUG 357443: when KWin is restarted, container window is shown on top - if (event->state == XCB_VISIBILITY_UNOBSCURED) { - for (auto sniProxy : m_proxies.values()) { - sniProxy->hideContainerWindow(event->window); + } else if (responseType == XCB_DESTROY_NOTIFY) { + const auto destroyedWId = reinterpret_cast(ev)->window; + if (m_proxies.contains(destroyedWId)) { + undock(destroyedWId); + } + } else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) { + const auto damagedWId = reinterpret_cast(ev)->drawable; + const auto sniProxy = m_proxies.value(damagedWId); + if (sniProxy) { + sniProxy->update(); + + xcb_damage_subtract(c, m_damageWatches[damagedWId], XCB_NONE, XCB_NONE); // 修改为使用新的X11连接 + } + } else if (responseType == XCB_CONFIGURE_REQUEST) { + const auto event = reinterpret_cast(ev); + const auto sniProxy = m_proxies.value(event->window); + if (sniProxy) { + // The embedded window tries to move or resize. Ignore move, handle resize only. + if ((event->value_mask & XCB_CONFIG_WINDOW_WIDTH) || (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT)) { + sniProxy->resizeWindow(event->width, event->height); + } + } + } else if (responseType == XCB_VISIBILITY_NOTIFY) { + const auto event = reinterpret_cast(ev); + // it's possible that something showed our container window, we have to hide it + // workaround for BUG 357443: when KWin is restarted, container window is shown on top + if (event->state == XCB_VISIBILITY_UNOBSCURED) { + for (auto sniProxy : m_proxies.values()) { + sniProxy->hideContainerWindow(event->window); + } } } + } else { + qCCritical(SNIPROXY) << "not running under an X11 environment. Quitting"; + return false; } return false; } + void FdoSelectionManager::setSystemTrayVisual() { if (auto *native = dynamic_cast(qApp)) { From 42c1045beba664831970134234d2d1ecb8e001c5 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:13:54 +0800 Subject: [PATCH 133/254] modified: xembed-sni-proxy/fdoselectionmanager.h --- xembed-sni-proxy/fdoselectionmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.h b/xembed-sni-proxy/fdoselectionmanager.h index 668981c..4a18f52 100755 --- a/xembed-sni-proxy/fdoselectionmanager.h +++ b/xembed-sni-proxy/fdoselectionmanager.h @@ -25,7 +25,7 @@ class FdoSelectionManager : public QObject, public QAbstractNativeEventFilter ~FdoSelectionManager() override; protected: - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; // bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; private Q_SLOTS: From 8a6d8569c8b24def91656e6df6c69003c79aeb8e Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:21:25 +0800 Subject: [PATCH 134/254] modified: notificationd/datehelper.cpp modified: polkit-agent/dialog.cpp --- notificationd/datehelper.cpp | 3 ++- polkit-agent/dialog.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notificationd/datehelper.cpp b/notificationd/datehelper.cpp index 396fd01..b700566 100755 --- a/notificationd/datehelper.cpp +++ b/notificationd/datehelper.cpp @@ -1,5 +1,6 @@ #include "datehelper.h" #include +#include DateHelper::DateHelper(QObject *parent) : QObject(parent) { @@ -30,5 +31,5 @@ QString DateHelper::friendlyTime(const QDateTime &time) else if (days <= 10) return tr("%1 days ago").arg(days); - return time.toString(Qt::DefaultLocaleShortDate); + return time.toString(QLocale::toDate()); } diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index f5d9729..4c7e3d6 100755 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -43,7 +43,7 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->setClearBeforeRendering(true); + m_view->beforeRenderPassRecording(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); From 9a0741b9e227608c59fa333a975e2b6e0cd6713c Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:26:14 +0800 Subject: [PATCH 135/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 7c7feff..29c78f8 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -41,7 +41,7 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = XGetXCBConnection(qApp->nativeInterface()->display())) + explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = dynamic_cast(qApp)->connection()) : m_connection(c) , m_retrieved(false) , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) From 4ff0781248e74cc88a44e0269af2acbdaf09c7d5 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:40:49 +0800 Subject: [PATCH 136/254] modified: session/processmanager.cpp modified: xembed-sni-proxy/fdoselectionmanager.cpp --- session/processmanager.cpp | 2 +- xembed-sni-proxy/fdoselectionmanager.cpp | 85 ++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index c62878b..aceddf1 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -180,7 +180,7 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag if (!m_wmStarted && m_waitLoop) { // all window managers must set their name according to the spec - xcb_connection_t *connection = XGetXCBConnection(qApp->nativeInterface()->display()); + xcb_connection_t *connection = dynamic_cast(qApp)->connection() if (!QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()).isEmpty()) { qDebug() << "Window manager started"; diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 30dd394..10651a0 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -109,6 +109,48 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) } } +void FdoSelectionManager::dock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to dock window " << winId; + + if (m_proxies.contains(winId)) { + return; + } + + if (addDamageWatch(winId)) { + m_proxies[winId] = new SNIProxy(winId, this); + } +} + +void FdoSelectionManager::undock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to undock window " << winId; + + if (!m_proxies.contains(winId)) { + return; + } + m_proxies[winId]->deleteLater(); + m_proxies.remove(winId); +} + +void FdoSelectionManager::onClaimedOwnership() +{ + qCDebug(SNIPROXY) << "Manager selection claimed"; + + setSystemTrayVisual(); +} + +void FdoSelectionManager::onFailedToClaimOwnership() +{ + qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; + qApp->exit(-1); +} + +void FdoSelectionManager::onLostOwnership() +{ + qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; + qApp->exit(-1); +} bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { Q_UNUSED(result) @@ -177,6 +219,49 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m } +void FdoSelectionManager::dock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to dock window " << winId; + + if (m_proxies.contains(winId)) { + return; + } + + if (addDamageWatch(winId)) { + m_proxies[winId] = new SNIProxy(winId, this); + } +} + +void FdoSelectionManager::undock(xcb_window_t winId) +{ + qCDebug(SNIPROXY) << "trying to undock window " << winId; + + if (!m_proxies.contains(winId)) { + return; + } + m_proxies[winId]->deleteLater(); + m_proxies.remove(winId); +} + +void FdoSelectionManager::onClaimedOwnership() +{ + qCDebug(SNIPROXY) << "Manager selection claimed"; + + setSystemTrayVisual(); +} + +void FdoSelectionManager::onFailedToClaimOwnership() +{ + qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; + qApp->exit(-1); +} + +void FdoSelectionManager::onLostOwnership() +{ + qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; + qApp->exit(-1); +} + void FdoSelectionManager::setSystemTrayVisual() { if (auto *native = dynamic_cast(qApp)) { From b62369a26daa04a7b3ff47918d866e20dd5671e0 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:42:00 +0800 Subject: [PATCH 137/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index aceddf1..4a346ae 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -180,7 +180,7 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag if (!m_wmStarted && m_waitLoop) { // all window managers must set their name according to the spec - xcb_connection_t *connection = dynamic_cast(qApp)->connection() + xcb_connection_t *connection = dynamic_cast(qApp)->connection(); if (!QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()).isEmpty()) { qDebug() << "Window manager started"; From 54d21da8dbcd0b93bb2f99e4c44069382e5ff570 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:43:46 +0800 Subject: [PATCH 138/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 42 ------------------------ 1 file changed, 42 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 10651a0..0ab403f 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -109,48 +109,6 @@ bool FdoSelectionManager::addDamageWatch(xcb_window_t client) } } -void FdoSelectionManager::dock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to dock window " << winId; - - if (m_proxies.contains(winId)) { - return; - } - - if (addDamageWatch(winId)) { - m_proxies[winId] = new SNIProxy(winId, this); - } -} - -void FdoSelectionManager::undock(xcb_window_t winId) -{ - qCDebug(SNIPROXY) << "trying to undock window " << winId; - - if (!m_proxies.contains(winId)) { - return; - } - m_proxies[winId]->deleteLater(); - m_proxies.remove(winId); -} - -void FdoSelectionManager::onClaimedOwnership() -{ - qCDebug(SNIPROXY) << "Manager selection claimed"; - - setSystemTrayVisual(); -} - -void FdoSelectionManager::onFailedToClaimOwnership() -{ - qCWarning(SNIPROXY) << "failed to claim ownership of Systray Manager"; - qApp->exit(-1); -} - -void FdoSelectionManager::onLostOwnership() -{ - qCWarning(SNIPROXY) << "lost ownership of Systray Manager"; - qApp->exit(-1); -} bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { Q_UNUSED(result) From 882826efeb792f37664cfb51836e5ea8fcfa4ba0 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:47:03 +0800 Subject: [PATCH 139/254] modified: notificationd/datehelper.cpp --- notificationd/datehelper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/notificationd/datehelper.cpp b/notificationd/datehelper.cpp index b700566..3dae6db 100755 --- a/notificationd/datehelper.cpp +++ b/notificationd/datehelper.cpp @@ -1,6 +1,5 @@ #include "datehelper.h" #include -#include DateHelper::DateHelper(QObject *parent) : QObject(parent) { @@ -31,5 +30,5 @@ QString DateHelper::friendlyTime(const QDateTime &time) else if (days <= 10) return tr("%1 days ago").arg(days); - return time.toString(QLocale::toDate()); + return time.toString(QLocale::system().dateFormat(QLocale::ShortFormat)); } From abc72d8952b7302dab8f6df1d1416e12d700c365 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:47:21 +0800 Subject: [PATCH 140/254] modified: notificationd/datehelper.cpp --- notificationd/datehelper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/notificationd/datehelper.cpp b/notificationd/datehelper.cpp index 3dae6db..8635b4d 100755 --- a/notificationd/datehelper.cpp +++ b/notificationd/datehelper.cpp @@ -1,5 +1,6 @@ #include "datehelper.h" #include +#include DateHelper::DateHelper(QObject *parent) : QObject(parent) { From 52bb482486372041ba12b4bc7814b5bbfe37a53d Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:54:50 +0800 Subject: [PATCH 141/254] modified: polkit-agent/dialog.cpp modified: powerman/dimdisplayaction.cpp --- polkit-agent/dialog.cpp | 2 +- powerman/dimdisplayaction.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index 4c7e3d6..f5d9729 100755 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -43,7 +43,7 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->beforeRenderPassRecording(true); + m_view->setClearBeforeRendering(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 93aa5a6..f0a8e01 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -39,13 +39,10 @@ DimDisplayAction::DimDisplayAction(QObject *parent) { auto isPlatformX11 = qGuiApp->nativeInterface(); if (isPlatformX11) { - auto *x11App = qApp->nativeInterface(); - - // 获取Display类型的显示指针 - auto *displayID = x11App->display(); - // 从Display转换为xcb_connection_t类型的连接 - auto *connection = XGetXCBConnection(qApp->nativeInterface()->display()); + auto *native = dynamic_cast(qApp) + auto *connection = native->connection(); + auto *displayID = native->display(); xcb_dpms_set_timeouts(connection, 0, 0, 0); From ae9ce1f0e4f91feaf759f65128cd610e9f7c67d0 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:56:45 +0800 Subject: [PATCH 142/254] modified: powerman/dimdisplayaction.cpp --- powerman/dimdisplayaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index f0a8e01..de1983d 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -41,7 +41,7 @@ DimDisplayAction::DimDisplayAction(QObject *parent) if (isPlatformX11) { // 从Display转换为xcb_connection_t类型的连接 auto *native = dynamic_cast(qApp) - auto *connection = native->connection(); + xcb_connection_t *connection = native->connection(); auto *displayID = native->display(); xcb_dpms_set_timeouts(connection, 0, 0, 0); From 5088611309ea75b32177b87ca859c5416a2779e1 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 03:59:13 +0800 Subject: [PATCH 143/254] modified: powerman/dimdisplayaction.cpp --- powerman/dimdisplayaction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index de1983d..7f78b54 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -30,6 +30,7 @@ #include #include #include +#include DimDisplayAction::DimDisplayAction(QObject *parent) : Action(parent) From f568a0789edbdc5b1d4a3763a910cbb528e950c0 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:02:51 +0800 Subject: [PATCH 144/254] modified: powerman/dimdisplayaction.cpp --- powerman/dimdisplayaction.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index 7f78b54..cfd0e45 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -30,7 +30,6 @@ #include #include #include -#include DimDisplayAction::DimDisplayAction(QObject *parent) : Action(parent) @@ -40,14 +39,11 @@ DimDisplayAction::DimDisplayAction(QObject *parent) { auto isPlatformX11 = qGuiApp->nativeInterface(); if (isPlatformX11) { - // 从Display转换为xcb_connection_t类型的连接 - auto *native = dynamic_cast(qApp) - xcb_connection_t *connection = native->connection(); - auto *displayID = native->display(); + auto *native = dynamic_cast(qApp); - xcb_dpms_set_timeouts(connection, 0, 0, 0); + xcb_dpms_set_timeouts(native->connection(), 0, 0, 0); - XSetScreenSaver(displayID, 0, 0, 0, 0); + XSetScreenSaver(native->display(), 0, 0, 0, 0); } } From bd85d4149997c1a633250938ff8141736b0390cc Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:09:29 +0800 Subject: [PATCH 145/254] modified: polkit-agent/dialog.cpp modified: settings-daemon/mouse/x11libinputdummydevice.h --- polkit-agent/dialog.cpp | 3 ++- settings-daemon/mouse/x11libinputdummydevice.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index f5d9729..fc7ef56 100755 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -20,6 +20,7 @@ #include "dialog.h" #include +#include #include #include #include @@ -43,7 +44,7 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->setClearBeforeRendering(true); + m_view->beforeRenderPassRecording(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 2298626..f49e12c 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -9,7 +9,6 @@ #include #include -#include #include From 57b719e54d3ef0f11a4fecdb6d267c62a5df56db Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:15:54 +0800 Subject: [PATCH 146/254] modified: xembed-sni-proxy/CMakeLists.txt --- xembed-sni-proxy/CMakeLists.txt | 52 ++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/xembed-sni-proxy/CMakeLists.txt b/xembed-sni-proxy/CMakeLists.txt index 3f72ced..2d3b215 100755 --- a/xembed-sni-proxy/CMakeLists.txt +++ b/xembed-sni-proxy/CMakeLists.txt @@ -1,18 +1,46 @@ -cmake_minimum_required(VERSION 3.14) project(lingmo-xembedsniproxy) add_definitions(-DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_URL_CAST_FROM_STRING - -DQT_NO_CAST_FROM_BYTEARRAY) +-DQT_NO_CAST_FROM_ASCII +-DQT_NO_URL_CAST_FROM_STRING +-DQT_NO_CAST_FROM_BYTEARRAY) find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(X11 REQUIRED) -find_package(XCB REQUIRED COMPONENTS XCB RANDR XFIXES DAMAGE COMPOSITE SHM UTIL IMAGE) -find_package(Qt6 REQUIRED COMPONENTS Core Gui DBus Widgets) -find_package(KF6WindowSystem REQUIRED) +set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" + URL "http://www.x.org" + TYPE OPTIONAL + PURPOSE "Required for building the X11 based workspace") + +if(X11_FOUND) + find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR) + set_package_properties(XCB PROPERTIES TYPE REQUIRED) + if(NOT X11_SM_FOUND) + message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n") + endif(NOT X11_SM_FOUND) + + find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS) +endif() + +if(X11_FOUND AND XCB_XCB_FOUND) + set(HAVE_X11 1) +endif() + +find_package(XCB + REQUIRED COMPONENTS + XCB + XFIXES + DAMAGE + COMPOSITE + RANDR + SHM + UTIL + IMAGE +) + +find_package(KF6WindowSystem) set(XCB_LIBS XCB::XCB @@ -34,24 +62,22 @@ set(XEMBED_SNI_PROXY_SOURCES xtestsender.cpp ) -qt_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml sniproxy.h SNIProxy) +qt_add_dbus_adaptor(DBUS_SOURCES org.kde.StatusNotifierItem.xml + sniproxy.h SNIProxy) set(statusnotifierwatcher_xml org.kde.StatusNotifierWatcher.xml) qt_add_dbus_interface(DBUS_SOURCES ${statusnotifierwatcher_xml} statusnotifierwatcher_interface) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(lingmo-xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES} ${DBUS_SOURCES}) - -message(STATUS "X11 Libraries: ${X11_LIBRARIES}") - +set_package_properties(XCB PROPERTIES TYPE REQUIRED) target_link_libraries(lingmo-xembedsniproxy Qt6::Core Qt6::Gui Qt6::DBus - Qt6::Widgets KF6::WindowSystem ${XCB_LIBS} - ${X11_LIBRARIES} # 添加这个来确保链接X11库 + ${X11_LIBRARIES} X11::Xtst ) install(TARGETS lingmo-xembedsniproxy DESTINATION ${CMAKE_INSTALL_BINDIR}) From 7e074b989170ff4bb566a4075dbf218ae4775a0f Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:20:12 +0800 Subject: [PATCH 147/254] modified: polkit-agent/dialog.cpp modified: settings-daemon/touchpad/x11/xlibbackend.h --- polkit-agent/dialog.cpp | 2 +- settings-daemon/touchpad/x11/xlibbackend.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index fc7ef56..ea79cb4 100755 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -44,7 +44,7 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->beforeRenderPassRecording(true); + m_view->QQuickWindow::beforeRenderPassRecording(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h index d7a26c8..0d684c9 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -13,7 +13,6 @@ #include #include #include -#include #include "libinputtouchpad.h" #include "synapticstouchpad.h" From 9b1eac913c7ed74cbb1266d9e770a03bf7db435e Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:27:25 +0800 Subject: [PATCH 148/254] modified: notificationd/notificationpopup.cpp --- notificationd/notificationpopup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notificationd/notificationpopup.cpp b/notificationd/notificationpopup.cpp index c4c2b1b..479cd7f 100755 --- a/notificationd/notificationpopup.cpp +++ b/notificationd/notificationpopup.cpp @@ -23,6 +23,7 @@ #include #include +#include NotificationPopup::NotificationPopup(QQuickView *parent) : QQuickView(parent) @@ -36,7 +37,7 @@ NotificationPopup::NotificationPopup(QQuickView *parent) bool NotificationPopup::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::Show) { - KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + NETWinInfo::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); } return QObject::eventFilter(object, event); From 2fdcee82e5cdd07aeedfbd7031c2ca73b013ca42 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:32:56 +0800 Subject: [PATCH 149/254] modified: chotkeys/QHotkey/qhotkey_x11.cpp modified: chotkeys/hotkeys.cpp modified: polkit-agent/dialog.cpp modified: settings-daemon/mouse/mousemanager.cpp modified: settings-daemon/touchpad/x11/propertyinfo.h modified: settings-daemon/touchpad/x11/xlibbackend.h modified: settings-daemon/touchpad/x11/xlibnotifications.h modified: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h --- chotkeys/QHotkey/qhotkey_x11.cpp | 1 - chotkeys/hotkeys.cpp | 1 - polkit-agent/dialog.cpp | 3 +-- settings-daemon/mouse/mousemanager.cpp | 2 +- settings-daemon/touchpad/x11/propertyinfo.h | 1 - settings-daemon/touchpad/x11/xlibbackend.h | 2 +- settings-daemon/touchpad/x11/xlibnotifications.h | 1 - settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h | 1 - 8 files changed, 3 insertions(+), 9 deletions(-) diff --git a/chotkeys/QHotkey/qhotkey_x11.cpp b/chotkeys/QHotkey/qhotkey_x11.cpp index ce408e6..7bcd60c 100755 --- a/chotkeys/QHotkey/qhotkey_x11.cpp +++ b/chotkeys/QHotkey/qhotkey_x11.cpp @@ -5,7 +5,6 @@ #include #else #include - #include #endif #include diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index ceea3d6..a6e190d 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include diff --git a/polkit-agent/dialog.cpp b/polkit-agent/dialog.cpp index ea79cb4..7872676 100755 --- a/polkit-agent/dialog.cpp +++ b/polkit-agent/dialog.cpp @@ -20,7 +20,6 @@ #include "dialog.h" #include -#include #include #include #include @@ -44,7 +43,7 @@ Dialog::Dialog(const QString &action, const QString &message, m_view->rootContext()->setContextProperty("confirmation", this); m_view->rootContext()->setContextProperty("rootWindow", m_view); m_view->setResizeMode(QQuickView::SizeViewToRootObject); - m_view->QQuickWindow::beforeRenderPassRecording(true); + // m_view->setClearBeforeRendering(true); m_view->setDefaultAlphaBuffer(true); m_view->setColor(Qt::transparent); m_view->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 6d537b5..1917d60 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -22,7 +22,7 @@ Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, QX11Info::display())) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic castconnection())) { // init dbus new MouseAdaptor(this); diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 5d70986..5ece996 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -8,7 +8,6 @@ #define PROPERTYINFO_H #include -#include #include void XDeleter(void *p); diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h index 0d684c9..35e186e 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "libinputtouchpad.h" diff --git a/settings-daemon/touchpad/x11/xlibnotifications.h b/settings-daemon/touchpad/x11/xlibnotifications.h index fe3f03d..5ca6f1d 100755 --- a/settings-daemon/touchpad/x11/xlibnotifications.h +++ b/settings-daemon/touchpad/x11/xlibnotifications.h @@ -8,7 +8,6 @@ #define XLIBNOTIFICATIONS_H #include -#include #include #include diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h index 0a1c6aa..6abec2f 100755 --- a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h +++ b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h @@ -9,7 +9,6 @@ #include #include -#include #include #include From 3b09eda248aefed97148784c65e5f730755f96a8 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:39:52 +0800 Subject: [PATCH 150/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index a6e190d..cf5e0f1 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -60,7 +60,7 @@ bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, long // // Keyboard needs to be ungrabed after XGrabKey() activates the grab, // // otherwise it becomes frozen. -// xcb_connection_t *c = QX11Info::connection(); +// xcb_connection_t *c = dynamic_castconnection(); // xcb_void_cookie_t cookie = xcb_ungrab_keyboard_checked(c, XCB_TIME_CURRENT_TIME); // xcb_flush(c); @@ -147,17 +147,18 @@ void Hotkeys::registerKey(quint32 keycode) void Hotkeys::registerKey(quint32 key, quint32 mods) { - xcb_grab_key(QX11Info::connection(), + auto *native = dynamic_cast(qApp); + xcb_grab_key(dynamic_castconnection(), 1, - QX11Info::appRootWindow(), + DefaultRootWindow(native->display()), mods, key, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); - xcb_grab_key(QX11Info::connection(), + xcb_grab_key(dynamic_castconnection(), 1, - QX11Info::appRootWindow(), + DefaultRootWindow(native->display()), mods | XCB_MOD_MASK_2, key, XCB_GRAB_MODE_ASYNC, @@ -166,7 +167,8 @@ void Hotkeys::registerKey(quint32 key, quint32 mods) void Hotkeys::unregisterKey(quint32 key, quint32 mods) { - xcb_ungrab_key(QX11Info::connection(), key, QX11Info::appRootWindow(), mods); + auto *native = dynamic_cast(qApp); + xcb_ungrab_key(native->connection(), key, DefaultRootWindow(native->display()), mods); } quint32 Hotkeys::nativeKeycode(Qt::Key k) From 1a3d63baa122a923da825c764857954e573a7c9a Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:45:24 +0800 Subject: [PATCH 151/254] modified: chotkeys/hotkeys.cpp modified: notificationd/notificationpopup.cpp modified: notificationd/notificationwindow.cpp --- chotkeys/hotkeys.cpp | 1 + notificationd/notificationpopup.cpp | 1 + notificationd/notificationwindow.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index cf5e0f1..3ef4558 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include diff --git a/notificationd/notificationpopup.cpp b/notificationd/notificationpopup.cpp index 479cd7f..aff9f8a 100755 --- a/notificationd/notificationpopup.cpp +++ b/notificationd/notificationpopup.cpp @@ -23,6 +23,7 @@ #include #include +#include #include NotificationPopup::NotificationPopup(QQuickView *parent) diff --git a/notificationd/notificationwindow.cpp b/notificationd/notificationwindow.cpp index 7ff0c31..accb526 100755 --- a/notificationd/notificationwindow.cpp +++ b/notificationd/notificationwindow.cpp @@ -65,7 +65,7 @@ bool NotificationWindow::eventFilter(QObject *object, QEvent *event) QQuickView::setVisible(false); } } else if (event->type() == QEvent::Show) { - KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + NETWinInfo::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); HistoryModel::self()->updateTime(); } else if (event->type() == QEvent::Hide) { setMouseGrabEnabled(false); From 45f588db789005847b9a05e8f7449651cbc96028 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:49:42 +0800 Subject: [PATCH 152/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 3ef4558..939d50a 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include From cdecdcedb2e0909330103af298d211cc675941dc Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:51:59 +0800 Subject: [PATCH 153/254] modified: notificationd/notificationwindow.cpp modified: settings-daemon/mouse/mousemanager.cpp --- notificationd/notificationwindow.cpp | 3 ++- settings-daemon/mouse/mousemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notificationd/notificationwindow.cpp b/notificationd/notificationwindow.cpp index accb526..1950819 100755 --- a/notificationd/notificationwindow.cpp +++ b/notificationd/notificationwindow.cpp @@ -25,6 +25,7 @@ #include #include +#include NotificationWindow::NotificationWindow(QQuickView *parent) : QQuickView(parent) @@ -65,7 +66,7 @@ bool NotificationWindow::eventFilter(QObject *object, QEvent *event) QQuickView::setVisible(false); } } else if (event->type() == QEvent::Show) { - NETWinInfo::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); HistoryModel::self()->updateTime(); } else if (event->type() == QEvent::Hide) { setMouseGrabEnabled(false); diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 1917d60..3e6fda9 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -22,7 +22,7 @@ Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic castconnection())) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) { // init dbus new MouseAdaptor(this); From 02bd2cf1ad91d9f458b64afb6a3ed394f9699df8 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:54:19 +0800 Subject: [PATCH 154/254] modified: chotkeys/hotkeys.cpp modified: notificationd/notificationpopup.cpp --- chotkeys/hotkeys.cpp | 1 - notificationd/notificationpopup.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 939d50a..3ef4558 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include diff --git a/notificationd/notificationpopup.cpp b/notificationd/notificationpopup.cpp index aff9f8a..b3c907a 100755 --- a/notificationd/notificationpopup.cpp +++ b/notificationd/notificationpopup.cpp @@ -38,7 +38,7 @@ NotificationPopup::NotificationPopup(QQuickView *parent) bool NotificationPopup::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::Show) { - NETWinInfo::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); + KX11Extras::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); } return QObject::eventFilter(object, event); From 22f11f17c74d9f096c07221ff49943ac9c04a03b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 04:58:54 +0800 Subject: [PATCH 155/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 3ef4558..5249a26 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -1,6 +1,7 @@ #include "hotkeys.h" #include +#include #include #include #include From a4addc06a4799e5a8157d0492054f02e23bfd6e8 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 05:00:00 +0800 Subject: [PATCH 156/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 5249a26..5b664b7 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -1,7 +1,6 @@ #include "hotkeys.h" #include -#include #include #include #include @@ -17,6 +16,15 @@ #include +#include +#include +#include +#include +#include +#include +#include +#include + Hotkeys::Hotkeys(QObject *parent) : QObject(parent) { From 5033cee923e0d7bc6c4ff4a2d5f178025ab93f9e Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 05:02:54 +0800 Subject: [PATCH 157/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 5b664b7..f97b6fb 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -158,7 +158,7 @@ void Hotkeys::registerKey(quint32 keycode) void Hotkeys::registerKey(quint32 key, quint32 mods) { auto *native = dynamic_cast(qApp); - xcb_grab_key(dynamic_castconnection(), + xcb_grab_key(native->connection(), 1, DefaultRootWindow(native->display()), mods, @@ -166,7 +166,7 @@ void Hotkeys::registerKey(quint32 key, quint32 mods) XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); - xcb_grab_key(dynamic_castconnection(), + xcb_grab_key(native->connection(), 1, DefaultRootWindow(native->display()), mods | XCB_MOD_MASK_2, From 3a9c709929b615998036671f63367cca6e74e6d5 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 05:05:16 +0800 Subject: [PATCH 158/254] modified: chotkeys/CMakeLists.txt --- chotkeys/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chotkeys/CMakeLists.txt b/chotkeys/CMakeLists.txt index 3d41353..c5e54f7 100755 --- a/chotkeys/CMakeLists.txt +++ b/chotkeys/CMakeLists.txt @@ -1,7 +1,7 @@ find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) -find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras REQUIRED) +find_package(Qt6 COMPONENTS Core Widgets DBus REQUIRED) find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS) find_package(X11) @@ -19,10 +19,9 @@ add_executable(lingmo-chotkeys target_link_libraries(lingmo-chotkeys PRIVATE - Qt5::Core - Qt5::Widgets - Qt5::DBus - Qt5::X11Extras + Qt6::Core + Qt6::Widgets + Qt6::DBus ${XCB_LIBS} ${X11_LIBRARIES} XCB::KEYSYMS From 0740e5cdb5bb97c60f48b01e29bc2f436b62b28c Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 05:07:38 +0800 Subject: [PATCH 159/254] modified: chotkeys/hotkeys.h --- chotkeys/hotkeys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chotkeys/hotkeys.h b/chotkeys/hotkeys.h index b8a74e4..8442578 100755 --- a/chotkeys/hotkeys.h +++ b/chotkeys/hotkeys.h @@ -18,7 +18,7 @@ class Hotkeys : public QObject, public QAbstractNativeEventFilter explicit Hotkeys(QObject *parent = nullptr); ~Hotkeys(); - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; + bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; void registerKey(QKeySequence keySequence); void registerKey(quint32 keycode); From cc6b75baac94b3b122c56b789bbe42649f9d28bd Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:07:46 +0800 Subject: [PATCH 160/254] modified: chotkeys/hotkeys.cpp --- chotkeys/hotkeys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index f97b6fb..1e331df 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -36,7 +36,7 @@ Hotkeys::~Hotkeys() qApp->removeNativeEventFilter(this); } -bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) { Q_UNUSED(result); @@ -255,7 +255,7 @@ quint32 Hotkeys::nativeKeycode(Qt::Key k) key = 0; } } - return XKeysymToKeycode(QX11Info::display(), key); + return XKeysymToKeycode(dynamic_cast(qApp)->display(), key); } quint32 Hotkeys::nativeModifiers(Qt::KeyboardModifiers m) From e4048c22456bc760f6c1bac998f920de5a07ceba Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:15:44 +0800 Subject: [PATCH 161/254] modified: settings-daemon/mouse/mousemanager.cpp modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/mousemanager.cpp | 3 ++- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 3e6fda9..3599d08 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -19,10 +19,11 @@ #include "mousemanager.h" #include "mouseadaptor.h" +#include Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) { // init dbus new MouseAdaptor(this); diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index f49e12c..d5d598b 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -11,6 +11,7 @@ #include #include +#include struct LibinputSettings; From 925a68380e11a1c32768eeb2e65f10c394bddc5c Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:23:04 +0800 Subject: [PATCH 162/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index d5d598b..dc7a450 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -9,6 +9,7 @@ #include #include +#include #include #include From 116fbeda0f4271a2203b5ac8fe97a0b5667a6fd8 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:36:38 +0800 Subject: [PATCH 163/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index dc7a450..844a198 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include From 175287a77a18759bf7820dec55b224837da5fb33 Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:40:10 +0800 Subject: [PATCH 164/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 844a198..bb204b6 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include From 6401d048c70cc69d7b50b93bc1aa61b874814faa Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 20 Jun 2024 11:43:15 +0800 Subject: [PATCH 165/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index bb204b6..5cbee5f 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include From a4fa14de9c3d9b2bd1565a627cf676faebec197f Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 00:33:34 +0800 Subject: [PATCH 166/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 3599d08..c228be2 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,6 +20,7 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include +#include Mouse::Mouse(QObject *parent) : QObject(parent) From aecd0bd2f801874c23ba35680c3386a59f72916b Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 00:35:38 +0800 Subject: [PATCH 167/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index c228be2..5544913 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,7 +20,7 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include -#include +#include Mouse::Mouse(QObject *parent) : QObject(parent) From 29f85a81058f38c2bdf3c2f2c30a20c63ffe6dbb Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 00:39:56 +0800 Subject: [PATCH 168/254] modified: settings-daemon/mouse/mousemanager.cpp modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/mousemanager.cpp | 1 - settings-daemon/mouse/x11libinputdummydevice.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 5544913..3599d08 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,7 +20,6 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include -#include Mouse::Mouse(QObject *parent) : QObject(parent) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 5cbee5f..754329d 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -16,6 +16,8 @@ #include #include +#include +#include struct LibinputSettings; From 4160fb81ebdc1f7d8b077c63786bbc1544a6adea Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:01:27 +0800 Subject: [PATCH 169/254] modified: settings-daemon/battery/battery.cpp modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/battery/battery.cpp | 1 + settings-daemon/mouse/x11libinputdummydevice.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/settings-daemon/battery/battery.cpp b/settings-daemon/battery/battery.cpp index d95b3fd..698ba08 100755 --- a/settings-daemon/battery/battery.cpp +++ b/settings-daemon/battery/battery.cpp @@ -3,6 +3,7 @@ #include "primarybatteryadaptor.h" #include +#include #include enum TimeConstants { diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 754329d..5cbee5f 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -16,8 +16,6 @@ #include #include -#include -#include struct LibinputSettings; From 2ebdad98e14d3207066cb957be26c6432da7fbb6 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:07:20 +0800 Subject: [PATCH 170/254] modified: settings-daemon/battery/battery.cpp modified: settings-daemon/battery/battery.h --- settings-daemon/battery/battery.cpp | 1 - settings-daemon/battery/battery.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/settings-daemon/battery/battery.cpp b/settings-daemon/battery/battery.cpp index 698ba08..d95b3fd 100755 --- a/settings-daemon/battery/battery.cpp +++ b/settings-daemon/battery/battery.cpp @@ -3,7 +3,6 @@ #include "primarybatteryadaptor.h" #include -#include #include enum TimeConstants { diff --git a/settings-daemon/battery/battery.h b/settings-daemon/battery/battery.h index f2d4cb5..8272bc3 100755 --- a/settings-daemon/battery/battery.h +++ b/settings-daemon/battery/battery.h @@ -8,7 +8,7 @@ class Battery : public QObject { - Q_OBJECT + // Q_OBJECT Q_PROPERTY(int isPresent READ isPresent) Q_PROPERTY(int type READ type) Q_PROPERTY(int chargePercent READ chargePercent NOTIFY chargePercentChanged) From e256f4d3a15b4cb9a030222e7d86029c58d0f6ca Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:13:21 +0800 Subject: [PATCH 171/254] modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/upowerdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 0a8342d..fc8c30e 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -6,7 +6,7 @@ class UPowerDevice : public QObject { - Q_OBJECT + // Q_OBJECT public: enum Type { Unknown = 0, GenericInterface = 1, Processor = 2, From 8a9e9a6afda16952e96617a1f6fa59dbc76344ca Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:15:10 +0800 Subject: [PATCH 172/254] modified: settings-daemon/battery/battery.h --- settings-daemon/battery/battery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/battery/battery.h b/settings-daemon/battery/battery.h index 8272bc3..f2d4cb5 100755 --- a/settings-daemon/battery/battery.h +++ b/settings-daemon/battery/battery.h @@ -8,7 +8,7 @@ class Battery : public QObject { - // Q_OBJECT + Q_OBJECT Q_PROPERTY(int isPresent READ isPresent) Q_PROPERTY(int type READ type) Q_PROPERTY(int chargePercent READ chargePercent NOTIFY chargePercentChanged) From 251a1c95aff88ebb7e7b3c2373619bd8be6ad6a4 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:16:58 +0800 Subject: [PATCH 173/254] modified: settings-daemon/battery/battery.h modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/battery.h | 2 +- settings-daemon/battery/upowerdevice.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/settings-daemon/battery/battery.h b/settings-daemon/battery/battery.h index f2d4cb5..8272bc3 100755 --- a/settings-daemon/battery/battery.h +++ b/settings-daemon/battery/battery.h @@ -8,7 +8,7 @@ class Battery : public QObject { - Q_OBJECT + // Q_OBJECT Q_PROPERTY(int isPresent READ isPresent) Q_PROPERTY(int type READ type) Q_PROPERTY(int chargePercent READ chargePercent NOTIFY chargePercentChanged) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index fc8c30e..0a8342d 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -6,7 +6,7 @@ class UPowerDevice : public QObject { - // Q_OBJECT + Q_OBJECT public: enum Type { Unknown = 0, GenericInterface = 1, Processor = 2, From c80bf67fe2a21e5e66b2fc797887634c47b30b95 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:21:13 +0800 Subject: [PATCH 174/254] modified: notificationd/historymodel.cpp --- notificationd/historymodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notificationd/historymodel.cpp b/notificationd/historymodel.cpp index 50af0be..4d9f1de 100755 --- a/notificationd/historymodel.cpp +++ b/notificationd/historymodel.cpp @@ -23,6 +23,7 @@ #include #include #include +#include static HistoryModel *s_historyModel = nullptr; @@ -136,7 +137,7 @@ void HistoryModel::save() settings.clear(); QByteArray datas; - QDataStream out(&datas, QIODevice::WriteOnly); + QDataStream out(&datas, QIODeviceBase::WriteOnly); out << m_notifications; @@ -147,7 +148,7 @@ void HistoryModel::initDatas() { QSettings settings(QSettings::UserScope, "lingmoos", "notifications"); QByteArray listByteArray = settings.value("datas").toByteArray(); - QDataStream in(&listByteArray, QIODevice::ReadOnly); + QDataStream in(&listByteArray, QIODeviceBase::ReadOnly); in >> m_notifications; } From b1851f683d64b39e33f9742a94d1f23b90deae30 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 21 Jun 2024 01:24:22 +0800 Subject: [PATCH 175/254] modified: notificationd/CMakeLists.txt --- notificationd/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/notificationd/CMakeLists.txt b/notificationd/CMakeLists.txt index 25ced55..54f90cb 100755 --- a/notificationd/CMakeLists.txt +++ b/notificationd/CMakeLists.txt @@ -34,6 +34,7 @@ qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(lingmo-notificationd Qt6::Core Qt6::DBus + Qt6::Gui Qt6::Quick Qt6::Widgets KF6::WindowSystem From 1f0e27174382aff7a51cf06ce5f0d5f017877b09 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 28 Jun 2024 23:09:05 +0800 Subject: [PATCH 176/254] modified: CMakeLists.txt modified: notificationd/CMakeLists.txt --- CMakeLists.txt | 2 +- notificationd/CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5768bae..c12824c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) diff --git a/notificationd/CMakeLists.txt b/notificationd/CMakeLists.txt index 54f90cb..25ced55 100755 --- a/notificationd/CMakeLists.txt +++ b/notificationd/CMakeLists.txt @@ -34,7 +34,6 @@ qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${ts_files_replaced}) target_link_libraries(lingmo-notificationd Qt6::Core Qt6::DBus - Qt6::Gui Qt6::Quick Qt6::Widgets KF6::WindowSystem From 7dc92de3fe23637a736e3e313d51f578748695e2 Mon Sep 17 00:00:00 2001 From: Intro Date: Fri, 28 Jun 2024 23:19:52 +0800 Subject: [PATCH 177/254] modified: CMakeLists.txt modified: settings-daemon/battery/upowerdevice.cpp --- CMakeLists.txt | 2 +- settings-daemon/battery/upowerdevice.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c12824c..5768bae 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) diff --git a/settings-daemon/battery/upowerdevice.cpp b/settings-daemon/battery/upowerdevice.cpp index bb11fbd..7b4fe05 100755 --- a/settings-daemon/battery/upowerdevice.cpp +++ b/settings-daemon/battery/upowerdevice.cpp @@ -1,6 +1,7 @@ #include "upowerdevice.h" #include "power.h" +#include #include #include #include From d6cdf94e857187316382202389c26d03eeec913b Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 02:48:17 +0800 Subject: [PATCH 178/254] modified: settings-daemon/battery/upowerdevice.cpp modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/upowerdevice.cpp | 3 +-- settings-daemon/battery/upowerdevice.h | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/settings-daemon/battery/upowerdevice.cpp b/settings-daemon/battery/upowerdevice.cpp index 7b4fe05..c231821 100755 --- a/settings-daemon/battery/upowerdevice.cpp +++ b/settings-daemon/battery/upowerdevice.cpp @@ -1,7 +1,6 @@ #include "upowerdevice.h" #include "power.h" -#include #include #include #include @@ -187,7 +186,7 @@ void UPowerDevice::checkCache(const QString &key) const return; } - QVariant reply = m_device.property(key.toUtf8()); + QVariant reply = m_device.property(key.toUtf8()); // 修改:将QString转换为QByteArray if (reply.isValid()) { m_cache[key] = reply; diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 0a8342d..86ad3a4 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -3,6 +3,8 @@ #include #include +#include // 新增:Qt6需要显式包含QVariantMap头文件 +#include // 新增:Qt6需要显式包含QDBusPendingReply头文件 class UPowerDevice : public QObject { @@ -15,9 +17,9 @@ class UPowerDevice : public QObject Camera = 9, PortableMediaPlayer = 10, Battery = 12, NetworkShare = 14, Last = 0xffff }; - Q_ENUM(Type) + Q_ENUM(Type) // 新增:使Type枚举类型在Qt的元对象系统中可用 - explicit UPowerDevice(const QString &udi, QObject *parent = nullptr); + explicit UPowerDevice(const QString &udi, QObject *parent = nullptr); // 修改:使用nullptr初始化指针 bool queryDeviceInterface(Type type) const; QString description() const; From 39fa396d53c747133a14a23f3bb346f37cbf8603 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 02:53:18 +0800 Subject: [PATCH 179/254] modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/upowerdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 86ad3a4..9fc957d 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -5,6 +5,7 @@ #include #include // 新增:Qt6需要显式包含QVariantMap头文件 #include // 新增:Qt6需要显式包含QDBusPendingReply头文件 +#include // 新增:确保QMetaType头文件被包含 class UPowerDevice : public QObject { From f0a3a2ac69f0ddc0af64d876b11ad82422ec9751 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:13:53 +0800 Subject: [PATCH 180/254] modified: settings-daemon/battery/upowerdevice.cpp modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/upowerdevice.cpp | 12 ++++---- settings-daemon/battery/upowerdevice.h | 36 +++++++++++++++--------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/settings-daemon/battery/upowerdevice.cpp b/settings-daemon/battery/upowerdevice.cpp index c231821..40428fb 100755 --- a/settings-daemon/battery/upowerdevice.cpp +++ b/settings-daemon/battery/upowerdevice.cpp @@ -1,5 +1,5 @@ #include "upowerdevice.h" -#include "power.h" +#include "power.h" // 假设这是包含了 UP_DBUS_SERVICE 和 UP_DBUS_INTERFACE_DEVICE 的头文件 #include #include @@ -15,18 +15,18 @@ UPowerDevice::UPowerDevice(const QString &udi, QObject *parent) { if (m_device.isValid()) { if (m_device.metaObject()->indexOfSignal("Changed()") != -1) { - connect(&m_device, SIGNAL(Changed()), this, SLOT(slotChanged())); + connect(&m_device, &QDBusInterface::signal, this, &UPowerDevice::slotChanged); } else { // for UPower >= 0.99.0, missing Changed() signal QDBusConnection::systemBus().connect(UP_DBUS_SERVICE, m_udi, "org.freedesktop.DBus.Properties", "PropertiesChanged", this, - SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); + &UPowerDevice::onPropertiesChanged); } // TODO port this to Solid::Power, we can't link against kdelibs4support for this signal // older upower versions not affected QDBusConnection::systemBus().connect("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "PrepareForSleep", - this, SLOT(login1Resuming(bool))); + this, &UPowerDevice::login1Resuming); } } @@ -138,7 +138,7 @@ QMap UPowerDevice::allProperties() const QDBusMessage call = QDBusMessage::createMethodCall(m_device.service(), m_device.path(), "org.freedesktop.DBus.Properties", "GetAll"); call << m_device.interface(); - QDBusPendingReply< QVariantMap > reply = QDBusConnection::systemBus().asyncCall(call); + QDBusReply reply = QDBusConnection::systemBus().asyncCall(call); reply.waitForFinished(); if (reply.isValid()) { @@ -186,7 +186,7 @@ void UPowerDevice::checkCache(const QString &key) const return; } - QVariant reply = m_device.property(key.toUtf8()); // 修改:将QString转换为QByteArray + QVariant reply = m_device.property(key.toUtf8()); // QString 转换为 QByteArray if (reply.isValid()) { m_cache[key] = reply; diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 9fc957d..ace3815 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -3,24 +3,34 @@ #include #include -#include // 新增:Qt6需要显式包含QVariantMap头文件 -#include // 新增:Qt6需要显式包含QDBusPendingReply头文件 -#include // 新增:确保QMetaType头文件被包含 +#include +#include // 新增:确保包含QDBusPendingReply头文件 +#include // 新增:确保包含QMetaType头文件 class UPowerDevice : public QObject { Q_OBJECT public: - enum Type { Unknown = 0, GenericInterface = 1, Processor = 2, - Block = 3, StorageAccess = 4, StorageDrive = 5, - OpticalDrive = 6, StorageVolume = 7, OpticalDisc = 8, - Camera = 9, PortableMediaPlayer = 10, - Battery = 12, NetworkShare = 14, Last = 0xffff - }; - Q_ENUM(Type) // 新增:使Type枚举类型在Qt的元对象系统中可用 + enum Type { + Unknown = 0, + GenericInterface = 1, + Processor = 2, + Block = 3, + StorageAccess = 4, + StorageDrive = 5, + OpticalDrive = 6, + StorageVolume = 7, + OpticalDisc = 8, + Camera = 9, + PortableMediaPlayer = 10, + Battery = 12, + NetworkShare = 14, + Last = 0xffff + }; + Q_ENUM(Type) // 确保Type枚举在元对象系统中可用 - explicit UPowerDevice(const QString &udi, QObject *parent = nullptr); // 修改:使用nullptr初始化指针 + explicit UPowerDevice(const QString &udi, QObject *parent = nullptr); bool queryDeviceInterface(Type type) const; QString description() const; @@ -46,8 +56,8 @@ private slots: void checkCache(const QString &key) const; private: - mutable QDBusInterface m_device; - mutable QVariantMap m_cache; + QDBusInterface m_device; + QVariantMap m_cache; QString m_udi; }; From ceacfc577d2cdf25f84d1975de31100183c75c1e Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:44:11 +0800 Subject: [PATCH 181/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/battery/upowerdevice.cpp modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/CMakeLists.txt | 2 ++ settings-daemon/battery/upowerdevice.cpp | 13 +++++----- settings-daemon/battery/upowerdevice.h | 31 +++++++----------------- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 850c3b7..9521eb3 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.16) project(lingmo-settings-daemon) set(TARGET lingmo-settings-daemon) @@ -7,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(X11 REQUIRED) find_package(X11_XCB REQUIRED) find_package(XCB REQUIRED) +find_package(Qt6 REQUIRED COMPONENTS DBus LinguistTools) pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET) pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) diff --git a/settings-daemon/battery/upowerdevice.cpp b/settings-daemon/battery/upowerdevice.cpp index 40428fb..7b4fe05 100755 --- a/settings-daemon/battery/upowerdevice.cpp +++ b/settings-daemon/battery/upowerdevice.cpp @@ -1,6 +1,7 @@ #include "upowerdevice.h" -#include "power.h" // 假设这是包含了 UP_DBUS_SERVICE 和 UP_DBUS_INTERFACE_DEVICE 的头文件 +#include "power.h" +#include #include #include #include @@ -15,18 +16,18 @@ UPowerDevice::UPowerDevice(const QString &udi, QObject *parent) { if (m_device.isValid()) { if (m_device.metaObject()->indexOfSignal("Changed()") != -1) { - connect(&m_device, &QDBusInterface::signal, this, &UPowerDevice::slotChanged); + connect(&m_device, SIGNAL(Changed()), this, SLOT(slotChanged())); } else { // for UPower >= 0.99.0, missing Changed() signal QDBusConnection::systemBus().connect(UP_DBUS_SERVICE, m_udi, "org.freedesktop.DBus.Properties", "PropertiesChanged", this, - &UPowerDevice::onPropertiesChanged); + SLOT(onPropertiesChanged(QString, QVariantMap, QStringList))); } // TODO port this to Solid::Power, we can't link against kdelibs4support for this signal // older upower versions not affected QDBusConnection::systemBus().connect("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "PrepareForSleep", - this, &UPowerDevice::login1Resuming); + this, SLOT(login1Resuming(bool))); } } @@ -138,7 +139,7 @@ QMap UPowerDevice::allProperties() const QDBusMessage call = QDBusMessage::createMethodCall(m_device.service(), m_device.path(), "org.freedesktop.DBus.Properties", "GetAll"); call << m_device.interface(); - QDBusReply reply = QDBusConnection::systemBus().asyncCall(call); + QDBusPendingReply< QVariantMap > reply = QDBusConnection::systemBus().asyncCall(call); reply.waitForFinished(); if (reply.isValid()) { @@ -186,7 +187,7 @@ void UPowerDevice::checkCache(const QString &key) const return; } - QVariant reply = m_device.property(key.toUtf8()); // QString 转换为 QByteArray + QVariant reply = m_device.property(key.toUtf8()); if (reply.isValid()) { m_cache[key] = reply; diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index ace3815..0a8342d 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -3,32 +3,19 @@ #include #include -#include -#include // 新增:确保包含QDBusPendingReply头文件 -#include // 新增:确保包含QMetaType头文件 class UPowerDevice : public QObject { Q_OBJECT public: - enum Type { - Unknown = 0, - GenericInterface = 1, - Processor = 2, - Block = 3, - StorageAccess = 4, - StorageDrive = 5, - OpticalDrive = 6, - StorageVolume = 7, - OpticalDisc = 8, - Camera = 9, - PortableMediaPlayer = 10, - Battery = 12, - NetworkShare = 14, - Last = 0xffff - }; - Q_ENUM(Type) // 确保Type枚举在元对象系统中可用 + enum Type { Unknown = 0, GenericInterface = 1, Processor = 2, + Block = 3, StorageAccess = 4, StorageDrive = 5, + OpticalDrive = 6, StorageVolume = 7, OpticalDisc = 8, + Camera = 9, PortableMediaPlayer = 10, + Battery = 12, NetworkShare = 14, Last = 0xffff + }; + Q_ENUM(Type) explicit UPowerDevice(const QString &udi, QObject *parent = nullptr); @@ -56,8 +43,8 @@ private slots: void checkCache(const QString &key) const; private: - QDBusInterface m_device; - QVariantMap m_cache; + mutable QDBusInterface m_device; + mutable QVariantMap m_cache; QString m_udi; }; From c2eed7f47ce7441d5308399f04562c1284bbc4a1 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:46:29 +0800 Subject: [PATCH 182/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 9521eb3..cbcced3 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.16) project(lingmo-settings-daemon) set(TARGET lingmo-settings-daemon) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) From 39085fccb69fca5c5ff37cc6a62fe4f6d719dc7a Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:51:55 +0800 Subject: [PATCH 183/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 5cbee5f..5047411 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -16,6 +16,7 @@ #include #include +#include struct LibinputSettings; From e438d20da6b3565595e87d45236fd3864d389547 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:55:53 +0800 Subject: [PATCH 184/254] modified: CMakeLists.txt modified: settings-daemon/CMakeLists.txt modified: settings-daemon/mouse/x11libinputdummydevice.h --- CMakeLists.txt | 2 +- settings-daemon/CMakeLists.txt | 5 ----- settings-daemon/mouse/x11libinputdummydevice.h | 3 ++- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5768bae..01cefc5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(QT Core Gui Widgets Quick QuickControls2 DBus Xml LinguistTools) -find_package(Qt6 COMPONENTS ${QT} REQUIRED ) +find_package(Qt6 COMPONENTS ${QT} REQUIRED) # find_package(LingmoUI REQUIRED) find_package(PkgConfig REQUIRED) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index cbcced3..850c3b7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -1,17 +1,12 @@ -cmake_minimum_required(VERSION 3.16) project(lingmo-settings-daemon) set(TARGET lingmo-settings-daemon) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - find_package(ECM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(X11 REQUIRED) find_package(X11_XCB REQUIRED) find_package(XCB REQUIRED) -find_package(Qt6 REQUIRED COMPONENTS DBus LinguistTools) pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET) pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 5047411..8cc7792 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -14,9 +14,10 @@ #include #include + #include #include -#include +#include struct LibinputSettings; From 1d5f0ac04da782f7e2edf45816c235fa6e5dca5a Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 03:58:30 +0800 Subject: [PATCH 185/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 8cc7792..1ad0c23 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -13,11 +13,10 @@ #include #include #include - +#include #include #include -#include struct LibinputSettings; From 6795ed73ccc6d731677ccb607f8f4868007461fd Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:05:22 +0800 Subject: [PATCH 186/254] modified: settings-daemon/battery/upowerdevice.h --- settings-daemon/battery/upowerdevice.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 0a8342d..bbde75a 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -4,6 +4,8 @@ #include #include +#undef Bool + class UPowerDevice : public QObject { Q_OBJECT From 948090789b4adbe1cdab2c9db3081d2cd817a05f Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:07:01 +0800 Subject: [PATCH 187/254] modified: settings-daemon/battery/upowerdevice.h modified: settings-daemon/mouse/x11libinputdummydevice.cpp --- settings-daemon/battery/upowerdevice.h | 2 -- settings-daemon/mouse/x11libinputdummydevice.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index bbde75a..0a8342d 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -4,8 +4,6 @@ #include #include -#undef Bool - class UPowerDevice : public QObject { Q_OBJECT diff --git a/settings-daemon/mouse/x11libinputdummydevice.cpp b/settings-daemon/mouse/x11libinputdummydevice.cpp index 6c9b44d..3ea5cdb 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.cpp +++ b/settings-daemon/mouse/x11libinputdummydevice.cpp @@ -12,6 +12,8 @@ #include #include +#undef Bool + static Atom s_touchpadAtom; template From de40a023496b07fcd388970e813e8fd367822c4f Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:07:53 +0800 Subject: [PATCH 188/254] modified: settings-daemon/battery/upowerdevice.h modified: settings-daemon/mouse/x11libinputdummydevice.cpp --- settings-daemon/battery/upowerdevice.h | 2 ++ settings-daemon/mouse/x11libinputdummydevice.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/settings-daemon/battery/upowerdevice.h b/settings-daemon/battery/upowerdevice.h index 0a8342d..bbde75a 100755 --- a/settings-daemon/battery/upowerdevice.h +++ b/settings-daemon/battery/upowerdevice.h @@ -4,6 +4,8 @@ #include #include +#undef Bool + class UPowerDevice : public QObject { Q_OBJECT diff --git a/settings-daemon/mouse/x11libinputdummydevice.cpp b/settings-daemon/mouse/x11libinputdummydevice.cpp index 3ea5cdb..6c9b44d 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.cpp +++ b/settings-daemon/mouse/x11libinputdummydevice.cpp @@ -12,8 +12,6 @@ #include #include -#undef Bool - static Atom s_touchpadAtom; template From 3d0508a10cb65cb0807bedad7ef80cd7734835fa Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:18:33 +0800 Subject: [PATCH 189/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 3599d08..5544913 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,6 +20,7 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include +#include Mouse::Mouse(QObject *parent) : QObject(parent) From 425397ed998033435353d260a81d4cc614b1460c Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:20:21 +0800 Subject: [PATCH 190/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 5544913..0fa0c3a 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -21,6 +21,7 @@ #include "mouseadaptor.h" #include #include +#include Mouse::Mouse(QObject *parent) : QObject(parent) From b0abf6a2b288f82a6a95dd93387c9bb11e13af5a Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:28:37 +0800 Subject: [PATCH 191/254] modified: settings-daemon/touchpad/x11/propertyinfo.h --- settings-daemon/mouse/mousemanager.cpp | 2 -- settings-daemon/touchpad/x11/propertyinfo.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 0fa0c3a..3599d08 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,8 +20,6 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include -#include -#include Mouse::Mouse(QObject *parent) : QObject(parent) diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 5ece996..37e60e5 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -9,6 +9,7 @@ #include #include +#include void XDeleter(void *p); From 0f94f82a86b5f43fc3a7f44b1d33fc6992bab8f8 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:40:11 +0800 Subject: [PATCH 192/254] modified: settings-daemon/mouse/x11libinputdummydevice.h modified: settings-daemon/touchpad/x11/propertyinfo.h --- settings-daemon/mouse/x11libinputdummydevice.h | 1 + settings-daemon/touchpad/x11/propertyinfo.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 1ad0c23..4288dba 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 37e60e5..5ece996 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -9,7 +9,6 @@ #include #include -#include void XDeleter(void *p); From 77c7e048ef6ef56804704a461c23ec0710e8f358 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:42:45 +0800 Subject: [PATCH 193/254] modified: settings-daemon/mouse/x11libinputdummydevice.h modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/mouse/x11libinputdummydevice.h | 1 - settings-daemon/touchpad/x11/propertyinfo.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 4288dba..1ad0c23 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index 12e4a8a..d4c2e24 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -6,6 +6,7 @@ #include "propertyinfo.h" +#include #include #include From f866ae6efc305493d84c6940067250acc4f100f4 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:46:34 +0800 Subject: [PATCH 194/254] modified: settings-daemon/theme/thememanager.cpp modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/theme/thememanager.cpp | 2 +- settings-daemon/touchpad/x11/propertyinfo.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/settings-daemon/theme/thememanager.cpp b/settings-daemon/theme/thememanager.cpp index d1600f0..4b5adef 100755 --- a/settings-daemon/theme/thememanager.cpp +++ b/settings-daemon/theme/thememanager.cpp @@ -448,7 +448,7 @@ void ThemeManager::updateGtk3Config() { QSettings settings(gtk3SettingsIniPath(), QSettings::IniFormat); settings.clear(); - settings.setIniCodec("UTF-8"); + // settings.setIniCodec("UTF-8"); settings.beginGroup("Settings"); // font diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index d4c2e24..12e4a8a 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -6,7 +6,6 @@ #include "propertyinfo.h" -#include #include #include From be021455e71bc2be3ec1709bccb65e3397448e84 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:53:22 +0800 Subject: [PATCH 195/254] modified: settings-daemon/touchpad/x11/xlibbackend.cpp --- settings-daemon/touchpad/x11/xlibbackend.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp index 0824bbe..7680b44 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -356,7 +356,7 @@ void XlibBackend::propertyChanged(xcb_atom_t prop) QStringList XlibBackend::listMouses(const QStringList &blacklist) { int nDevices = 0; - QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); + QScopedPointer info(XListInputDevices(m_display, &nDevices)); QStringList list; for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { if (m_device && i->id == static_cast(m_device->deviceId())) { @@ -374,7 +374,7 @@ QStringList XlibBackend::listMouses(const QStringList &blacklist) if (blacklist.contains(name, Qt::CaseInsensitive)) { continue; } - PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); + PropertyInfo enabled(m_display, i->id, m_enabledAtom.atom(), 0); if (enabled.value(0) == false) { continue; } @@ -404,7 +404,7 @@ QVector XlibBackend::getDevices() const void XlibBackend::watchForEvents(bool keyboard) { if (!m_notifications) { - m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); + m_notifications.reset(new XlibNotifications(m_display, m_device ? m_device->deviceId() : XIAllDevices)); connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); @@ -419,7 +419,7 @@ void XlibBackend::watchForEvents(bool keyboard) return; } - m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); + m_keyboard.reset(new XRecordKeyboardMonitor(m_display)); connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); } From 5222a8336826fb0b48056f392956f56f6de9aec7 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:56:25 +0800 Subject: [PATCH 196/254] modified: settings-daemon/touchpad/x11/xlibbackend.cpp --- settings-daemon/touchpad/x11/xlibbackend.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp index 7680b44..1bf0700 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -356,7 +356,7 @@ void XlibBackend::propertyChanged(xcb_atom_t prop) QStringList XlibBackend::listMouses(const QStringList &blacklist) { int nDevices = 0; - QScopedPointer info(XListInputDevices(m_display, &nDevices)); + QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); QStringList list; for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { if (m_device && i->id == static_cast(m_device->deviceId())) { @@ -374,7 +374,7 @@ QStringList XlibBackend::listMouses(const QStringList &blacklist) if (blacklist.contains(name, Qt::CaseInsensitive)) { continue; } - PropertyInfo enabled(m_display, i->id, m_enabledAtom.atom(), 0); + PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); if (enabled.value(0) == false) { continue; } @@ -404,7 +404,7 @@ QVector XlibBackend::getDevices() const void XlibBackend::watchForEvents(bool keyboard) { if (!m_notifications) { - m_notifications.reset(new XlibNotifications(m_display, m_device ? m_device->deviceId() : XIAllDevices)); + m_notifications.reset(new XlibNotifications(m_display.get(), m_device ? m_device->deviceId() : XIAllDevices)); connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); @@ -419,7 +419,7 @@ void XlibBackend::watchForEvents(bool keyboard) return; } - m_keyboard.reset(new XRecordKeyboardMonitor(m_display)); + m_keyboard.reset(new XRecordKeyboardMonitor(m_display.get())); connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); } From 7d332a9b2dd304c9e0d56ba395aaae3707bbb072 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 04:59:35 +0800 Subject: [PATCH 197/254] modified: settings-daemon/touchpad/x11/synapticstouchpad.cpp --- settings-daemon/touchpad/x11/synapticstouchpad.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp index 37d60aa..22f8123 100755 --- a/settings-daemon/touchpad/x11/synapticstouchpad.cpp +++ b/settings-daemon/touchpad/x11/synapticstouchpad.cpp @@ -9,6 +9,7 @@ #include #include "synapticstouchpad.h" +#include "xlibbackend.h" #include #include From 9c712de04752713d41a746d8099e090c1b9f92e5 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:06:59 +0800 Subject: [PATCH 198/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/touchpad/x11/propertyinfo.h modified: settings-daemon/touchpad/x11/synapticstouchpad.cpp --- settings-daemon/CMakeLists.txt | 10 +++------- settings-daemon/touchpad/x11/propertyinfo.h | 1 + settings-daemon/touchpad/x11/synapticstouchpad.cpp | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 850c3b7..e959586 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,10 +28,6 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -57,9 +53,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 5ece996..964c61d 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -10,6 +10,7 @@ #include #include + void XDeleter(void *p); struct PropertyInfo { diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp index 22f8123..37d60aa 100755 --- a/settings-daemon/touchpad/x11/synapticstouchpad.cpp +++ b/settings-daemon/touchpad/x11/synapticstouchpad.cpp @@ -9,7 +9,6 @@ #include #include "synapticstouchpad.h" -#include "xlibbackend.h" #include #include From 4853a8c68a64182b4b27fcd19aed8a2c3b1ecae6 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:09:20 +0800 Subject: [PATCH 199/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index e959586..53306a7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -26,8 +26,6 @@ file (GLOB_RECURSE SRCS "language/*.h" "dock/*.cpp" "dock/*.h" - "mouse/*.h" - "mouse/*.cpp" ) set(SOURCES ${SRCS}) @@ -50,9 +48,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES dock/com.lingmo.Dock.xml dock/dock.h Dock) -qt_add_dbus_adaptor(DBUS_SOURCES - mouse/com.lingmo.Mouse.xml - mouse/mousemanager.h Mouse) +# qt_add_dbus_adaptor(DBUS_SOURCES +# mouse/com.lingmo.Mouse.xml +# mouse/mousemanager.h Mouse) # qt_add_dbus_adaptor(DBUS_SOURCES # touchpad/com.lingmo.Touchpad.xml # touchpad/touchpadmanager.h TouchpadManager) From 52e3c6769a7600f7ebb05c4b38dbded57dabf3c2 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:13:34 +0800 Subject: [PATCH 200/254] modified: CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01cefc5..f1810bf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(QT Core Gui Widgets Quick QuickControls2 DBus Xml LinguistTools) find_package(Qt6 COMPONENTS ${QT} REQUIRED) -# find_package(LingmoUI REQUIRED) + find_package(PkgConfig REQUIRED) include(GNUInstallDirs) From ce23e1db75ecd9f7eee2969f2c127f0732e31d42 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:14:47 +0800 Subject: [PATCH 201/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 53306a7..4c57e63 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -48,12 +48,12 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES dock/com.lingmo.Dock.xml dock/dock.h Dock) -# qt_add_dbus_adaptor(DBUS_SOURCES -# mouse/com.lingmo.Mouse.xml -# mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + mouse/com.lingmo.Mouse.xml + mouse/mousemanager.h Mouse) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From c0abaabafefc72b7bd2b757ff153acf0c9ce4021 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:15:59 +0800 Subject: [PATCH 202/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 4c57e63..4a17d42 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -51,9 +51,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 70d532c34a6714ca2418caeadfdbdab3e0304216 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:20:41 +0800 Subject: [PATCH 203/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/CMakeLists.txt | 12 +++++++++--- settings-daemon/mouse/mousemanager.cpp | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 4a17d42..850c3b7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -26,6 +26,12 @@ file (GLOB_RECURSE SRCS "language/*.h" "dock/*.cpp" "dock/*.h" + "mouse/*.h" + "mouse/*.cpp" + "touchpad/*.h" + "touchpad/*.cpp" + "touchpad/x11/*.h" + "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -51,9 +57,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 3599d08..a1c9481 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,11 +20,13 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include +#include Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) { + m_inputDummydevice = new X11LibinputDummyDevice(this, QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("connection")); + // init dbus new MouseAdaptor(this); QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mouse"), this); From 574bb04a19e1bbf5d7bee80f1ccc94926c06e930 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:22:21 +0800 Subject: [PATCH 204/254] modified: settings-daemon/mouse/mousemanager.h --- settings-daemon/mouse/mousemanager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings-daemon/mouse/mousemanager.h b/settings-daemon/mouse/mousemanager.h index 07b626a..c878fd5 100755 --- a/settings-daemon/mouse/mousemanager.h +++ b/settings-daemon/mouse/mousemanager.h @@ -21,6 +21,8 @@ #define MOUSE_H #include +#include +#include #include "x11libinputdummydevice.h" class Mouse : public QObject From caa2ac80f4bb247e8d96671c2d30170b0d8b1b34 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:24:14 +0800 Subject: [PATCH 205/254] modified: settings-daemon/mouse/mousemanager.cpp modified: settings-daemon/touchpad/x11/xlibbackend.cpp --- settings-daemon/mouse/mousemanager.cpp | 4 +--- settings-daemon/touchpad/x11/xlibbackend.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index a1c9481..3599d08 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -20,13 +20,11 @@ #include "mousemanager.h" #include "mouseadaptor.h" #include -#include Mouse::Mouse(QObject *parent) : QObject(parent) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) { - m_inputDummydevice = new X11LibinputDummyDevice(this, QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("connection")); - // init dbus new MouseAdaptor(this); QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mouse"), this); diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp index 1bf0700..0824bbe 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -404,7 +404,7 @@ QVector XlibBackend::getDevices() const void XlibBackend::watchForEvents(bool keyboard) { if (!m_notifications) { - m_notifications.reset(new XlibNotifications(m_display.get(), m_device ? m_device->deviceId() : XIAllDevices)); + m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); @@ -419,7 +419,7 @@ void XlibBackend::watchForEvents(bool keyboard) return; } - m_keyboard.reset(new XRecordKeyboardMonitor(m_display.get())); + m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); } From b5008157bbf27f58e171ee63791ff7faa01d25ea Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:26:03 +0800 Subject: [PATCH 206/254] modified: settings-daemon/touchpad/x11/propertyinfo.h --- settings-daemon/touchpad/x11/propertyinfo.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 964c61d..0e91e92 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -9,6 +9,7 @@ #include #include +#include void XDeleter(void *p); From 795a9e16297a4b1b9505f995dc74cd71941e4534 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:28:48 +0800 Subject: [PATCH 207/254] modified: settings-daemon/touchpad/touchpadmanager.h --- settings-daemon/touchpad/touchpadmanager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h index d8f84d6..e90d575 100755 --- a/settings-daemon/touchpad/touchpadmanager.h +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -2,6 +2,7 @@ #define TOUCHPADMANAGER_H #include +#include #include "x11/xlibbackend.h" class TouchpadManager : public QObject From 05ea965dc4d65df3ba97f2d2105ef8d173cd4306 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:31:38 +0800 Subject: [PATCH 208/254] modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/touchpad/x11/propertyinfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index 12e4a8a..b23988a 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include From dbb5a0f5fe20a2a456024a65de1fc34e998327ed Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 05:34:37 +0800 Subject: [PATCH 209/254] modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/touchpad/x11/propertyinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index b23988a..481edcc 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -6,9 +6,9 @@ #include "propertyinfo.h" +#include #include #include -#include #include #include From e194dce385b575ef7fdccb41018778bc7305d96c Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 15:41:19 +0800 Subject: [PATCH 210/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 2 ++ settings-daemon/touchpad/x11/propertyinfo.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index 13c20c8..bcb0cf6 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -17,6 +17,8 @@ #include +#define __stdcall + const Parameter libinputProperties[] = { /* libinput disable supports property */ diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index 481edcc..12e4a8a 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -6,7 +6,6 @@ #include "propertyinfo.h" -#include #include #include From a35f146b42c7ea7afa6a51f7a51b6128ec88b9ca Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:04:37 +0800 Subject: [PATCH 211/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index bcb0cf6..967d47c 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -4,11 +4,11 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "libinputtouchpad.h" - #include #include +#include "libinputtouchpad.h" + #include #include @@ -17,8 +17,6 @@ #include -#define __stdcall - const Parameter libinputProperties[] = { /* libinput disable supports property */ From 16ee7e26ed1b0035a7686ebcc4e52f3348389020 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:06:13 +0800 Subject: [PATCH 212/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp modified: settings-daemon/touchpad/x11/propertyinfo.cpp --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 4 ++-- settings-daemon/touchpad/x11/propertyinfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index 967d47c..13c20c8 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -4,11 +4,11 @@ SPDX-License-Identifier: GPL-2.0-or-later */ +#include "libinputtouchpad.h" + #include #include -#include "libinputtouchpad.h" - #include #include diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp index 12e4a8a..c8acf79 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -4,11 +4,11 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "propertyinfo.h" - #include #include +#include "propertyinfo.h" + #include #include #include From 0a0cc9dc354fd80ddee1a266b2116a7c323d9f9d Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:29:31 +0800 Subject: [PATCH 213/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index 13c20c8..78014e3 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -15,6 +15,7 @@ #include #include +#include #include const Parameter libinputProperties[] = { From 63aeb8dce23ba07be9706df492c62ccbe29d0fe2 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:32:17 +0800 Subject: [PATCH 214/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/touchpad/x11/propertyinfo.h --- settings-daemon/CMakeLists.txt | 10 +++------- settings-daemon/touchpad/x11/propertyinfo.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 850c3b7..e959586 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,10 +28,6 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -57,9 +53,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h index 0e91e92..37e60e5 100755 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -11,7 +11,6 @@ #include #include - void XDeleter(void *p); struct PropertyInfo { From ff0182850b189dd141130de3df5ac860726f292c Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:33:31 +0800 Subject: [PATCH 215/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index e959586..850c3b7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,6 +28,10 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" + "touchpad/*.h" + "touchpad/*.cpp" + "touchpad/x11/*.h" + "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -53,9 +57,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 836e66243fffaf86246362c4207241c8263c8a3f Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:35:32 +0800 Subject: [PATCH 216/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index 78014e3..8104b2d 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -15,7 +15,8 @@ #include #include -#include +#include +#include #include const Parameter libinputProperties[] = { From f299a9c06a4b2800ba546d87174ca8340900d972 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:38:23 +0800 Subject: [PATCH 217/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.cpp modified: settings-daemon/touchpad/x11/libinputtouchpad.h --- settings-daemon/touchpad/x11/libinputtouchpad.cpp | 7 +++---- settings-daemon/touchpad/x11/libinputtouchpad.h | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp index 8104b2d..814b7eb 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -9,16 +9,15 @@ #include #include +#include +#include + #include #include #include #include -#include -#include -#include - const Parameter libinputProperties[] = { /* libinput disable supports property */ diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h index c1b8a5a..4d1733b 100755 --- a/settings-daemon/touchpad/x11/libinputtouchpad.h +++ b/settings-daemon/touchpad/x11/libinputtouchpad.h @@ -7,11 +7,12 @@ #ifndef LIBINPUTTOUCHPAD_H #define LIBINPUTTOUCHPAD_H +#include +#include + #include "../libinputcommon.h" #include "xlibtouchpad.h" -#include - class LibinputTouchpad : public LibinputCommon, public XlibTouchpad { Q_OBJECT From 2509f0f8e72ee6cf2e83ea1f6613cada16395757 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:40:46 +0800 Subject: [PATCH 218/254] modified: settings-daemon/touchpad/touchpadmanager.h modified: settings-daemon/touchpad/x11/xlibbackend.h --- settings-daemon/touchpad/touchpadmanager.h | 1 - settings-daemon/touchpad/x11/xlibbackend.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h index e90d575..d8f84d6 100755 --- a/settings-daemon/touchpad/touchpadmanager.h +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -2,7 +2,6 @@ #define TOUCHPADMANAGER_H #include -#include #include "x11/xlibbackend.h" class TouchpadManager : public QObject diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h index 35e186e..4c2a522 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -13,12 +13,14 @@ #include #include #include +#include #include "libinputtouchpad.h" #include "synapticstouchpad.h" #include "xlibtouchpad.h" #include +#include #include "propertyinfo.h" #include "xcbatom.h" From ab6886174a59ddc852b54a9717312de6e18d605f Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:43:08 +0800 Subject: [PATCH 219/254] modified: settings-daemon/touchpad/touchpadmanager.cpp modified: settings-daemon/touchpad/touchpadmanager.h modified: settings-daemon/touchpad/x11/xlibbackend.h --- settings-daemon/touchpad/touchpadmanager.cpp | 1 + settings-daemon/touchpad/touchpadmanager.h | 2 ++ settings-daemon/touchpad/x11/xlibbackend.h | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp index dba99f6..a00a056 100755 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -2,6 +2,7 @@ #include "touchpadadaptor.h" #include +#include TouchpadManager::TouchpadManager(QObject *parent) : QObject(parent) diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h index d8f84d6..6527143 100755 --- a/settings-daemon/touchpad/touchpadmanager.h +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -2,6 +2,8 @@ #define TOUCHPADMANAGER_H #include +#include + #include "x11/xlibbackend.h" class TouchpadManager : public QObject diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h index 4c2a522..c4af163 100755 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -20,7 +20,6 @@ #include "xlibtouchpad.h" #include -#include #include "propertyinfo.h" #include "xcbatom.h" From f66a6a5fa62660fd4e39b6c38cc5970bc1ea0f78 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:48:44 +0800 Subject: [PATCH 220/254] modified: chotkeys/hotkeys.cpp modified: settings-daemon/mouse/mousemanager.cpp modified: settings-daemon/touchpad/touchpadmanager.cpp modified: settings-daemon/touchpad/touchpadmanager.h --- chotkeys/hotkeys.cpp | 2 +- settings-daemon/mouse/mousemanager.cpp | 2 +- settings-daemon/touchpad/touchpadmanager.cpp | 1 - settings-daemon/touchpad/touchpadmanager.h | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/chotkeys/hotkeys.cpp b/chotkeys/hotkeys.cpp index 1e331df..d0a8d3b 100755 --- a/chotkeys/hotkeys.cpp +++ b/chotkeys/hotkeys.cpp @@ -70,7 +70,7 @@ bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, qint // // Keyboard needs to be ungrabed after XGrabKey() activates the grab, // // otherwise it becomes frozen. -// xcb_connection_t *c = dynamic_castconnection(); +// xcb_connection_t *c = dynamic_cast(qApp)->connection(); // xcb_void_cookie_t cookie = xcb_ungrab_keyboard_checked(c, XCB_TIME_CURRENT_TIME); // xcb_flush(c); diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 3599d08..268d829 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -23,7 +23,7 @@ Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_castconnection())) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_cast(qApp)->connection())) { // init dbus new MouseAdaptor(this); diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp index a00a056..dba99f6 100755 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -2,7 +2,6 @@ #include "touchpadadaptor.h" #include -#include TouchpadManager::TouchpadManager(QObject *parent) : QObject(parent) diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h index 6527143..d8f84d6 100755 --- a/settings-daemon/touchpad/touchpadmanager.h +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -2,8 +2,6 @@ #define TOUCHPADMANAGER_H #include -#include - #include "x11/xlibbackend.h" class TouchpadManager : public QObject From 08bc36bb66e245d6a5281572cacc7339e454e2c5 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:51:51 +0800 Subject: [PATCH 221/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 268d829..7c811a1 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -23,7 +23,7 @@ Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_cast(qApp)->connection())) + , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_cast(qApp)->display())) { // init dbus new MouseAdaptor(this); From fc33de5bba55936d4434d977d63fa8161d9b2dc2 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 17:58:41 +0800 Subject: [PATCH 222/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 850c3b7..e959586 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,10 +28,6 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -57,9 +53,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 1e21f0c942b648c459fba582fbfa3ee983dad893 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:00:46 +0800 Subject: [PATCH 223/254] deleted: settings-daemon/touchpad/com.lingmo.Touchpad.xml deleted: settings-daemon/touchpad/libinputcommon.cpp deleted: settings-daemon/touchpad/libinputcommon.h deleted: settings-daemon/touchpad/touchpadmanager.cpp deleted: settings-daemon/touchpad/touchpadmanager.h deleted: settings-daemon/touchpad/x11/libinputtouchpad.cpp deleted: settings-daemon/touchpad/x11/libinputtouchpad.h deleted: settings-daemon/touchpad/x11/propertyinfo.cpp deleted: settings-daemon/touchpad/x11/propertyinfo.h deleted: settings-daemon/touchpad/x11/synapticstouchpad.cpp deleted: settings-daemon/touchpad/x11/synapticstouchpad.h deleted: settings-daemon/touchpad/x11/xcbatom.cpp deleted: settings-daemon/touchpad/x11/xcbatom.h deleted: settings-daemon/touchpad/x11/xlibbackend.cpp deleted: settings-daemon/touchpad/x11/xlibbackend.h deleted: settings-daemon/touchpad/x11/xlibnotifications.cpp deleted: settings-daemon/touchpad/x11/xlibnotifications.h deleted: settings-daemon/touchpad/x11/xlibtouchpad.cpp deleted: settings-daemon/touchpad/x11/xlibtouchpad.h deleted: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp deleted: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h --- .../touchpad/com.lingmo.Touchpad.xml | 26 - settings-daemon/touchpad/libinputcommon.cpp | 9 - settings-daemon/touchpad/libinputcommon.h | 566 ------------------ settings-daemon/touchpad/touchpadmanager.cpp | 66 -- settings-daemon/touchpad/touchpadmanager.h | 37 -- .../touchpad/x11/libinputtouchpad.cpp | 402 ------------- .../touchpad/x11/libinputtouchpad.h | 149 ----- settings-daemon/touchpad/x11/propertyinfo.cpp | 86 --- settings-daemon/touchpad/x11/propertyinfo.h | 37 -- .../touchpad/x11/synapticstouchpad.cpp | 225 ------- .../touchpad/x11/synapticstouchpad.h | 34 -- settings-daemon/touchpad/x11/xcbatom.cpp | 48 -- settings-daemon/touchpad/x11/xcbatom.h | 36 -- settings-daemon/touchpad/x11/xlibbackend.cpp | 425 ------------- settings-daemon/touchpad/x11/xlibbackend.h | 124 ---- .../touchpad/x11/xlibnotifications.cpp | 135 ----- .../touchpad/x11/xlibnotifications.h | 41 -- settings-daemon/touchpad/x11/xlibtouchpad.cpp | 257 -------- settings-daemon/touchpad/x11/xlibtouchpad.h | 101 ---- .../touchpad/x11/xrecordkeyboardmonitor.cpp | 140 ----- .../touchpad/x11/xrecordkeyboardmonitor.h | 47 -- 21 files changed, 2991 deletions(-) delete mode 100755 settings-daemon/touchpad/com.lingmo.Touchpad.xml delete mode 100755 settings-daemon/touchpad/libinputcommon.cpp delete mode 100755 settings-daemon/touchpad/libinputcommon.h delete mode 100755 settings-daemon/touchpad/touchpadmanager.cpp delete mode 100755 settings-daemon/touchpad/touchpadmanager.h delete mode 100755 settings-daemon/touchpad/x11/libinputtouchpad.cpp delete mode 100755 settings-daemon/touchpad/x11/libinputtouchpad.h delete mode 100755 settings-daemon/touchpad/x11/propertyinfo.cpp delete mode 100755 settings-daemon/touchpad/x11/propertyinfo.h delete mode 100755 settings-daemon/touchpad/x11/synapticstouchpad.cpp delete mode 100755 settings-daemon/touchpad/x11/synapticstouchpad.h delete mode 100755 settings-daemon/touchpad/x11/xcbatom.cpp delete mode 100755 settings-daemon/touchpad/x11/xcbatom.h delete mode 100755 settings-daemon/touchpad/x11/xlibbackend.cpp delete mode 100755 settings-daemon/touchpad/x11/xlibbackend.h delete mode 100755 settings-daemon/touchpad/x11/xlibnotifications.cpp delete mode 100755 settings-daemon/touchpad/x11/xlibnotifications.h delete mode 100755 settings-daemon/touchpad/x11/xlibtouchpad.cpp delete mode 100755 settings-daemon/touchpad/x11/xlibtouchpad.h delete mode 100755 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp delete mode 100755 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h diff --git a/settings-daemon/touchpad/com.lingmo.Touchpad.xml b/settings-daemon/touchpad/com.lingmo.Touchpad.xml deleted file mode 100755 index c32ef00..0000000 --- a/settings-daemon/touchpad/com.lingmo.Touchpad.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/settings-daemon/touchpad/libinputcommon.cpp b/settings-daemon/touchpad/libinputcommon.cpp deleted file mode 100755 index 2d0a92d..0000000 --- a/settings-daemon/touchpad/libinputcommon.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "libinputcommon.h" - -#include "moc_libinputcommon.cpp" diff --git a/settings-daemon/touchpad/libinputcommon.h b/settings-daemon/touchpad/libinputcommon.h deleted file mode 100755 index 7d18def..0000000 --- a/settings-daemon/touchpad/libinputcommon.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Roman Gilg - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef LIBINPUTCOMMON_H -#define LIBINPUTCOMMON_H - -#include -#include - -namespace -{ -template -inline T valueLoaderPart(QVariant const &reply) -{ - Q_UNUSED(reply); - return T(); -} - -template<> -inline bool valueLoaderPart(QVariant const &reply) -{ - return reply.toBool(); -} - -template<> -inline int valueLoaderPart(QVariant const &reply) -{ - return reply.toInt(); -} - -template<> -inline quint32 valueLoaderPart(QVariant const &reply) -{ - return reply.toInt(); -} - -template<> -inline qreal valueLoaderPart(QVariant const &reply) -{ - return reply.toReal(); -} - -template<> -inline QString valueLoaderPart(QVariant const &reply) -{ - return reply.toString(); -} - -template<> -inline Qt::MouseButtons valueLoaderPart(QVariant const &reply) -{ - return static_cast(reply.toInt()); -} -} - -class LibinputCommon : public QObject -{ - Q_OBJECT - - // - // general - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - - // - // advanced - Q_PROPERTY(Qt::MouseButtons supportedButtons READ supportedButtons CONSTANT) - - Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT) - Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT) - Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged) - - Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT) - - Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT) - Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT) - Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged) - - Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT) - Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT) - Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged) - - // - // acceleration speed and profile - Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT) - Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged) - - Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT) - Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT) - Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY - pointerAccelerationProfileChanged) - - Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT) - Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT) - Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY - pointerAccelerationProfileChanged) - - // - // tapping - Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT) - Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged) - - Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT) - Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT) - Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY lmrTapButtonMapChanged) - - Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged) - - Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged) - - // - // scrolling - Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT) - Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT) - Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged) - - Q_PROPERTY(bool supportsHorizontalScrolling READ supportsHorizontalScrolling CONSTANT) - Q_PROPERTY(bool horizontalScrollingByDefault READ horizontalScrollingByDefault CONSTANT) - Q_PROPERTY(bool horizontalScrolling READ horizontalScrolling WRITE setHorizontalScrolling NOTIFY horizontalScrollingChanged) - - Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT) - Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged) - - Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT) - Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged) - - Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT) - Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged) - - Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT) - Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged) - - // Click Methods - Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT) - Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT) - Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged) - - Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT) - Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT) - Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged) - - Q_PROPERTY(bool supportsScrollFactor READ supportsScrollFactor CONSTANT) -public: - LibinputCommon() - { - } - virtual ~LibinputCommon() - { - } - - virtual QString name() const = 0; - virtual bool supportsDisableEvents() const = 0; - virtual bool isEnabled() const = 0; - virtual void setEnabled(bool set) = 0; - - // - // advanced - Qt::MouseButtons supportedButtons() const - { - return m_supportedButtons.val; - } - - virtual bool supportsLeftHanded() const = 0; - bool leftHandedEnabledByDefault() const - { - return m_leftHandedEnabledByDefault.val; - } - bool isLeftHanded() const - { - return m_leftHanded.val; - } - void setLeftHanded(bool set) - { - m_leftHanded.set(set); - } - - virtual bool supportsDisableEventsOnExternalMouse() const = 0; - - virtual bool supportsDisableWhileTyping() const = 0; - bool disableWhileTypingEnabledByDefault() const - { - return m_disableWhileTypingEnabledByDefault.val; - } - bool isDisableWhileTyping() const - { - return m_disableWhileTyping.val; - } - void setDisableWhileTyping(bool set) - { - m_disableWhileTyping.set(set); - } - - virtual bool supportsMiddleEmulation() const = 0; - bool middleEmulationEnabledByDefault() const - { - return m_middleEmulationEnabledByDefault.val; - } - bool isMiddleEmulation() const - { - return m_middleEmulation.val; - } - void setMiddleEmulation(bool set) - { - m_middleEmulation.set(set); - } - - virtual bool supportsPointerAcceleration() const = 0; - qreal pointerAcceleration() const - { - return m_pointerAcceleration.val; - } - void setPointerAcceleration(qreal acceleration) - { - m_pointerAcceleration.set(acceleration); - } - - virtual bool supportsPointerAccelerationProfileFlat() const = 0; - bool defaultPointerAccelerationProfileFlat() const - { - return m_defaultPointerAccelerationProfileFlat.val; - } - bool pointerAccelerationProfileFlat() const - { - return m_pointerAccelerationProfileFlat.val; - } - void setPointerAccelerationProfileFlat(bool set) - { - m_pointerAccelerationProfileFlat.set(set); - } - - virtual bool supportsPointerAccelerationProfileAdaptive() const = 0; - bool defaultPointerAccelerationProfileAdaptive() const - { - return m_defaultPointerAccelerationProfileAdaptive.val; - } - bool pointerAccelerationProfileAdaptive() const - { - return m_pointerAccelerationProfileAdaptive.val; - } - void setPointerAccelerationProfileAdaptive(bool set) - { - m_pointerAccelerationProfileAdaptive.set(set); - } - - // - // scrolling - virtual bool supportsNaturalScroll() const = 0; - bool naturalScrollEnabledByDefault() const - { - return m_naturalScrollEnabledByDefault.val; - } - bool isNaturalScroll() const - { - return m_naturalScroll.val; - } - void setNaturalScroll(bool set) - { - m_naturalScroll.set(set); - } - - virtual bool supportsHorizontalScrolling() const = 0; - bool horizontalScrollingByDefault() const - { - return true; - } - bool horizontalScrolling() const - { - return m_horizontalScrolling.val; - } - void setHorizontalScrolling(bool set) - { - m_horizontalScrolling.set(set); - } - - virtual bool supportsScrollTwoFinger() const = 0; - bool scrollTwoFingerEnabledByDefault() const - { - return m_scrollTwoFingerEnabledByDefault.val; - } - bool isScrollTwoFinger() const - { - return m_isScrollTwoFinger.val; - } - void setScrollTwoFinger(bool set) - { - m_isScrollTwoFinger.set(set); - } - - virtual bool supportsScrollEdge() const = 0; - bool scrollEdgeEnabledByDefault() const - { - return m_scrollEdgeEnabledByDefault.val; - } - bool isScrollEdge() const - { - return m_isScrollEdge.val; - } - void setScrollEdge(bool set) - { - m_isScrollEdge.set(set); - } - - virtual bool supportsScrollOnButtonDown() const = 0; - bool scrollOnButtonDownEnabledByDefault() const - { - return m_scrollOnButtonDownEnabledByDefault.val; - } - bool isScrollOnButtonDown() const - { - return m_isScrollOnButtonDown.val; - } - void setScrollOnButtonDown(bool set) - { - m_isScrollOnButtonDown.set(set); - } - - quint32 defaultScrollButton() const - { - return m_defaultScrollButton.val; - } - quint32 scrollButton() const - { - return m_scrollButton.val; - } - void setScrollButton(quint32 button) - { - m_scrollButton.set(button); - } - - // - // tapping - int tapFingerCount() const - { - return m_tapFingerCount.val; - } - bool tapToClickEnabledByDefault() const - { - return m_tapToClickEnabledByDefault.val; - } - bool isTapToClick() const - { - return m_tapToClick.val; - } - void setTapToClick(bool set) - { - m_tapToClick.set(set); - } - - bool supportsLmrTapButtonMap() const - { - return m_tapFingerCount.val > 1; - } - bool lmrTapButtonMapEnabledByDefault() const - { - return m_lmrTapButtonMapEnabledByDefault.val; - } - bool lmrTapButtonMap() const - { - return m_lmrTapButtonMap.val; - } - virtual void setLmrTapButtonMap(bool set) = 0; - - bool tapAndDragEnabledByDefault() const - { - return m_tapAndDragEnabledByDefault.val; - } - bool isTapAndDrag() const - { - return m_tapAndDrag.val; - } - void setTapAndDrag(bool set) - { - m_tapAndDrag.set(set); - } - - bool tapDragLockEnabledByDefault() const - { - return m_tapDragLockEnabledByDefault.val; - } - bool isTapDragLock() const - { - return m_tapDragLock.val; - } - void setTapDragLock(bool set) - { - m_tapDragLock.set(set); - } - - // - // click method - virtual bool supportsClickMethodAreas() const = 0; - bool defaultClickMethodAreas() const - { - return m_defaultClickMethodAreas.val; - } - bool isClickMethodAreas() const - { - return m_clickMethodAreas.val; - } - void setClickMethodAreas(bool set) - { - m_clickMethodAreas.set(set); - } - - virtual bool supportsClickMethodClickfinger() const = 0; - bool defaultClickMethodClickfinger() const - { - return m_defaultClickMethodClickfinger.val; - } - bool isClickMethodClickfinger() const - { - return m_clickMethodClickfinger.val; - } - void setClickMethodClickfinger(bool set) - { - m_clickMethodClickfinger.set(set); - } - - virtual bool supportsScrollFactor() const = 0; - -Q_SIGNALS: - void enabledChanged(); - // Tapping - void tapToClickChanged(); - void lmrTapButtonMapChanged(); - void tapAndDragChanged(); - void tapDragLockChanged(); - // Advanced - void leftHandedChanged(); - void disableWhileTypingChanged(); - void middleEmulationChanged(); - // acceleration speed and profile - void pointerAccelerationChanged(); - void pointerAccelerationProfileChanged(); - // scrolling - void naturalScrollChanged(); - void horizontalScrollingChanged(); - void scrollMethodChanged(); - void scrollButtonChanged(); - // click methods - void clickMethodChanged(); - -protected: - template - struct Prop { - explicit Prop(const QByteArray &name) - : name(name) - { - } - - void set(T newVal) - { - if (avail && val != newVal) { - val = newVal; - } - } - void set(const Prop &p) - { - if (avail && val != p.val) { - val = p.val; - } - } - bool changed() const - { - return avail && (old != val); - } - - // In wayland, name will be dbus name - QByteArray name; - bool avail; - T old; - T val; - }; - - // - // general - Prop m_supportsDisableEvents = Prop("supportsDisableEvents"); - Prop m_enabledDefault = Prop("enabledDefault"); - Prop m_enabled = Prop("enabled"); - - // - // advanced - Prop m_supportedButtons = Prop("supportedButtons"); - - Prop m_leftHandedEnabledByDefault = Prop("leftHandedEnabledByDefault"); - Prop m_leftHanded = Prop("leftHanded"); - - Prop m_supportsDisableEventsOnExternalMouse = Prop("supportsDisableEventsOnExternalMouse"); - - Prop m_disableWhileTypingEnabledByDefault = Prop("disableWhileTypingEnabledByDefault"); - Prop m_disableWhileTyping = Prop("disableWhileTyping"); - - Prop m_middleEmulationEnabledByDefault = Prop("middleEmulationEnabledByDefault"); - Prop m_middleEmulation = Prop("middleEmulation"); - - // - // acceleration speed and profile - Prop m_defaultPointerAcceleration = Prop("defaultPointerAcceleration"); - Prop m_pointerAcceleration = Prop("pointerAcceleration"); - - Prop m_supportsPointerAccelerationProfileFlat = Prop("supportsPointerAccelerationProfileFlat"); - Prop m_defaultPointerAccelerationProfileFlat = Prop("defaultPointerAccelerationProfileFlat"); - Prop m_pointerAccelerationProfileFlat = Prop("pointerAccelerationProfileFlat"); - - Prop m_supportsPointerAccelerationProfileAdaptive = Prop("supportsPointerAccelerationProfileAdaptive"); - Prop m_defaultPointerAccelerationProfileAdaptive = Prop("defaultPointerAccelerationProfileAdaptive"); - Prop m_pointerAccelerationProfileAdaptive = Prop("pointerAccelerationProfileAdaptive"); - - // - // tapping - Prop m_tapFingerCount = Prop("tapFingerCount"); - Prop m_tapToClickEnabledByDefault = Prop("tapToClickEnabledByDefault"); - Prop m_tapToClick = Prop("tapToClick"); - - Prop m_lmrTapButtonMapEnabledByDefault = Prop("lmrTapButtonMapEnabledByDefault"); - Prop m_lmrTapButtonMap = Prop("lmrTapButtonMap"); - - Prop m_tapAndDragEnabledByDefault = Prop("tapAndDragEnabledByDefault"); - Prop m_tapAndDrag = Prop("tapAndDrag"); - Prop m_tapDragLockEnabledByDefault = Prop("tapDragLockEnabledByDefault"); - Prop m_tapDragLock = Prop("tapDragLock"); - - // - // scrolling - Prop m_naturalScrollEnabledByDefault = Prop("naturalScrollEnabledByDefault"); - Prop m_naturalScroll = Prop("naturalScroll"); - - Prop m_horizontalScrolling = Prop("horizontalScrolling"); - - Prop m_supportsScrollTwoFinger = Prop("supportsScrollTwoFinger"); - Prop m_scrollTwoFingerEnabledByDefault = Prop("scrollTwoFingerEnabledByDefault"); - Prop m_isScrollTwoFinger = Prop("scrollTwoFinger"); - - Prop m_supportsScrollEdge = Prop("supportsScrollEdge"); - Prop m_scrollEdgeEnabledByDefault = Prop("scrollEdgeEnabledByDefault"); - Prop m_isScrollEdge = Prop("scrollEdge"); - - Prop m_supportsScrollOnButtonDown = Prop("supportsScrollOnButtonDown"); - Prop m_scrollOnButtonDownEnabledByDefault = Prop("scrollOnButtonDownEnabledByDefault"); - Prop m_isScrollOnButtonDown = Prop("scrollOnButtonDown"); - - Prop m_defaultScrollButton = Prop("defaultScrollButton"); - Prop m_scrollButton = Prop("scrollButton"); - - // Click Method - Prop m_supportsClickMethodAreas = Prop("supportsClickMethodAreas"); - Prop m_defaultClickMethodAreas = Prop("defaultClickMethodAreas"); - Prop m_clickMethodAreas = Prop("clickMethodAreas"); - - Prop m_supportsClickMethodClickfinger = Prop("supportsClickMethodClickfinger"); - Prop m_defaultClickMethodClickfinger = Prop("defaultClickMethodClickfinger"); - Prop m_clickMethodClickfinger = Prop("clickMethodClickfinger"); -}; - -#endif // LIBINPUTCOMMON_H diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp deleted file mode 100755 index dba99f6..0000000 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "touchpadmanager.h" -#include "touchpadadaptor.h" - -#include - -TouchpadManager::TouchpadManager(QObject *parent) - : QObject(parent) - , m_backend(XlibBackend::initialize()) -{ - // init dbus - new TouchpadAdaptor(this); - QDBusConnection::sessionBus().registerObject(QStringLiteral("/Touchpad"), this); - - m_backend->getConfig(); - m_backend->applyConfig(); -} - -bool TouchpadManager::available() const -{ - return m_backend->isTouchpadAvailable(); -} - -bool TouchpadManager::enabled() const -{ - return m_backend->isTouchpadEnabled(); -} - -void TouchpadManager::setEnabled(bool enabled) -{ - m_backend->setTouchpadEnabled(enabled); - m_backend->applyConfig(); -} - -bool TouchpadManager::tapToClick() const -{ - return m_backend->tapToClick(); -} - -void TouchpadManager::setTapToClick(bool value) -{ - m_backend->setTapToClick(value); - m_backend->applyConfig(); -} - -bool TouchpadManager::naturalScroll() const -{ - return m_backend->naturalScroll(); -} - -void TouchpadManager::setNaturalScroll(bool naturalScroll) -{ - m_backend->setNaturalScroll(naturalScroll); - m_backend->applyConfig(); -} - -qreal TouchpadManager::pointerAcceleration() const -{ - return m_backend->pointerAcceleration(); -} - -void TouchpadManager::setPointerAcceleration(qreal value) -{ - qDebug() << value; - m_backend->setPointerAcceleration(value); - m_backend->applyConfig(); -} diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h deleted file mode 100755 index d8f84d6..0000000 --- a/settings-daemon/touchpad/touchpadmanager.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef TOUCHPADMANAGER_H -#define TOUCHPADMANAGER_H - -#include -#include "x11/xlibbackend.h" - -class TouchpadManager : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool available READ available CONSTANT) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled CONSTANT) - Q_PROPERTY(bool tapToClick READ tapToClick WRITE setTapToClick CONSTANT) - Q_PROPERTY(bool naturalScroll READ naturalScroll WRITE setNaturalScroll CONSTANT) - Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration CONSTANT) - -public: - explicit TouchpadManager(QObject *parent = nullptr); - - bool available() const; - - bool enabled() const; - void setEnabled(bool enabled); - - bool tapToClick() const; - void setTapToClick(bool value); - - bool naturalScroll() const; - void setNaturalScroll(bool naturalScroll); - - qreal pointerAcceleration() const; - void setPointerAcceleration(qreal value); - -private: - XlibBackend *m_backend; -}; - -#endif // TOUCHPADMANAGER_H diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp deleted file mode 100755 index 814b7eb..0000000 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ /dev/null @@ -1,402 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "libinputtouchpad.h" - -#include -#include - -#include -#include - -#include -#include - -#include -#include - -const Parameter libinputProperties[] = { - - /* libinput disable supports property */ - {"supportsDisableEvents", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 0}, - {"enabled", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 0}, - {"enabledDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 0}, - - /* LeftHandSupport */ - {"leftHandedEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED_DEFAULT, 8, 0}, - {"leftHanded", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED, 8, 0}, - - /* Disable on external mouse */ - {"supportsDisableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 1}, - {"disableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 1}, - {"disableEventsOnExternalMouseDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 1}, - - /* Disable while typing */ - {"disableWhileTypingEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT, 8, 0}, - {"disableWhileTyping", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING, 8, 0}, - - /* Middle Emulation */ - {"middleEmulationEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT, 8, 0}, - {"middleEmulation", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED, 8, 0}, - - /* This is a boolean for all three fingers, no per-finger config */ - {"tapToClick", PT_INT, 0, 1, LIBINPUT_PROP_TAP, 8, 0}, - {"tapToClickEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DEFAULT, 8, 0}, - - /* LMR */ - {"lrmTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 0}, - {"lrmTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 0}, - {"lmrTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 1}, - {"lmrTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 1}, - - /* Tap and Drag Enabled */ - {"tapAndDragEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_DEFAULT, 8, 0}, - {"tapAndDrag", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG, 8, 0}, - - /* Tap and Drag Lock Enabled */ - {"tapDragLockEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT, 8, 0}, - {"tapDragLock", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK, 8, 0}, - - /* libinput normalizes the accel to -1/1 */ - {"defaultPointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL_DEFAULT, 0 /*float */, 0}, - {"pointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL, 0 /*float */, 0}, - - /* Libinput Accel Profile */ - {"supportsPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 0}, - {"defaultPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 0}, - {"pointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 0}, - {"supportsPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 1}, - {"defaultPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 1}, - {"pointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 1}, - - /* Natural Scrolling */ - {"naturalScrollEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT, 8, 0}, - {"naturalScroll", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL, 8, 0}, - - /* Horizontal scrolling */ - {"horizontalScrolling", PT_INT, 0, 1, LIBINPUT_PROP_HORIZ_SCROLL_ENABLED, 8, 0}, - - /* Two-Finger Scrolling */ - {"supportsScrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 0}, - {"scrollTwoFingerEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 0}, - {"scrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 0}, - - /* Edge Scrolling */ - {"supportsScrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 1}, - {"scrollEdgeEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 1}, - {"scrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 1}, - - /* scroll on button */ - {"supportsScrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 2}, - {"scrollOnButtonDownEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 2}, - {"scrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 2}, - - /* Scroll Button for scroll on button Down */ - {"defaultScrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT, 32, 0}, - {"scrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON, 32, 0}, - - /* Click Methods */ - {"supportsClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 0}, - {"defaultClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 0}, - {"clickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 0}, - - {"supportsClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 1}, - {"defaultClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 1}, - {"clickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 1}, - - /* libinput doesn't have a separate toggle for horiz scrolling */ - {nullptr, PT_INT, 0, 0, nullptr, 0, 0}}; - -Qt::MouseButtons maskBtns(Display *display, XIButtonClassInfo *buttonInfo) -{ - Qt::MouseButtons buttons = Qt::NoButton; - for (int i = 0; i < buttonInfo->num_buttons; ++i) { - QByteArray reply = XGetAtomName(display, buttonInfo->labels[i]); - - if (reply == BTN_LABEL_PROP_BTN_LEFT) { - buttons |= Qt::LeftButton; - } - if (reply == BTN_LABEL_PROP_BTN_RIGHT) { - buttons |= Qt::RightButton; - } - if (reply == BTN_LABEL_PROP_BTN_MIDDLE) { - buttons |= Qt::MiddleButton; - } - if (reply == BTN_LABEL_PROP_BTN_SIDE) { - buttons |= Qt::ExtraButton1; - } - if (reply == BTN_LABEL_PROP_BTN_EXTRA) { - buttons |= Qt::ExtraButton2; - } - if (reply == BTN_LABEL_PROP_BTN_FORWARD) { - buttons |= Qt::ForwardButton; - } - if (reply == BTN_LABEL_PROP_BTN_BACK) { - buttons |= Qt::BackButton; - } - if (reply == BTN_LABEL_PROP_BTN_TASK) { - buttons |= Qt::TaskButton; - } - } - return buttons; -} - -LibinputTouchpad::LibinputTouchpad(Display *display, int deviceId) - : LibinputCommon() - , XlibTouchpad(display, deviceId) - , m_config("lingmoos", "touchpadxlibinputrc") -{ - loadSupportedProperties(libinputProperties); - - int nDevices = 0; - XIDeviceInfo *deviceInfo = XIQueryDevice(m_display, m_deviceId, &nDevices); - m_name = deviceInfo->name; - - for (int i = 0; i < deviceInfo->num_classes; ++i) { - XIAnyClassInfo *classInfo = deviceInfo->classes[i]; - - if (classInfo->type == XIButtonClass) { - XIButtonClassInfo *btnInfo = (XIButtonClassInfo *)classInfo; - m_supportedButtons.avail = true; - m_supportedButtons.set(maskBtns(m_display, btnInfo)); - } - if (classInfo->type == XITouchClass) { - XITouchClassInfo *touchInfo = (XITouchClassInfo *)classInfo; - m_tapFingerCount.avail = true; - m_tapFingerCount.set(touchInfo->num_touches); - } - } - XIFreeDeviceInfo(deviceInfo); - - /* FingerCount cannot be zero */ - if (!m_tapFingerCount.val) { - m_tapFingerCount.avail = true; - m_tapFingerCount.set(1); - } -} - -bool LibinputTouchpad::getConfig() -{ - bool success = true; - - success &= valueLoader(m_supportsDisableEvents); - success &= valueLoader(m_enabled); - success &= valueLoader(m_enabledDefault); - - success &= valueLoader(m_tapToClickEnabledByDefault); - success &= valueLoader(m_tapToClick); - success &= valueLoader(m_lrmTapButtonMapEnabledByDefault); - success &= valueLoader(m_lrmTapButtonMap); - success &= valueLoader(m_lmrTapButtonMapEnabledByDefault); - success &= valueLoader(m_lmrTapButtonMap); - success &= valueLoader(m_tapAndDragEnabledByDefault); - success &= valueLoader(m_tapAndDrag); - success &= valueLoader(m_tapDragLockEnabledByDefault); - success &= valueLoader(m_tapDragLock); - - success &= valueLoader(m_leftHandedEnabledByDefault); - success &= valueLoader(m_leftHanded); - - success &= valueLoader(m_supportsDisableEventsOnExternalMouse); - success &= valueLoader(m_disableEventsOnExternalMouse); - success &= valueLoader(m_disableEventsOnExternalMouseDefault); - - success &= valueLoader(m_disableWhileTypingEnabledByDefault); - success &= valueLoader(m_disableWhileTyping); - - success &= valueLoader(m_middleEmulationEnabledByDefault); - success &= valueLoader(m_middleEmulation); - - success &= valueLoader(m_defaultPointerAcceleration); - success &= valueLoader(m_pointerAcceleration); - - success &= valueLoader(m_supportsPointerAccelerationProfileFlat); - success &= valueLoader(m_defaultPointerAccelerationProfileFlat); - success &= valueLoader(m_pointerAccelerationProfileFlat); - success &= valueLoader(m_supportsPointerAccelerationProfileAdaptive); - success &= valueLoader(m_defaultPointerAccelerationProfileAdaptive); - success &= valueLoader(m_pointerAccelerationProfileAdaptive); - - success &= valueLoader(m_naturalScrollEnabledByDefault); - success &= valueLoader(m_naturalScroll); - - success &= valueLoader(m_horizontalScrolling); - - success &= valueLoader(m_supportsScrollTwoFinger); - success &= valueLoader(m_scrollTwoFingerEnabledByDefault); - success &= valueLoader(m_isScrollTwoFinger); - - success &= valueLoader(m_supportsScrollEdge); - success &= valueLoader(m_scrollEdgeEnabledByDefault); - success &= valueLoader(m_isScrollEdge); - - success &= valueLoader(m_supportsScrollOnButtonDown); - success &= valueLoader(m_scrollOnButtonDownEnabledByDefault); - success &= valueLoader(m_isScrollOnButtonDown); - - success &= valueLoader(m_defaultScrollButton); - success &= valueLoader(m_scrollButton); - - // click methods - success &= valueLoader(m_supportsClickMethodAreas); - success &= valueLoader(m_supportsClickMethodClickfinger); - success &= valueLoader(m_defaultClickMethodAreas); - success &= valueLoader(m_defaultClickMethodClickfinger); - success &= valueLoader(m_clickMethodAreas); - success &= valueLoader(m_clickMethodClickfinger); - - return success; -} - -bool LibinputTouchpad::applyConfig() -{ - QVector msgs; - - msgs << valueWriter(m_enabled) << valueWriter(m_tapToClick) << valueWriter(m_lrmTapButtonMap) << valueWriter(m_lmrTapButtonMap) << valueWriter(m_tapAndDrag) - << valueWriter(m_tapDragLock) << valueWriter(m_leftHanded) << valueWriter(m_disableWhileTyping) << valueWriter(m_middleEmulation) - << valueWriter(m_pointerAcceleration) << valueWriter(m_pointerAccelerationProfileFlat) << valueWriter(m_pointerAccelerationProfileAdaptive) - << valueWriter(m_naturalScroll) << valueWriter(m_horizontalScrolling) << valueWriter(m_isScrollTwoFinger) << valueWriter(m_isScrollEdge) - << valueWriter(m_isScrollOnButtonDown) << valueWriter(m_scrollButton) << valueWriter(m_clickMethodAreas) << valueWriter(m_clickMethodClickfinger); - - bool success = true; - QString error_msg; - - for (QString m : msgs) { - if (!m.isNull()) { - // qCCritical(KCM_TOUCHPAD) << "in error:" << m; - if (!success) { - error_msg.append("\n"); - } - error_msg.append(m); - success = false; - } - } - - if (!success) { - // qCCritical(KCM_TOUCHPAD) << error_msg; - } - - flush(); - return success; -} - -bool LibinputTouchpad::getDefaultConfig() -{ - m_enabled.set(m_enabledDefault); - m_tapToClick.set(m_tapToClickEnabledByDefault); - m_lrmTapButtonMap.set(m_lrmTapButtonMap); - m_lmrTapButtonMap.set(m_lmrTapButtonMapEnabledByDefault); - m_tapAndDrag.set(m_tapAndDragEnabledByDefault); - m_tapDragLock.set(m_tapDragLockEnabledByDefault); - m_leftHanded.set(m_leftHandedEnabledByDefault); - m_disableEventsOnExternalMouse.set(m_disableEventsOnExternalMouseDefault); - m_disableWhileTyping.set(m_disableWhileTypingEnabledByDefault); - m_middleEmulation.set(m_middleEmulationEnabledByDefault); - m_pointerAcceleration.set(m_defaultPointerAcceleration); - m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); - m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); - m_naturalScroll.set(m_naturalScrollEnabledByDefault); - m_horizontalScrolling.set(true); - m_isScrollTwoFinger.set(m_scrollTwoFingerEnabledByDefault); - m_isScrollEdge.set(m_scrollEdgeEnabledByDefault); - m_isScrollOnButtonDown.set(m_scrollOnButtonDownEnabledByDefault); - m_scrollButton.set(m_defaultScrollButton); - m_clickMethodAreas.set(m_defaultClickMethodAreas); - m_clickMethodClickfinger.set(m_defaultClickMethodClickfinger); - - return true; -} - -bool LibinputTouchpad::isChangedConfig() -{ - // clang-format off - bool changed = m_enabled.changed() || - m_tapToClick.changed() || - m_lrmTapButtonMap.changed() || - m_lmrTapButtonMap.changed() || - m_tapAndDrag.changed() || - m_tapDragLock.changed() || - m_leftHanded.changed() || - m_disableEventsOnExternalMouse.changed() || - m_disableWhileTyping.changed() || - m_middleEmulation.changed() || - m_pointerAcceleration.changed() || - m_pointerAccelerationProfileFlat.changed() || - m_pointerAccelerationProfileAdaptive.changed() || - m_naturalScroll.changed() || - m_horizontalScrolling.changed() || - m_isScrollTwoFinger.changed() || - m_isScrollEdge.changed() || - m_isScrollOnButtonDown.changed() || - m_scrollButton.changed() || - m_clickMethodAreas.changed() || - m_clickMethodClickfinger.changed(); - // clang-format on - - return changed; -} - -int LibinputTouchpad::touchpadOff() -{ - return m_enabled.val; -} - -XcbAtom &LibinputTouchpad::touchpadOffAtom() -{ - return *m_atoms[QLatin1String(LIBINPUT_PROP_SENDEVENTS_ENABLED)].data(); -} - -template -bool LibinputTouchpad::valueLoader(Prop &prop) -{ - const Parameter *p = findParameter(QString::fromLatin1(prop.name)); - - if (!p) { - // qCCritical(KCM_TOUCHPAD) << "Error on read of " << QString::fromLatin1(prop.name); - } - - QVariant reply = getParameter(p); - if (!reply.isValid()) { - prop.avail = false; - return true; - } - prop.avail = true; - - m_config.beginGroup(m_name); - - const T replyValue = valueLoaderPart(reply); - const T loadedValue = m_config.value(prop.name, replyValue).toBool(); - prop.old = replyValue; - prop.val = loadedValue; - - m_config.endGroup(); - - return true; -} - -template -QString LibinputTouchpad::valueWriter(const Prop &prop) -{ - const Parameter *p = findParameter(QString::fromLatin1(prop.name)); - - // Reion - if (!p /*|| !prop.changed()*/) { - return QString(); - } - - bool error = !setParameter(p, prop.val); - if (error) { - // qCCritical(KCM_TOUCHPAD) << "Cannot set property " + QString::fromLatin1(prop.name); - return QStringLiteral("Cannot set property ") + QString::fromLatin1(prop.name); - } - - m_config.beginGroup(m_name); - m_config.setValue(prop.name, prop.val); - m_config.endGroup(); - m_config.sync(); - - return QString(); -} diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h deleted file mode 100755 index 4d1733b..0000000 --- a/settings-daemon/touchpad/x11/libinputtouchpad.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef LIBINPUTTOUCHPAD_H -#define LIBINPUTTOUCHPAD_H - -#include -#include - -#include "../libinputcommon.h" -#include "xlibtouchpad.h" - -class LibinputTouchpad : public LibinputCommon, public XlibTouchpad -{ - Q_OBJECT - -public: - LibinputTouchpad(Display *display, int deviceId); - ~LibinputTouchpad() override - { - } - - bool getConfig() override; - bool applyConfig() override; - bool getDefaultConfig() override; - bool isChangedConfig() override; - - int touchpadOff() override; - XcbAtom &touchpadOffAtom() override; - -private: - template - bool valueLoader(Prop &prop); - - template - QString valueWriter(const Prop &prop); - - QSettings m_config; - - // - // general - QString name() const override - { - return m_name; - } - bool supportsDisableEvents() const override - { - return m_supportsDisableEvents.avail && m_supportsDisableEvents.val; - } - bool isEnabled() const override - { - return !m_enabled.val; - } - void setEnabled(bool set) override - { - m_enabled.set(!set); - } - // - // Tapping - void setLmrTapButtonMap(bool set) override - { - m_lrmTapButtonMap.set(!set); - m_lmrTapButtonMap.set(set); - } - // - // advanced - bool supportsLeftHanded() const override - { - return m_leftHanded.avail; - } - bool supportsDisableEventsOnExternalMouse() const override - { - return m_supportsDisableEventsOnExternalMouse.avail && m_supportsDisableEventsOnExternalMouse.val; - } - bool supportsDisableWhileTyping() const override - { - return m_disableWhileTyping.avail; - } - bool supportsMiddleEmulation() const override - { - return m_middleEmulation.avail; - } - // - // acceleration speed and profile - bool supportsPointerAcceleration() const override - { - return m_pointerAcceleration.avail; - } - bool supportsPointerAccelerationProfileFlat() const override - { - return m_supportsPointerAccelerationProfileFlat.avail && m_supportsPointerAccelerationProfileFlat.val; - } - bool supportsPointerAccelerationProfileAdaptive() const override - { - return m_supportsPointerAccelerationProfileAdaptive.avail && m_supportsPointerAccelerationProfileAdaptive.val; - } - // - // scrolling - bool supportsNaturalScroll() const override - { - return m_naturalScroll.avail; - } - bool supportsHorizontalScrolling() const override - { - return true; - } - bool supportsScrollTwoFinger() const override - { - return m_supportsScrollTwoFinger.avail && m_supportsScrollTwoFinger.val; - } - bool supportsScrollEdge() const override - { - return m_supportsScrollEdge.avail && m_supportsScrollEdge.val; - } - bool supportsScrollOnButtonDown() const override - { - return m_supportsScrollOnButtonDown.avail && m_supportsScrollOnButtonDown.val; - } - // - // click method - bool supportsClickMethodAreas() const override - { - return m_supportsClickMethodAreas.avail && m_supportsClickMethodAreas.val; - } - bool supportsClickMethodClickfinger() const override - { - return m_supportsClickMethodClickfinger.avail && m_supportsClickMethodClickfinger.val; - } - - bool supportsScrollFactor() const override - { - return false; - } - - // Tapping - Prop m_lrmTapButtonMapEnabledByDefault = Prop("lrmTapButtonMapEnabledByDefault"); - Prop m_lrmTapButtonMap = Prop("lrmTapButtonMap"); - // - // advanced - Prop m_disableEventsOnExternalMouse = Prop("disableEventsOnExternalMouse"); - Prop m_disableEventsOnExternalMouseDefault = Prop("disableEventsOnExternalMouseDefault"); - - QString m_name; -}; - -#endif // LIBINPUTTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp deleted file mode 100755 index c8acf79..0000000 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include -#include - -#include "propertyinfo.h" - -#include -#include -#include - -void XDeleter(void *p) -{ - if (p) { - XFree(p); - } -} - -PropertyInfo::PropertyInfo() - : type(0) - , format(0) - , nitems(0) - , f(nullptr) - , i(nullptr) - , b(nullptr) - , display(nullptr) - , device(0) - , prop(0) -{ -} - -PropertyInfo::PropertyInfo(Display *display, int device, Atom prop, Atom floatType) - : type(0) - , format(0) - , nitems(0) - , f(nullptr) - , i(nullptr) - , b(nullptr) - , display(display) - , device(device) - , prop(prop) -{ - unsigned char *dataPtr = nullptr; - unsigned long bytes_after; - XIGetProperty(display, device, prop, 0, 1000, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &dataPtr); - data = QSharedPointer(dataPtr, XDeleter); - - if (format == CHAR_BIT && type == XA_INTEGER) { - b = reinterpret_cast(dataPtr); - } - if (format == sizeof(int) * CHAR_BIT && (type == XA_INTEGER || type == XA_CARDINAL)) { - i = reinterpret_cast(dataPtr); - } - if (format == sizeof(float) * CHAR_BIT && floatType && type == floatType) { - f = reinterpret_cast(dataPtr); - } -} - -QVariant PropertyInfo::value(unsigned offset) const -{ - QVariant v; - if (offset >= nitems) { - return v; - } - - if (b) { - v = QVariant(static_cast(b[offset])); - } - if (i) { - v = QVariant(i[offset]); - } - if (f) { - v = QVariant(f[offset]); - } - - return v; -} - -void PropertyInfo::set() -{ - XIChangeProperty(display, device, prop, type, format, XIPropModeReplace, data.data(), nitems); -} diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h deleted file mode 100755 index 37e60e5..0000000 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef PROPERTYINFO_H -#define PROPERTYINFO_H - -#include -#include -#include - -void XDeleter(void *p); - -struct PropertyInfo { - Atom type; - int format; - QSharedPointer data; - unsigned long nitems; - - float *f; - int *i; - char *b; - - Display *display; - int device; - Atom prop; - - PropertyInfo(); - PropertyInfo(Display *display, int device, Atom prop, Atom floatType); - QVariant value(unsigned offset) const; - - void set(); -}; - -#endif // PROPERTYINFO_H diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp deleted file mode 100755 index 37d60aa..0000000 --- a/settings-daemon/touchpad/x11/synapticstouchpad.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - SPDX-FileContributor: 2002-2005, 2007 Peter Osterlund - - SPDX-License-Identifier: GPL-2.0-or-later AND LicenseRef-synaptics -*/ - -#include -#include - -#include "synapticstouchpad.h" - -#include -#include -#include - -#define SYN_MAX_BUTTONS 12 - -const struct Parameter synapticsProperties[] = { - {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0}, - {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, - {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, - {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, - {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, - {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, - {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0}, - {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0}, - {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1}, - {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0}, - {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2}, - {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, - {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32, 0}, - {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, - {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, - {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, - {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, - {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, - {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, - {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, - {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 0}, - {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 1}, - {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0}, - {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1}, - {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2}, - /*{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},*/ - {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0}, - {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0}, - {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0}, - {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 1}, - {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 2}, - {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 3}, - {"OneFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4}, - {"TwoFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5}, - {"ThreeFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6}, - {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 0}, - {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 1}, - {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 2}, - {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0}, - {"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0}, - {"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0}, - {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0}, - {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0}, - {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1}, - {"CoastingSpeed", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 0}, - {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 1}, - {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0}, - {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1}, - {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 0}, - {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 1}, - {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0}, - {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0}, - {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0}, - {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1}, - {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2}, - {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3}, - {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 0}, - {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 1}, - {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0}, - {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0}, - {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1}, - {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2}, - {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3}, - {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4}, - {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5}, - {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6}, - {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7}, - {NULL, PT_INT, 0, 0, nullptr, 0, 0}, -}; - -SynapticsTouchpad::SynapticsTouchpad(Display *display, int deviceId) - : XlibTouchpad(display, deviceId) - , m_resX(1) - , m_resY(1) -{ - m_capsAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); - m_touchpadOffAtom.intern(m_connection, SYNAPTICS_PROP_OFF); - XcbAtom resolutionAtom(m_connection, SYNAPTICS_PROP_RESOLUTION); - XcbAtom edgesAtom(m_connection, SYNAPTICS_PROP_EDGES); - - loadSupportedProperties(synapticsProperties); - - m_toRadians.append("CircScrollDelta"); - - PropertyInfo edges(m_display, m_deviceId, edgesAtom, 0); - if (edges.i && edges.nitems == 4) { - int w = qAbs(edges.i[1] - edges.i[0]); - int h = qAbs(edges.i[3] - edges.i[2]); - m_resX = w / 90; - m_resY = h / 50; - qDebug() << "Width: " << w << " height: " << h; - qDebug() << "Approx. resX: " << m_resX << " resY: " << m_resY; - } - - PropertyInfo resolution(m_display, m_deviceId, resolutionAtom, 0); - if (resolution.i && resolution.nitems == 2 && resolution.i[0] > 1 && resolution.i[1] > 1) { - m_resY = qMin(static_cast(resolution.i[0]), static_cast(INT_MAX)); - m_resX = qMin(static_cast(resolution.i[1]), static_cast(INT_MAX)); - qDebug() << "Touchpad resolution: x: " << m_resX << " y: " << m_resY; - } - - m_scaleByResX.append("HorizScrollDelta"); - m_scaleByResY.append("VertScrollDelta"); - m_scaleByResX.append("MaxTapMove"); - m_scaleByResY.append("MaxTapMove"); - - m_resX = qMax(10, m_resX); - m_resY = qMax(10, m_resY); - qDebug() << "Final resolution x:" << m_resX << " y:" << m_resY; - m_negate["HorizScrollDelta"] = "InvertHorizScroll"; - m_negate["VertScrollDelta"] = "InvertVertScroll"; - m_supported.append(m_negate.values()); - m_supported.append("Coasting"); - - PropertyInfo caps(m_display, m_deviceId, m_capsAtom.atom(), 0); - if (!caps.b) { - return; - } - - enum TouchpadCapabilitiy { - TouchpadHasLeftButton, - TouchpadHasMiddleButton, - TouchpadHasRightButton, - TouchpadTwoFingerDetect, - TouchpadThreeFingerDetect, - TouchpadPressureDetect, - TouchpadPalmDetect, - TouchpadCapsCount, - }; - - QVector cap(TouchpadCapsCount, false); - std::copy(caps.b, caps.b + qMin(cap.size(), static_cast(caps.nitems)), cap.begin()); - - if (!cap[TouchpadTwoFingerDetect]) { - m_supported.removeAll("HorizTwoFingerScroll"); - m_supported.removeAll("VertTwoFingerScroll"); - m_supported.removeAll("TwoFingerTapButton"); - } - - if (!cap[TouchpadThreeFingerDetect]) { - m_supported.removeAll("ThreeFingerTapButton"); - } - - if (!cap[TouchpadPressureDetect]) { - m_supported.removeAll("FingerHigh"); - m_supported.removeAll("FingerLow"); - - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("PressureMotionMinZ"); - m_supported.removeAll("PressureMotionMinFactor"); - m_supported.removeAll("PressureMotionMaxZ"); - m_supported.removeAll("PressureMotionMaxFactor"); - m_supported.removeAll("EmulateTwoFingerMinZ"); - } - - if (!cap[TouchpadPalmDetect]) { - m_supported.removeAll("PalmDetect"); - m_supported.removeAll("PalmMinWidth"); - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("EmulateTwoFingerMinW"); - } - - for (QMap::Iterator i = m_negate.begin(); i != m_negate.end(); ++i) { - if (!m_supported.contains(i.key())) { - m_supported.removeAll(i.value()); - } - } - - m_paramList = synapticsProperties; -} - -void SynapticsTouchpad::setTouchpadOff(int touchpadOff) -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - if (off.b && *(off.b) != touchpadOff) { - *(off.b) = touchpadOff; - off.set(); - } - - flush(); -} - -int SynapticsTouchpad::touchpadOff() -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - return off.value(0).toInt(); -} - -XcbAtom &SynapticsTouchpad::touchpadOffAtom() -{ - return m_touchpadOffAtom; -} - -double SynapticsTouchpad::getPropertyScale(const QString &name) const -{ - if (m_scaleByResX.contains(name) && m_scaleByResY.contains(name)) { - return std::sqrt(static_cast(m_resX) * m_resX + static_cast(m_resY) * m_resY); - } else if (m_scaleByResX.contains(name)) { - return m_resX; - } else if (m_scaleByResY.contains(name)) { - return m_resY; - } else if (m_toRadians.contains(name)) { - return M_PI_4 / 45.0; - } - return 1.0; -} diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.h b/settings-daemon/touchpad/x11/synapticstouchpad.h deleted file mode 100755 index c503ce1..0000000 --- a/settings-daemon/touchpad/x11/synapticstouchpad.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - SPDX-FileCopyrightText: 2015 Weng Xuetian - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef SYNAPTICSTOUCHPAD_H -#define SYNAPTICSTOUCHPAD_H - -#include "xcbatom.h" -#include "xlibtouchpad.h" - -class SynapticsTouchpad : public QObject, public XlibTouchpad -{ - Q_OBJECT - -public: - SynapticsTouchpad(Display *display, int deviceId); - - void setTouchpadOff(int touchpadOff) override; - int touchpadOff() override; - - XcbAtom &touchpadOffAtom() override; - -protected: - double getPropertyScale(const QString &name) const override; - -private: - XcbAtom m_capsAtom, m_touchpadOffAtom; - int m_resX, m_resY; - QStringList m_scaleByResX, m_scaleByResY, m_toRadians; -}; - -#endif // SYNAPTICSTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/xcbatom.cpp b/settings-daemon/touchpad/x11/xcbatom.cpp deleted file mode 100755 index c48f9d2..0000000 --- a/settings-daemon/touchpad/x11/xcbatom.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xcbatom.h" - -#include -#include - -XcbAtom::XcbAtom() - : m_connection(nullptr) - , m_reply(nullptr) - , m_fetched(false) -{ -} - -XcbAtom::XcbAtom(xcb_connection_t *c, const char *name, bool onlyIfExists) - : m_reply(nullptr) - , m_fetched(false) -{ - intern(c, name, onlyIfExists); -} - -void XcbAtom::intern(xcb_connection_t *c, const char *name, bool onlyIfExists) -{ - m_connection = c; - m_cookie = xcb_intern_atom(c, onlyIfExists, std::strlen(name), name); -} - -XcbAtom::~XcbAtom() -{ - std::free(m_reply); -} - -xcb_atom_t XcbAtom::atom() -{ - if (!m_fetched) { - m_fetched = true; - m_reply = xcb_intern_atom_reply(m_connection, m_cookie, nullptr); - } - if (m_reply) { - return m_reply->atom; - } else { - return 0; - } -} diff --git a/settings-daemon/touchpad/x11/xcbatom.h b/settings-daemon/touchpad/x11/xcbatom.h deleted file mode 100755 index e3a8914..0000000 --- a/settings-daemon/touchpad/x11/xcbatom.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XCBATOM_H -#define XCBATOM_H - -#include - -class XcbAtom -{ -public: - XcbAtom(); - XcbAtom(xcb_connection_t *, const char *name, bool onlyIfExists = true); - ~XcbAtom(); - - void intern(xcb_connection_t *, const char *name, bool onlyIfExists = true); - xcb_atom_t atom(); - operator xcb_atom_t() - { - return atom(); - } - -private: - XcbAtom(const XcbAtom &); - XcbAtom &operator=(const XcbAtom &); - - xcb_connection_t *m_connection; - xcb_intern_atom_cookie_t m_cookie; - xcb_intern_atom_reply_t *m_reply; - bool m_fetched; -}; - -#endif // XCBATOM_H diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp deleted file mode 100755 index 0824bbe..0000000 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include -#include - -#include - -#include - -// Includes are ordered this way because of #defines in Xorg's headers -#include "xlibbackend.h" // krazy:exclude=includes -#include "xlibnotifications.h" // krazy:exclude=includes -#include "xrecordkeyboardmonitor.h" // krazy:exclude=includes - -#include -#include -#include -#include - -#include -#include - -struct DeviceListDeleter { - static void cleanup(XDeviceInfo *p) - { - if (p) { - XFreeDeviceList(p); - } - } -}; - -void XlibBackend::XDisplayCleanup::cleanup(Display *p) -{ - if (p) { - XCloseDisplay(p); - } -} - -XlibBackend *XlibBackend::initialize(QObject *parent) -{ - XlibBackend *backend = new XlibBackend(parent); - if (!backend->m_display) { - delete backend; - return nullptr; - } - return backend; -} - -XlibBackend::~XlibBackend() -{ -} - -XlibBackend::XlibBackend(QObject *parent) - : QObject(parent) - , m_display(XOpenDisplay(nullptr)) - , m_connection(nullptr) -{ - if (m_display) { - m_connection = XGetXCBConnection(m_display.data()); - } - - if (!m_connection) { - m_errorString = "Cannot connect to X server"; - return; - } - - m_mouseAtom.intern(m_connection, XI_MOUSE); - m_keyboardAtom.intern(m_connection, XI_KEYBOARD); - m_touchpadAtom.intern(m_connection, XI_TOUCHPAD); - m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); - - m_synapticsIdentifierAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); - m_libinputIdentifierAtom.intern(m_connection, "libinput Send Events Modes Available"); - - m_device.reset(findTouchpad()); - if (!m_device) { - m_errorString = "No touchpad found"; - } -} - -XlibTouchpad *XlibBackend::findTouchpad() -{ - int nDevices = 0; - QScopedPointer deviceInfo(XListInputDevices(m_display.data(), &nDevices)); - - for (XDeviceInfo *info = deviceInfo.data(); info < deviceInfo.data() + nDevices; info++) { - // Make sure device is touchpad - if (info->type != m_touchpadAtom.atom()) { - continue; - } - int nProperties = 0; - QSharedPointer properties(XIListProperties(m_display.data(), info->id, &nProperties), XDeleter); - - Atom *atom = properties.data(), *atomEnd = properties.data() + nProperties; - for (; atom != atomEnd; atom++) { - - if (*atom == m_libinputIdentifierAtom.atom()) { - // setMode(TouchpadInputBackendMode::XLibinput); - return new LibinputTouchpad(m_display.data(), info->id); - } - - if (*atom == m_synapticsIdentifierAtom.atom()) { - // setMode(TouchpadInputBackendMode::XSynaptics); - return new SynapticsTouchpad(m_display.data(), info->id); - } - } - } - - return nullptr; -} - -bool XlibBackend::applyConfig(const QVariantHash &p) -{ - if (!m_device) { - return false; - } - - bool success = m_device->applyConfig(p); - if (!success) { - m_errorString = "Cannot apply touchpad configuration"; - } - - return success; -} - -bool XlibBackend::applyConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->applyConfig(); - if (!success) { - m_errorString = "Cannot apply touchpad configuration"; - } - - return success; -} - -bool XlibBackend::getConfig(QVariantHash &p) -{ - if (!m_device) { - return false; - } - - bool success = m_device->getConfig(p); - if (!success) { - m_errorString = "Cannot read touchpad configuration"; - } - return success; -} - -bool XlibBackend::getConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->getConfig(); - if (!success) { - m_errorString = "Cannot read touchpad configuration"; - } - return success; -} - -bool XlibBackend::getDefaultConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->getDefaultConfig(); - if (!success) { - m_errorString = "Cannot read default touchpad configuration"; - } - return success; -} - -bool XlibBackend::isChangedConfig() const -{ - if (!m_device) { - return false; - } - - return m_device->isChangedConfig(); -} - -void XlibBackend::setTouchpadEnabled(bool enable) -{ - if (!m_device) { - return; - } - - m_device->setEnabled(enable); - - // FIXME? This should not be needed, m_notifications should trigger - // a propertyChanged signal when we enable/disable the touchpad, - // that will Q_EMIT touchpadStateChanged, but for some reason - // XlibNotifications is not getting the property change events - // so we just Q_EMIT touchpadStateChanged from here as a workaround - Q_EMIT touchpadStateChanged(); -} - -bool XlibBackend::tapToClick() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return false; - - return object->isTapToClick(); -} - -void XlibBackend::setTapToClick(bool enabled) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setTapToClick(enabled); -} - -bool XlibBackend::naturalScroll() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return false; - - return object->isNaturalScroll(); -} - -void XlibBackend::setNaturalScroll(bool value) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setNaturalScroll(value); -} - -qreal XlibBackend::pointerAcceleration() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return 1; - - return object->pointerAcceleration(); -} - -void XlibBackend::setPointerAcceleration(qreal value) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setPointerAcceleration(value); -} - -void XlibBackend::setTouchpadOff(XlibBackend::TouchpadOffState state) -{ - if (!m_device) { - return; - } - - int touchpadOff = 0; - switch (state) { - case TouchpadEnabled: - touchpadOff = 0; - break; - case TouchpadFullyDisabled: - touchpadOff = 1; - break; - case TouchpadTapAndScrollDisabled: - touchpadOff = 2; - break; - default: - qCritical() << "Unknown TouchpadOffState" << state; - return; - } - - m_device->setTouchpadOff(touchpadOff); -} - -bool XlibBackend::isTouchpadAvailable() -{ - return m_device; -} - -bool XlibBackend::isTouchpadEnabled() -{ - if (!m_device) { - return false; - } - - return m_device->enabled(); -} - -XlibBackend::TouchpadOffState XlibBackend::getTouchpadOff() -{ - if (!m_device) { - return TouchpadFullyDisabled; - } - int value = m_device->touchpadOff(); - switch (value) { - case 0: - return TouchpadEnabled; - case 1: - return TouchpadFullyDisabled; - case 2: - return TouchpadTapAndScrollDisabled; - default: - qCritical() << "Unknown TouchpadOff value" << value; - return TouchpadFullyDisabled; - } -} - -void XlibBackend::touchpadDetached() -{ - qWarning() << "Touchpad detached"; - m_device.reset(); - Q_EMIT touchpadReset(); -} - -void XlibBackend::devicePlugged(int device) -{ - if (!m_device) { - m_device.reset(findTouchpad()); - if (m_device) { - qWarning() << "Touchpad reset"; - m_notifications.reset(); - watchForEvents(m_keyboard); - Q_EMIT touchpadReset(); - } - } - if (!m_device || device != m_device->deviceId()) { - Q_EMIT mousesChanged(); - } -} - -void XlibBackend::propertyChanged(xcb_atom_t prop) -{ - if ((m_device && prop == m_device->touchpadOffAtom().atom()) || prop == m_enabledAtom.atom()) { - Q_EMIT touchpadStateChanged(); - } -} - -QStringList XlibBackend::listMouses(const QStringList &blacklist) -{ - int nDevices = 0; - QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); - QStringList list; - for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { - if (m_device && i->id == static_cast(m_device->deviceId())) { - continue; - } - if (i->use != IsXExtensionPointer && i->use != IsXPointer) { - continue; - } - // type = KEYBOARD && use = Pointer means usb receiver for both keyboard - // and mouse - if (i->type != m_mouseAtom.atom() && i->type != m_keyboardAtom.atom()) { - continue; - } - QString name(i->name); - if (blacklist.contains(name, Qt::CaseInsensitive)) { - continue; - } - PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); - if (enabled.value(0) == false) { - continue; - } - list.append(name); - } - - return list; -} - -QVector XlibBackend::getDevices() const -{ - QVector touchpads; - - LibinputTouchpad *libinputtouchpad = dynamic_cast(m_device.data()); - if (libinputtouchpad) { - touchpads.push_back(libinputtouchpad); - } - - SynapticsTouchpad *synaptics = dynamic_cast(m_device.data()); - if (synaptics) { - touchpads.push_back(synaptics); - } - - return touchpads; -} - -void XlibBackend::watchForEvents(bool keyboard) -{ - if (!m_notifications) { - m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); - connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); - connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); - connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); - } - - if (keyboard == !m_keyboard.isNull()) { - return; - } - - if (!keyboard) { - m_keyboard.reset(); - return; - } - - m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); - connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); - connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); -} diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h deleted file mode 100755 index c4af163..0000000 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBBACKEND_H -#define XLIBBACKEND_H - -#include -#include -#include -#include -#include -#include -#include - -#include "libinputtouchpad.h" -#include "synapticstouchpad.h" -#include "xlibtouchpad.h" - -#include - -#include "propertyinfo.h" -#include "xcbatom.h" - -class XlibTouchpad; -class XlibNotifications; -class XRecordKeyboardMonitor; - -class XlibBackend : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int touchpadCount READ touchpadCount CONSTANT) - -public: - enum TouchpadOffState { - TouchpadEnabled, - TouchpadTapAndScrollDisabled, - TouchpadFullyDisabled, - }; - - static XlibBackend *initialize(QObject *parent = nullptr); - ~XlibBackend(); - - bool applyConfig(const QVariantHash &); - bool applyConfig(); - bool getConfig(QVariantHash &); - bool getConfig(); - bool getDefaultConfig(); - bool isChangedConfig() const; - QStringList supportedParameters() const - { - return m_device ? m_device->supportedParameters() : QStringList(); - } - QString errorString() const - { - return m_errorString; - } - int touchpadCount() const - { - return m_device ? 1 : 0; - } - - void setTouchpadOff(TouchpadOffState); - TouchpadOffState getTouchpadOff(); - - bool isTouchpadAvailable(); - bool isTouchpadEnabled(); - void setTouchpadEnabled(bool); - - bool tapToClick(); - void setTapToClick(bool enabled); - - bool naturalScroll(); - void setNaturalScroll(bool value); - - qreal pointerAcceleration(); - void setPointerAcceleration(qreal value); - - void watchForEvents(bool keyboard); - - QStringList listMouses(const QStringList &blacklist); - QVector getDevices() const; - -signals: - void touchpadStateChanged(); - void mousesChanged(); - void touchpadReset(); - void keyboardActivityStarted(); - void keyboardActivityFinished(); - - void touchpadAdded(bool success); - void touchpadRemoved(int index); - -private Q_SLOTS: - void propertyChanged(xcb_atom_t); - void touchpadDetached(); - void devicePlugged(int); - -protected: - explicit XlibBackend(QObject *parent); - - struct XDisplayCleanup { - static void cleanup(Display *); - }; - - QScopedPointer m_display; - xcb_connection_t *m_connection; - - XcbAtom m_enabledAtom, m_mouseAtom, m_keyboardAtom, m_touchpadAtom; - XcbAtom m_synapticsIdentifierAtom; - XcbAtom m_libinputIdentifierAtom; - - XlibTouchpad *findTouchpad(); - QScopedPointer m_device; - - QString m_errorString; - QScopedPointer m_notifications; - QScopedPointer m_keyboard; -}; - -#endif // XLIBBACKEND_H diff --git a/settings-daemon/touchpad/x11/xlibnotifications.cpp b/settings-daemon/touchpad/x11/xlibnotifications.cpp deleted file mode 100755 index 13037c2..0000000 --- a/settings-daemon/touchpad/x11/xlibnotifications.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xlibnotifications.h" - -#include - -#include -#include -#include -#include - -XlibNotifications::XlibNotifications(Display *display, int device) - : m_display(display) - , m_device(device) -{ - m_connection = XGetXCBConnection(display); - - m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); - - xcb_query_extension_cookie_t inputExtCookie = xcb_query_extension(m_connection, std::strlen(INAME), INAME); - QScopedPointer inputExt(xcb_query_extension_reply(m_connection, inputExtCookie, nullptr)); - if (!inputExt) { - return; - } - m_inputOpcode = inputExt->major_opcode; - - const xcb_setup_t *setup = xcb_get_setup(m_connection); - xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup); - xcb_screen_t *screen = iter.data; - - m_inputWindow = xcb_generate_id(m_connection); - xcb_create_window(m_connection, 0, m_inputWindow, screen->root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, 0, 0, nullptr); - xcb_flush(m_connection); - - XIEventMask masks[2]; - - unsigned char touchpadMask[] = {0, 0, 0, 0}; - masks[0].deviceid = device; - masks[0].mask = touchpadMask; - masks[0].mask_len = sizeof(touchpadMask); - XISetMask(touchpadMask, XI_PropertyEvent); - - unsigned char allMask[] = {0, 0, 0, 0}; - masks[1].deviceid = XIAllDevices; - masks[1].mask = allMask; - masks[1].mask_len = sizeof(allMask); - XISetMask(allMask, XI_HierarchyChanged); - - XISelectEvents(display, XDefaultRootWindow(display), masks, sizeof(masks) / sizeof(XIEventMask)); - XFlush(display); - - connect(m_notifier, SIGNAL(activated(int)), SLOT(processEvents())); - m_notifier->setEnabled(true); -} - -void XlibNotifications::processEvents() -{ - while (XPending(m_display)) { - XEvent event; - XNextEvent(m_display, &event); - processEvent(&event); - } -} - -struct XEventDataDeleter { - XEventDataDeleter(Display *display, XGenericEventCookie *cookie) - : m_display(display) - , m_cookie(cookie) - { - XGetEventData(m_display, m_cookie); - } - - ~XEventDataDeleter() - { - if (m_cookie->data) { - XFreeEventData(m_display, m_cookie); - } - } - - Display *m_display; - XGenericEventCookie *m_cookie; -}; - -void XlibNotifications::processEvent(XEvent *event) -{ - if (event->xcookie.type != GenericEvent) { - return; - } - if (event->xcookie.extension != m_inputOpcode) { - return; - } - - if (event->xcookie.evtype == XI_PropertyEvent) { - XEventDataDeleter helper(m_display, &event->xcookie); - if (!event->xcookie.data) { - return; - } - - XIPropertyEvent *propEvent = reinterpret_cast(event->xcookie.data); - Q_EMIT propertyChanged(propEvent->property); - } else if (event->xcookie.evtype == XI_HierarchyChanged) { - XEventDataDeleter helper(m_display, &event->xcookie); - if (!event->xcookie.data) { - return; - } - - XIHierarchyEvent *hierarchyEvent = reinterpret_cast(event->xcookie.data); - for (uint16_t i = 0; i < hierarchyEvent->num_info; i++) { - if (hierarchyEvent->info[i].deviceid == m_device) { - if (hierarchyEvent->info[i].flags & XISlaveRemoved) { - Q_EMIT touchpadDetached(); - return; - } - } - if (hierarchyEvent->info[i].use != XISlavePointer) { - continue; - } - if (hierarchyEvent->info[i].flags & (XIDeviceEnabled | XIDeviceDisabled)) { - Q_EMIT devicePlugged(hierarchyEvent->info[i].deviceid); - } - } - } -} - -XlibNotifications::~XlibNotifications() -{ - xcb_destroy_window(m_connection, m_inputWindow); - xcb_flush(m_connection); -} - -#include "moc_xlibnotifications.cpp" diff --git a/settings-daemon/touchpad/x11/xlibnotifications.h b/settings-daemon/touchpad/x11/xlibnotifications.h deleted file mode 100755 index 5ca6f1d..0000000 --- a/settings-daemon/touchpad/x11/xlibnotifications.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBNOTIFICATIONS_H -#define XLIBNOTIFICATIONS_H - -#include - -#include -#include - -class XlibNotifications : public QObject -{ - Q_OBJECT -public: - XlibNotifications(Display *display, int device); - ~XlibNotifications(); - -Q_SIGNALS: - void propertyChanged(xcb_atom_t); - void devicePlugged(int); - void touchpadDetached(); - -private Q_SLOTS: - void processEvents(); - -private: - void processEvent(XEvent *); - - Display *m_display; - xcb_connection_t *m_connection; - QSocketNotifier *m_notifier; - xcb_window_t m_inputWindow; - uint8_t m_inputOpcode; - int m_device; -}; - -#endif // XLIBNOTIFICATIONS_H diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.cpp b/settings-daemon/touchpad/x11/xlibtouchpad.cpp deleted file mode 100755 index 7581c9a..0000000 --- a/settings-daemon/touchpad/x11/xlibtouchpad.cpp +++ /dev/null @@ -1,257 +0,0 @@ -#include - -#include "xlibtouchpad.h" -#include -#include -#include -#include - -static QVariant negateVariant(const QVariant &value) -{ - if (value.type() == QVariant::Double) { - return QVariant(-value.toDouble()); - } else if (value.type() == QVariant::Int) { - return QVariant(-value.toInt()); - } - return value; -} - -XlibTouchpad::XlibTouchpad(Display *display, int deviceId) - : m_display(display) - , m_connection(XGetXCBConnection(display)) - , m_deviceId(deviceId) -{ - m_floatType.intern(m_connection, "FLOAT"); - m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); -} - -bool XlibTouchpad::applyConfig(const QVariantHash &p) -{ - m_props.clear(); - - bool error = false; - for (const QString &name : qAsConst(m_supported)) { - QVariantHash::ConstIterator i = p.find(name); - if (i == p.end()) { - continue; - } - const Parameter *par = findParameter(name); - if (par) { - QVariant value(i.value()); - - double k = getPropertyScale(name); - if (k != 1.0) { - bool ok = false; - value = QVariant(value.toDouble(&ok) * k); - if (!ok) { - error = true; - continue; - } - } - - if (m_negate.contains(name)) { - QVariantHash::ConstIterator i = p.find(m_negate[name]); - if (i != p.end() && i.value().toBool()) { - value = negateVariant(value); - } - } - - if (name == "CoastingSpeed") { - QVariantHash::ConstIterator coastingEnabled = p.find("Coasting"); - if (coastingEnabled != p.end() && !coastingEnabled.value().toBool()) { - value = QVariant(0); - } - } - - if (!setParameter(par, value)) { - error = true; - } - } - } - - flush(); - - return !error; -} - -bool XlibTouchpad::getConfig(QVariantHash &p) -{ - if (m_supported.isEmpty()) { - return false; - } - - m_props.clear(); - - bool error = false; - for (const QString &name : qAsConst(m_supported)) { - const Parameter *par = findParameter(name); - if (!par) { - continue; - } - - QVariant value(getParameter(par)); - if (!value.isValid()) { - error = true; - continue; - } - - double k = getPropertyScale(name); - if (k != 1.0) { - bool ok = false; - value = QVariant(value.toDouble(&ok) / k); - if (!ok) { - error = true; - continue; - } - } - - if (m_negate.contains(name)) { - bool negative = value.toDouble() < 0.0; - p[m_negate[name]] = QVariant(negative); - if (negative) { - value = negateVariant(value); - } - } - - if (name == "CoastingSpeed") { - bool coasting = value.toDouble() != 0.0; - p["Coasting"] = QVariant(coasting); - if (!coasting) { - continue; - } - } - - p[name] = value; - } - - return !error; -} - -void XlibTouchpad::loadSupportedProperties(const Parameter *props) -{ - m_paramList = props; - for (const Parameter *param = props; param->name; param++) { - QLatin1String name(param->prop_name); - - if (!m_atoms.contains(name)) { - m_atoms.insert(name, QSharedPointer(new XcbAtom(m_connection, param->prop_name))); - } - } - - for (const Parameter *p = props; p->name; p++) { - if (getParameter(p).isValid()) { - m_supported.append(p->name); - } - } -} - -QVariant XlibTouchpad::getParameter(const Parameter *par) -{ - PropertyInfo *p = getDevProperty(QLatin1String(par->prop_name)); - if (!p || par->prop_offset >= p->nitems) { - return QVariant(); - } - - return p->value(par->prop_offset); -} - -void XlibTouchpad::flush() -{ - for (const QLatin1String &name : qAsConst(m_changed)) { - m_props[name].set(); - } - m_changed.clear(); - - XFlush(m_display); -} - -double XlibTouchpad::getPropertyScale(const QString &name) const -{ - Q_UNUSED(name); - return 1.0; -} - -PropertyInfo *XlibTouchpad::getDevProperty(const QLatin1String &propName) -{ - if (m_props.contains(propName)) { - return &m_props[propName]; - } - - if (!m_atoms.contains(propName) || !m_atoms[propName]) { - return nullptr; - } - - xcb_atom_t prop = m_atoms[propName]->atom(); - if (!prop) { - return nullptr; - } - - PropertyInfo p(m_display, m_deviceId, prop, m_floatType.atom()); - if (!p.b && !p.f && !p.i) { - return nullptr; - } - return &m_props.insert(propName, p).value(); -} - -bool XlibTouchpad::setParameter(const Parameter *par, const QVariant &value) -{ - QLatin1String propName(par->prop_name); - PropertyInfo *p = getDevProperty(propName); - if (!p || par->prop_offset >= p->nitems) { - return false; - } - - QVariant converted(value); - QVariant::Type convType = QVariant::Int; - if (p->f) { - convType = QVariant::Double; - } else if (value.type() == QVariant::Double) { - converted = QVariant(qRound(static_cast(value.toDouble()))); - } - - if (!converted.convert(convType)) { - return false; - } - - if (converted == p->value(par->prop_offset)) { - return true; - } - - if (p->b) { - p->b[par->prop_offset] = static_cast(converted.toInt()); - } else if (p->i) { - p->i[par->prop_offset] = converted.toInt(); - } else if (p->f) { - p->f[par->prop_offset] = converted.toDouble(); - } - - m_changed.insert(propName); - return true; -} - -void XlibTouchpad::setEnabled(bool enable) -{ - PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); - if (enabled.b && *(enabled.b) != enable) { - *(enabled.b) = enable; - enabled.set(); - } - - flush(); -} - -bool XlibTouchpad::enabled() -{ - PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); - return enabled.value(0).toBool(); -} - -const Parameter *XlibTouchpad::findParameter(const QString &name) -{ - for (const Parameter *par = m_paramList; par->name; par++) { - if (name == par->name) { - return par; - } - } - return nullptr; -} diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.h b/settings-daemon/touchpad/x11/xlibtouchpad.h deleted file mode 100755 index f20bb66..0000000 --- a/settings-daemon/touchpad/x11/xlibtouchpad.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - SPDX-FileCopyrightText: 2015 Weng Xuetian - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBTOUCHPAD_H -#define XLIBTOUCHPAD_H - -#include -#include -#include - -#include "propertyinfo.h" -#include "xcbatom.h" -#include - -enum ParaType { - PT_INT, - PT_BOOL, - PT_DOUBLE, -}; - -struct Parameter { - const char *name; /* Name of parameter */ - enum ParaType type; /* Type of parameter */ - double min_val; /* Minimum allowed value */ - double max_val; /* Maximum allowed value */ - const char *prop_name; /* Property name */ - int prop_format; /* Property format (0 for floats) */ - unsigned prop_offset; /* Offset inside property */ -}; - -class XlibTouchpad -{ -public: - XlibTouchpad(Display *display, int deviceId); - virtual ~XlibTouchpad() - { - } - - int deviceId() - { - return m_deviceId; - } - const QStringList &supportedParameters() const - { - return m_supported; - } - bool applyConfig(const QVariantHash &p); - bool getConfig(QVariantHash &p); - virtual bool getConfig() - { - return false; - } - virtual bool applyConfig() - { - return false; - } - virtual bool getDefaultConfig() - { - return false; - } - virtual bool isChangedConfig() - { - return false; - } - void setEnabled(bool enable); - bool enabled(); - virtual void setTouchpadOff(int /*touchpadOff*/) - { - } - virtual int touchpadOff() = 0; - - virtual XcbAtom &touchpadOffAtom() = 0; - -protected: - void loadSupportedProperties(const Parameter *props); - bool setParameter(const struct Parameter *, const QVariant &); - QVariant getParameter(const struct Parameter *); - struct PropertyInfo *getDevProperty(const QLatin1String &propName); - void flush(); - virtual double getPropertyScale(const QString &name) const; - const Parameter *findParameter(const QString &name); - - Display *m_display; - xcb_connection_t *m_connection; - int m_deviceId; - - XcbAtom m_floatType, m_enabledAtom; - - QMap> m_atoms; - - QMap m_negate; - QMap m_props; - QSet m_changed; - QStringList m_supported; - const struct Parameter *m_paramList; -}; - -#endif diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp deleted file mode 100755 index c9fe99b..0000000 --- a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xrecordkeyboardmonitor.h" - -#include -#include - -#include - -#include -#include - -XRecordKeyboardMonitor::XRecordKeyboardMonitor(Display *display) - : m_connection(xcb_connect(XDisplayString(display), nullptr)) - , m_modifiersPressed(0) - , m_keysPressed(0) -{ - if (!m_connection) { - return; - } - - xcb_get_modifier_mapping_cookie_t modmapCookie = xcb_get_modifier_mapping(m_connection); - - m_context = xcb_generate_id(m_connection); - xcb_record_range_t range; - memset(&range, 0, sizeof(range)); - range.device_events.first = XCB_KEY_PRESS; - range.device_events.last = XCB_KEY_RELEASE; - xcb_record_client_spec_t cs = XCB_RECORD_CS_ALL_CLIENTS; - xcb_record_create_context(m_connection, m_context, 0, 1, 1, &cs, &range); - xcb_flush(m_connection); - - QScopedPointer modmap(xcb_get_modifier_mapping_reply(m_connection, modmapCookie, nullptr)); - if (!modmap) { - return; - } - - int nModifiers = xcb_get_modifier_mapping_keycodes_length(modmap.data()); - xcb_keycode_t *modifiers = xcb_get_modifier_mapping_keycodes(modmap.data()); - m_modifier.fill(false, std::numeric_limits::max() + 1); - for (xcb_keycode_t *i = modifiers; i < modifiers + nModifiers; i++) { - m_modifier[*i] = true; - } - m_ignore.fill(false, std::numeric_limits::max() + 1); - for (xcb_keycode_t *i = modifiers; i < modifiers + modmap->keycodes_per_modifier; i++) { - m_ignore[*i] = true; - } - m_pressed.fill(false, std::numeric_limits::max() + 1); - - m_cookie = xcb_record_enable_context(m_connection, m_context); - xcb_flush(m_connection); - - m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); - connect(m_notifier, &QSocketNotifier::activated, this, &XRecordKeyboardMonitor::processNextReply); - m_notifier->setEnabled(true); -} - -XRecordKeyboardMonitor::~XRecordKeyboardMonitor() -{ - if (!m_connection) { - return; - } - - xcb_record_disable_context(m_connection, m_context); - xcb_record_free_context(m_connection, m_context); - xcb_disconnect(m_connection); -} - -void XRecordKeyboardMonitor::processNextReply() -{ - xcb_generic_event_t *event; - while ((event = xcb_poll_for_event(m_connection))) { - std::free(event); - } - - void *reply = nullptr; - xcb_generic_error_t *error = nullptr; - while (m_cookie.sequence && xcb_poll_for_reply(m_connection, m_cookie.sequence, &reply, &error)) { - // xcb_poll_for_reply may set both reply and error to null if connection has error. - // break if xcb_connection has error, no point to continue anyway. - if (xcb_connection_has_error(m_connection)) { - break; - } - - if (error) { - std::free(error); - break; - } - - if (!reply) { - continue; - } - - QScopedPointer data(reinterpret_cast(reply)); - process(data.data()); - } -} - -void XRecordKeyboardMonitor::process(xcb_record_enable_context_reply_t *reply) -{ - bool prevActivity = activity(); - - xcb_key_press_event_t *events = reinterpret_cast(xcb_record_enable_context_data(reply)); - int nEvents = xcb_record_enable_context_data_length(reply) / sizeof(xcb_key_press_event_t); - bool wasActivity = prevActivity; - for (xcb_key_press_event_t *e = events; e < events + nEvents; e++) { - if (e->response_type != XCB_KEY_PRESS && e->response_type != XCB_KEY_RELEASE) { - continue; - } - - if (m_ignore[e->detail]) { - continue; - } - - bool pressed = (e->response_type == XCB_KEY_PRESS); - if (m_pressed[e->detail] == pressed) { - continue; - } - m_pressed[e->detail] = pressed; - - int &counter = m_modifier[e->detail] ? m_modifiersPressed : m_keysPressed; - if (pressed) { - counter++; - } else { - counter--; - } - - wasActivity = wasActivity || activity(); - } - - if (!prevActivity && activity()) { - Q_EMIT keyboardActivityStarted(); - } else if (!activity() && wasActivity) { - Q_EMIT keyboardActivityFinished(); - } -} diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h deleted file mode 100755 index 6abec2f..0000000 --- a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XRECORDKEYBOARDMONITOR_H -#define XRECORDKEYBOARDMONITOR_H - -#include -#include - -#include -#include - -class XRecordKeyboardMonitor : public QObject -{ - Q_OBJECT - -public: - XRecordKeyboardMonitor(Display *display); - ~XRecordKeyboardMonitor(); - -Q_SIGNALS: - void keyboardActivityStarted(); - void keyboardActivityFinished(); - -private Q_SLOTS: - void processNextReply(); - -private: - void process(xcb_record_enable_context_reply_t *reply); - bool activity() const - { - return m_keysPressed && !m_modifiersPressed; - } - - QSocketNotifier *m_notifier; - xcb_connection_t *m_connection; - xcb_record_context_t m_context; - xcb_record_enable_context_cookie_t m_cookie; - - QVector m_modifier, m_ignore, m_pressed; - int m_modifiersPressed, m_keysPressed; -}; - -#endif // XRECORDKEYBOARDMONITOR_H From 830ce94682d91e87e9733b6ebfc3ecdbc5544cb7 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:02:21 +0800 Subject: [PATCH 224/254] modified: settings-daemon/application.cpp settings-daemon/touchpad/ --- settings-daemon/application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/application.cpp b/settings-daemon/application.cpp index 9b3c544..c98ff5f 100755 --- a/settings-daemon/application.cpp +++ b/settings-daemon/application.cpp @@ -43,7 +43,7 @@ Application::Application(int &argc, char **argv) , m_upowerManager(new UPowerManager(this)) , m_language(Language::self()) , m_mouse(new Mouse) - , m_touchpad(new TouchpadManager) + // , m_touchpad(new TouchpadManager) , m_defaultApps(new DefaultApplications) // , m_kwinTimer(new QTimer(this)) From 29d05328a013ef90fb9bbbc09aa099da9c2c3cc7 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:03:04 +0800 Subject: [PATCH 225/254] new file: settings-daemon/build/CMakeFiles/3.29.5/CMakeCCompiler.cmake new file: settings-daemon/build/CMakeFiles/3.29.5/CMakeCXXCompiler.cmake new file: settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_C.bin new file: settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_CXX.bin new file: settings-daemon/build/CMakeFiles/3.29.5/CMakeSystem.cmake new file: settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/CMakeCCompilerId.c new file: settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out new file: settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/CMakeCXXCompilerId.cpp new file: settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out new file: settings-daemon/build/CMakeFiles/CMakeConfigureLog.yaml new file: settings-daemon/build/CMakeFiles/ar_AA.ts_lst_file new file: settings-daemon/build/CMakeFiles/be_BY.ts_lst_file new file: settings-daemon/build/CMakeFiles/be_Latn.ts_lst_file new file: settings-daemon/build/CMakeFiles/bg_BG.ts_lst_file new file: settings-daemon/build/CMakeFiles/bs_BA.ts_lst_file new file: settings-daemon/build/CMakeFiles/cs_CZ.ts_lst_file new file: settings-daemon/build/CMakeFiles/da_DK.ts_lst_file new file: settings-daemon/build/CMakeFiles/de_DE.ts_lst_file new file: settings-daemon/build/CMakeFiles/en_US.ts_lst_file new file: settings-daemon/build/CMakeFiles/eo_XX.ts_lst_file new file: settings-daemon/build/CMakeFiles/es_ES.ts_lst_file new file: settings-daemon/build/CMakeFiles/es_MX.ts_lst_file new file: settings-daemon/build/CMakeFiles/fa_IR.ts_lst_file new file: settings-daemon/build/CMakeFiles/fi_FI.ts_lst_file new file: settings-daemon/build/CMakeFiles/fr_FR.ts_lst_file new file: settings-daemon/build/CMakeFiles/he_IL.ts_lst_file new file: settings-daemon/build/CMakeFiles/hi_IN.ts_lst_file new file: settings-daemon/build/CMakeFiles/hu_HU.ts_lst_file new file: settings-daemon/build/CMakeFiles/id_ID.ts_lst_file new file: settings-daemon/build/CMakeFiles/ie.ts_lst_file new file: settings-daemon/build/CMakeFiles/it_IT.ts_lst_file new file: settings-daemon/build/CMakeFiles/ja_JP.ts_lst_file new file: settings-daemon/build/CMakeFiles/lt_LT.ts_lst_file new file: settings-daemon/build/CMakeFiles/lv_LV.ts_lst_file new file: settings-daemon/build/CMakeFiles/mg.ts_lst_file new file: settings-daemon/build/CMakeFiles/ml_IN.ts_lst_file new file: settings-daemon/build/moc_brightnessadaptor.cpp_parameters new file: settings-daemon/build/moc_dockadaptor.cpp_parameters new file: settings-daemon/build/moc_languageadaptor.cpp_parameters new file: settings-daemon/build/moc_mouseadaptor.cpp_parameters new file: settings-daemon/build/moc_primarybatteryadaptor.cpp_parameters new file: settings-daemon/build/moc_themeadaptor.cpp_parameters new file: settings-daemon/build/moc_touchpadadaptor.cpp_parameters new file: settings-daemon/touchpad/com.lingmo.Touchpad.xml new file: settings-daemon/touchpad/libinputcommon.cpp new file: settings-daemon/touchpad/libinputcommon.h new file: settings-daemon/touchpad/touchpadmanager.cpp new file: settings-daemon/touchpad/touchpadmanager.h new file: settings-daemon/touchpad/x11/libinputtouchpad.cpp new file: settings-daemon/touchpad/x11/libinputtouchpad.h new file: settings-daemon/touchpad/x11/propertyinfo.cpp new file: settings-daemon/touchpad/x11/propertyinfo.h new file: settings-daemon/touchpad/x11/synapticstouchpad.cpp new file: settings-daemon/touchpad/x11/synapticstouchpad.h new file: settings-daemon/touchpad/x11/xcbatom.cpp new file: settings-daemon/touchpad/x11/xcbatom.h new file: settings-daemon/touchpad/x11/xlibbackend.cpp new file: settings-daemon/touchpad/x11/xlibbackend.h new file: settings-daemon/touchpad/x11/xlibnotifications.cpp new file: settings-daemon/touchpad/x11/xlibnotifications.h new file: settings-daemon/touchpad/x11/xlibtouchpad.cpp new file: settings-daemon/touchpad/x11/xlibtouchpad.h new file: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp new file: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h --- .../CMakeFiles/3.29.5/CMakeCCompiler.cmake | 80 + .../CMakeFiles/3.29.5/CMakeCXXCompiler.cmake | 92 ++ .../3.29.5/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 15448 bytes .../3.29.5/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 15464 bytes .../build/CMakeFiles/3.29.5/CMakeSystem.cmake | 15 + .../3.29.5/CompilerIdC/CMakeCCompilerId.c | 895 +++++++++++ .../build/CMakeFiles/3.29.5/CompilerIdC/a.out | Bin 0 -> 15560 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 878 +++++++++++ .../CMakeFiles/3.29.5/CompilerIdCXX/a.out | Bin 0 -> 15576 bytes .../build/CMakeFiles/CMakeConfigureLog.yaml | 1318 +++++++++++++++++ .../build/CMakeFiles/ar_AA.ts_lst_file | 1 + .../build/CMakeFiles/be_BY.ts_lst_file | 1 + .../build/CMakeFiles/be_Latn.ts_lst_file | 1 + .../build/CMakeFiles/bg_BG.ts_lst_file | 1 + .../build/CMakeFiles/bs_BA.ts_lst_file | 1 + .../build/CMakeFiles/cs_CZ.ts_lst_file | 1 + .../build/CMakeFiles/da_DK.ts_lst_file | 1 + .../build/CMakeFiles/de_DE.ts_lst_file | 1 + .../build/CMakeFiles/en_US.ts_lst_file | 1 + .../build/CMakeFiles/eo_XX.ts_lst_file | 1 + .../build/CMakeFiles/es_ES.ts_lst_file | 1 + .../build/CMakeFiles/es_MX.ts_lst_file | 1 + .../build/CMakeFiles/fa_IR.ts_lst_file | 1 + .../build/CMakeFiles/fi_FI.ts_lst_file | 1 + .../build/CMakeFiles/fr_FR.ts_lst_file | 1 + .../build/CMakeFiles/he_IL.ts_lst_file | 1 + .../build/CMakeFiles/hi_IN.ts_lst_file | 1 + .../build/CMakeFiles/hu_HU.ts_lst_file | 1 + .../build/CMakeFiles/id_ID.ts_lst_file | 1 + .../build/CMakeFiles/ie.ts_lst_file | 1 + .../build/CMakeFiles/it_IT.ts_lst_file | 1 + .../build/CMakeFiles/ja_JP.ts_lst_file | 1 + .../build/CMakeFiles/lt_LT.ts_lst_file | 1 + .../build/CMakeFiles/lv_LV.ts_lst_file | 1 + .../build/CMakeFiles/mg.ts_lst_file | 1 + .../build/CMakeFiles/ml_IN.ts_lst_file | 1 + .../moc_brightnessadaptor.cpp_parameters | 3 + .../build/moc_dockadaptor.cpp_parameters | 3 + .../build/moc_languageadaptor.cpp_parameters | 3 + .../build/moc_mouseadaptor.cpp_parameters | 3 + .../moc_primarybatteryadaptor.cpp_parameters | 3 + .../build/moc_themeadaptor.cpp_parameters | 3 + .../build/moc_touchpadadaptor.cpp_parameters | 3 + .../touchpad/com.lingmo.Touchpad.xml | 26 + settings-daemon/touchpad/libinputcommon.cpp | 9 + settings-daemon/touchpad/libinputcommon.h | 566 +++++++ settings-daemon/touchpad/touchpadmanager.cpp | 66 + settings-daemon/touchpad/touchpadmanager.h | 37 + .../touchpad/x11/libinputtouchpad.cpp | 402 +++++ .../touchpad/x11/libinputtouchpad.h | 149 ++ settings-daemon/touchpad/x11/propertyinfo.cpp | 86 ++ settings-daemon/touchpad/x11/propertyinfo.h | 37 + .../touchpad/x11/synapticstouchpad.cpp | 225 +++ .../touchpad/x11/synapticstouchpad.h | 34 + settings-daemon/touchpad/x11/xcbatom.cpp | 48 + settings-daemon/touchpad/x11/xcbatom.h | 36 + settings-daemon/touchpad/x11/xlibbackend.cpp | 425 ++++++ settings-daemon/touchpad/x11/xlibbackend.h | 124 ++ .../touchpad/x11/xlibnotifications.cpp | 135 ++ .../touchpad/x11/xlibnotifications.h | 41 + settings-daemon/touchpad/x11/xlibtouchpad.cpp | 257 ++++ settings-daemon/touchpad/x11/xlibtouchpad.h | 101 ++ .../touchpad/x11/xrecordkeyboardmonitor.cpp | 140 ++ .../touchpad/x11/xrecordkeyboardmonitor.h | 47 + 64 files changed, 6316 insertions(+) create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CMakeCCompiler.cmake create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CMakeCXXCompiler.cmake create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_C.bin create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_CXX.bin create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CMakeSystem.cmake create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/CMakeCCompilerId.c create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out create mode 100644 settings-daemon/build/CMakeFiles/CMakeConfigureLog.yaml create mode 100644 settings-daemon/build/CMakeFiles/ar_AA.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/be_BY.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/be_Latn.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/bg_BG.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/bs_BA.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/cs_CZ.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/da_DK.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/de_DE.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/en_US.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/eo_XX.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/es_ES.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/es_MX.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/fa_IR.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/fi_FI.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/fr_FR.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/he_IL.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/hi_IN.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/hu_HU.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/id_ID.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/ie.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/it_IT.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/ja_JP.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/lt_LT.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/lv_LV.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/mg.ts_lst_file create mode 100644 settings-daemon/build/CMakeFiles/ml_IN.ts_lst_file create mode 100644 settings-daemon/build/moc_brightnessadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_dockadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_languageadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_mouseadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_primarybatteryadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_themeadaptor.cpp_parameters create mode 100644 settings-daemon/build/moc_touchpadadaptor.cpp_parameters create mode 100644 settings-daemon/touchpad/com.lingmo.Touchpad.xml create mode 100644 settings-daemon/touchpad/libinputcommon.cpp create mode 100644 settings-daemon/touchpad/libinputcommon.h create mode 100644 settings-daemon/touchpad/touchpadmanager.cpp create mode 100644 settings-daemon/touchpad/touchpadmanager.h create mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.h create mode 100644 settings-daemon/touchpad/x11/propertyinfo.cpp create mode 100644 settings-daemon/touchpad/x11/propertyinfo.h create mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.h create mode 100644 settings-daemon/touchpad/x11/xcbatom.cpp create mode 100644 settings-daemon/touchpad/x11/xcbatom.h create mode 100644 settings-daemon/touchpad/x11/xlibbackend.cpp create mode 100644 settings-daemon/touchpad/x11/xlibbackend.h create mode 100644 settings-daemon/touchpad/x11/xlibnotifications.cpp create mode 100644 settings-daemon/touchpad/x11/xlibnotifications.h create mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.h create mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp create mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h diff --git a/settings-daemon/build/CMakeFiles/3.29.5/CMakeCCompiler.cmake b/settings-daemon/build/CMakeFiles/3.29.5/CMakeCCompiler.cmake new file mode 100644 index 0000000..460635e --- /dev/null +++ b/settings-daemon/build/CMakeFiles/3.29.5/CMakeCCompiler.cmake @@ -0,0 +1,80 @@ +set(CMAKE_C_COMPILER "/usr/sbin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "GNU") +set(CMAKE_C_COMPILER_VERSION "14.1.1") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") +set(CMAKE_C17_COMPILE_FEATURES "c_std_17") +set(CMAKE_C23_COMPILE_FEATURES "c_std_23") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/usr/sbin/ar") +set(CMAKE_C_COMPILER_AR "/usr/sbin/gcc-ar") +set(CMAKE_RANLIB "/usr/sbin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "/usr/sbin/gcc-ranlib") +set(CMAKE_LINKER "/usr/sbin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_C_COMPILER_LINKER "/usr/sbin/ld") +set(CMAKE_C_COMPILER_LINKER_ID "GNU") +set(CMAKE_C_COMPILER_LINKER_VERSION 2.42.0) +set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND") +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) +set(CMAKE_C_LINKER_DEPFILE_SUPPORTED FALSE) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/settings-daemon/build/CMakeFiles/3.29.5/CMakeCXXCompiler.cmake b/settings-daemon/build/CMakeFiles/3.29.5/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..55fcce1 --- /dev/null +++ b/settings-daemon/build/CMakeFiles/3.29.5/CMakeCXXCompiler.cmake @@ -0,0 +1,92 @@ +set(CMAKE_CXX_COMPILER "/usr/sbin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "GNU") +set(CMAKE_CXX_COMPILER_VERSION "14.1.1") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") +set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/usr/sbin/ar") +set(CMAKE_CXX_COMPILER_AR "/usr/sbin/gcc-ar") +set(CMAKE_RANLIB "/usr/sbin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "/usr/sbin/gcc-ranlib") +set(CMAKE_LINKER "/usr/sbin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_CXX_COMPILER_LINKER "/usr/sbin/ld") +set(CMAKE_CXX_COMPILER_LINKER_ID "GNU") +set(CMAKE_CXX_COMPILER_LINKER_VERSION 2.42.0) +set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND") +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang IN ITEMS C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) +set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED FALSE) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/14.1.1;/usr/include/c++/14.1.1/x86_64-pc-linux-gnu;/usr/include/c++/14.1.1/backward;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") +set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") diff --git a/settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_C.bin b/settings-daemon/build/CMakeFiles/3.29.5/CMakeDetermineCompilerABI_C.bin new file mode 100644 index 0000000000000000000000000000000000000000..04c8c719dbd2e6d5c87a0b6b156137a28c3ced6d GIT binary patch literal 15448 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 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if !defined(__STDC__) && !defined(__clang__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif __STDC_VERSION__ > 201710L +# define C_VERSION "23" +#elif __STDC_VERSION__ >= 201710L +# define C_VERSION "17" +#elif __STDC_VERSION__ >= 201000L +# define C_VERSION "11" +#elif __STDC_VERSION__ >= 199901L +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out b/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out new file mode 100644 index 0000000000000000000000000000000000000000..7559f734cb743dae778721327d3061433cfcfd55 GIT binary patch literal 15560 zcmeHOeQX?85uZEf!)fE*#jRa831n$erw5($(6xwolxL z*;|8CR2nG|VoXrWXOZ}bR3Skn{-^{Mf1q$ts?s7rDH2juq2eMc1r%sd0l5(QnAtb8 zS#R%J)PE|ZeU@+D{APah-p3XfFcY0T4@C-NMRCsOiB zIideS&SzMr(MB!py#j=J%ghVQ5%w2JV^DkGRX6`m#=DPsztX%g5SFsuB4xb$k;hA` zh;Q>M%Y2l_YqkzoIiDg~g#*RH%s~HvV!o$XC@(GdEDsL!4D{>Oir(jqO!G?NKb=!Y zCXPY;B-98Kehgxp^f>G2;x+QU1^+4S#Q($Ik2t5F_Ij&i<3S~rQ zmo0OyP_~MNhio7-<#_;(jOB(iW}n`tAM*PL`@zgjjhlJfvF8g_*LJ4HGsQ~Tp0Z|& zHpZGSRmvRQRIUvj0dPgUKXu~AP^bCId9$>;u!C0T1C0Inv2Wn%7so4~YVv-T_fc|} z!n^qWDtL_pwx*R`aM6mg=c*+fCtaZwE*s2cLTAaZj^y215pN|3`7}-G7x1T%D}sqf!7o7{kL)I zN~^KD^}+!F9=>9%EUo<_dyS@S ztaiMNkyf);jK_`GrNq;aIA4opuOa@MCiwYAxC(H##bUDVs!HE z*-B}#P_&(Cdl|jpy zU6|%RJ|8USEhmo;`sS>qqC4Gt7hCLQ*Dlj2Ro^x_;ms-8~|^sJRy?4hF&TTaII?A+e^C_eZioSrpzq5pnz7}@SUu_KK5Zy^4C!iR23o{neQ zw#CmOlYpp28Hh3vWgyBxlz}J%Q3j$6L>Y)O5M|*1I|EY3D0Pcc8+bb()=oJ*u4`;# zy~g#Ax3Mnuk$YH|uS~mHmpVzQ^A-C)H|iB~sd15^)DA9kaUsFYe-H^iUg zzFR`-$D55W^{ASrJfz-K>Pw}bRO&~MWHNVa-FQFXP7S~2_v*b`U#hP^btrWgG&A+} zH5(jp%HJ0Fd%clMBb>gs$KYlNAJ==l013aYT;ioX{|>m!b*X}nVy9h{fSkp?7SN^p zWe@KJNDHFmBPf#434i!N-KXk|6fNn3AaL;ab*Sg3U=CIr~iA9{cKoAxeJdsnO1Aal(0MN1Wo^#@7k&o(fWLMVyW+?0*O07(ZOsJdC)ehTQb}am3{s6*PPr@%A`g z75I83wucd?yrngT^s(WK9^MIBS^;ugkQui=VP`UYCoGrOXTco#*u>CyE`wF)_(m|Z zhB2*u z6jkK@riynnU#*x6c=L>^;d7Jdl`oXdrK+8WLV2!Y%AGf*6|M68k~MFeZ@#Mrrd?)^ z-2cPDW~x;lm}~d3{NBt?jF@I9VE6{!Th!uj{sDlW5-R&Q@pxSoneQzsg>DrB=+zS? z*P21;I!Z1`uTaLH1}uVJuDG^7UtZD|oywx^xF-V8%u)e=-%-djG&G#+ajkjq+!w6s z0_gb@WgJ3D*HIRkhv&wMi8jYBT0{Wdo3rj>N37iY@zs-D+nmDoy^FNCC zzwonK<}dpXk#hXom>-_Mg*fd!gfIIOk&iNuj*)UFeA#Cd5ThvzU-mm9&!8>X!ukIs z8fh;geA$19lzp4bU;IRV7WuTd5nc8-BI)y!T6q2n1vrZx%Bk>Wf8|S_u#6u*{%<0e zT*U5Qulc$y`$%;0T6q1wgJ_ViF;C=oLkVLuM+0~w#INz^lt|g<3L!lH51B8=4;p*2 ze4bSi42ud+VUMOL{ARz46GC|WpNIIDHRUOCN{B2a{{qwea2Mg7gM`WcU4Azg_7`2` z?~s!S@MVABg|&;+#7}A0b-`aj1Fb#3ZT)?n{0{OQuOFR%)PyJN_!q>;MfmdjrrH7W z2IyA8e-*yS*U%E=%Rcck^W}Xi0fZ-#_CrBFq}em2>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_standard_default = "INFO" ":" "standard_default[" +#if CXX_STD > 202002L + "23" +#elif CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} diff --git a/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out b/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out new file mode 100644 index 0000000000000000000000000000000000000000..3f6cf989583c323b8a2b4a7ea636ba1b2874ed4d GIT binary patch literal 15576 zcmeHOYit}>6~4R9!+|*Kgu1wKMWzK+F2$2w$8k--bRB!`vE)Zd9T6~LI^G@IEB3|g zxN?dB3-hw9R4qu5AAKO9{s5_hqN?zR;wVsvR8aZ@De4d8AS#(EP$M2nY2@Xcd(Roq zUe*PHK>V0%?VLH^Ip4W=&Yju0o;mxu%-C=|78Bf>#D@fGMyo>7WVm{qc0i;>pJ;*Y z?V>~M0ezRmls&BkSXH|kub0h)H-SW6JMJ`)w<{R>P>n~35_vnd3pgNXECn40@^+(v zbY1>}I$+86pg#l2&!7yiMY55|8B->W?Mo z6LW%}KFX&q(_q7vmRlio-XigIIYj;}u@7tyyz1xvo&N48-b;oIBXr60&64~3Fz{$< z74e^Jd74jAe>=^CLHTD%=@mx{`I+9HqlH{oAzxZp>{{&W?dt6@t7WrW_Kf37!UxZ( zk%`kHz9iNVV}4A;>hw72;36CP-U1&?JMvp5v)8`gHGRi(OPM`Qhd=-6J04&C9{S*M zU`+JEh8TXhp^ZO`{VVbeINjO6aTu^e4R9QX(E!K38{zNU0T;GCS1gz8s_%HdZ3}yJ zYTVAbo;#PX`mQ%MK3FK1+$m?K;3`{Viw)D0r65HoUxKjNMaQ1amz+ZWVOM~;>gTfe z+=DaLi)u00o67$%6i z4yR?4xIoy#;ru=UKHoxTXnfuC_11b&;Tv>aGrmRvo72k9IP0w%ZWzk1UBf-X4GsS? z;hh@(HNuk`{tV%3_X*kHASnY%|9J?fOGp~7gmC&wk@(dR9zK89L%95YR^g*Y)O5M?0Bz<((Ne@eXTZ`ShlW@~l#<)cDaUtII!wJX;0Pns{u9?_oq{piZe zpRiVbV=e!7^Zuz!YAtoyI^X{aIMmvff%WHEGjZe#(jV|^80Y-%S5UnFhTjIEXDRf) z+Ir&15;|TY3I5MY|Ks05arc(BvT0rX!+qAp8%voB}l0)@Kt(hPL@Q zzNP*mn8m`e)7EnTYbNYkE3f)3)@uJ)oL&99s(eC_R{uvFU@Z6Cyt~A z#{1nI_@0IsE1$V;tt_nnEOQfwY^}Ea8X~P`u3HzZ*pY)O5M?0BK$L+f z15pN|3`7}-GEkoZe4q7JZFFLI@Hw|wg&(?d_+3km1ubMBHrjxRzdQ7#G zOa(hzCq#EqmhM1SSGei!u;pAj&|LfhYq}2BHi^8Hh3vWgyDH z|5paM-jM4HRTZNUb2LoWAJX(CO@D;+{Uo^nvW4_Ds%yNBbgp~sAf5kZI!rp(KXRQf z+yAmvE2GOA6%TSvV1o7kW_RQCTk?6itoMPHf`C9%%m09 zoM4oVYg|3h?o?3S_B?2Z#C~xbT{lmY^{XHc#%~ooA53}*ap+gC_kD(NBdt97Jo^Et zhvF@QuS;bW;zx+H5|UWVf$@`R1#+A>32)W#G~@xtZ&2N`e0Bo9`w)-ARmcU>Dx63F zj>o0vvjcJHw^NIM0&vW~p63yXzf+{ipTdhV!u9xP05{kvB>f%m6&ujM}WeHfIdWoN_{&sF$5+2 z^#Sw;ci@Ugr)u@#P)m4ZGu0{sZ&m-_;HLr&e-0qb>baut%z*SgCFglBUxJ?%RD@Y7 z`>r`xS}-eKx#D{Mxezq7kcS_7CW4;o>O$~`5Z7 z&Vs*hSnq|MFn^KwEZ@V9B>DT6;ZcqMIPqB;>_}4Qe+2Nq!o8cv&+8GEeEhr~(Z}xq zAJ-zx=k*H9N2y;tM$8@adEJo*42R5oUjMM<^$xhmrsw}tfa2PO`Me%s$?G^CKl`!# zEbwuy!#b~b0;#%{a}*vw!2<7Zm{aESdW$8mx43`(_`d;MjLY`menR&ZURQ#PZ2J5? z0ce=d_bHZ7Y6;VBSMv8eVLsnSS@ODJ! zg!#Na+#o(*ryPKJEN^IhktWZil6|DIU>@sRu!9(npVu{g#Mk|Ctl`!K0Al1Gn3#{> zui?i0u;g{p?HKP2N}Fyb8WcsMWn0OPTT`JKm<_5^oCMoon^VPpPJ@ueKJ{Te}2 G#oqzN2JyoH literal 0 HcmV?d00001 diff --git a/settings-daemon/build/CMakeFiles/CMakeConfigureLog.yaml b/settings-daemon/build/CMakeFiles/CMakeConfigureLog.yaml new file mode 100644 index 0000000..f9071e9 --- /dev/null +++ b/settings-daemon/build/CMakeFiles/CMakeConfigureLog.yaml @@ -0,0 +1,1318 @@ + +--- +events: + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineSystem.cmake:205 (message)" + - "CMakeLists.txt:2 (project)" + message: | + The system is: Linux - 5.10.102.1-microsoft-standard-WSL2 - x86_64 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:2 (project)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. + Compiler: /usr/sbin/cc + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + + The C compiler identification is GNU, found in: + /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:2 (project)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. + Compiler: /usr/sbin/c++ + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + + The CXX compiler identification is GNU, found in: + /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out + + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:67 (try_compile)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_8f0f5/fast + /usr/sbin/make -f CMakeFiles/cmTC_8f0f5.dir/build.make CMakeFiles/cmTC_8f0f5.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad' + Building C object CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o + /usr/sbin/cc -v -o CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c + Using built-in specs. + COLLECT_GCC=/usr/sbin/cc + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1 -quiet -v /usr/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles/cmTC_8f0f5.dir/ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccejBS0Z.s + GNU C17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu) + compiled by GNU C version 14.1.1 20240522, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP + + GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 + ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include" + #include "..." search starts here: + #include <...> search starts here: + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include + /usr/local/include + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed + /usr/include + End of search list. + Compiler executable checksum: 555662f6736d29692f90e28e958fc3de + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/' + as -v --64 -o CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o /tmp/ccejBS0Z.s + GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0 + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.' + Linking C executable cmTC_8f0f5 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8f0f5.dir/link.txt --verbose=1 + /usr/sbin/cc -v -Wl,-v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -o cmTC_8f0f5 + Using built-in specs. + COLLECT_GCC=/usr/sbin/cc + COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8f0f5' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_8f0f5.' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPwmz7m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_8f0f5 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + collect2 version 14.1.1 20240522 + /usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPwmz7m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_8f0f5 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + GNU ld (GNU Binutils) 2.42.0 + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8f0f5' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_8f0f5.' + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad' + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:137 (message)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed C implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + add: [/usr/local/include] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + add: [/usr/include] + end of search list found + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:173 (message)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed C implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_8f0f5/fast] + ignore line: [/usr/sbin/make -f CMakeFiles/cmTC_8f0f5.dir/build.make CMakeFiles/cmTC_8f0f5.dir/build] + ignore line: [make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-ldsJad'] + ignore line: [Building C object CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/sbin/cc -v -o CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/cc] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/'] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1 -quiet -v /usr/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles/cmTC_8f0f5.dir/ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccejBS0Z.s] + ignore line: [GNU C17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu)] + ignore line: [ compiled by GNU C version 14.1.1 20240522 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [Compiler executable checksum: 555662f6736d29692f90e28e958fc3de] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o /tmp/ccejBS0Z.s] + ignore line: [GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.'] + ignore line: [Linking C executable cmTC_8f0f5] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8f0f5.dir/link.txt --verbose=1] + ignore line: [/usr/sbin/cc -v -Wl -v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -o cmTC_8f0f5] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/cc] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8f0f5' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_8f0f5.'] + link line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPwmz7m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_8f0f5 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccPwmz7m.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-o] ==> ignore + arg [cmTC_8f0f5] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + ignore line: [collect2 version 14.1.1 20240522] + ignore line: [/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPwmz7m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_8f0f5 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_8f0f5.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + linker tool for 'C': /usr/sbin/ld + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> [/usr/lib/Scrt1.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> [/usr/lib/crti.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> [/usr/lib/crtn.o] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> [/usr/lib] + implicit libs: [gcc;gcc_s;c;gcc;gcc_s] + implicit objs: [/usr/lib/Scrt1.o;/usr/lib/crti.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o;/usr/lib/crtn.o] + implicit dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib] + implicit fwks: [] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:210 (cmake_determine_linker_id)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Running the C compiler's linker: "/usr/sbin/ld" "-v" + GNU ld (GNU Binutils) 2.42.0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:67 (try_compile)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + checks: + - "Detecting CXX compiler ABI info" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2" + cmakeVariables: + CMAKE_CXX_FLAGS: "" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_CXX_SCAN_FOR_MODULES: "OFF" + CMAKE_EXE_LINKER_FLAGS: "" + buildResult: + variable: "CMAKE_CXX_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_f175a/fast + /usr/sbin/make -f CMakeFiles/cmTC_f175a.dir/build.make CMakeFiles/cmTC_f175a.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2' + Building CXX object CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o + /usr/sbin/c++ -v -o CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp + Using built-in specs. + COLLECT_GCC=/usr/sbin/c++ + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1plus -quiet -v -D_GNU_SOURCE /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_f175a.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o /tmp/ccaoCVLg.s + GNU C++17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu) + compiled by GNU C version 14.1.1 20240522, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP + + GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 + ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include" + #include "..." search starts here: + #include <...> search starts here: + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1 + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include + /usr/local/include + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed + /usr/include + End of search list. + Compiler executable checksum: 29a4cbac9a82c8094a8662004ee682d4 + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/' + as -v --64 -o CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccaoCVLg.s + GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0 + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.' + Linking CXX executable cmTC_f175a + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f175a.dir/link.txt --verbose=1 + /usr/sbin/c++ -v -Wl,-v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f175a + Using built-in specs. + COLLECT_GCC=/usr/sbin/c++ + COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f175a' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_f175a.' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc6hwLXD.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_f175a /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + collect2 version 14.1.1 20240522 + /usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc6hwLXD.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_f175a /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + GNU ld (GNU Binutils) 2.42.0 + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f175a' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_f175a.' + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2' + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:137 (message)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed CXX implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + add: [/usr/local/include] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + add: [/usr/include] + end of search list found + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] ==> [/usr/include/c++/14.1.1] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] ==> [/usr/include/c++/14.1.1/x86_64-pc-linux-gnu] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] ==> [/usr/include/c++/14.1.1/backward] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/include/c++/14.1.1;/usr/include/c++/14.1.1/x86_64-pc-linux-gnu;/usr/include/c++/14.1.1/backward;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:173 (message)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed CXX implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_f175a/fast] + ignore line: [/usr/sbin/make -f CMakeFiles/cmTC_f175a.dir/build.make CMakeFiles/cmTC_f175a.dir/build] + ignore line: [make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-qRF0o2'] + ignore line: [Building CXX object CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/usr/sbin/c++ -v -o CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/c++] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/'] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1plus -quiet -v -D_GNU_SOURCE /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_f175a.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o /tmp/ccaoCVLg.s] + ignore line: [GNU C++17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu)] + ignore line: [ compiled by GNU C version 14.1.1 20240522 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [Compiler executable checksum: 29a4cbac9a82c8094a8662004ee682d4] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccaoCVLg.s] + ignore line: [GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.'] + ignore line: [Linking CXX executable cmTC_f175a] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f175a.dir/link.txt --verbose=1] + ignore line: [/usr/sbin/c++ -v -Wl -v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f175a] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/c++] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f175a' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_f175a.'] + link line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc6hwLXD.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_f175a /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cc6hwLXD.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-o] ==> ignore + arg [cmTC_f175a] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lstdc++] ==> lib [stdc++] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + ignore line: [collect2 version 14.1.1 20240522] + ignore line: [/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc6hwLXD.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_f175a /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_f175a.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + linker tool for 'CXX': /usr/sbin/ld + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> [/usr/lib/Scrt1.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> [/usr/lib/crti.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> [/usr/lib/crtn.o] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> [/usr/lib] + implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] + implicit objs: [/usr/lib/Scrt1.o;/usr/lib/crti.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o;/usr/lib/crtn.o] + implicit dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib] + implicit fwks: [] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:210 (cmake_determine_linker_id)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Running the CXX compiler's linker: "/usr/sbin/ld" "-v" + GNU ld (GNU Binutils) 2.42.0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckLibraryExists.cmake:69 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:693 (check_library_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "X11_LIB_X11_SOLO" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_cf489/fast + /usr/sbin/make -f CMakeFiles/cmTC_cf489.dir/build.make CMakeFiles/cmTC_cf489.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy' + Building C object CMakeFiles/cmTC_cf489.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=XOpenDisplay -o CMakeFiles/cmTC_cf489.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy/CheckFunctionExists.c + Linking C executable cmTC_cf489 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cf489.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=XOpenDisplay CMakeFiles/cmTC_cf489.dir/CheckFunctionExists.c.o -o cmTC_cf489 /usr/lib/libX11.so /usr/lib/libXext.so + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-DCwEmy' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckFunctionExists.cmake:86 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:708 (check_function_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for gethostbyname" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "CMAKE_HAVE_GETHOSTBYNAME" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_c89d0/fast + /usr/sbin/make -f CMakeFiles/cmTC_c89d0.dir/build.make CMakeFiles/cmTC_c89d0.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW' + Building C object CMakeFiles/cmTC_c89d0.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=gethostbyname -o CMakeFiles/cmTC_c89d0.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW/CheckFunctionExists.c + Linking C executable cmTC_c89d0 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c89d0.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=gethostbyname CMakeFiles/cmTC_c89d0.dir/CheckFunctionExists.c.o -o cmTC_c89d0 + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-IXMRxW' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckFunctionExists.cmake:86 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:722 (check_function_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for connect" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "CMAKE_HAVE_CONNECT" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_53021/fast + /usr/sbin/make -f CMakeFiles/cmTC_53021.dir/build.make CMakeFiles/cmTC_53021.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw' + Building C object CMakeFiles/cmTC_53021.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=connect -o CMakeFiles/cmTC_53021.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw/CheckFunctionExists.c + Linking C executable cmTC_53021 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_53021.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=connect CMakeFiles/cmTC_53021.dir/CheckFunctionExists.c.o -o cmTC_53021 + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-JD1WAw' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckFunctionExists.cmake:86 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:731 (check_function_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for remove" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "CMAKE_HAVE_REMOVE" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_53fa3/fast + /usr/sbin/make -f CMakeFiles/cmTC_53fa3.dir/build.make CMakeFiles/cmTC_53fa3.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV' + Building C object CMakeFiles/cmTC_53fa3.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=remove -o CMakeFiles/cmTC_53fa3.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV/CheckFunctionExists.c + Linking C executable cmTC_53fa3 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_53fa3.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=remove CMakeFiles/cmTC_53fa3.dir/CheckFunctionExists.c.o -o cmTC_53fa3 + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-0QRgDV' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckFunctionExists.cmake:86 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:740 (check_function_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for shmat" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "CMAKE_HAVE_SHMAT" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_83aee/fast + /usr/sbin/make -f CMakeFiles/cmTC_83aee.dir/build.make CMakeFiles/cmTC_83aee.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS' + Building C object CMakeFiles/cmTC_83aee.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=shmat -o CMakeFiles/cmTC_83aee.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS/CheckFunctionExists.c + Linking C executable cmTC_83aee + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_83aee.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=shmat CMakeFiles/cmTC_83aee.dir/CheckFunctionExists.c.o -o cmTC_83aee + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-fxQ3vS' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CheckLibraryExists.cmake:69 (try_compile)" + - "/usr/share/cmake/Modules/FindX11.cmake:750 (check_library_exists)" + - "CMakeLists.txt:8 (find_package)" + checks: + - "Looking for IceConnectionNumber in ICE" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/" + buildResult: + variable: "CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_61724/fast + /usr/sbin/make -f CMakeFiles/cmTC_61724.dir/build.make CMakeFiles/cmTC_61724.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc' + Building C object CMakeFiles/cmTC_61724.dir/CheckFunctionExists.c.o + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=IceConnectionNumber -o CMakeFiles/cmTC_61724.dir/CheckFunctionExists.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc/CheckFunctionExists.c + Linking C executable cmTC_61724 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_61724.dir/link.txt --verbose=1 + /usr/sbin/cc -DCHECK_FUNCTION_EXISTS=IceConnectionNumber CMakeFiles/cmTC_61724.dir/CheckFunctionExists.c.o -o cmTC_61724 -lICE + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-akUgbc' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile)" + - "/usr/share/cmake/Modules/CheckCSourceCompiles.cmake:52 (cmake_check_source_compiles)" + - "/usr/share/cmake/Modules/FindThreads.cmake:97 (CHECK_C_SOURCE_COMPILES)" + - "/usr/share/cmake/Modules/FindThreads.cmake:163 (_threads_check_libc)" + - "/usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)" + - "/usr/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)" + - "/usr/lib/cmake/Qt6/Qt6Dependencies.cmake:27 (_qt_internal_find_third_party_dependencies)" + - "/usr/lib/cmake/Qt6/Qt6Config.cmake:134 (include)" + - "CMakeLists.txt:11 (find_package)" + checks: + - "Performing Test CMAKE_HAVE_LIBC_PTHREAD" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/;/usr/lib/cmake/Qt6;/usr/lib/cmake/Qt6/3rdparty/extra-cmake-modules/find-modules;/usr/lib/cmake/Qt6/3rdparty/kwin" + buildResult: + variable: "CMAKE_HAVE_LIBC_PTHREAD" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_c5837/fast + /usr/sbin/make -f CMakeFiles/cmTC_c5837.dir/build.make CMakeFiles/cmTC_c5837.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu' + Building C object CMakeFiles/cmTC_c5837.dir/src.c.o + /usr/sbin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_c5837.dir/src.c.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu/src.c + Linking C executable cmTC_c5837 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c5837.dir/link.txt --verbose=1 + /usr/sbin/cc CMakeFiles/cmTC_c5837.dir/src.c.o -o cmTC_c5837 + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-zJzgnu' + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile)" + - "/usr/share/cmake/Modules/CheckCXXSourceCompiles.cmake:52 (cmake_check_source_compiles)" + - "/usr/lib/cmake/Qt6/FindWrapAtomic.cmake:36 (check_cxx_source_compiles)" + - "/usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)" + - "/usr/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)" + - "/usr/lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:33 (_qt_internal_find_third_party_dependencies)" + - "/usr/lib/cmake/Qt6Core/Qt6CoreConfig.cmake:55 (include)" + - "/usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)" + - "/usr/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:111 (find_dependency)" + - "/usr/lib/cmake/Qt6DBus/Qt6DBusDependencies.cmake:42 (_qt_internal_find_qt_dependencies)" + - "/usr/lib/cmake/Qt6DBus/Qt6DBusConfig.cmake:53 (include)" + - "/usr/lib/cmake/Qt6/Qt6Config.cmake:179 (find_package)" + - "CMakeLists.txt:11 (find_package)" + checks: + - "Performing Test HAVE_STDATOMIC" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi" + cmakeVariables: + CMAKE_CXX_FLAGS: "" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "/usr/share/ECM/modules/;/usr/share/ECM/find-modules/;/usr/share/ECM/kde-modules/;/usr/lib/cmake/Qt6;/usr/lib/cmake/Qt6/3rdparty/extra-cmake-modules/find-modules;/usr/lib/cmake/Qt6/3rdparty/kwin" + buildResult: + variable: "HAVE_STDATOMIC" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_82b79/fast + /usr/sbin/make -f CMakeFiles/cmTC_82b79.dir/build.make CMakeFiles/cmTC_82b79.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi' + Building CXX object CMakeFiles/cmTC_82b79.dir/src.cxx.o + /usr/sbin/c++ -DHAVE_STDATOMIC -o CMakeFiles/cmTC_82b79.dir/src.cxx.o -c /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi/src.cxx + Linking CXX executable cmTC_82b79 + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_82b79.dir/link.txt --verbose=1 + /usr/sbin/c++ CMakeFiles/cmTC_82b79.dir/src.cxx.o -o cmTC_82b79 + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-WY09Mi' + + exitCode: 0 + +--- +events: + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineSystem.cmake:205 (message)" + - "CMakeLists.txt:2 (project)" + message: | + The system is: Linux - 5.10.102.1-microsoft-standard-WSL2 - x86_64 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:2 (project)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. + Compiler: /usr/sbin/cc + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + + The C compiler identification is GNU, found in: + /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdC/a.out + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:2 (project)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. + Compiler: /usr/sbin/c++ + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + + The CXX compiler identification is GNU, found in: + /mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/3.29.5/CompilerIdCXX/a.out + + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:67 (try_compile)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_521aa/fast + /usr/sbin/make -f CMakeFiles/cmTC_521aa.dir/build.make CMakeFiles/cmTC_521aa.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3' + Building C object CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o + /usr/sbin/cc -v -o CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c + Using built-in specs. + COLLECT_GCC=/usr/sbin/cc + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1 -quiet -v /usr/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles/cmTC_521aa.dir/ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccdKxmo8.s + GNU C17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu) + compiled by GNU C version 14.1.1 20240522, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP + + GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 + ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include" + #include "..." search starts here: + #include <...> search starts here: + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include + /usr/local/include + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed + /usr/include + End of search list. + Compiler executable checksum: 555662f6736d29692f90e28e958fc3de + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/' + as -v --64 -o CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o /tmp/ccdKxmo8.s + GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0 + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.' + Linking C executable cmTC_521aa + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_521aa.dir/link.txt --verbose=1 + /usr/sbin/cc -v -Wl,-v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -o cmTC_521aa + Using built-in specs. + COLLECT_GCC=/usr/sbin/cc + COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_521aa' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_521aa.' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc543GxK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_521aa /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + collect2 version 14.1.1 20240522 + /usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc543GxK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_521aa /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + GNU ld (GNU Binutils) 2.42.0 + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_521aa' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_521aa.' + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3' + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:137 (message)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed C implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + add: [/usr/local/include] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + add: [/usr/include] + end of search list found + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:173 (message)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed C implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_521aa/fast] + ignore line: [/usr/sbin/make -f CMakeFiles/cmTC_521aa.dir/build.make CMakeFiles/cmTC_521aa.dir/build] + ignore line: [make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-PMT3L3'] + ignore line: [Building C object CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/sbin/cc -v -o CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/cc] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/'] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1 -quiet -v /usr/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles/cmTC_521aa.dir/ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccdKxmo8.s] + ignore line: [GNU C17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu)] + ignore line: [ compiled by GNU C version 14.1.1 20240522 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [Compiler executable checksum: 555662f6736d29692f90e28e958fc3de] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o /tmp/ccdKxmo8.s] + ignore line: [GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.'] + ignore line: [Linking C executable cmTC_521aa] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_521aa.dir/link.txt --verbose=1] + ignore line: [/usr/sbin/cc -v -Wl -v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -o cmTC_521aa] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/cc] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_521aa' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_521aa.'] + link line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc543GxK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_521aa /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cc543GxK.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-o] ==> ignore + arg [cmTC_521aa] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--push-state] ==> ignore + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--pop-state] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + ignore line: [collect2 version 14.1.1 20240522] + ignore line: [/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cc543GxK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_521aa /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_521aa.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + linker tool for 'C': /usr/sbin/ld + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> [/usr/lib/Scrt1.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> [/usr/lib/crti.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> [/usr/lib/crtn.o] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> [/usr/lib] + implicit libs: [gcc;gcc_s;c;gcc;gcc_s] + implicit objs: [/usr/lib/Scrt1.o;/usr/lib/crti.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o;/usr/lib/crtn.o] + implicit dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib] + implicit fwks: [] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:210 (cmake_determine_linker_id)" + - "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Running the C compiler's linker: "/usr/sbin/ld" "-v" + GNU ld (GNU Binutils) 2.42.0 + - + kind: "try_compile-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:67 (try_compile)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + checks: + - "Detecting CXX compiler ABI info" + directories: + source: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD" + binary: "/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD" + cmakeVariables: + CMAKE_CXX_FLAGS: "" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_CXX_SCAN_FOR_MODULES: "OFF" + CMAKE_EXE_LINKER_FLAGS: "" + buildResult: + variable: "CMAKE_CXX_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD' + + Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_e735c/fast + /usr/sbin/make -f CMakeFiles/cmTC_e735c.dir/build.make CMakeFiles/cmTC_e735c.dir/build + make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD' + Building CXX object CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o + /usr/sbin/c++ -v -o CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp + Using built-in specs. + COLLECT_GCC=/usr/sbin/c++ + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1plus -quiet -v -D_GNU_SOURCE /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_e735c.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o /tmp/ccIEnVRY.s + GNU C++17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu) + compiled by GNU C version 14.1.1 20240522, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP + + GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 + ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include" + #include "..." search starts here: + #include <...> search starts here: + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1 + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include + /usr/local/include + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed + /usr/include + End of search list. + Compiler executable checksum: 29a4cbac9a82c8094a8662004ee682d4 + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/' + as -v --64 -o CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccIEnVRY.s + GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0 + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.' + Linking CXX executable cmTC_e735c + /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e735c.dir/link.txt --verbose=1 + /usr/sbin/c++ -v -Wl,-v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e735c + Using built-in specs. + COLLECT_GCC=/usr/sbin/c++ + COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper + Target: x86_64-pc-linux-gnu + Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror + Thread model: posix + Supported LTO compression algorithms: zlib zstd + gcc version 14.1.1 20240522 (GCC) + COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/ + LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/ + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e735c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e735c.' + /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cckJ92tW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_e735c /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + collect2 version 14.1.1 20240522 + /usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cckJ92tW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_e735c /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o + GNU ld (GNU Binutils) 2.42.0 + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e735c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e735c.' + make[1]: Leaving directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD' + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:137 (message)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed CXX implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + add: [/usr/local/include] + add: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + add: [/usr/include] + end of search list found + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] ==> [/usr/include/c++/14.1.1] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] ==> [/usr/include/c++/14.1.1/x86_64-pc-linux-gnu] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] ==> [/usr/include/c++/14.1.1/backward] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/include/c++/14.1.1;/usr/include/c++/14.1.1/x86_64-pc-linux-gnu;/usr/include/c++/14.1.1/backward;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include;/usr/local/include;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed;/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:173 (message)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Parsed CXX implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/sbin/make -f Makefile cmTC_e735c/fast] + ignore line: [/usr/sbin/make -f CMakeFiles/cmTC_e735c.dir/build.make CMakeFiles/cmTC_e735c.dir/build] + ignore line: [make[1]: Entering directory '/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/CMakeFiles/CMakeScratch/TryCompile-132wWD'] + ignore line: [Building CXX object CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/usr/sbin/c++ -v -o CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/c++] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/'] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/cc1plus -quiet -v -D_GNU_SOURCE /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_e735c.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o /tmp/ccIEnVRY.s] + ignore line: [GNU C++17 (GCC) version 14.1.1 20240522 (x86_64-pc-linux-gnu)] + ignore line: [ compiled by GNU C version 14.1.1 20240522 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../x86_64-pc-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/x86_64-pc-linux-gnu] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/backward] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include-fixed] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [Compiler executable checksum: 29a4cbac9a82c8094a8662004ee682d4] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccIEnVRY.s] + ignore line: [GNU assembler version 2.42.0 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.42.0] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.'] + ignore line: [Linking CXX executable cmTC_e735c] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e735c.dir/link.txt --verbose=1] + ignore line: [/usr/sbin/c++ -v -Wl -v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e735c] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/sbin/c++] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] + ignore line: [Target: x86_64-pc-linux-gnu] + ignore line: [Configured with: /build/gcc/src/gcc/configure --enable-languages=ada c c++ d fortran go lto m2 objc obj-c++ rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror] + ignore line: [Thread model: posix] + ignore line: [Supported LTO compression algorithms: zlib zstd] + ignore line: [gcc version 14.1.1 20240522 (GCC) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e735c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e735c.'] + link line: [ /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2 -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cckJ92tW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_e735c /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cckJ92tW.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-o] ==> ignore + arg [cmTC_e735c] ==> ignore + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lstdc++] ==> lib [stdc++] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o] + arg [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + ignore line: [collect2 version 14.1.1 20240522] + ignore line: [/usr/sbin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cckJ92tW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_e735c /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../.. -v CMakeFiles/cmTC_e735c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] + linker tool for 'CXX': /usr/sbin/ld + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o] ==> [/usr/lib/Scrt1.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crti.o] ==> [/usr/lib/crti.o] + collapse obj [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/crtn.o] ==> [/usr/lib/crtn.o] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] ==> [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../..] ==> [/usr/lib] + implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] + implicit objs: [/usr/lib/Scrt1.o;/usr/lib/crti.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtbeginS.o;/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/crtendS.o;/usr/lib/crtn.o] + implicit dirs: [/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1;/usr/lib;/lib] + implicit fwks: [] + + + - + kind: "message-v1" + backtrace: + - "/usr/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:210 (cmake_determine_linker_id)" + - "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:2 (project)" + message: | + Running the CXX compiler's linker: "/usr/sbin/ld" "-v" + GNU ld (GNU Binutils) 2.42.0 diff --git a/settings-daemon/build/CMakeFiles/ar_AA.ts_lst_file b/settings-daemon/build/CMakeFiles/ar_AA.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/ar_AA.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/be_BY.ts_lst_file b/settings-daemon/build/CMakeFiles/be_BY.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/be_BY.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/be_Latn.ts_lst_file b/settings-daemon/build/CMakeFiles/be_Latn.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/be_Latn.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/bg_BG.ts_lst_file b/settings-daemon/build/CMakeFiles/bg_BG.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/bg_BG.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/bs_BA.ts_lst_file b/settings-daemon/build/CMakeFiles/bs_BA.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/bs_BA.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/cs_CZ.ts_lst_file b/settings-daemon/build/CMakeFiles/cs_CZ.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/cs_CZ.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/da_DK.ts_lst_file b/settings-daemon/build/CMakeFiles/da_DK.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/da_DK.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/de_DE.ts_lst_file b/settings-daemon/build/CMakeFiles/de_DE.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/de_DE.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/en_US.ts_lst_file b/settings-daemon/build/CMakeFiles/en_US.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/en_US.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/eo_XX.ts_lst_file b/settings-daemon/build/CMakeFiles/eo_XX.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/eo_XX.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/es_ES.ts_lst_file b/settings-daemon/build/CMakeFiles/es_ES.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/es_ES.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/es_MX.ts_lst_file b/settings-daemon/build/CMakeFiles/es_MX.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/es_MX.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/fa_IR.ts_lst_file b/settings-daemon/build/CMakeFiles/fa_IR.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/fa_IR.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/fi_FI.ts_lst_file b/settings-daemon/build/CMakeFiles/fi_FI.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/fi_FI.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/fr_FR.ts_lst_file b/settings-daemon/build/CMakeFiles/fr_FR.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/fr_FR.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/he_IL.ts_lst_file b/settings-daemon/build/CMakeFiles/he_IL.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/he_IL.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/hi_IN.ts_lst_file b/settings-daemon/build/CMakeFiles/hi_IN.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/hi_IN.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/hu_HU.ts_lst_file b/settings-daemon/build/CMakeFiles/hu_HU.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/hu_HU.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/id_ID.ts_lst_file b/settings-daemon/build/CMakeFiles/id_ID.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/id_ID.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/ie.ts_lst_file b/settings-daemon/build/CMakeFiles/ie.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/ie.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/it_IT.ts_lst_file b/settings-daemon/build/CMakeFiles/it_IT.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/it_IT.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/ja_JP.ts_lst_file b/settings-daemon/build/CMakeFiles/ja_JP.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/ja_JP.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/lt_LT.ts_lst_file b/settings-daemon/build/CMakeFiles/lt_LT.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/lt_LT.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/lv_LV.ts_lst_file b/settings-daemon/build/CMakeFiles/lv_LV.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/lv_LV.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/mg.ts_lst_file b/settings-daemon/build/CMakeFiles/mg.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/mg.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/CMakeFiles/ml_IN.ts_lst_file b/settings-daemon/build/CMakeFiles/ml_IN.ts_lst_file new file mode 100644 index 0000000..70a280b --- /dev/null +++ b/settings-daemon/build/CMakeFiles/ml_IN.ts_lst_file @@ -0,0 +1 @@ +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon diff --git a/settings-daemon/build/moc_brightnessadaptor.cpp_parameters b/settings-daemon/build/moc_brightnessadaptor.cpp_parameters new file mode 100644 index 0000000..ea510f1 --- /dev/null +++ b/settings-daemon/build/moc_brightnessadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_brightnessadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/brightnessadaptor.h diff --git a/settings-daemon/build/moc_dockadaptor.cpp_parameters b/settings-daemon/build/moc_dockadaptor.cpp_parameters new file mode 100644 index 0000000..4dc317c --- /dev/null +++ b/settings-daemon/build/moc_dockadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_dockadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/dockadaptor.h diff --git a/settings-daemon/build/moc_languageadaptor.cpp_parameters b/settings-daemon/build/moc_languageadaptor.cpp_parameters new file mode 100644 index 0000000..ab05b94 --- /dev/null +++ b/settings-daemon/build/moc_languageadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_languageadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/languageadaptor.h diff --git a/settings-daemon/build/moc_mouseadaptor.cpp_parameters b/settings-daemon/build/moc_mouseadaptor.cpp_parameters new file mode 100644 index 0000000..678d4e6 --- /dev/null +++ b/settings-daemon/build/moc_mouseadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_mouseadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/mouseadaptor.h diff --git a/settings-daemon/build/moc_primarybatteryadaptor.cpp_parameters b/settings-daemon/build/moc_primarybatteryadaptor.cpp_parameters new file mode 100644 index 0000000..8dbe041 --- /dev/null +++ b/settings-daemon/build/moc_primarybatteryadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_primarybatteryadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/primarybatteryadaptor.h diff --git a/settings-daemon/build/moc_themeadaptor.cpp_parameters b/settings-daemon/build/moc_themeadaptor.cpp_parameters new file mode 100644 index 0000000..c0a79a7 --- /dev/null +++ b/settings-daemon/build/moc_themeadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_themeadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/themeadaptor.h diff --git a/settings-daemon/build/moc_touchpadadaptor.cpp_parameters b/settings-daemon/build/moc_touchpadadaptor.cpp_parameters new file mode 100644 index 0000000..4fabee8 --- /dev/null +++ b/settings-daemon/build/moc_touchpadadaptor.cpp_parameters @@ -0,0 +1,3 @@ +-o +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/moc_touchpadadaptor.cpp +/mnt/c/Users/Intro/Project/Lingmo/lingmo-core/settings-daemon/build/touchpadadaptor.h diff --git a/settings-daemon/touchpad/com.lingmo.Touchpad.xml b/settings-daemon/touchpad/com.lingmo.Touchpad.xml new file mode 100644 index 0000000..c32ef00 --- /dev/null +++ b/settings-daemon/touchpad/com.lingmo.Touchpad.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/settings-daemon/touchpad/libinputcommon.cpp b/settings-daemon/touchpad/libinputcommon.cpp new file mode 100644 index 0000000..2d0a92d --- /dev/null +++ b/settings-daemon/touchpad/libinputcommon.cpp @@ -0,0 +1,9 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "libinputcommon.h" + +#include "moc_libinputcommon.cpp" diff --git a/settings-daemon/touchpad/libinputcommon.h b/settings-daemon/touchpad/libinputcommon.h new file mode 100644 index 0000000..7d18def --- /dev/null +++ b/settings-daemon/touchpad/libinputcommon.h @@ -0,0 +1,566 @@ +/* + SPDX-FileCopyrightText: 2017 Roman Gilg + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef LIBINPUTCOMMON_H +#define LIBINPUTCOMMON_H + +#include +#include + +namespace +{ +template +inline T valueLoaderPart(QVariant const &reply) +{ + Q_UNUSED(reply); + return T(); +} + +template<> +inline bool valueLoaderPart(QVariant const &reply) +{ + return reply.toBool(); +} + +template<> +inline int valueLoaderPart(QVariant const &reply) +{ + return reply.toInt(); +} + +template<> +inline quint32 valueLoaderPart(QVariant const &reply) +{ + return reply.toInt(); +} + +template<> +inline qreal valueLoaderPart(QVariant const &reply) +{ + return reply.toReal(); +} + +template<> +inline QString valueLoaderPart(QVariant const &reply) +{ + return reply.toString(); +} + +template<> +inline Qt::MouseButtons valueLoaderPart(QVariant const &reply) +{ + return static_cast(reply.toInt()); +} +} + +class LibinputCommon : public QObject +{ + Q_OBJECT + + // + // general + Q_PROPERTY(QString name READ name CONSTANT) + Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) + + // + // advanced + Q_PROPERTY(Qt::MouseButtons supportedButtons READ supportedButtons CONSTANT) + + Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT) + Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT) + Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged) + + Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT) + + Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT) + Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT) + Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged) + + Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT) + Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT) + Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged) + + // + // acceleration speed and profile + Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT) + Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged) + + Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT) + Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT) + Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY + pointerAccelerationProfileChanged) + + Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT) + Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT) + Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY + pointerAccelerationProfileChanged) + + // + // tapping + Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT) + Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged) + + Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT) + Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT) + Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY lmrTapButtonMapChanged) + + Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged) + + Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged) + + // + // scrolling + Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT) + Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT) + Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged) + + Q_PROPERTY(bool supportsHorizontalScrolling READ supportsHorizontalScrolling CONSTANT) + Q_PROPERTY(bool horizontalScrollingByDefault READ horizontalScrollingByDefault CONSTANT) + Q_PROPERTY(bool horizontalScrolling READ horizontalScrolling WRITE setHorizontalScrolling NOTIFY horizontalScrollingChanged) + + Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT) + Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged) + + Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT) + Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged) + + Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT) + Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged) + + Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT) + Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged) + + // Click Methods + Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT) + Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT) + Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged) + + Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT) + Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT) + Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged) + + Q_PROPERTY(bool supportsScrollFactor READ supportsScrollFactor CONSTANT) +public: + LibinputCommon() + { + } + virtual ~LibinputCommon() + { + } + + virtual QString name() const = 0; + virtual bool supportsDisableEvents() const = 0; + virtual bool isEnabled() const = 0; + virtual void setEnabled(bool set) = 0; + + // + // advanced + Qt::MouseButtons supportedButtons() const + { + return m_supportedButtons.val; + } + + virtual bool supportsLeftHanded() const = 0; + bool leftHandedEnabledByDefault() const + { + return m_leftHandedEnabledByDefault.val; + } + bool isLeftHanded() const + { + return m_leftHanded.val; + } + void setLeftHanded(bool set) + { + m_leftHanded.set(set); + } + + virtual bool supportsDisableEventsOnExternalMouse() const = 0; + + virtual bool supportsDisableWhileTyping() const = 0; + bool disableWhileTypingEnabledByDefault() const + { + return m_disableWhileTypingEnabledByDefault.val; + } + bool isDisableWhileTyping() const + { + return m_disableWhileTyping.val; + } + void setDisableWhileTyping(bool set) + { + m_disableWhileTyping.set(set); + } + + virtual bool supportsMiddleEmulation() const = 0; + bool middleEmulationEnabledByDefault() const + { + return m_middleEmulationEnabledByDefault.val; + } + bool isMiddleEmulation() const + { + return m_middleEmulation.val; + } + void setMiddleEmulation(bool set) + { + m_middleEmulation.set(set); + } + + virtual bool supportsPointerAcceleration() const = 0; + qreal pointerAcceleration() const + { + return m_pointerAcceleration.val; + } + void setPointerAcceleration(qreal acceleration) + { + m_pointerAcceleration.set(acceleration); + } + + virtual bool supportsPointerAccelerationProfileFlat() const = 0; + bool defaultPointerAccelerationProfileFlat() const + { + return m_defaultPointerAccelerationProfileFlat.val; + } + bool pointerAccelerationProfileFlat() const + { + return m_pointerAccelerationProfileFlat.val; + } + void setPointerAccelerationProfileFlat(bool set) + { + m_pointerAccelerationProfileFlat.set(set); + } + + virtual bool supportsPointerAccelerationProfileAdaptive() const = 0; + bool defaultPointerAccelerationProfileAdaptive() const + { + return m_defaultPointerAccelerationProfileAdaptive.val; + } + bool pointerAccelerationProfileAdaptive() const + { + return m_pointerAccelerationProfileAdaptive.val; + } + void setPointerAccelerationProfileAdaptive(bool set) + { + m_pointerAccelerationProfileAdaptive.set(set); + } + + // + // scrolling + virtual bool supportsNaturalScroll() const = 0; + bool naturalScrollEnabledByDefault() const + { + return m_naturalScrollEnabledByDefault.val; + } + bool isNaturalScroll() const + { + return m_naturalScroll.val; + } + void setNaturalScroll(bool set) + { + m_naturalScroll.set(set); + } + + virtual bool supportsHorizontalScrolling() const = 0; + bool horizontalScrollingByDefault() const + { + return true; + } + bool horizontalScrolling() const + { + return m_horizontalScrolling.val; + } + void setHorizontalScrolling(bool set) + { + m_horizontalScrolling.set(set); + } + + virtual bool supportsScrollTwoFinger() const = 0; + bool scrollTwoFingerEnabledByDefault() const + { + return m_scrollTwoFingerEnabledByDefault.val; + } + bool isScrollTwoFinger() const + { + return m_isScrollTwoFinger.val; + } + void setScrollTwoFinger(bool set) + { + m_isScrollTwoFinger.set(set); + } + + virtual bool supportsScrollEdge() const = 0; + bool scrollEdgeEnabledByDefault() const + { + return m_scrollEdgeEnabledByDefault.val; + } + bool isScrollEdge() const + { + return m_isScrollEdge.val; + } + void setScrollEdge(bool set) + { + m_isScrollEdge.set(set); + } + + virtual bool supportsScrollOnButtonDown() const = 0; + bool scrollOnButtonDownEnabledByDefault() const + { + return m_scrollOnButtonDownEnabledByDefault.val; + } + bool isScrollOnButtonDown() const + { + return m_isScrollOnButtonDown.val; + } + void setScrollOnButtonDown(bool set) + { + m_isScrollOnButtonDown.set(set); + } + + quint32 defaultScrollButton() const + { + return m_defaultScrollButton.val; + } + quint32 scrollButton() const + { + return m_scrollButton.val; + } + void setScrollButton(quint32 button) + { + m_scrollButton.set(button); + } + + // + // tapping + int tapFingerCount() const + { + return m_tapFingerCount.val; + } + bool tapToClickEnabledByDefault() const + { + return m_tapToClickEnabledByDefault.val; + } + bool isTapToClick() const + { + return m_tapToClick.val; + } + void setTapToClick(bool set) + { + m_tapToClick.set(set); + } + + bool supportsLmrTapButtonMap() const + { + return m_tapFingerCount.val > 1; + } + bool lmrTapButtonMapEnabledByDefault() const + { + return m_lmrTapButtonMapEnabledByDefault.val; + } + bool lmrTapButtonMap() const + { + return m_lmrTapButtonMap.val; + } + virtual void setLmrTapButtonMap(bool set) = 0; + + bool tapAndDragEnabledByDefault() const + { + return m_tapAndDragEnabledByDefault.val; + } + bool isTapAndDrag() const + { + return m_tapAndDrag.val; + } + void setTapAndDrag(bool set) + { + m_tapAndDrag.set(set); + } + + bool tapDragLockEnabledByDefault() const + { + return m_tapDragLockEnabledByDefault.val; + } + bool isTapDragLock() const + { + return m_tapDragLock.val; + } + void setTapDragLock(bool set) + { + m_tapDragLock.set(set); + } + + // + // click method + virtual bool supportsClickMethodAreas() const = 0; + bool defaultClickMethodAreas() const + { + return m_defaultClickMethodAreas.val; + } + bool isClickMethodAreas() const + { + return m_clickMethodAreas.val; + } + void setClickMethodAreas(bool set) + { + m_clickMethodAreas.set(set); + } + + virtual bool supportsClickMethodClickfinger() const = 0; + bool defaultClickMethodClickfinger() const + { + return m_defaultClickMethodClickfinger.val; + } + bool isClickMethodClickfinger() const + { + return m_clickMethodClickfinger.val; + } + void setClickMethodClickfinger(bool set) + { + m_clickMethodClickfinger.set(set); + } + + virtual bool supportsScrollFactor() const = 0; + +Q_SIGNALS: + void enabledChanged(); + // Tapping + void tapToClickChanged(); + void lmrTapButtonMapChanged(); + void tapAndDragChanged(); + void tapDragLockChanged(); + // Advanced + void leftHandedChanged(); + void disableWhileTypingChanged(); + void middleEmulationChanged(); + // acceleration speed and profile + void pointerAccelerationChanged(); + void pointerAccelerationProfileChanged(); + // scrolling + void naturalScrollChanged(); + void horizontalScrollingChanged(); + void scrollMethodChanged(); + void scrollButtonChanged(); + // click methods + void clickMethodChanged(); + +protected: + template + struct Prop { + explicit Prop(const QByteArray &name) + : name(name) + { + } + + void set(T newVal) + { + if (avail && val != newVal) { + val = newVal; + } + } + void set(const Prop &p) + { + if (avail && val != p.val) { + val = p.val; + } + } + bool changed() const + { + return avail && (old != val); + } + + // In wayland, name will be dbus name + QByteArray name; + bool avail; + T old; + T val; + }; + + // + // general + Prop m_supportsDisableEvents = Prop("supportsDisableEvents"); + Prop m_enabledDefault = Prop("enabledDefault"); + Prop m_enabled = Prop("enabled"); + + // + // advanced + Prop m_supportedButtons = Prop("supportedButtons"); + + Prop m_leftHandedEnabledByDefault = Prop("leftHandedEnabledByDefault"); + Prop m_leftHanded = Prop("leftHanded"); + + Prop m_supportsDisableEventsOnExternalMouse = Prop("supportsDisableEventsOnExternalMouse"); + + Prop m_disableWhileTypingEnabledByDefault = Prop("disableWhileTypingEnabledByDefault"); + Prop m_disableWhileTyping = Prop("disableWhileTyping"); + + Prop m_middleEmulationEnabledByDefault = Prop("middleEmulationEnabledByDefault"); + Prop m_middleEmulation = Prop("middleEmulation"); + + // + // acceleration speed and profile + Prop m_defaultPointerAcceleration = Prop("defaultPointerAcceleration"); + Prop m_pointerAcceleration = Prop("pointerAcceleration"); + + Prop m_supportsPointerAccelerationProfileFlat = Prop("supportsPointerAccelerationProfileFlat"); + Prop m_defaultPointerAccelerationProfileFlat = Prop("defaultPointerAccelerationProfileFlat"); + Prop m_pointerAccelerationProfileFlat = Prop("pointerAccelerationProfileFlat"); + + Prop m_supportsPointerAccelerationProfileAdaptive = Prop("supportsPointerAccelerationProfileAdaptive"); + Prop m_defaultPointerAccelerationProfileAdaptive = Prop("defaultPointerAccelerationProfileAdaptive"); + Prop m_pointerAccelerationProfileAdaptive = Prop("pointerAccelerationProfileAdaptive"); + + // + // tapping + Prop m_tapFingerCount = Prop("tapFingerCount"); + Prop m_tapToClickEnabledByDefault = Prop("tapToClickEnabledByDefault"); + Prop m_tapToClick = Prop("tapToClick"); + + Prop m_lmrTapButtonMapEnabledByDefault = Prop("lmrTapButtonMapEnabledByDefault"); + Prop m_lmrTapButtonMap = Prop("lmrTapButtonMap"); + + Prop m_tapAndDragEnabledByDefault = Prop("tapAndDragEnabledByDefault"); + Prop m_tapAndDrag = Prop("tapAndDrag"); + Prop m_tapDragLockEnabledByDefault = Prop("tapDragLockEnabledByDefault"); + Prop m_tapDragLock = Prop("tapDragLock"); + + // + // scrolling + Prop m_naturalScrollEnabledByDefault = Prop("naturalScrollEnabledByDefault"); + Prop m_naturalScroll = Prop("naturalScroll"); + + Prop m_horizontalScrolling = Prop("horizontalScrolling"); + + Prop m_supportsScrollTwoFinger = Prop("supportsScrollTwoFinger"); + Prop m_scrollTwoFingerEnabledByDefault = Prop("scrollTwoFingerEnabledByDefault"); + Prop m_isScrollTwoFinger = Prop("scrollTwoFinger"); + + Prop m_supportsScrollEdge = Prop("supportsScrollEdge"); + Prop m_scrollEdgeEnabledByDefault = Prop("scrollEdgeEnabledByDefault"); + Prop m_isScrollEdge = Prop("scrollEdge"); + + Prop m_supportsScrollOnButtonDown = Prop("supportsScrollOnButtonDown"); + Prop m_scrollOnButtonDownEnabledByDefault = Prop("scrollOnButtonDownEnabledByDefault"); + Prop m_isScrollOnButtonDown = Prop("scrollOnButtonDown"); + + Prop m_defaultScrollButton = Prop("defaultScrollButton"); + Prop m_scrollButton = Prop("scrollButton"); + + // Click Method + Prop m_supportsClickMethodAreas = Prop("supportsClickMethodAreas"); + Prop m_defaultClickMethodAreas = Prop("defaultClickMethodAreas"); + Prop m_clickMethodAreas = Prop("clickMethodAreas"); + + Prop m_supportsClickMethodClickfinger = Prop("supportsClickMethodClickfinger"); + Prop m_defaultClickMethodClickfinger = Prop("defaultClickMethodClickfinger"); + Prop m_clickMethodClickfinger = Prop("clickMethodClickfinger"); +}; + +#endif // LIBINPUTCOMMON_H diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp new file mode 100644 index 0000000..dba99f6 --- /dev/null +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -0,0 +1,66 @@ +#include "touchpadmanager.h" +#include "touchpadadaptor.h" + +#include + +TouchpadManager::TouchpadManager(QObject *parent) + : QObject(parent) + , m_backend(XlibBackend::initialize()) +{ + // init dbus + new TouchpadAdaptor(this); + QDBusConnection::sessionBus().registerObject(QStringLiteral("/Touchpad"), this); + + m_backend->getConfig(); + m_backend->applyConfig(); +} + +bool TouchpadManager::available() const +{ + return m_backend->isTouchpadAvailable(); +} + +bool TouchpadManager::enabled() const +{ + return m_backend->isTouchpadEnabled(); +} + +void TouchpadManager::setEnabled(bool enabled) +{ + m_backend->setTouchpadEnabled(enabled); + m_backend->applyConfig(); +} + +bool TouchpadManager::tapToClick() const +{ + return m_backend->tapToClick(); +} + +void TouchpadManager::setTapToClick(bool value) +{ + m_backend->setTapToClick(value); + m_backend->applyConfig(); +} + +bool TouchpadManager::naturalScroll() const +{ + return m_backend->naturalScroll(); +} + +void TouchpadManager::setNaturalScroll(bool naturalScroll) +{ + m_backend->setNaturalScroll(naturalScroll); + m_backend->applyConfig(); +} + +qreal TouchpadManager::pointerAcceleration() const +{ + return m_backend->pointerAcceleration(); +} + +void TouchpadManager::setPointerAcceleration(qreal value) +{ + qDebug() << value; + m_backend->setPointerAcceleration(value); + m_backend->applyConfig(); +} diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h new file mode 100644 index 0000000..d8f84d6 --- /dev/null +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -0,0 +1,37 @@ +#ifndef TOUCHPADMANAGER_H +#define TOUCHPADMANAGER_H + +#include +#include "x11/xlibbackend.h" + +class TouchpadManager : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool available READ available CONSTANT) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled CONSTANT) + Q_PROPERTY(bool tapToClick READ tapToClick WRITE setTapToClick CONSTANT) + Q_PROPERTY(bool naturalScroll READ naturalScroll WRITE setNaturalScroll CONSTANT) + Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration CONSTANT) + +public: + explicit TouchpadManager(QObject *parent = nullptr); + + bool available() const; + + bool enabled() const; + void setEnabled(bool enabled); + + bool tapToClick() const; + void setTapToClick(bool value); + + bool naturalScroll() const; + void setNaturalScroll(bool naturalScroll); + + qreal pointerAcceleration() const; + void setPointerAcceleration(qreal value); + +private: + XlibBackend *m_backend; +}; + +#endif // TOUCHPADMANAGER_H diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp new file mode 100644 index 0000000..814b7eb --- /dev/null +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -0,0 +1,402 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "libinputtouchpad.h" + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +const Parameter libinputProperties[] = { + + /* libinput disable supports property */ + {"supportsDisableEvents", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 0}, + {"enabled", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 0}, + {"enabledDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 0}, + + /* LeftHandSupport */ + {"leftHandedEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED_DEFAULT, 8, 0}, + {"leftHanded", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED, 8, 0}, + + /* Disable on external mouse */ + {"supportsDisableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 1}, + {"disableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 1}, + {"disableEventsOnExternalMouseDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 1}, + + /* Disable while typing */ + {"disableWhileTypingEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT, 8, 0}, + {"disableWhileTyping", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING, 8, 0}, + + /* Middle Emulation */ + {"middleEmulationEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT, 8, 0}, + {"middleEmulation", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED, 8, 0}, + + /* This is a boolean for all three fingers, no per-finger config */ + {"tapToClick", PT_INT, 0, 1, LIBINPUT_PROP_TAP, 8, 0}, + {"tapToClickEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DEFAULT, 8, 0}, + + /* LMR */ + {"lrmTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 0}, + {"lrmTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 0}, + {"lmrTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 1}, + {"lmrTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 1}, + + /* Tap and Drag Enabled */ + {"tapAndDragEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_DEFAULT, 8, 0}, + {"tapAndDrag", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG, 8, 0}, + + /* Tap and Drag Lock Enabled */ + {"tapDragLockEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT, 8, 0}, + {"tapDragLock", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK, 8, 0}, + + /* libinput normalizes the accel to -1/1 */ + {"defaultPointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL_DEFAULT, 0 /*float */, 0}, + {"pointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL, 0 /*float */, 0}, + + /* Libinput Accel Profile */ + {"supportsPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 0}, + {"defaultPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 0}, + {"pointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 0}, + {"supportsPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 1}, + {"defaultPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 1}, + {"pointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 1}, + + /* Natural Scrolling */ + {"naturalScrollEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT, 8, 0}, + {"naturalScroll", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL, 8, 0}, + + /* Horizontal scrolling */ + {"horizontalScrolling", PT_INT, 0, 1, LIBINPUT_PROP_HORIZ_SCROLL_ENABLED, 8, 0}, + + /* Two-Finger Scrolling */ + {"supportsScrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 0}, + {"scrollTwoFingerEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 0}, + {"scrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 0}, + + /* Edge Scrolling */ + {"supportsScrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 1}, + {"scrollEdgeEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 1}, + {"scrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 1}, + + /* scroll on button */ + {"supportsScrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 2}, + {"scrollOnButtonDownEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 2}, + {"scrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 2}, + + /* Scroll Button for scroll on button Down */ + {"defaultScrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT, 32, 0}, + {"scrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON, 32, 0}, + + /* Click Methods */ + {"supportsClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 0}, + {"defaultClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 0}, + {"clickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 0}, + + {"supportsClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 1}, + {"defaultClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 1}, + {"clickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 1}, + + /* libinput doesn't have a separate toggle for horiz scrolling */ + {nullptr, PT_INT, 0, 0, nullptr, 0, 0}}; + +Qt::MouseButtons maskBtns(Display *display, XIButtonClassInfo *buttonInfo) +{ + Qt::MouseButtons buttons = Qt::NoButton; + for (int i = 0; i < buttonInfo->num_buttons; ++i) { + QByteArray reply = XGetAtomName(display, buttonInfo->labels[i]); + + if (reply == BTN_LABEL_PROP_BTN_LEFT) { + buttons |= Qt::LeftButton; + } + if (reply == BTN_LABEL_PROP_BTN_RIGHT) { + buttons |= Qt::RightButton; + } + if (reply == BTN_LABEL_PROP_BTN_MIDDLE) { + buttons |= Qt::MiddleButton; + } + if (reply == BTN_LABEL_PROP_BTN_SIDE) { + buttons |= Qt::ExtraButton1; + } + if (reply == BTN_LABEL_PROP_BTN_EXTRA) { + buttons |= Qt::ExtraButton2; + } + if (reply == BTN_LABEL_PROP_BTN_FORWARD) { + buttons |= Qt::ForwardButton; + } + if (reply == BTN_LABEL_PROP_BTN_BACK) { + buttons |= Qt::BackButton; + } + if (reply == BTN_LABEL_PROP_BTN_TASK) { + buttons |= Qt::TaskButton; + } + } + return buttons; +} + +LibinputTouchpad::LibinputTouchpad(Display *display, int deviceId) + : LibinputCommon() + , XlibTouchpad(display, deviceId) + , m_config("lingmoos", "touchpadxlibinputrc") +{ + loadSupportedProperties(libinputProperties); + + int nDevices = 0; + XIDeviceInfo *deviceInfo = XIQueryDevice(m_display, m_deviceId, &nDevices); + m_name = deviceInfo->name; + + for (int i = 0; i < deviceInfo->num_classes; ++i) { + XIAnyClassInfo *classInfo = deviceInfo->classes[i]; + + if (classInfo->type == XIButtonClass) { + XIButtonClassInfo *btnInfo = (XIButtonClassInfo *)classInfo; + m_supportedButtons.avail = true; + m_supportedButtons.set(maskBtns(m_display, btnInfo)); + } + if (classInfo->type == XITouchClass) { + XITouchClassInfo *touchInfo = (XITouchClassInfo *)classInfo; + m_tapFingerCount.avail = true; + m_tapFingerCount.set(touchInfo->num_touches); + } + } + XIFreeDeviceInfo(deviceInfo); + + /* FingerCount cannot be zero */ + if (!m_tapFingerCount.val) { + m_tapFingerCount.avail = true; + m_tapFingerCount.set(1); + } +} + +bool LibinputTouchpad::getConfig() +{ + bool success = true; + + success &= valueLoader(m_supportsDisableEvents); + success &= valueLoader(m_enabled); + success &= valueLoader(m_enabledDefault); + + success &= valueLoader(m_tapToClickEnabledByDefault); + success &= valueLoader(m_tapToClick); + success &= valueLoader(m_lrmTapButtonMapEnabledByDefault); + success &= valueLoader(m_lrmTapButtonMap); + success &= valueLoader(m_lmrTapButtonMapEnabledByDefault); + success &= valueLoader(m_lmrTapButtonMap); + success &= valueLoader(m_tapAndDragEnabledByDefault); + success &= valueLoader(m_tapAndDrag); + success &= valueLoader(m_tapDragLockEnabledByDefault); + success &= valueLoader(m_tapDragLock); + + success &= valueLoader(m_leftHandedEnabledByDefault); + success &= valueLoader(m_leftHanded); + + success &= valueLoader(m_supportsDisableEventsOnExternalMouse); + success &= valueLoader(m_disableEventsOnExternalMouse); + success &= valueLoader(m_disableEventsOnExternalMouseDefault); + + success &= valueLoader(m_disableWhileTypingEnabledByDefault); + success &= valueLoader(m_disableWhileTyping); + + success &= valueLoader(m_middleEmulationEnabledByDefault); + success &= valueLoader(m_middleEmulation); + + success &= valueLoader(m_defaultPointerAcceleration); + success &= valueLoader(m_pointerAcceleration); + + success &= valueLoader(m_supportsPointerAccelerationProfileFlat); + success &= valueLoader(m_defaultPointerAccelerationProfileFlat); + success &= valueLoader(m_pointerAccelerationProfileFlat); + success &= valueLoader(m_supportsPointerAccelerationProfileAdaptive); + success &= valueLoader(m_defaultPointerAccelerationProfileAdaptive); + success &= valueLoader(m_pointerAccelerationProfileAdaptive); + + success &= valueLoader(m_naturalScrollEnabledByDefault); + success &= valueLoader(m_naturalScroll); + + success &= valueLoader(m_horizontalScrolling); + + success &= valueLoader(m_supportsScrollTwoFinger); + success &= valueLoader(m_scrollTwoFingerEnabledByDefault); + success &= valueLoader(m_isScrollTwoFinger); + + success &= valueLoader(m_supportsScrollEdge); + success &= valueLoader(m_scrollEdgeEnabledByDefault); + success &= valueLoader(m_isScrollEdge); + + success &= valueLoader(m_supportsScrollOnButtonDown); + success &= valueLoader(m_scrollOnButtonDownEnabledByDefault); + success &= valueLoader(m_isScrollOnButtonDown); + + success &= valueLoader(m_defaultScrollButton); + success &= valueLoader(m_scrollButton); + + // click methods + success &= valueLoader(m_supportsClickMethodAreas); + success &= valueLoader(m_supportsClickMethodClickfinger); + success &= valueLoader(m_defaultClickMethodAreas); + success &= valueLoader(m_defaultClickMethodClickfinger); + success &= valueLoader(m_clickMethodAreas); + success &= valueLoader(m_clickMethodClickfinger); + + return success; +} + +bool LibinputTouchpad::applyConfig() +{ + QVector msgs; + + msgs << valueWriter(m_enabled) << valueWriter(m_tapToClick) << valueWriter(m_lrmTapButtonMap) << valueWriter(m_lmrTapButtonMap) << valueWriter(m_tapAndDrag) + << valueWriter(m_tapDragLock) << valueWriter(m_leftHanded) << valueWriter(m_disableWhileTyping) << valueWriter(m_middleEmulation) + << valueWriter(m_pointerAcceleration) << valueWriter(m_pointerAccelerationProfileFlat) << valueWriter(m_pointerAccelerationProfileAdaptive) + << valueWriter(m_naturalScroll) << valueWriter(m_horizontalScrolling) << valueWriter(m_isScrollTwoFinger) << valueWriter(m_isScrollEdge) + << valueWriter(m_isScrollOnButtonDown) << valueWriter(m_scrollButton) << valueWriter(m_clickMethodAreas) << valueWriter(m_clickMethodClickfinger); + + bool success = true; + QString error_msg; + + for (QString m : msgs) { + if (!m.isNull()) { + // qCCritical(KCM_TOUCHPAD) << "in error:" << m; + if (!success) { + error_msg.append("\n"); + } + error_msg.append(m); + success = false; + } + } + + if (!success) { + // qCCritical(KCM_TOUCHPAD) << error_msg; + } + + flush(); + return success; +} + +bool LibinputTouchpad::getDefaultConfig() +{ + m_enabled.set(m_enabledDefault); + m_tapToClick.set(m_tapToClickEnabledByDefault); + m_lrmTapButtonMap.set(m_lrmTapButtonMap); + m_lmrTapButtonMap.set(m_lmrTapButtonMapEnabledByDefault); + m_tapAndDrag.set(m_tapAndDragEnabledByDefault); + m_tapDragLock.set(m_tapDragLockEnabledByDefault); + m_leftHanded.set(m_leftHandedEnabledByDefault); + m_disableEventsOnExternalMouse.set(m_disableEventsOnExternalMouseDefault); + m_disableWhileTyping.set(m_disableWhileTypingEnabledByDefault); + m_middleEmulation.set(m_middleEmulationEnabledByDefault); + m_pointerAcceleration.set(m_defaultPointerAcceleration); + m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); + m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); + m_naturalScroll.set(m_naturalScrollEnabledByDefault); + m_horizontalScrolling.set(true); + m_isScrollTwoFinger.set(m_scrollTwoFingerEnabledByDefault); + m_isScrollEdge.set(m_scrollEdgeEnabledByDefault); + m_isScrollOnButtonDown.set(m_scrollOnButtonDownEnabledByDefault); + m_scrollButton.set(m_defaultScrollButton); + m_clickMethodAreas.set(m_defaultClickMethodAreas); + m_clickMethodClickfinger.set(m_defaultClickMethodClickfinger); + + return true; +} + +bool LibinputTouchpad::isChangedConfig() +{ + // clang-format off + bool changed = m_enabled.changed() || + m_tapToClick.changed() || + m_lrmTapButtonMap.changed() || + m_lmrTapButtonMap.changed() || + m_tapAndDrag.changed() || + m_tapDragLock.changed() || + m_leftHanded.changed() || + m_disableEventsOnExternalMouse.changed() || + m_disableWhileTyping.changed() || + m_middleEmulation.changed() || + m_pointerAcceleration.changed() || + m_pointerAccelerationProfileFlat.changed() || + m_pointerAccelerationProfileAdaptive.changed() || + m_naturalScroll.changed() || + m_horizontalScrolling.changed() || + m_isScrollTwoFinger.changed() || + m_isScrollEdge.changed() || + m_isScrollOnButtonDown.changed() || + m_scrollButton.changed() || + m_clickMethodAreas.changed() || + m_clickMethodClickfinger.changed(); + // clang-format on + + return changed; +} + +int LibinputTouchpad::touchpadOff() +{ + return m_enabled.val; +} + +XcbAtom &LibinputTouchpad::touchpadOffAtom() +{ + return *m_atoms[QLatin1String(LIBINPUT_PROP_SENDEVENTS_ENABLED)].data(); +} + +template +bool LibinputTouchpad::valueLoader(Prop &prop) +{ + const Parameter *p = findParameter(QString::fromLatin1(prop.name)); + + if (!p) { + // qCCritical(KCM_TOUCHPAD) << "Error on read of " << QString::fromLatin1(prop.name); + } + + QVariant reply = getParameter(p); + if (!reply.isValid()) { + prop.avail = false; + return true; + } + prop.avail = true; + + m_config.beginGroup(m_name); + + const T replyValue = valueLoaderPart(reply); + const T loadedValue = m_config.value(prop.name, replyValue).toBool(); + prop.old = replyValue; + prop.val = loadedValue; + + m_config.endGroup(); + + return true; +} + +template +QString LibinputTouchpad::valueWriter(const Prop &prop) +{ + const Parameter *p = findParameter(QString::fromLatin1(prop.name)); + + // Reion + if (!p /*|| !prop.changed()*/) { + return QString(); + } + + bool error = !setParameter(p, prop.val); + if (error) { + // qCCritical(KCM_TOUCHPAD) << "Cannot set property " + QString::fromLatin1(prop.name); + return QStringLiteral("Cannot set property ") + QString::fromLatin1(prop.name); + } + + m_config.beginGroup(m_name); + m_config.setValue(prop.name, prop.val); + m_config.endGroup(); + m_config.sync(); + + return QString(); +} diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h new file mode 100644 index 0000000..4d1733b --- /dev/null +++ b/settings-daemon/touchpad/x11/libinputtouchpad.h @@ -0,0 +1,149 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef LIBINPUTTOUCHPAD_H +#define LIBINPUTTOUCHPAD_H + +#include +#include + +#include "../libinputcommon.h" +#include "xlibtouchpad.h" + +class LibinputTouchpad : public LibinputCommon, public XlibTouchpad +{ + Q_OBJECT + +public: + LibinputTouchpad(Display *display, int deviceId); + ~LibinputTouchpad() override + { + } + + bool getConfig() override; + bool applyConfig() override; + bool getDefaultConfig() override; + bool isChangedConfig() override; + + int touchpadOff() override; + XcbAtom &touchpadOffAtom() override; + +private: + template + bool valueLoader(Prop &prop); + + template + QString valueWriter(const Prop &prop); + + QSettings m_config; + + // + // general + QString name() const override + { + return m_name; + } + bool supportsDisableEvents() const override + { + return m_supportsDisableEvents.avail && m_supportsDisableEvents.val; + } + bool isEnabled() const override + { + return !m_enabled.val; + } + void setEnabled(bool set) override + { + m_enabled.set(!set); + } + // + // Tapping + void setLmrTapButtonMap(bool set) override + { + m_lrmTapButtonMap.set(!set); + m_lmrTapButtonMap.set(set); + } + // + // advanced + bool supportsLeftHanded() const override + { + return m_leftHanded.avail; + } + bool supportsDisableEventsOnExternalMouse() const override + { + return m_supportsDisableEventsOnExternalMouse.avail && m_supportsDisableEventsOnExternalMouse.val; + } + bool supportsDisableWhileTyping() const override + { + return m_disableWhileTyping.avail; + } + bool supportsMiddleEmulation() const override + { + return m_middleEmulation.avail; + } + // + // acceleration speed and profile + bool supportsPointerAcceleration() const override + { + return m_pointerAcceleration.avail; + } + bool supportsPointerAccelerationProfileFlat() const override + { + return m_supportsPointerAccelerationProfileFlat.avail && m_supportsPointerAccelerationProfileFlat.val; + } + bool supportsPointerAccelerationProfileAdaptive() const override + { + return m_supportsPointerAccelerationProfileAdaptive.avail && m_supportsPointerAccelerationProfileAdaptive.val; + } + // + // scrolling + bool supportsNaturalScroll() const override + { + return m_naturalScroll.avail; + } + bool supportsHorizontalScrolling() const override + { + return true; + } + bool supportsScrollTwoFinger() const override + { + return m_supportsScrollTwoFinger.avail && m_supportsScrollTwoFinger.val; + } + bool supportsScrollEdge() const override + { + return m_supportsScrollEdge.avail && m_supportsScrollEdge.val; + } + bool supportsScrollOnButtonDown() const override + { + return m_supportsScrollOnButtonDown.avail && m_supportsScrollOnButtonDown.val; + } + // + // click method + bool supportsClickMethodAreas() const override + { + return m_supportsClickMethodAreas.avail && m_supportsClickMethodAreas.val; + } + bool supportsClickMethodClickfinger() const override + { + return m_supportsClickMethodClickfinger.avail && m_supportsClickMethodClickfinger.val; + } + + bool supportsScrollFactor() const override + { + return false; + } + + // Tapping + Prop m_lrmTapButtonMapEnabledByDefault = Prop("lrmTapButtonMapEnabledByDefault"); + Prop m_lrmTapButtonMap = Prop("lrmTapButtonMap"); + // + // advanced + Prop m_disableEventsOnExternalMouse = Prop("disableEventsOnExternalMouse"); + Prop m_disableEventsOnExternalMouseDefault = Prop("disableEventsOnExternalMouseDefault"); + + QString m_name; +}; + +#endif // LIBINPUTTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp new file mode 100644 index 0000000..c8acf79 --- /dev/null +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -0,0 +1,86 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include +#include + +#include "propertyinfo.h" + +#include +#include +#include + +void XDeleter(void *p) +{ + if (p) { + XFree(p); + } +} + +PropertyInfo::PropertyInfo() + : type(0) + , format(0) + , nitems(0) + , f(nullptr) + , i(nullptr) + , b(nullptr) + , display(nullptr) + , device(0) + , prop(0) +{ +} + +PropertyInfo::PropertyInfo(Display *display, int device, Atom prop, Atom floatType) + : type(0) + , format(0) + , nitems(0) + , f(nullptr) + , i(nullptr) + , b(nullptr) + , display(display) + , device(device) + , prop(prop) +{ + unsigned char *dataPtr = nullptr; + unsigned long bytes_after; + XIGetProperty(display, device, prop, 0, 1000, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &dataPtr); + data = QSharedPointer(dataPtr, XDeleter); + + if (format == CHAR_BIT && type == XA_INTEGER) { + b = reinterpret_cast(dataPtr); + } + if (format == sizeof(int) * CHAR_BIT && (type == XA_INTEGER || type == XA_CARDINAL)) { + i = reinterpret_cast(dataPtr); + } + if (format == sizeof(float) * CHAR_BIT && floatType && type == floatType) { + f = reinterpret_cast(dataPtr); + } +} + +QVariant PropertyInfo::value(unsigned offset) const +{ + QVariant v; + if (offset >= nitems) { + return v; + } + + if (b) { + v = QVariant(static_cast(b[offset])); + } + if (i) { + v = QVariant(i[offset]); + } + if (f) { + v = QVariant(f[offset]); + } + + return v; +} + +void PropertyInfo::set() +{ + XIChangeProperty(display, device, prop, type, format, XIPropModeReplace, data.data(), nitems); +} diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h new file mode 100644 index 0000000..37e60e5 --- /dev/null +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef PROPERTYINFO_H +#define PROPERTYINFO_H + +#include +#include +#include + +void XDeleter(void *p); + +struct PropertyInfo { + Atom type; + int format; + QSharedPointer data; + unsigned long nitems; + + float *f; + int *i; + char *b; + + Display *display; + int device; + Atom prop; + + PropertyInfo(); + PropertyInfo(Display *display, int device, Atom prop, Atom floatType); + QVariant value(unsigned offset) const; + + void set(); +}; + +#endif // PROPERTYINFO_H diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp new file mode 100644 index 0000000..37d60aa --- /dev/null +++ b/settings-daemon/touchpad/x11/synapticstouchpad.cpp @@ -0,0 +1,225 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + SPDX-FileContributor: 2002-2005, 2007 Peter Osterlund + + SPDX-License-Identifier: GPL-2.0-or-later AND LicenseRef-synaptics +*/ + +#include +#include + +#include "synapticstouchpad.h" + +#include +#include +#include + +#define SYN_MAX_BUTTONS 12 + +const struct Parameter synapticsProperties[] = { + {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0}, + {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, + {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, + {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, + {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, + {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, + {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0}, + {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0}, + {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1}, + {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0}, + {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2}, + {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, + {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32, 0}, + {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, + {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, + {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, + {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, + {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, + {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, + {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, + {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 0}, + {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 1}, + {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0}, + {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1}, + {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2}, + /*{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},*/ + {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0}, + {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0}, + {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0}, + {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 1}, + {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 2}, + {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 3}, + {"OneFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4}, + {"TwoFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5}, + {"ThreeFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6}, + {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 0}, + {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 1}, + {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 2}, + {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0}, + {"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0}, + {"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0}, + {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0}, + {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0}, + {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1}, + {"CoastingSpeed", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 0}, + {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 1}, + {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0}, + {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1}, + {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 0}, + {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 1}, + {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0}, + {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0}, + {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0}, + {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1}, + {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2}, + {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3}, + {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 0}, + {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 1}, + {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0}, + {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0}, + {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1}, + {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2}, + {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3}, + {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4}, + {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5}, + {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6}, + {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7}, + {NULL, PT_INT, 0, 0, nullptr, 0, 0}, +}; + +SynapticsTouchpad::SynapticsTouchpad(Display *display, int deviceId) + : XlibTouchpad(display, deviceId) + , m_resX(1) + , m_resY(1) +{ + m_capsAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); + m_touchpadOffAtom.intern(m_connection, SYNAPTICS_PROP_OFF); + XcbAtom resolutionAtom(m_connection, SYNAPTICS_PROP_RESOLUTION); + XcbAtom edgesAtom(m_connection, SYNAPTICS_PROP_EDGES); + + loadSupportedProperties(synapticsProperties); + + m_toRadians.append("CircScrollDelta"); + + PropertyInfo edges(m_display, m_deviceId, edgesAtom, 0); + if (edges.i && edges.nitems == 4) { + int w = qAbs(edges.i[1] - edges.i[0]); + int h = qAbs(edges.i[3] - edges.i[2]); + m_resX = w / 90; + m_resY = h / 50; + qDebug() << "Width: " << w << " height: " << h; + qDebug() << "Approx. resX: " << m_resX << " resY: " << m_resY; + } + + PropertyInfo resolution(m_display, m_deviceId, resolutionAtom, 0); + if (resolution.i && resolution.nitems == 2 && resolution.i[0] > 1 && resolution.i[1] > 1) { + m_resY = qMin(static_cast(resolution.i[0]), static_cast(INT_MAX)); + m_resX = qMin(static_cast(resolution.i[1]), static_cast(INT_MAX)); + qDebug() << "Touchpad resolution: x: " << m_resX << " y: " << m_resY; + } + + m_scaleByResX.append("HorizScrollDelta"); + m_scaleByResY.append("VertScrollDelta"); + m_scaleByResX.append("MaxTapMove"); + m_scaleByResY.append("MaxTapMove"); + + m_resX = qMax(10, m_resX); + m_resY = qMax(10, m_resY); + qDebug() << "Final resolution x:" << m_resX << " y:" << m_resY; + m_negate["HorizScrollDelta"] = "InvertHorizScroll"; + m_negate["VertScrollDelta"] = "InvertVertScroll"; + m_supported.append(m_negate.values()); + m_supported.append("Coasting"); + + PropertyInfo caps(m_display, m_deviceId, m_capsAtom.atom(), 0); + if (!caps.b) { + return; + } + + enum TouchpadCapabilitiy { + TouchpadHasLeftButton, + TouchpadHasMiddleButton, + TouchpadHasRightButton, + TouchpadTwoFingerDetect, + TouchpadThreeFingerDetect, + TouchpadPressureDetect, + TouchpadPalmDetect, + TouchpadCapsCount, + }; + + QVector cap(TouchpadCapsCount, false); + std::copy(caps.b, caps.b + qMin(cap.size(), static_cast(caps.nitems)), cap.begin()); + + if (!cap[TouchpadTwoFingerDetect]) { + m_supported.removeAll("HorizTwoFingerScroll"); + m_supported.removeAll("VertTwoFingerScroll"); + m_supported.removeAll("TwoFingerTapButton"); + } + + if (!cap[TouchpadThreeFingerDetect]) { + m_supported.removeAll("ThreeFingerTapButton"); + } + + if (!cap[TouchpadPressureDetect]) { + m_supported.removeAll("FingerHigh"); + m_supported.removeAll("FingerLow"); + + m_supported.removeAll("PalmMinZ"); + m_supported.removeAll("PressureMotionMinZ"); + m_supported.removeAll("PressureMotionMinFactor"); + m_supported.removeAll("PressureMotionMaxZ"); + m_supported.removeAll("PressureMotionMaxFactor"); + m_supported.removeAll("EmulateTwoFingerMinZ"); + } + + if (!cap[TouchpadPalmDetect]) { + m_supported.removeAll("PalmDetect"); + m_supported.removeAll("PalmMinWidth"); + m_supported.removeAll("PalmMinZ"); + m_supported.removeAll("EmulateTwoFingerMinW"); + } + + for (QMap::Iterator i = m_negate.begin(); i != m_negate.end(); ++i) { + if (!m_supported.contains(i.key())) { + m_supported.removeAll(i.value()); + } + } + + m_paramList = synapticsProperties; +} + +void SynapticsTouchpad::setTouchpadOff(int touchpadOff) +{ + PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); + if (off.b && *(off.b) != touchpadOff) { + *(off.b) = touchpadOff; + off.set(); + } + + flush(); +} + +int SynapticsTouchpad::touchpadOff() +{ + PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); + return off.value(0).toInt(); +} + +XcbAtom &SynapticsTouchpad::touchpadOffAtom() +{ + return m_touchpadOffAtom; +} + +double SynapticsTouchpad::getPropertyScale(const QString &name) const +{ + if (m_scaleByResX.contains(name) && m_scaleByResY.contains(name)) { + return std::sqrt(static_cast(m_resX) * m_resX + static_cast(m_resY) * m_resY); + } else if (m_scaleByResX.contains(name)) { + return m_resX; + } else if (m_scaleByResY.contains(name)) { + return m_resY; + } else if (m_toRadians.contains(name)) { + return M_PI_4 / 45.0; + } + return 1.0; +} diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.h b/settings-daemon/touchpad/x11/synapticstouchpad.h new file mode 100644 index 0000000..c503ce1 --- /dev/null +++ b/settings-daemon/touchpad/x11/synapticstouchpad.h @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2015 Weng Xuetian + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef SYNAPTICSTOUCHPAD_H +#define SYNAPTICSTOUCHPAD_H + +#include "xcbatom.h" +#include "xlibtouchpad.h" + +class SynapticsTouchpad : public QObject, public XlibTouchpad +{ + Q_OBJECT + +public: + SynapticsTouchpad(Display *display, int deviceId); + + void setTouchpadOff(int touchpadOff) override; + int touchpadOff() override; + + XcbAtom &touchpadOffAtom() override; + +protected: + double getPropertyScale(const QString &name) const override; + +private: + XcbAtom m_capsAtom, m_touchpadOffAtom; + int m_resX, m_resY; + QStringList m_scaleByResX, m_scaleByResY, m_toRadians; +}; + +#endif // SYNAPTICSTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/xcbatom.cpp b/settings-daemon/touchpad/x11/xcbatom.cpp new file mode 100644 index 0000000..c48f9d2 --- /dev/null +++ b/settings-daemon/touchpad/x11/xcbatom.cpp @@ -0,0 +1,48 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xcbatom.h" + +#include +#include + +XcbAtom::XcbAtom() + : m_connection(nullptr) + , m_reply(nullptr) + , m_fetched(false) +{ +} + +XcbAtom::XcbAtom(xcb_connection_t *c, const char *name, bool onlyIfExists) + : m_reply(nullptr) + , m_fetched(false) +{ + intern(c, name, onlyIfExists); +} + +void XcbAtom::intern(xcb_connection_t *c, const char *name, bool onlyIfExists) +{ + m_connection = c; + m_cookie = xcb_intern_atom(c, onlyIfExists, std::strlen(name), name); +} + +XcbAtom::~XcbAtom() +{ + std::free(m_reply); +} + +xcb_atom_t XcbAtom::atom() +{ + if (!m_fetched) { + m_fetched = true; + m_reply = xcb_intern_atom_reply(m_connection, m_cookie, nullptr); + } + if (m_reply) { + return m_reply->atom; + } else { + return 0; + } +} diff --git a/settings-daemon/touchpad/x11/xcbatom.h b/settings-daemon/touchpad/x11/xcbatom.h new file mode 100644 index 0000000..e3a8914 --- /dev/null +++ b/settings-daemon/touchpad/x11/xcbatom.h @@ -0,0 +1,36 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XCBATOM_H +#define XCBATOM_H + +#include + +class XcbAtom +{ +public: + XcbAtom(); + XcbAtom(xcb_connection_t *, const char *name, bool onlyIfExists = true); + ~XcbAtom(); + + void intern(xcb_connection_t *, const char *name, bool onlyIfExists = true); + xcb_atom_t atom(); + operator xcb_atom_t() + { + return atom(); + } + +private: + XcbAtom(const XcbAtom &); + XcbAtom &operator=(const XcbAtom &); + + xcb_connection_t *m_connection; + xcb_intern_atom_cookie_t m_cookie; + xcb_intern_atom_reply_t *m_reply; + bool m_fetched; +}; + +#endif // XCBATOM_H diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp new file mode 100644 index 0000000..0824bbe --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -0,0 +1,425 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include +#include + +#include + +#include + +// Includes are ordered this way because of #defines in Xorg's headers +#include "xlibbackend.h" // krazy:exclude=includes +#include "xlibnotifications.h" // krazy:exclude=includes +#include "xrecordkeyboardmonitor.h" // krazy:exclude=includes + +#include +#include +#include +#include + +#include +#include + +struct DeviceListDeleter { + static void cleanup(XDeviceInfo *p) + { + if (p) { + XFreeDeviceList(p); + } + } +}; + +void XlibBackend::XDisplayCleanup::cleanup(Display *p) +{ + if (p) { + XCloseDisplay(p); + } +} + +XlibBackend *XlibBackend::initialize(QObject *parent) +{ + XlibBackend *backend = new XlibBackend(parent); + if (!backend->m_display) { + delete backend; + return nullptr; + } + return backend; +} + +XlibBackend::~XlibBackend() +{ +} + +XlibBackend::XlibBackend(QObject *parent) + : QObject(parent) + , m_display(XOpenDisplay(nullptr)) + , m_connection(nullptr) +{ + if (m_display) { + m_connection = XGetXCBConnection(m_display.data()); + } + + if (!m_connection) { + m_errorString = "Cannot connect to X server"; + return; + } + + m_mouseAtom.intern(m_connection, XI_MOUSE); + m_keyboardAtom.intern(m_connection, XI_KEYBOARD); + m_touchpadAtom.intern(m_connection, XI_TOUCHPAD); + m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); + + m_synapticsIdentifierAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); + m_libinputIdentifierAtom.intern(m_connection, "libinput Send Events Modes Available"); + + m_device.reset(findTouchpad()); + if (!m_device) { + m_errorString = "No touchpad found"; + } +} + +XlibTouchpad *XlibBackend::findTouchpad() +{ + int nDevices = 0; + QScopedPointer deviceInfo(XListInputDevices(m_display.data(), &nDevices)); + + for (XDeviceInfo *info = deviceInfo.data(); info < deviceInfo.data() + nDevices; info++) { + // Make sure device is touchpad + if (info->type != m_touchpadAtom.atom()) { + continue; + } + int nProperties = 0; + QSharedPointer properties(XIListProperties(m_display.data(), info->id, &nProperties), XDeleter); + + Atom *atom = properties.data(), *atomEnd = properties.data() + nProperties; + for (; atom != atomEnd; atom++) { + + if (*atom == m_libinputIdentifierAtom.atom()) { + // setMode(TouchpadInputBackendMode::XLibinput); + return new LibinputTouchpad(m_display.data(), info->id); + } + + if (*atom == m_synapticsIdentifierAtom.atom()) { + // setMode(TouchpadInputBackendMode::XSynaptics); + return new SynapticsTouchpad(m_display.data(), info->id); + } + } + } + + return nullptr; +} + +bool XlibBackend::applyConfig(const QVariantHash &p) +{ + if (!m_device) { + return false; + } + + bool success = m_device->applyConfig(p); + if (!success) { + m_errorString = "Cannot apply touchpad configuration"; + } + + return success; +} + +bool XlibBackend::applyConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->applyConfig(); + if (!success) { + m_errorString = "Cannot apply touchpad configuration"; + } + + return success; +} + +bool XlibBackend::getConfig(QVariantHash &p) +{ + if (!m_device) { + return false; + } + + bool success = m_device->getConfig(p); + if (!success) { + m_errorString = "Cannot read touchpad configuration"; + } + return success; +} + +bool XlibBackend::getConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->getConfig(); + if (!success) { + m_errorString = "Cannot read touchpad configuration"; + } + return success; +} + +bool XlibBackend::getDefaultConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->getDefaultConfig(); + if (!success) { + m_errorString = "Cannot read default touchpad configuration"; + } + return success; +} + +bool XlibBackend::isChangedConfig() const +{ + if (!m_device) { + return false; + } + + return m_device->isChangedConfig(); +} + +void XlibBackend::setTouchpadEnabled(bool enable) +{ + if (!m_device) { + return; + } + + m_device->setEnabled(enable); + + // FIXME? This should not be needed, m_notifications should trigger + // a propertyChanged signal when we enable/disable the touchpad, + // that will Q_EMIT touchpadStateChanged, but for some reason + // XlibNotifications is not getting the property change events + // so we just Q_EMIT touchpadStateChanged from here as a workaround + Q_EMIT touchpadStateChanged(); +} + +bool XlibBackend::tapToClick() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return false; + + return object->isTapToClick(); +} + +void XlibBackend::setTapToClick(bool enabled) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setTapToClick(enabled); +} + +bool XlibBackend::naturalScroll() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return false; + + return object->isNaturalScroll(); +} + +void XlibBackend::setNaturalScroll(bool value) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setNaturalScroll(value); +} + +qreal XlibBackend::pointerAcceleration() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return 1; + + return object->pointerAcceleration(); +} + +void XlibBackend::setPointerAcceleration(qreal value) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setPointerAcceleration(value); +} + +void XlibBackend::setTouchpadOff(XlibBackend::TouchpadOffState state) +{ + if (!m_device) { + return; + } + + int touchpadOff = 0; + switch (state) { + case TouchpadEnabled: + touchpadOff = 0; + break; + case TouchpadFullyDisabled: + touchpadOff = 1; + break; + case TouchpadTapAndScrollDisabled: + touchpadOff = 2; + break; + default: + qCritical() << "Unknown TouchpadOffState" << state; + return; + } + + m_device->setTouchpadOff(touchpadOff); +} + +bool XlibBackend::isTouchpadAvailable() +{ + return m_device; +} + +bool XlibBackend::isTouchpadEnabled() +{ + if (!m_device) { + return false; + } + + return m_device->enabled(); +} + +XlibBackend::TouchpadOffState XlibBackend::getTouchpadOff() +{ + if (!m_device) { + return TouchpadFullyDisabled; + } + int value = m_device->touchpadOff(); + switch (value) { + case 0: + return TouchpadEnabled; + case 1: + return TouchpadFullyDisabled; + case 2: + return TouchpadTapAndScrollDisabled; + default: + qCritical() << "Unknown TouchpadOff value" << value; + return TouchpadFullyDisabled; + } +} + +void XlibBackend::touchpadDetached() +{ + qWarning() << "Touchpad detached"; + m_device.reset(); + Q_EMIT touchpadReset(); +} + +void XlibBackend::devicePlugged(int device) +{ + if (!m_device) { + m_device.reset(findTouchpad()); + if (m_device) { + qWarning() << "Touchpad reset"; + m_notifications.reset(); + watchForEvents(m_keyboard); + Q_EMIT touchpadReset(); + } + } + if (!m_device || device != m_device->deviceId()) { + Q_EMIT mousesChanged(); + } +} + +void XlibBackend::propertyChanged(xcb_atom_t prop) +{ + if ((m_device && prop == m_device->touchpadOffAtom().atom()) || prop == m_enabledAtom.atom()) { + Q_EMIT touchpadStateChanged(); + } +} + +QStringList XlibBackend::listMouses(const QStringList &blacklist) +{ + int nDevices = 0; + QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); + QStringList list; + for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { + if (m_device && i->id == static_cast(m_device->deviceId())) { + continue; + } + if (i->use != IsXExtensionPointer && i->use != IsXPointer) { + continue; + } + // type = KEYBOARD && use = Pointer means usb receiver for both keyboard + // and mouse + if (i->type != m_mouseAtom.atom() && i->type != m_keyboardAtom.atom()) { + continue; + } + QString name(i->name); + if (blacklist.contains(name, Qt::CaseInsensitive)) { + continue; + } + PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); + if (enabled.value(0) == false) { + continue; + } + list.append(name); + } + + return list; +} + +QVector XlibBackend::getDevices() const +{ + QVector touchpads; + + LibinputTouchpad *libinputtouchpad = dynamic_cast(m_device.data()); + if (libinputtouchpad) { + touchpads.push_back(libinputtouchpad); + } + + SynapticsTouchpad *synaptics = dynamic_cast(m_device.data()); + if (synaptics) { + touchpads.push_back(synaptics); + } + + return touchpads; +} + +void XlibBackend::watchForEvents(bool keyboard) +{ + if (!m_notifications) { + m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); + connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); + connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); + connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); + } + + if (keyboard == !m_keyboard.isNull()) { + return; + } + + if (!keyboard) { + m_keyboard.reset(); + return; + } + + m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); + connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); + connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); +} diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h new file mode 100644 index 0000000..c4af163 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -0,0 +1,124 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBBACKEND_H +#define XLIBBACKEND_H + +#include +#include +#include +#include +#include +#include +#include + +#include "libinputtouchpad.h" +#include "synapticstouchpad.h" +#include "xlibtouchpad.h" + +#include + +#include "propertyinfo.h" +#include "xcbatom.h" + +class XlibTouchpad; +class XlibNotifications; +class XRecordKeyboardMonitor; + +class XlibBackend : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int touchpadCount READ touchpadCount CONSTANT) + +public: + enum TouchpadOffState { + TouchpadEnabled, + TouchpadTapAndScrollDisabled, + TouchpadFullyDisabled, + }; + + static XlibBackend *initialize(QObject *parent = nullptr); + ~XlibBackend(); + + bool applyConfig(const QVariantHash &); + bool applyConfig(); + bool getConfig(QVariantHash &); + bool getConfig(); + bool getDefaultConfig(); + bool isChangedConfig() const; + QStringList supportedParameters() const + { + return m_device ? m_device->supportedParameters() : QStringList(); + } + QString errorString() const + { + return m_errorString; + } + int touchpadCount() const + { + return m_device ? 1 : 0; + } + + void setTouchpadOff(TouchpadOffState); + TouchpadOffState getTouchpadOff(); + + bool isTouchpadAvailable(); + bool isTouchpadEnabled(); + void setTouchpadEnabled(bool); + + bool tapToClick(); + void setTapToClick(bool enabled); + + bool naturalScroll(); + void setNaturalScroll(bool value); + + qreal pointerAcceleration(); + void setPointerAcceleration(qreal value); + + void watchForEvents(bool keyboard); + + QStringList listMouses(const QStringList &blacklist); + QVector getDevices() const; + +signals: + void touchpadStateChanged(); + void mousesChanged(); + void touchpadReset(); + void keyboardActivityStarted(); + void keyboardActivityFinished(); + + void touchpadAdded(bool success); + void touchpadRemoved(int index); + +private Q_SLOTS: + void propertyChanged(xcb_atom_t); + void touchpadDetached(); + void devicePlugged(int); + +protected: + explicit XlibBackend(QObject *parent); + + struct XDisplayCleanup { + static void cleanup(Display *); + }; + + QScopedPointer m_display; + xcb_connection_t *m_connection; + + XcbAtom m_enabledAtom, m_mouseAtom, m_keyboardAtom, m_touchpadAtom; + XcbAtom m_synapticsIdentifierAtom; + XcbAtom m_libinputIdentifierAtom; + + XlibTouchpad *findTouchpad(); + QScopedPointer m_device; + + QString m_errorString; + QScopedPointer m_notifications; + QScopedPointer m_keyboard; +}; + +#endif // XLIBBACKEND_H diff --git a/settings-daemon/touchpad/x11/xlibnotifications.cpp b/settings-daemon/touchpad/x11/xlibnotifications.cpp new file mode 100644 index 0000000..13037c2 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibnotifications.cpp @@ -0,0 +1,135 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xlibnotifications.h" + +#include + +#include +#include +#include +#include + +XlibNotifications::XlibNotifications(Display *display, int device) + : m_display(display) + , m_device(device) +{ + m_connection = XGetXCBConnection(display); + + m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); + + xcb_query_extension_cookie_t inputExtCookie = xcb_query_extension(m_connection, std::strlen(INAME), INAME); + QScopedPointer inputExt(xcb_query_extension_reply(m_connection, inputExtCookie, nullptr)); + if (!inputExt) { + return; + } + m_inputOpcode = inputExt->major_opcode; + + const xcb_setup_t *setup = xcb_get_setup(m_connection); + xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup); + xcb_screen_t *screen = iter.data; + + m_inputWindow = xcb_generate_id(m_connection); + xcb_create_window(m_connection, 0, m_inputWindow, screen->root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, 0, 0, nullptr); + xcb_flush(m_connection); + + XIEventMask masks[2]; + + unsigned char touchpadMask[] = {0, 0, 0, 0}; + masks[0].deviceid = device; + masks[0].mask = touchpadMask; + masks[0].mask_len = sizeof(touchpadMask); + XISetMask(touchpadMask, XI_PropertyEvent); + + unsigned char allMask[] = {0, 0, 0, 0}; + masks[1].deviceid = XIAllDevices; + masks[1].mask = allMask; + masks[1].mask_len = sizeof(allMask); + XISetMask(allMask, XI_HierarchyChanged); + + XISelectEvents(display, XDefaultRootWindow(display), masks, sizeof(masks) / sizeof(XIEventMask)); + XFlush(display); + + connect(m_notifier, SIGNAL(activated(int)), SLOT(processEvents())); + m_notifier->setEnabled(true); +} + +void XlibNotifications::processEvents() +{ + while (XPending(m_display)) { + XEvent event; + XNextEvent(m_display, &event); + processEvent(&event); + } +} + +struct XEventDataDeleter { + XEventDataDeleter(Display *display, XGenericEventCookie *cookie) + : m_display(display) + , m_cookie(cookie) + { + XGetEventData(m_display, m_cookie); + } + + ~XEventDataDeleter() + { + if (m_cookie->data) { + XFreeEventData(m_display, m_cookie); + } + } + + Display *m_display; + XGenericEventCookie *m_cookie; +}; + +void XlibNotifications::processEvent(XEvent *event) +{ + if (event->xcookie.type != GenericEvent) { + return; + } + if (event->xcookie.extension != m_inputOpcode) { + return; + } + + if (event->xcookie.evtype == XI_PropertyEvent) { + XEventDataDeleter helper(m_display, &event->xcookie); + if (!event->xcookie.data) { + return; + } + + XIPropertyEvent *propEvent = reinterpret_cast(event->xcookie.data); + Q_EMIT propertyChanged(propEvent->property); + } else if (event->xcookie.evtype == XI_HierarchyChanged) { + XEventDataDeleter helper(m_display, &event->xcookie); + if (!event->xcookie.data) { + return; + } + + XIHierarchyEvent *hierarchyEvent = reinterpret_cast(event->xcookie.data); + for (uint16_t i = 0; i < hierarchyEvent->num_info; i++) { + if (hierarchyEvent->info[i].deviceid == m_device) { + if (hierarchyEvent->info[i].flags & XISlaveRemoved) { + Q_EMIT touchpadDetached(); + return; + } + } + if (hierarchyEvent->info[i].use != XISlavePointer) { + continue; + } + if (hierarchyEvent->info[i].flags & (XIDeviceEnabled | XIDeviceDisabled)) { + Q_EMIT devicePlugged(hierarchyEvent->info[i].deviceid); + } + } + } +} + +XlibNotifications::~XlibNotifications() +{ + xcb_destroy_window(m_connection, m_inputWindow); + xcb_flush(m_connection); +} + +#include "moc_xlibnotifications.cpp" diff --git a/settings-daemon/touchpad/x11/xlibnotifications.h b/settings-daemon/touchpad/x11/xlibnotifications.h new file mode 100644 index 0000000..5ca6f1d --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibnotifications.h @@ -0,0 +1,41 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBNOTIFICATIONS_H +#define XLIBNOTIFICATIONS_H + +#include + +#include +#include + +class XlibNotifications : public QObject +{ + Q_OBJECT +public: + XlibNotifications(Display *display, int device); + ~XlibNotifications(); + +Q_SIGNALS: + void propertyChanged(xcb_atom_t); + void devicePlugged(int); + void touchpadDetached(); + +private Q_SLOTS: + void processEvents(); + +private: + void processEvent(XEvent *); + + Display *m_display; + xcb_connection_t *m_connection; + QSocketNotifier *m_notifier; + xcb_window_t m_inputWindow; + uint8_t m_inputOpcode; + int m_device; +}; + +#endif // XLIBNOTIFICATIONS_H diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.cpp b/settings-daemon/touchpad/x11/xlibtouchpad.cpp new file mode 100644 index 0000000..7581c9a --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibtouchpad.cpp @@ -0,0 +1,257 @@ +#include + +#include "xlibtouchpad.h" +#include +#include +#include +#include + +static QVariant negateVariant(const QVariant &value) +{ + if (value.type() == QVariant::Double) { + return QVariant(-value.toDouble()); + } else if (value.type() == QVariant::Int) { + return QVariant(-value.toInt()); + } + return value; +} + +XlibTouchpad::XlibTouchpad(Display *display, int deviceId) + : m_display(display) + , m_connection(XGetXCBConnection(display)) + , m_deviceId(deviceId) +{ + m_floatType.intern(m_connection, "FLOAT"); + m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); +} + +bool XlibTouchpad::applyConfig(const QVariantHash &p) +{ + m_props.clear(); + + bool error = false; + for (const QString &name : qAsConst(m_supported)) { + QVariantHash::ConstIterator i = p.find(name); + if (i == p.end()) { + continue; + } + const Parameter *par = findParameter(name); + if (par) { + QVariant value(i.value()); + + double k = getPropertyScale(name); + if (k != 1.0) { + bool ok = false; + value = QVariant(value.toDouble(&ok) * k); + if (!ok) { + error = true; + continue; + } + } + + if (m_negate.contains(name)) { + QVariantHash::ConstIterator i = p.find(m_negate[name]); + if (i != p.end() && i.value().toBool()) { + value = negateVariant(value); + } + } + + if (name == "CoastingSpeed") { + QVariantHash::ConstIterator coastingEnabled = p.find("Coasting"); + if (coastingEnabled != p.end() && !coastingEnabled.value().toBool()) { + value = QVariant(0); + } + } + + if (!setParameter(par, value)) { + error = true; + } + } + } + + flush(); + + return !error; +} + +bool XlibTouchpad::getConfig(QVariantHash &p) +{ + if (m_supported.isEmpty()) { + return false; + } + + m_props.clear(); + + bool error = false; + for (const QString &name : qAsConst(m_supported)) { + const Parameter *par = findParameter(name); + if (!par) { + continue; + } + + QVariant value(getParameter(par)); + if (!value.isValid()) { + error = true; + continue; + } + + double k = getPropertyScale(name); + if (k != 1.0) { + bool ok = false; + value = QVariant(value.toDouble(&ok) / k); + if (!ok) { + error = true; + continue; + } + } + + if (m_negate.contains(name)) { + bool negative = value.toDouble() < 0.0; + p[m_negate[name]] = QVariant(negative); + if (negative) { + value = negateVariant(value); + } + } + + if (name == "CoastingSpeed") { + bool coasting = value.toDouble() != 0.0; + p["Coasting"] = QVariant(coasting); + if (!coasting) { + continue; + } + } + + p[name] = value; + } + + return !error; +} + +void XlibTouchpad::loadSupportedProperties(const Parameter *props) +{ + m_paramList = props; + for (const Parameter *param = props; param->name; param++) { + QLatin1String name(param->prop_name); + + if (!m_atoms.contains(name)) { + m_atoms.insert(name, QSharedPointer(new XcbAtom(m_connection, param->prop_name))); + } + } + + for (const Parameter *p = props; p->name; p++) { + if (getParameter(p).isValid()) { + m_supported.append(p->name); + } + } +} + +QVariant XlibTouchpad::getParameter(const Parameter *par) +{ + PropertyInfo *p = getDevProperty(QLatin1String(par->prop_name)); + if (!p || par->prop_offset >= p->nitems) { + return QVariant(); + } + + return p->value(par->prop_offset); +} + +void XlibTouchpad::flush() +{ + for (const QLatin1String &name : qAsConst(m_changed)) { + m_props[name].set(); + } + m_changed.clear(); + + XFlush(m_display); +} + +double XlibTouchpad::getPropertyScale(const QString &name) const +{ + Q_UNUSED(name); + return 1.0; +} + +PropertyInfo *XlibTouchpad::getDevProperty(const QLatin1String &propName) +{ + if (m_props.contains(propName)) { + return &m_props[propName]; + } + + if (!m_atoms.contains(propName) || !m_atoms[propName]) { + return nullptr; + } + + xcb_atom_t prop = m_atoms[propName]->atom(); + if (!prop) { + return nullptr; + } + + PropertyInfo p(m_display, m_deviceId, prop, m_floatType.atom()); + if (!p.b && !p.f && !p.i) { + return nullptr; + } + return &m_props.insert(propName, p).value(); +} + +bool XlibTouchpad::setParameter(const Parameter *par, const QVariant &value) +{ + QLatin1String propName(par->prop_name); + PropertyInfo *p = getDevProperty(propName); + if (!p || par->prop_offset >= p->nitems) { + return false; + } + + QVariant converted(value); + QVariant::Type convType = QVariant::Int; + if (p->f) { + convType = QVariant::Double; + } else if (value.type() == QVariant::Double) { + converted = QVariant(qRound(static_cast(value.toDouble()))); + } + + if (!converted.convert(convType)) { + return false; + } + + if (converted == p->value(par->prop_offset)) { + return true; + } + + if (p->b) { + p->b[par->prop_offset] = static_cast(converted.toInt()); + } else if (p->i) { + p->i[par->prop_offset] = converted.toInt(); + } else if (p->f) { + p->f[par->prop_offset] = converted.toDouble(); + } + + m_changed.insert(propName); + return true; +} + +void XlibTouchpad::setEnabled(bool enable) +{ + PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); + if (enabled.b && *(enabled.b) != enable) { + *(enabled.b) = enable; + enabled.set(); + } + + flush(); +} + +bool XlibTouchpad::enabled() +{ + PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); + return enabled.value(0).toBool(); +} + +const Parameter *XlibTouchpad::findParameter(const QString &name) +{ + for (const Parameter *par = m_paramList; par->name; par++) { + if (name == par->name) { + return par; + } + } + return nullptr; +} diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.h b/settings-daemon/touchpad/x11/xlibtouchpad.h new file mode 100644 index 0000000..f20bb66 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibtouchpad.h @@ -0,0 +1,101 @@ +/* + SPDX-FileCopyrightText: 2015 Weng Xuetian + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBTOUCHPAD_H +#define XLIBTOUCHPAD_H + +#include +#include +#include + +#include "propertyinfo.h" +#include "xcbatom.h" +#include + +enum ParaType { + PT_INT, + PT_BOOL, + PT_DOUBLE, +}; + +struct Parameter { + const char *name; /* Name of parameter */ + enum ParaType type; /* Type of parameter */ + double min_val; /* Minimum allowed value */ + double max_val; /* Maximum allowed value */ + const char *prop_name; /* Property name */ + int prop_format; /* Property format (0 for floats) */ + unsigned prop_offset; /* Offset inside property */ +}; + +class XlibTouchpad +{ +public: + XlibTouchpad(Display *display, int deviceId); + virtual ~XlibTouchpad() + { + } + + int deviceId() + { + return m_deviceId; + } + const QStringList &supportedParameters() const + { + return m_supported; + } + bool applyConfig(const QVariantHash &p); + bool getConfig(QVariantHash &p); + virtual bool getConfig() + { + return false; + } + virtual bool applyConfig() + { + return false; + } + virtual bool getDefaultConfig() + { + return false; + } + virtual bool isChangedConfig() + { + return false; + } + void setEnabled(bool enable); + bool enabled(); + virtual void setTouchpadOff(int /*touchpadOff*/) + { + } + virtual int touchpadOff() = 0; + + virtual XcbAtom &touchpadOffAtom() = 0; + +protected: + void loadSupportedProperties(const Parameter *props); + bool setParameter(const struct Parameter *, const QVariant &); + QVariant getParameter(const struct Parameter *); + struct PropertyInfo *getDevProperty(const QLatin1String &propName); + void flush(); + virtual double getPropertyScale(const QString &name) const; + const Parameter *findParameter(const QString &name); + + Display *m_display; + xcb_connection_t *m_connection; + int m_deviceId; + + XcbAtom m_floatType, m_enabledAtom; + + QMap> m_atoms; + + QMap m_negate; + QMap m_props; + QSet m_changed; + QStringList m_supported; + const struct Parameter *m_paramList; +}; + +#endif diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp new file mode 100644 index 0000000..c9fe99b --- /dev/null +++ b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp @@ -0,0 +1,140 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xrecordkeyboardmonitor.h" + +#include +#include + +#include + +#include +#include + +XRecordKeyboardMonitor::XRecordKeyboardMonitor(Display *display) + : m_connection(xcb_connect(XDisplayString(display), nullptr)) + , m_modifiersPressed(0) + , m_keysPressed(0) +{ + if (!m_connection) { + return; + } + + xcb_get_modifier_mapping_cookie_t modmapCookie = xcb_get_modifier_mapping(m_connection); + + m_context = xcb_generate_id(m_connection); + xcb_record_range_t range; + memset(&range, 0, sizeof(range)); + range.device_events.first = XCB_KEY_PRESS; + range.device_events.last = XCB_KEY_RELEASE; + xcb_record_client_spec_t cs = XCB_RECORD_CS_ALL_CLIENTS; + xcb_record_create_context(m_connection, m_context, 0, 1, 1, &cs, &range); + xcb_flush(m_connection); + + QScopedPointer modmap(xcb_get_modifier_mapping_reply(m_connection, modmapCookie, nullptr)); + if (!modmap) { + return; + } + + int nModifiers = xcb_get_modifier_mapping_keycodes_length(modmap.data()); + xcb_keycode_t *modifiers = xcb_get_modifier_mapping_keycodes(modmap.data()); + m_modifier.fill(false, std::numeric_limits::max() + 1); + for (xcb_keycode_t *i = modifiers; i < modifiers + nModifiers; i++) { + m_modifier[*i] = true; + } + m_ignore.fill(false, std::numeric_limits::max() + 1); + for (xcb_keycode_t *i = modifiers; i < modifiers + modmap->keycodes_per_modifier; i++) { + m_ignore[*i] = true; + } + m_pressed.fill(false, std::numeric_limits::max() + 1); + + m_cookie = xcb_record_enable_context(m_connection, m_context); + xcb_flush(m_connection); + + m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); + connect(m_notifier, &QSocketNotifier::activated, this, &XRecordKeyboardMonitor::processNextReply); + m_notifier->setEnabled(true); +} + +XRecordKeyboardMonitor::~XRecordKeyboardMonitor() +{ + if (!m_connection) { + return; + } + + xcb_record_disable_context(m_connection, m_context); + xcb_record_free_context(m_connection, m_context); + xcb_disconnect(m_connection); +} + +void XRecordKeyboardMonitor::processNextReply() +{ + xcb_generic_event_t *event; + while ((event = xcb_poll_for_event(m_connection))) { + std::free(event); + } + + void *reply = nullptr; + xcb_generic_error_t *error = nullptr; + while (m_cookie.sequence && xcb_poll_for_reply(m_connection, m_cookie.sequence, &reply, &error)) { + // xcb_poll_for_reply may set both reply and error to null if connection has error. + // break if xcb_connection has error, no point to continue anyway. + if (xcb_connection_has_error(m_connection)) { + break; + } + + if (error) { + std::free(error); + break; + } + + if (!reply) { + continue; + } + + QScopedPointer data(reinterpret_cast(reply)); + process(data.data()); + } +} + +void XRecordKeyboardMonitor::process(xcb_record_enable_context_reply_t *reply) +{ + bool prevActivity = activity(); + + xcb_key_press_event_t *events = reinterpret_cast(xcb_record_enable_context_data(reply)); + int nEvents = xcb_record_enable_context_data_length(reply) / sizeof(xcb_key_press_event_t); + bool wasActivity = prevActivity; + for (xcb_key_press_event_t *e = events; e < events + nEvents; e++) { + if (e->response_type != XCB_KEY_PRESS && e->response_type != XCB_KEY_RELEASE) { + continue; + } + + if (m_ignore[e->detail]) { + continue; + } + + bool pressed = (e->response_type == XCB_KEY_PRESS); + if (m_pressed[e->detail] == pressed) { + continue; + } + m_pressed[e->detail] = pressed; + + int &counter = m_modifier[e->detail] ? m_modifiersPressed : m_keysPressed; + if (pressed) { + counter++; + } else { + counter--; + } + + wasActivity = wasActivity || activity(); + } + + if (!prevActivity && activity()) { + Q_EMIT keyboardActivityStarted(); + } else if (!activity() && wasActivity) { + Q_EMIT keyboardActivityFinished(); + } +} diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h new file mode 100644 index 0000000..6abec2f --- /dev/null +++ b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XRECORDKEYBOARDMONITOR_H +#define XRECORDKEYBOARDMONITOR_H + +#include +#include + +#include +#include + +class XRecordKeyboardMonitor : public QObject +{ + Q_OBJECT + +public: + XRecordKeyboardMonitor(Display *display); + ~XRecordKeyboardMonitor(); + +Q_SIGNALS: + void keyboardActivityStarted(); + void keyboardActivityFinished(); + +private Q_SLOTS: + void processNextReply(); + +private: + void process(xcb_record_enable_context_reply_t *reply); + bool activity() const + { + return m_keysPressed && !m_modifiersPressed; + } + + QSocketNotifier *m_notifier; + xcb_connection_t *m_connection; + xcb_record_context_t m_context; + xcb_record_enable_context_cookie_t m_cookie; + + QVector m_modifier, m_ignore, m_pressed; + int m_modifiersPressed, m_keysPressed; +}; + +#endif // XRECORDKEYBOARDMONITOR_H From 5a5092091d0eb432cdedeba52dee51ebe28eda94 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:06:40 +0800 Subject: [PATCH 226/254] modified: settings-daemon/application.h --- settings-daemon/application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index a0661e7..b0659c6 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -26,7 +26,7 @@ #include "battery/upowermanager.h" #include "language/language.h" #include "mouse/mousemanager.h" -#include "touchpad/touchpadmanager.h" +// #include "touchpad/touchpadmanager.h" #include "defaultapplications.h" #include From 8c3b44353ac70cd3719c2088488aed2986b2b1db Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:08:00 +0800 Subject: [PATCH 227/254] modified: settings-daemon/application.h --- settings-daemon/application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index b0659c6..73fbcfd 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -49,7 +49,7 @@ class Application : public QApplication UPowerManager *m_upowerManager; Language *m_language; Mouse *m_mouse; - TouchpadManager *m_touchpad; + // TouchpadManager *m_touchpad; DefaultApplications *m_defaultApps; // QTimer *m_kwinTimer; From 7ba0221c8435ce350c0c57ef81a528b78b38c29b Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:09:39 +0800 Subject: [PATCH 228/254] modified: settings-daemon/touchpad/touchpadmanager.cpp --- settings-daemon/touchpad/touchpadmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp index dba99f6..7806dcc 100644 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -1,5 +1,5 @@ #include "touchpadmanager.h" -#include "touchpadadaptor.h" +// #include "touchpadadaptor.h" #include From 6b759d451d49c48a247dad1e9087054930244ceb Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 18:12:54 +0800 Subject: [PATCH 229/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/application.cpp modified: settings-daemon/application.h modified: settings-daemon/touchpad/touchpadmanager.cpp --- settings-daemon/CMakeLists.txt | 10 +++++++--- settings-daemon/application.cpp | 2 +- settings-daemon/application.h | 4 ++-- settings-daemon/touchpad/touchpadmanager.cpp | 3 ++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index e959586..850c3b7 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,6 +28,10 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" + "touchpad/*.h" + "touchpad/*.cpp" + "touchpad/x11/*.h" + "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -53,9 +57,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/application.cpp b/settings-daemon/application.cpp index c98ff5f..9b3c544 100755 --- a/settings-daemon/application.cpp +++ b/settings-daemon/application.cpp @@ -43,7 +43,7 @@ Application::Application(int &argc, char **argv) , m_upowerManager(new UPowerManager(this)) , m_language(Language::self()) , m_mouse(new Mouse) - // , m_touchpad(new TouchpadManager) + , m_touchpad(new TouchpadManager) , m_defaultApps(new DefaultApplications) // , m_kwinTimer(new QTimer(this)) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index 73fbcfd..a0661e7 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -26,7 +26,7 @@ #include "battery/upowermanager.h" #include "language/language.h" #include "mouse/mousemanager.h" -// #include "touchpad/touchpadmanager.h" +#include "touchpad/touchpadmanager.h" #include "defaultapplications.h" #include @@ -49,7 +49,7 @@ class Application : public QApplication UPowerManager *m_upowerManager; Language *m_language; Mouse *m_mouse; - // TouchpadManager *m_touchpad; + TouchpadManager *m_touchpad; DefaultApplications *m_defaultApps; // QTimer *m_kwinTimer; diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp index 7806dcc..26266d5 100644 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -1,7 +1,8 @@ #include "touchpadmanager.h" -// #include "touchpadadaptor.h" +#include "touchpadadaptor.h" #include +#include TouchpadManager::TouchpadManager(QObject *parent) : QObject(parent) From efc04934576acae2dd1db88caa75f2bc723abae6 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:25:58 +0800 Subject: [PATCH 230/254] modified: settings-daemon/theme/thememanager.cpp --- settings-daemon/theme/thememanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settings-daemon/theme/thememanager.cpp b/settings-daemon/theme/thememanager.cpp index 4b5adef..5553664 100755 --- a/settings-daemon/theme/thememanager.cpp +++ b/settings-daemon/theme/thememanager.cpp @@ -27,6 +27,7 @@ #include #include #include +#include static const QByteArray s_systemFontName = QByteArrayLiteral("Font"); static const QByteArray s_systemFixedFontName = QByteArrayLiteral("FixedFont"); @@ -309,9 +310,9 @@ void ThemeManager::setWallpaper(const QString &path) m_wallpaperPath = path; m_settings->setValue("Wallpaper", path); - //启动莫奈取色 + // 启动莫奈取色 QProcess *proc = new QProcess(this); - connect(proc, static_cast(&QProcess::finished), proc, &QProcess::deleteLater); + connect(proc, &QProcess::finished, proc, &QProcess::deleteLater); proc->startDetached("/usr/bin/lingmo-wallpaper-color-pick"); emit wallpaperChanged(path); From 58441b9bd0cdb16c0cf883002073a5ede7444c05 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:29:11 +0800 Subject: [PATCH 231/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.h --- settings-daemon/touchpad/x11/libinputtouchpad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h index 4d1733b..c1bc096 100644 --- a/settings-daemon/touchpad/x11/libinputtouchpad.h +++ b/settings-daemon/touchpad/x11/libinputtouchpad.h @@ -7,8 +7,8 @@ #ifndef LIBINPUTTOUCHPAD_H #define LIBINPUTTOUCHPAD_H -#include #include +#include #include "../libinputcommon.h" #include "xlibtouchpad.h" From 694510450de320a9481eed82084ab929a4d7ca84 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:31:05 +0800 Subject: [PATCH 232/254] modified: settings-daemon/touchpad/x11/libinputtouchpad.h --- settings-daemon/touchpad/x11/libinputtouchpad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h index c1bc096..4d1733b 100644 --- a/settings-daemon/touchpad/x11/libinputtouchpad.h +++ b/settings-daemon/touchpad/x11/libinputtouchpad.h @@ -7,8 +7,8 @@ #ifndef LIBINPUTTOUCHPAD_H #define LIBINPUTTOUCHPAD_H -#include #include +#include #include "../libinputcommon.h" #include "xlibtouchpad.h" From 76731efaf67693f949c7b0f8891cb4fbbfceb846 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:40:34 +0800 Subject: [PATCH 233/254] modified: settings-daemon/touchpad/touchpadmanager.cpp --- settings-daemon/touchpad/touchpadmanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp index 26266d5..4b1ae12 100644 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -3,6 +3,13 @@ #include #include +#include +#include +#include +#include +#include +#include +#include TouchpadManager::TouchpadManager(QObject *parent) : QObject(parent) From 81aa874224b4fd7c2e6f6f8b9b8c715a9e0d735b Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:47:36 +0800 Subject: [PATCH 234/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/application.cpp modified: settings-daemon/application.h deleted: settings-daemon/touchpad/com.lingmo.Touchpad.xml deleted: settings-daemon/touchpad/libinputcommon.cpp deleted: settings-daemon/touchpad/libinputcommon.h deleted: settings-daemon/touchpad/touchpadmanager.cpp deleted: settings-daemon/touchpad/touchpadmanager.h deleted: settings-daemon/touchpad/x11/libinputtouchpad.cpp deleted: settings-daemon/touchpad/x11/libinputtouchpad.h deleted: settings-daemon/touchpad/x11/propertyinfo.cpp deleted: settings-daemon/touchpad/x11/propertyinfo.h deleted: settings-daemon/touchpad/x11/synapticstouchpad.cpp deleted: settings-daemon/touchpad/x11/synapticstouchpad.h deleted: settings-daemon/touchpad/x11/xcbatom.cpp deleted: settings-daemon/touchpad/x11/xcbatom.h deleted: settings-daemon/touchpad/x11/xlibbackend.cpp deleted: settings-daemon/touchpad/x11/xlibbackend.h deleted: settings-daemon/touchpad/x11/xlibnotifications.cpp deleted: settings-daemon/touchpad/x11/xlibnotifications.h deleted: settings-daemon/touchpad/x11/xlibtouchpad.cpp deleted: settings-daemon/touchpad/x11/xlibtouchpad.h deleted: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp deleted: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h --- settings-daemon/CMakeLists.txt | 10 +- settings-daemon/application.cpp | 2 +- settings-daemon/application.h | 2 +- .../touchpad/com.lingmo.Touchpad.xml | 26 - settings-daemon/touchpad/libinputcommon.cpp | 9 - settings-daemon/touchpad/libinputcommon.h | 566 ------------------ settings-daemon/touchpad/touchpadmanager.cpp | 74 --- settings-daemon/touchpad/touchpadmanager.h | 37 -- .../touchpad/x11/libinputtouchpad.cpp | 402 ------------- .../touchpad/x11/libinputtouchpad.h | 149 ----- settings-daemon/touchpad/x11/propertyinfo.cpp | 86 --- settings-daemon/touchpad/x11/propertyinfo.h | 37 -- .../touchpad/x11/synapticstouchpad.cpp | 225 ------- .../touchpad/x11/synapticstouchpad.h | 34 -- settings-daemon/touchpad/x11/xcbatom.cpp | 48 -- settings-daemon/touchpad/x11/xcbatom.h | 36 -- settings-daemon/touchpad/x11/xlibbackend.cpp | 425 ------------- settings-daemon/touchpad/x11/xlibbackend.h | 124 ---- .../touchpad/x11/xlibnotifications.cpp | 135 ----- .../touchpad/x11/xlibnotifications.h | 41 -- settings-daemon/touchpad/x11/xlibtouchpad.cpp | 257 -------- settings-daemon/touchpad/x11/xlibtouchpad.h | 101 ---- .../touchpad/x11/xrecordkeyboardmonitor.cpp | 140 ----- .../touchpad/x11/xrecordkeyboardmonitor.h | 47 -- 24 files changed, 5 insertions(+), 3008 deletions(-) delete mode 100644 settings-daemon/touchpad/com.lingmo.Touchpad.xml delete mode 100644 settings-daemon/touchpad/libinputcommon.cpp delete mode 100644 settings-daemon/touchpad/libinputcommon.h delete mode 100644 settings-daemon/touchpad/touchpadmanager.cpp delete mode 100644 settings-daemon/touchpad/touchpadmanager.h delete mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.cpp delete mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.h delete mode 100644 settings-daemon/touchpad/x11/propertyinfo.cpp delete mode 100644 settings-daemon/touchpad/x11/propertyinfo.h delete mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.cpp delete mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.h delete mode 100644 settings-daemon/touchpad/x11/xcbatom.cpp delete mode 100644 settings-daemon/touchpad/x11/xcbatom.h delete mode 100644 settings-daemon/touchpad/x11/xlibbackend.cpp delete mode 100644 settings-daemon/touchpad/x11/xlibbackend.h delete mode 100644 settings-daemon/touchpad/x11/xlibnotifications.cpp delete mode 100644 settings-daemon/touchpad/x11/xlibnotifications.h delete mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.cpp delete mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.h delete mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp delete mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 850c3b7..e959586 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,10 +28,6 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" ) set(SOURCES ${SRCS}) @@ -57,9 +53,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/application.cpp b/settings-daemon/application.cpp index 9b3c544..c98ff5f 100755 --- a/settings-daemon/application.cpp +++ b/settings-daemon/application.cpp @@ -43,7 +43,7 @@ Application::Application(int &argc, char **argv) , m_upowerManager(new UPowerManager(this)) , m_language(Language::self()) , m_mouse(new Mouse) - , m_touchpad(new TouchpadManager) + // , m_touchpad(new TouchpadManager) , m_defaultApps(new DefaultApplications) // , m_kwinTimer(new QTimer(this)) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index a0661e7..b0659c6 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -26,7 +26,7 @@ #include "battery/upowermanager.h" #include "language/language.h" #include "mouse/mousemanager.h" -#include "touchpad/touchpadmanager.h" +// #include "touchpad/touchpadmanager.h" #include "defaultapplications.h" #include diff --git a/settings-daemon/touchpad/com.lingmo.Touchpad.xml b/settings-daemon/touchpad/com.lingmo.Touchpad.xml deleted file mode 100644 index c32ef00..0000000 --- a/settings-daemon/touchpad/com.lingmo.Touchpad.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/settings-daemon/touchpad/libinputcommon.cpp b/settings-daemon/touchpad/libinputcommon.cpp deleted file mode 100644 index 2d0a92d..0000000 --- a/settings-daemon/touchpad/libinputcommon.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "libinputcommon.h" - -#include "moc_libinputcommon.cpp" diff --git a/settings-daemon/touchpad/libinputcommon.h b/settings-daemon/touchpad/libinputcommon.h deleted file mode 100644 index 7d18def..0000000 --- a/settings-daemon/touchpad/libinputcommon.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Roman Gilg - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef LIBINPUTCOMMON_H -#define LIBINPUTCOMMON_H - -#include -#include - -namespace -{ -template -inline T valueLoaderPart(QVariant const &reply) -{ - Q_UNUSED(reply); - return T(); -} - -template<> -inline bool valueLoaderPart(QVariant const &reply) -{ - return reply.toBool(); -} - -template<> -inline int valueLoaderPart(QVariant const &reply) -{ - return reply.toInt(); -} - -template<> -inline quint32 valueLoaderPart(QVariant const &reply) -{ - return reply.toInt(); -} - -template<> -inline qreal valueLoaderPart(QVariant const &reply) -{ - return reply.toReal(); -} - -template<> -inline QString valueLoaderPart(QVariant const &reply) -{ - return reply.toString(); -} - -template<> -inline Qt::MouseButtons valueLoaderPart(QVariant const &reply) -{ - return static_cast(reply.toInt()); -} -} - -class LibinputCommon : public QObject -{ - Q_OBJECT - - // - // general - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - - // - // advanced - Q_PROPERTY(Qt::MouseButtons supportedButtons READ supportedButtons CONSTANT) - - Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT) - Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT) - Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged) - - Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT) - - Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT) - Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT) - Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged) - - Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT) - Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT) - Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged) - - // - // acceleration speed and profile - Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT) - Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged) - - Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT) - Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT) - Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY - pointerAccelerationProfileChanged) - - Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT) - Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT) - Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY - pointerAccelerationProfileChanged) - - // - // tapping - Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT) - Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged) - - Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT) - Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT) - Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY lmrTapButtonMapChanged) - - Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged) - - Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT) - Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged) - - // - // scrolling - Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT) - Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT) - Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged) - - Q_PROPERTY(bool supportsHorizontalScrolling READ supportsHorizontalScrolling CONSTANT) - Q_PROPERTY(bool horizontalScrollingByDefault READ horizontalScrollingByDefault CONSTANT) - Q_PROPERTY(bool horizontalScrolling READ horizontalScrolling WRITE setHorizontalScrolling NOTIFY horizontalScrollingChanged) - - Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT) - Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged) - - Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT) - Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged) - - Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT) - Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT) - Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged) - - Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT) - Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged) - - // Click Methods - Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT) - Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT) - Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged) - - Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT) - Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT) - Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged) - - Q_PROPERTY(bool supportsScrollFactor READ supportsScrollFactor CONSTANT) -public: - LibinputCommon() - { - } - virtual ~LibinputCommon() - { - } - - virtual QString name() const = 0; - virtual bool supportsDisableEvents() const = 0; - virtual bool isEnabled() const = 0; - virtual void setEnabled(bool set) = 0; - - // - // advanced - Qt::MouseButtons supportedButtons() const - { - return m_supportedButtons.val; - } - - virtual bool supportsLeftHanded() const = 0; - bool leftHandedEnabledByDefault() const - { - return m_leftHandedEnabledByDefault.val; - } - bool isLeftHanded() const - { - return m_leftHanded.val; - } - void setLeftHanded(bool set) - { - m_leftHanded.set(set); - } - - virtual bool supportsDisableEventsOnExternalMouse() const = 0; - - virtual bool supportsDisableWhileTyping() const = 0; - bool disableWhileTypingEnabledByDefault() const - { - return m_disableWhileTypingEnabledByDefault.val; - } - bool isDisableWhileTyping() const - { - return m_disableWhileTyping.val; - } - void setDisableWhileTyping(bool set) - { - m_disableWhileTyping.set(set); - } - - virtual bool supportsMiddleEmulation() const = 0; - bool middleEmulationEnabledByDefault() const - { - return m_middleEmulationEnabledByDefault.val; - } - bool isMiddleEmulation() const - { - return m_middleEmulation.val; - } - void setMiddleEmulation(bool set) - { - m_middleEmulation.set(set); - } - - virtual bool supportsPointerAcceleration() const = 0; - qreal pointerAcceleration() const - { - return m_pointerAcceleration.val; - } - void setPointerAcceleration(qreal acceleration) - { - m_pointerAcceleration.set(acceleration); - } - - virtual bool supportsPointerAccelerationProfileFlat() const = 0; - bool defaultPointerAccelerationProfileFlat() const - { - return m_defaultPointerAccelerationProfileFlat.val; - } - bool pointerAccelerationProfileFlat() const - { - return m_pointerAccelerationProfileFlat.val; - } - void setPointerAccelerationProfileFlat(bool set) - { - m_pointerAccelerationProfileFlat.set(set); - } - - virtual bool supportsPointerAccelerationProfileAdaptive() const = 0; - bool defaultPointerAccelerationProfileAdaptive() const - { - return m_defaultPointerAccelerationProfileAdaptive.val; - } - bool pointerAccelerationProfileAdaptive() const - { - return m_pointerAccelerationProfileAdaptive.val; - } - void setPointerAccelerationProfileAdaptive(bool set) - { - m_pointerAccelerationProfileAdaptive.set(set); - } - - // - // scrolling - virtual bool supportsNaturalScroll() const = 0; - bool naturalScrollEnabledByDefault() const - { - return m_naturalScrollEnabledByDefault.val; - } - bool isNaturalScroll() const - { - return m_naturalScroll.val; - } - void setNaturalScroll(bool set) - { - m_naturalScroll.set(set); - } - - virtual bool supportsHorizontalScrolling() const = 0; - bool horizontalScrollingByDefault() const - { - return true; - } - bool horizontalScrolling() const - { - return m_horizontalScrolling.val; - } - void setHorizontalScrolling(bool set) - { - m_horizontalScrolling.set(set); - } - - virtual bool supportsScrollTwoFinger() const = 0; - bool scrollTwoFingerEnabledByDefault() const - { - return m_scrollTwoFingerEnabledByDefault.val; - } - bool isScrollTwoFinger() const - { - return m_isScrollTwoFinger.val; - } - void setScrollTwoFinger(bool set) - { - m_isScrollTwoFinger.set(set); - } - - virtual bool supportsScrollEdge() const = 0; - bool scrollEdgeEnabledByDefault() const - { - return m_scrollEdgeEnabledByDefault.val; - } - bool isScrollEdge() const - { - return m_isScrollEdge.val; - } - void setScrollEdge(bool set) - { - m_isScrollEdge.set(set); - } - - virtual bool supportsScrollOnButtonDown() const = 0; - bool scrollOnButtonDownEnabledByDefault() const - { - return m_scrollOnButtonDownEnabledByDefault.val; - } - bool isScrollOnButtonDown() const - { - return m_isScrollOnButtonDown.val; - } - void setScrollOnButtonDown(bool set) - { - m_isScrollOnButtonDown.set(set); - } - - quint32 defaultScrollButton() const - { - return m_defaultScrollButton.val; - } - quint32 scrollButton() const - { - return m_scrollButton.val; - } - void setScrollButton(quint32 button) - { - m_scrollButton.set(button); - } - - // - // tapping - int tapFingerCount() const - { - return m_tapFingerCount.val; - } - bool tapToClickEnabledByDefault() const - { - return m_tapToClickEnabledByDefault.val; - } - bool isTapToClick() const - { - return m_tapToClick.val; - } - void setTapToClick(bool set) - { - m_tapToClick.set(set); - } - - bool supportsLmrTapButtonMap() const - { - return m_tapFingerCount.val > 1; - } - bool lmrTapButtonMapEnabledByDefault() const - { - return m_lmrTapButtonMapEnabledByDefault.val; - } - bool lmrTapButtonMap() const - { - return m_lmrTapButtonMap.val; - } - virtual void setLmrTapButtonMap(bool set) = 0; - - bool tapAndDragEnabledByDefault() const - { - return m_tapAndDragEnabledByDefault.val; - } - bool isTapAndDrag() const - { - return m_tapAndDrag.val; - } - void setTapAndDrag(bool set) - { - m_tapAndDrag.set(set); - } - - bool tapDragLockEnabledByDefault() const - { - return m_tapDragLockEnabledByDefault.val; - } - bool isTapDragLock() const - { - return m_tapDragLock.val; - } - void setTapDragLock(bool set) - { - m_tapDragLock.set(set); - } - - // - // click method - virtual bool supportsClickMethodAreas() const = 0; - bool defaultClickMethodAreas() const - { - return m_defaultClickMethodAreas.val; - } - bool isClickMethodAreas() const - { - return m_clickMethodAreas.val; - } - void setClickMethodAreas(bool set) - { - m_clickMethodAreas.set(set); - } - - virtual bool supportsClickMethodClickfinger() const = 0; - bool defaultClickMethodClickfinger() const - { - return m_defaultClickMethodClickfinger.val; - } - bool isClickMethodClickfinger() const - { - return m_clickMethodClickfinger.val; - } - void setClickMethodClickfinger(bool set) - { - m_clickMethodClickfinger.set(set); - } - - virtual bool supportsScrollFactor() const = 0; - -Q_SIGNALS: - void enabledChanged(); - // Tapping - void tapToClickChanged(); - void lmrTapButtonMapChanged(); - void tapAndDragChanged(); - void tapDragLockChanged(); - // Advanced - void leftHandedChanged(); - void disableWhileTypingChanged(); - void middleEmulationChanged(); - // acceleration speed and profile - void pointerAccelerationChanged(); - void pointerAccelerationProfileChanged(); - // scrolling - void naturalScrollChanged(); - void horizontalScrollingChanged(); - void scrollMethodChanged(); - void scrollButtonChanged(); - // click methods - void clickMethodChanged(); - -protected: - template - struct Prop { - explicit Prop(const QByteArray &name) - : name(name) - { - } - - void set(T newVal) - { - if (avail && val != newVal) { - val = newVal; - } - } - void set(const Prop &p) - { - if (avail && val != p.val) { - val = p.val; - } - } - bool changed() const - { - return avail && (old != val); - } - - // In wayland, name will be dbus name - QByteArray name; - bool avail; - T old; - T val; - }; - - // - // general - Prop m_supportsDisableEvents = Prop("supportsDisableEvents"); - Prop m_enabledDefault = Prop("enabledDefault"); - Prop m_enabled = Prop("enabled"); - - // - // advanced - Prop m_supportedButtons = Prop("supportedButtons"); - - Prop m_leftHandedEnabledByDefault = Prop("leftHandedEnabledByDefault"); - Prop m_leftHanded = Prop("leftHanded"); - - Prop m_supportsDisableEventsOnExternalMouse = Prop("supportsDisableEventsOnExternalMouse"); - - Prop m_disableWhileTypingEnabledByDefault = Prop("disableWhileTypingEnabledByDefault"); - Prop m_disableWhileTyping = Prop("disableWhileTyping"); - - Prop m_middleEmulationEnabledByDefault = Prop("middleEmulationEnabledByDefault"); - Prop m_middleEmulation = Prop("middleEmulation"); - - // - // acceleration speed and profile - Prop m_defaultPointerAcceleration = Prop("defaultPointerAcceleration"); - Prop m_pointerAcceleration = Prop("pointerAcceleration"); - - Prop m_supportsPointerAccelerationProfileFlat = Prop("supportsPointerAccelerationProfileFlat"); - Prop m_defaultPointerAccelerationProfileFlat = Prop("defaultPointerAccelerationProfileFlat"); - Prop m_pointerAccelerationProfileFlat = Prop("pointerAccelerationProfileFlat"); - - Prop m_supportsPointerAccelerationProfileAdaptive = Prop("supportsPointerAccelerationProfileAdaptive"); - Prop m_defaultPointerAccelerationProfileAdaptive = Prop("defaultPointerAccelerationProfileAdaptive"); - Prop m_pointerAccelerationProfileAdaptive = Prop("pointerAccelerationProfileAdaptive"); - - // - // tapping - Prop m_tapFingerCount = Prop("tapFingerCount"); - Prop m_tapToClickEnabledByDefault = Prop("tapToClickEnabledByDefault"); - Prop m_tapToClick = Prop("tapToClick"); - - Prop m_lmrTapButtonMapEnabledByDefault = Prop("lmrTapButtonMapEnabledByDefault"); - Prop m_lmrTapButtonMap = Prop("lmrTapButtonMap"); - - Prop m_tapAndDragEnabledByDefault = Prop("tapAndDragEnabledByDefault"); - Prop m_tapAndDrag = Prop("tapAndDrag"); - Prop m_tapDragLockEnabledByDefault = Prop("tapDragLockEnabledByDefault"); - Prop m_tapDragLock = Prop("tapDragLock"); - - // - // scrolling - Prop m_naturalScrollEnabledByDefault = Prop("naturalScrollEnabledByDefault"); - Prop m_naturalScroll = Prop("naturalScroll"); - - Prop m_horizontalScrolling = Prop("horizontalScrolling"); - - Prop m_supportsScrollTwoFinger = Prop("supportsScrollTwoFinger"); - Prop m_scrollTwoFingerEnabledByDefault = Prop("scrollTwoFingerEnabledByDefault"); - Prop m_isScrollTwoFinger = Prop("scrollTwoFinger"); - - Prop m_supportsScrollEdge = Prop("supportsScrollEdge"); - Prop m_scrollEdgeEnabledByDefault = Prop("scrollEdgeEnabledByDefault"); - Prop m_isScrollEdge = Prop("scrollEdge"); - - Prop m_supportsScrollOnButtonDown = Prop("supportsScrollOnButtonDown"); - Prop m_scrollOnButtonDownEnabledByDefault = Prop("scrollOnButtonDownEnabledByDefault"); - Prop m_isScrollOnButtonDown = Prop("scrollOnButtonDown"); - - Prop m_defaultScrollButton = Prop("defaultScrollButton"); - Prop m_scrollButton = Prop("scrollButton"); - - // Click Method - Prop m_supportsClickMethodAreas = Prop("supportsClickMethodAreas"); - Prop m_defaultClickMethodAreas = Prop("defaultClickMethodAreas"); - Prop m_clickMethodAreas = Prop("clickMethodAreas"); - - Prop m_supportsClickMethodClickfinger = Prop("supportsClickMethodClickfinger"); - Prop m_defaultClickMethodClickfinger = Prop("defaultClickMethodClickfinger"); - Prop m_clickMethodClickfinger = Prop("clickMethodClickfinger"); -}; - -#endif // LIBINPUTCOMMON_H diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp deleted file mode 100644 index 4b1ae12..0000000 --- a/settings-daemon/touchpad/touchpadmanager.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "touchpadmanager.h" -#include "touchpadadaptor.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -TouchpadManager::TouchpadManager(QObject *parent) - : QObject(parent) - , m_backend(XlibBackend::initialize()) -{ - // init dbus - new TouchpadAdaptor(this); - QDBusConnection::sessionBus().registerObject(QStringLiteral("/Touchpad"), this); - - m_backend->getConfig(); - m_backend->applyConfig(); -} - -bool TouchpadManager::available() const -{ - return m_backend->isTouchpadAvailable(); -} - -bool TouchpadManager::enabled() const -{ - return m_backend->isTouchpadEnabled(); -} - -void TouchpadManager::setEnabled(bool enabled) -{ - m_backend->setTouchpadEnabled(enabled); - m_backend->applyConfig(); -} - -bool TouchpadManager::tapToClick() const -{ - return m_backend->tapToClick(); -} - -void TouchpadManager::setTapToClick(bool value) -{ - m_backend->setTapToClick(value); - m_backend->applyConfig(); -} - -bool TouchpadManager::naturalScroll() const -{ - return m_backend->naturalScroll(); -} - -void TouchpadManager::setNaturalScroll(bool naturalScroll) -{ - m_backend->setNaturalScroll(naturalScroll); - m_backend->applyConfig(); -} - -qreal TouchpadManager::pointerAcceleration() const -{ - return m_backend->pointerAcceleration(); -} - -void TouchpadManager::setPointerAcceleration(qreal value) -{ - qDebug() << value; - m_backend->setPointerAcceleration(value); - m_backend->applyConfig(); -} diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h deleted file mode 100644 index d8f84d6..0000000 --- a/settings-daemon/touchpad/touchpadmanager.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef TOUCHPADMANAGER_H -#define TOUCHPADMANAGER_H - -#include -#include "x11/xlibbackend.h" - -class TouchpadManager : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool available READ available CONSTANT) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled CONSTANT) - Q_PROPERTY(bool tapToClick READ tapToClick WRITE setTapToClick CONSTANT) - Q_PROPERTY(bool naturalScroll READ naturalScroll WRITE setNaturalScroll CONSTANT) - Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration CONSTANT) - -public: - explicit TouchpadManager(QObject *parent = nullptr); - - bool available() const; - - bool enabled() const; - void setEnabled(bool enabled); - - bool tapToClick() const; - void setTapToClick(bool value); - - bool naturalScroll() const; - void setNaturalScroll(bool naturalScroll); - - qreal pointerAcceleration() const; - void setPointerAcceleration(qreal value); - -private: - XlibBackend *m_backend; -}; - -#endif // TOUCHPADMANAGER_H diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp deleted file mode 100644 index 814b7eb..0000000 --- a/settings-daemon/touchpad/x11/libinputtouchpad.cpp +++ /dev/null @@ -1,402 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "libinputtouchpad.h" - -#include -#include - -#include -#include - -#include -#include - -#include -#include - -const Parameter libinputProperties[] = { - - /* libinput disable supports property */ - {"supportsDisableEvents", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 0}, - {"enabled", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 0}, - {"enabledDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 0}, - - /* LeftHandSupport */ - {"leftHandedEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED_DEFAULT, 8, 0}, - {"leftHanded", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED, 8, 0}, - - /* Disable on external mouse */ - {"supportsDisableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 1}, - {"disableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 1}, - {"disableEventsOnExternalMouseDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 1}, - - /* Disable while typing */ - {"disableWhileTypingEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT, 8, 0}, - {"disableWhileTyping", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING, 8, 0}, - - /* Middle Emulation */ - {"middleEmulationEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT, 8, 0}, - {"middleEmulation", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED, 8, 0}, - - /* This is a boolean for all three fingers, no per-finger config */ - {"tapToClick", PT_INT, 0, 1, LIBINPUT_PROP_TAP, 8, 0}, - {"tapToClickEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DEFAULT, 8, 0}, - - /* LMR */ - {"lrmTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 0}, - {"lrmTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 0}, - {"lmrTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 1}, - {"lmrTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 1}, - - /* Tap and Drag Enabled */ - {"tapAndDragEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_DEFAULT, 8, 0}, - {"tapAndDrag", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG, 8, 0}, - - /* Tap and Drag Lock Enabled */ - {"tapDragLockEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT, 8, 0}, - {"tapDragLock", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK, 8, 0}, - - /* libinput normalizes the accel to -1/1 */ - {"defaultPointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL_DEFAULT, 0 /*float */, 0}, - {"pointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL, 0 /*float */, 0}, - - /* Libinput Accel Profile */ - {"supportsPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 0}, - {"defaultPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 0}, - {"pointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 0}, - {"supportsPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 1}, - {"defaultPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 1}, - {"pointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 1}, - - /* Natural Scrolling */ - {"naturalScrollEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT, 8, 0}, - {"naturalScroll", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL, 8, 0}, - - /* Horizontal scrolling */ - {"horizontalScrolling", PT_INT, 0, 1, LIBINPUT_PROP_HORIZ_SCROLL_ENABLED, 8, 0}, - - /* Two-Finger Scrolling */ - {"supportsScrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 0}, - {"scrollTwoFingerEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 0}, - {"scrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 0}, - - /* Edge Scrolling */ - {"supportsScrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 1}, - {"scrollEdgeEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 1}, - {"scrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 1}, - - /* scroll on button */ - {"supportsScrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 2}, - {"scrollOnButtonDownEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 2}, - {"scrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 2}, - - /* Scroll Button for scroll on button Down */ - {"defaultScrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT, 32, 0}, - {"scrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON, 32, 0}, - - /* Click Methods */ - {"supportsClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 0}, - {"defaultClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 0}, - {"clickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 0}, - - {"supportsClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 1}, - {"defaultClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 1}, - {"clickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 1}, - - /* libinput doesn't have a separate toggle for horiz scrolling */ - {nullptr, PT_INT, 0, 0, nullptr, 0, 0}}; - -Qt::MouseButtons maskBtns(Display *display, XIButtonClassInfo *buttonInfo) -{ - Qt::MouseButtons buttons = Qt::NoButton; - for (int i = 0; i < buttonInfo->num_buttons; ++i) { - QByteArray reply = XGetAtomName(display, buttonInfo->labels[i]); - - if (reply == BTN_LABEL_PROP_BTN_LEFT) { - buttons |= Qt::LeftButton; - } - if (reply == BTN_LABEL_PROP_BTN_RIGHT) { - buttons |= Qt::RightButton; - } - if (reply == BTN_LABEL_PROP_BTN_MIDDLE) { - buttons |= Qt::MiddleButton; - } - if (reply == BTN_LABEL_PROP_BTN_SIDE) { - buttons |= Qt::ExtraButton1; - } - if (reply == BTN_LABEL_PROP_BTN_EXTRA) { - buttons |= Qt::ExtraButton2; - } - if (reply == BTN_LABEL_PROP_BTN_FORWARD) { - buttons |= Qt::ForwardButton; - } - if (reply == BTN_LABEL_PROP_BTN_BACK) { - buttons |= Qt::BackButton; - } - if (reply == BTN_LABEL_PROP_BTN_TASK) { - buttons |= Qt::TaskButton; - } - } - return buttons; -} - -LibinputTouchpad::LibinputTouchpad(Display *display, int deviceId) - : LibinputCommon() - , XlibTouchpad(display, deviceId) - , m_config("lingmoos", "touchpadxlibinputrc") -{ - loadSupportedProperties(libinputProperties); - - int nDevices = 0; - XIDeviceInfo *deviceInfo = XIQueryDevice(m_display, m_deviceId, &nDevices); - m_name = deviceInfo->name; - - for (int i = 0; i < deviceInfo->num_classes; ++i) { - XIAnyClassInfo *classInfo = deviceInfo->classes[i]; - - if (classInfo->type == XIButtonClass) { - XIButtonClassInfo *btnInfo = (XIButtonClassInfo *)classInfo; - m_supportedButtons.avail = true; - m_supportedButtons.set(maskBtns(m_display, btnInfo)); - } - if (classInfo->type == XITouchClass) { - XITouchClassInfo *touchInfo = (XITouchClassInfo *)classInfo; - m_tapFingerCount.avail = true; - m_tapFingerCount.set(touchInfo->num_touches); - } - } - XIFreeDeviceInfo(deviceInfo); - - /* FingerCount cannot be zero */ - if (!m_tapFingerCount.val) { - m_tapFingerCount.avail = true; - m_tapFingerCount.set(1); - } -} - -bool LibinputTouchpad::getConfig() -{ - bool success = true; - - success &= valueLoader(m_supportsDisableEvents); - success &= valueLoader(m_enabled); - success &= valueLoader(m_enabledDefault); - - success &= valueLoader(m_tapToClickEnabledByDefault); - success &= valueLoader(m_tapToClick); - success &= valueLoader(m_lrmTapButtonMapEnabledByDefault); - success &= valueLoader(m_lrmTapButtonMap); - success &= valueLoader(m_lmrTapButtonMapEnabledByDefault); - success &= valueLoader(m_lmrTapButtonMap); - success &= valueLoader(m_tapAndDragEnabledByDefault); - success &= valueLoader(m_tapAndDrag); - success &= valueLoader(m_tapDragLockEnabledByDefault); - success &= valueLoader(m_tapDragLock); - - success &= valueLoader(m_leftHandedEnabledByDefault); - success &= valueLoader(m_leftHanded); - - success &= valueLoader(m_supportsDisableEventsOnExternalMouse); - success &= valueLoader(m_disableEventsOnExternalMouse); - success &= valueLoader(m_disableEventsOnExternalMouseDefault); - - success &= valueLoader(m_disableWhileTypingEnabledByDefault); - success &= valueLoader(m_disableWhileTyping); - - success &= valueLoader(m_middleEmulationEnabledByDefault); - success &= valueLoader(m_middleEmulation); - - success &= valueLoader(m_defaultPointerAcceleration); - success &= valueLoader(m_pointerAcceleration); - - success &= valueLoader(m_supportsPointerAccelerationProfileFlat); - success &= valueLoader(m_defaultPointerAccelerationProfileFlat); - success &= valueLoader(m_pointerAccelerationProfileFlat); - success &= valueLoader(m_supportsPointerAccelerationProfileAdaptive); - success &= valueLoader(m_defaultPointerAccelerationProfileAdaptive); - success &= valueLoader(m_pointerAccelerationProfileAdaptive); - - success &= valueLoader(m_naturalScrollEnabledByDefault); - success &= valueLoader(m_naturalScroll); - - success &= valueLoader(m_horizontalScrolling); - - success &= valueLoader(m_supportsScrollTwoFinger); - success &= valueLoader(m_scrollTwoFingerEnabledByDefault); - success &= valueLoader(m_isScrollTwoFinger); - - success &= valueLoader(m_supportsScrollEdge); - success &= valueLoader(m_scrollEdgeEnabledByDefault); - success &= valueLoader(m_isScrollEdge); - - success &= valueLoader(m_supportsScrollOnButtonDown); - success &= valueLoader(m_scrollOnButtonDownEnabledByDefault); - success &= valueLoader(m_isScrollOnButtonDown); - - success &= valueLoader(m_defaultScrollButton); - success &= valueLoader(m_scrollButton); - - // click methods - success &= valueLoader(m_supportsClickMethodAreas); - success &= valueLoader(m_supportsClickMethodClickfinger); - success &= valueLoader(m_defaultClickMethodAreas); - success &= valueLoader(m_defaultClickMethodClickfinger); - success &= valueLoader(m_clickMethodAreas); - success &= valueLoader(m_clickMethodClickfinger); - - return success; -} - -bool LibinputTouchpad::applyConfig() -{ - QVector msgs; - - msgs << valueWriter(m_enabled) << valueWriter(m_tapToClick) << valueWriter(m_lrmTapButtonMap) << valueWriter(m_lmrTapButtonMap) << valueWriter(m_tapAndDrag) - << valueWriter(m_tapDragLock) << valueWriter(m_leftHanded) << valueWriter(m_disableWhileTyping) << valueWriter(m_middleEmulation) - << valueWriter(m_pointerAcceleration) << valueWriter(m_pointerAccelerationProfileFlat) << valueWriter(m_pointerAccelerationProfileAdaptive) - << valueWriter(m_naturalScroll) << valueWriter(m_horizontalScrolling) << valueWriter(m_isScrollTwoFinger) << valueWriter(m_isScrollEdge) - << valueWriter(m_isScrollOnButtonDown) << valueWriter(m_scrollButton) << valueWriter(m_clickMethodAreas) << valueWriter(m_clickMethodClickfinger); - - bool success = true; - QString error_msg; - - for (QString m : msgs) { - if (!m.isNull()) { - // qCCritical(KCM_TOUCHPAD) << "in error:" << m; - if (!success) { - error_msg.append("\n"); - } - error_msg.append(m); - success = false; - } - } - - if (!success) { - // qCCritical(KCM_TOUCHPAD) << error_msg; - } - - flush(); - return success; -} - -bool LibinputTouchpad::getDefaultConfig() -{ - m_enabled.set(m_enabledDefault); - m_tapToClick.set(m_tapToClickEnabledByDefault); - m_lrmTapButtonMap.set(m_lrmTapButtonMap); - m_lmrTapButtonMap.set(m_lmrTapButtonMapEnabledByDefault); - m_tapAndDrag.set(m_tapAndDragEnabledByDefault); - m_tapDragLock.set(m_tapDragLockEnabledByDefault); - m_leftHanded.set(m_leftHandedEnabledByDefault); - m_disableEventsOnExternalMouse.set(m_disableEventsOnExternalMouseDefault); - m_disableWhileTyping.set(m_disableWhileTypingEnabledByDefault); - m_middleEmulation.set(m_middleEmulationEnabledByDefault); - m_pointerAcceleration.set(m_defaultPointerAcceleration); - m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); - m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); - m_naturalScroll.set(m_naturalScrollEnabledByDefault); - m_horizontalScrolling.set(true); - m_isScrollTwoFinger.set(m_scrollTwoFingerEnabledByDefault); - m_isScrollEdge.set(m_scrollEdgeEnabledByDefault); - m_isScrollOnButtonDown.set(m_scrollOnButtonDownEnabledByDefault); - m_scrollButton.set(m_defaultScrollButton); - m_clickMethodAreas.set(m_defaultClickMethodAreas); - m_clickMethodClickfinger.set(m_defaultClickMethodClickfinger); - - return true; -} - -bool LibinputTouchpad::isChangedConfig() -{ - // clang-format off - bool changed = m_enabled.changed() || - m_tapToClick.changed() || - m_lrmTapButtonMap.changed() || - m_lmrTapButtonMap.changed() || - m_tapAndDrag.changed() || - m_tapDragLock.changed() || - m_leftHanded.changed() || - m_disableEventsOnExternalMouse.changed() || - m_disableWhileTyping.changed() || - m_middleEmulation.changed() || - m_pointerAcceleration.changed() || - m_pointerAccelerationProfileFlat.changed() || - m_pointerAccelerationProfileAdaptive.changed() || - m_naturalScroll.changed() || - m_horizontalScrolling.changed() || - m_isScrollTwoFinger.changed() || - m_isScrollEdge.changed() || - m_isScrollOnButtonDown.changed() || - m_scrollButton.changed() || - m_clickMethodAreas.changed() || - m_clickMethodClickfinger.changed(); - // clang-format on - - return changed; -} - -int LibinputTouchpad::touchpadOff() -{ - return m_enabled.val; -} - -XcbAtom &LibinputTouchpad::touchpadOffAtom() -{ - return *m_atoms[QLatin1String(LIBINPUT_PROP_SENDEVENTS_ENABLED)].data(); -} - -template -bool LibinputTouchpad::valueLoader(Prop &prop) -{ - const Parameter *p = findParameter(QString::fromLatin1(prop.name)); - - if (!p) { - // qCCritical(KCM_TOUCHPAD) << "Error on read of " << QString::fromLatin1(prop.name); - } - - QVariant reply = getParameter(p); - if (!reply.isValid()) { - prop.avail = false; - return true; - } - prop.avail = true; - - m_config.beginGroup(m_name); - - const T replyValue = valueLoaderPart(reply); - const T loadedValue = m_config.value(prop.name, replyValue).toBool(); - prop.old = replyValue; - prop.val = loadedValue; - - m_config.endGroup(); - - return true; -} - -template -QString LibinputTouchpad::valueWriter(const Prop &prop) -{ - const Parameter *p = findParameter(QString::fromLatin1(prop.name)); - - // Reion - if (!p /*|| !prop.changed()*/) { - return QString(); - } - - bool error = !setParameter(p, prop.val); - if (error) { - // qCCritical(KCM_TOUCHPAD) << "Cannot set property " + QString::fromLatin1(prop.name); - return QStringLiteral("Cannot set property ") + QString::fromLatin1(prop.name); - } - - m_config.beginGroup(m_name); - m_config.setValue(prop.name, prop.val); - m_config.endGroup(); - m_config.sync(); - - return QString(); -} diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h deleted file mode 100644 index 4d1733b..0000000 --- a/settings-daemon/touchpad/x11/libinputtouchpad.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - SPDX-FileCopyrightText: 2019 Atul Bisht - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef LIBINPUTTOUCHPAD_H -#define LIBINPUTTOUCHPAD_H - -#include -#include - -#include "../libinputcommon.h" -#include "xlibtouchpad.h" - -class LibinputTouchpad : public LibinputCommon, public XlibTouchpad -{ - Q_OBJECT - -public: - LibinputTouchpad(Display *display, int deviceId); - ~LibinputTouchpad() override - { - } - - bool getConfig() override; - bool applyConfig() override; - bool getDefaultConfig() override; - bool isChangedConfig() override; - - int touchpadOff() override; - XcbAtom &touchpadOffAtom() override; - -private: - template - bool valueLoader(Prop &prop); - - template - QString valueWriter(const Prop &prop); - - QSettings m_config; - - // - // general - QString name() const override - { - return m_name; - } - bool supportsDisableEvents() const override - { - return m_supportsDisableEvents.avail && m_supportsDisableEvents.val; - } - bool isEnabled() const override - { - return !m_enabled.val; - } - void setEnabled(bool set) override - { - m_enabled.set(!set); - } - // - // Tapping - void setLmrTapButtonMap(bool set) override - { - m_lrmTapButtonMap.set(!set); - m_lmrTapButtonMap.set(set); - } - // - // advanced - bool supportsLeftHanded() const override - { - return m_leftHanded.avail; - } - bool supportsDisableEventsOnExternalMouse() const override - { - return m_supportsDisableEventsOnExternalMouse.avail && m_supportsDisableEventsOnExternalMouse.val; - } - bool supportsDisableWhileTyping() const override - { - return m_disableWhileTyping.avail; - } - bool supportsMiddleEmulation() const override - { - return m_middleEmulation.avail; - } - // - // acceleration speed and profile - bool supportsPointerAcceleration() const override - { - return m_pointerAcceleration.avail; - } - bool supportsPointerAccelerationProfileFlat() const override - { - return m_supportsPointerAccelerationProfileFlat.avail && m_supportsPointerAccelerationProfileFlat.val; - } - bool supportsPointerAccelerationProfileAdaptive() const override - { - return m_supportsPointerAccelerationProfileAdaptive.avail && m_supportsPointerAccelerationProfileAdaptive.val; - } - // - // scrolling - bool supportsNaturalScroll() const override - { - return m_naturalScroll.avail; - } - bool supportsHorizontalScrolling() const override - { - return true; - } - bool supportsScrollTwoFinger() const override - { - return m_supportsScrollTwoFinger.avail && m_supportsScrollTwoFinger.val; - } - bool supportsScrollEdge() const override - { - return m_supportsScrollEdge.avail && m_supportsScrollEdge.val; - } - bool supportsScrollOnButtonDown() const override - { - return m_supportsScrollOnButtonDown.avail && m_supportsScrollOnButtonDown.val; - } - // - // click method - bool supportsClickMethodAreas() const override - { - return m_supportsClickMethodAreas.avail && m_supportsClickMethodAreas.val; - } - bool supportsClickMethodClickfinger() const override - { - return m_supportsClickMethodClickfinger.avail && m_supportsClickMethodClickfinger.val; - } - - bool supportsScrollFactor() const override - { - return false; - } - - // Tapping - Prop m_lrmTapButtonMapEnabledByDefault = Prop("lrmTapButtonMapEnabledByDefault"); - Prop m_lrmTapButtonMap = Prop("lrmTapButtonMap"); - // - // advanced - Prop m_disableEventsOnExternalMouse = Prop("disableEventsOnExternalMouse"); - Prop m_disableEventsOnExternalMouseDefault = Prop("disableEventsOnExternalMouseDefault"); - - QString m_name; -}; - -#endif // LIBINPUTTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp deleted file mode 100644 index c8acf79..0000000 --- a/settings-daemon/touchpad/x11/propertyinfo.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include -#include - -#include "propertyinfo.h" - -#include -#include -#include - -void XDeleter(void *p) -{ - if (p) { - XFree(p); - } -} - -PropertyInfo::PropertyInfo() - : type(0) - , format(0) - , nitems(0) - , f(nullptr) - , i(nullptr) - , b(nullptr) - , display(nullptr) - , device(0) - , prop(0) -{ -} - -PropertyInfo::PropertyInfo(Display *display, int device, Atom prop, Atom floatType) - : type(0) - , format(0) - , nitems(0) - , f(nullptr) - , i(nullptr) - , b(nullptr) - , display(display) - , device(device) - , prop(prop) -{ - unsigned char *dataPtr = nullptr; - unsigned long bytes_after; - XIGetProperty(display, device, prop, 0, 1000, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &dataPtr); - data = QSharedPointer(dataPtr, XDeleter); - - if (format == CHAR_BIT && type == XA_INTEGER) { - b = reinterpret_cast(dataPtr); - } - if (format == sizeof(int) * CHAR_BIT && (type == XA_INTEGER || type == XA_CARDINAL)) { - i = reinterpret_cast(dataPtr); - } - if (format == sizeof(float) * CHAR_BIT && floatType && type == floatType) { - f = reinterpret_cast(dataPtr); - } -} - -QVariant PropertyInfo::value(unsigned offset) const -{ - QVariant v; - if (offset >= nitems) { - return v; - } - - if (b) { - v = QVariant(static_cast(b[offset])); - } - if (i) { - v = QVariant(i[offset]); - } - if (f) { - v = QVariant(f[offset]); - } - - return v; -} - -void PropertyInfo::set() -{ - XIChangeProperty(display, device, prop, type, format, XIPropModeReplace, data.data(), nitems); -} diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h deleted file mode 100644 index 37e60e5..0000000 --- a/settings-daemon/touchpad/x11/propertyinfo.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef PROPERTYINFO_H -#define PROPERTYINFO_H - -#include -#include -#include - -void XDeleter(void *p); - -struct PropertyInfo { - Atom type; - int format; - QSharedPointer data; - unsigned long nitems; - - float *f; - int *i; - char *b; - - Display *display; - int device; - Atom prop; - - PropertyInfo(); - PropertyInfo(Display *display, int device, Atom prop, Atom floatType); - QVariant value(unsigned offset) const; - - void set(); -}; - -#endif // PROPERTYINFO_H diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp deleted file mode 100644 index 37d60aa..0000000 --- a/settings-daemon/touchpad/x11/synapticstouchpad.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - SPDX-FileContributor: 2002-2005, 2007 Peter Osterlund - - SPDX-License-Identifier: GPL-2.0-or-later AND LicenseRef-synaptics -*/ - -#include -#include - -#include "synapticstouchpad.h" - -#include -#include -#include - -#define SYN_MAX_BUTTONS 12 - -const struct Parameter synapticsProperties[] = { - {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0}, - {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, - {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, - {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, - {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, - {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, - {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0}, - {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0}, - {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1}, - {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0}, - {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2}, - {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, - {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32, 0}, - {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, - {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, - {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, - {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, - {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, - {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, - {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, - {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 0}, - {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 1}, - {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0}, - {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1}, - {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2}, - /*{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},*/ - {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0}, - {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0}, - {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0}, - {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 1}, - {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 2}, - {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 3}, - {"OneFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4}, - {"TwoFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5}, - {"ThreeFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6}, - {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 0}, - {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 1}, - {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 2}, - {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0}, - {"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0}, - {"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0}, - {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0}, - {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0}, - {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1}, - {"CoastingSpeed", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 0}, - {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 1}, - {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0}, - {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1}, - {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 0}, - {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 1}, - {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0}, - {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0}, - {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0}, - {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1}, - {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2}, - {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3}, - {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 0}, - {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 1}, - {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0}, - {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0}, - {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1}, - {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2}, - {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3}, - {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4}, - {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5}, - {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6}, - {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7}, - {NULL, PT_INT, 0, 0, nullptr, 0, 0}, -}; - -SynapticsTouchpad::SynapticsTouchpad(Display *display, int deviceId) - : XlibTouchpad(display, deviceId) - , m_resX(1) - , m_resY(1) -{ - m_capsAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); - m_touchpadOffAtom.intern(m_connection, SYNAPTICS_PROP_OFF); - XcbAtom resolutionAtom(m_connection, SYNAPTICS_PROP_RESOLUTION); - XcbAtom edgesAtom(m_connection, SYNAPTICS_PROP_EDGES); - - loadSupportedProperties(synapticsProperties); - - m_toRadians.append("CircScrollDelta"); - - PropertyInfo edges(m_display, m_deviceId, edgesAtom, 0); - if (edges.i && edges.nitems == 4) { - int w = qAbs(edges.i[1] - edges.i[0]); - int h = qAbs(edges.i[3] - edges.i[2]); - m_resX = w / 90; - m_resY = h / 50; - qDebug() << "Width: " << w << " height: " << h; - qDebug() << "Approx. resX: " << m_resX << " resY: " << m_resY; - } - - PropertyInfo resolution(m_display, m_deviceId, resolutionAtom, 0); - if (resolution.i && resolution.nitems == 2 && resolution.i[0] > 1 && resolution.i[1] > 1) { - m_resY = qMin(static_cast(resolution.i[0]), static_cast(INT_MAX)); - m_resX = qMin(static_cast(resolution.i[1]), static_cast(INT_MAX)); - qDebug() << "Touchpad resolution: x: " << m_resX << " y: " << m_resY; - } - - m_scaleByResX.append("HorizScrollDelta"); - m_scaleByResY.append("VertScrollDelta"); - m_scaleByResX.append("MaxTapMove"); - m_scaleByResY.append("MaxTapMove"); - - m_resX = qMax(10, m_resX); - m_resY = qMax(10, m_resY); - qDebug() << "Final resolution x:" << m_resX << " y:" << m_resY; - m_negate["HorizScrollDelta"] = "InvertHorizScroll"; - m_negate["VertScrollDelta"] = "InvertVertScroll"; - m_supported.append(m_negate.values()); - m_supported.append("Coasting"); - - PropertyInfo caps(m_display, m_deviceId, m_capsAtom.atom(), 0); - if (!caps.b) { - return; - } - - enum TouchpadCapabilitiy { - TouchpadHasLeftButton, - TouchpadHasMiddleButton, - TouchpadHasRightButton, - TouchpadTwoFingerDetect, - TouchpadThreeFingerDetect, - TouchpadPressureDetect, - TouchpadPalmDetect, - TouchpadCapsCount, - }; - - QVector cap(TouchpadCapsCount, false); - std::copy(caps.b, caps.b + qMin(cap.size(), static_cast(caps.nitems)), cap.begin()); - - if (!cap[TouchpadTwoFingerDetect]) { - m_supported.removeAll("HorizTwoFingerScroll"); - m_supported.removeAll("VertTwoFingerScroll"); - m_supported.removeAll("TwoFingerTapButton"); - } - - if (!cap[TouchpadThreeFingerDetect]) { - m_supported.removeAll("ThreeFingerTapButton"); - } - - if (!cap[TouchpadPressureDetect]) { - m_supported.removeAll("FingerHigh"); - m_supported.removeAll("FingerLow"); - - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("PressureMotionMinZ"); - m_supported.removeAll("PressureMotionMinFactor"); - m_supported.removeAll("PressureMotionMaxZ"); - m_supported.removeAll("PressureMotionMaxFactor"); - m_supported.removeAll("EmulateTwoFingerMinZ"); - } - - if (!cap[TouchpadPalmDetect]) { - m_supported.removeAll("PalmDetect"); - m_supported.removeAll("PalmMinWidth"); - m_supported.removeAll("PalmMinZ"); - m_supported.removeAll("EmulateTwoFingerMinW"); - } - - for (QMap::Iterator i = m_negate.begin(); i != m_negate.end(); ++i) { - if (!m_supported.contains(i.key())) { - m_supported.removeAll(i.value()); - } - } - - m_paramList = synapticsProperties; -} - -void SynapticsTouchpad::setTouchpadOff(int touchpadOff) -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - if (off.b && *(off.b) != touchpadOff) { - *(off.b) = touchpadOff; - off.set(); - } - - flush(); -} - -int SynapticsTouchpad::touchpadOff() -{ - PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); - return off.value(0).toInt(); -} - -XcbAtom &SynapticsTouchpad::touchpadOffAtom() -{ - return m_touchpadOffAtom; -} - -double SynapticsTouchpad::getPropertyScale(const QString &name) const -{ - if (m_scaleByResX.contains(name) && m_scaleByResY.contains(name)) { - return std::sqrt(static_cast(m_resX) * m_resX + static_cast(m_resY) * m_resY); - } else if (m_scaleByResX.contains(name)) { - return m_resX; - } else if (m_scaleByResY.contains(name)) { - return m_resY; - } else if (m_toRadians.contains(name)) { - return M_PI_4 / 45.0; - } - return 1.0; -} diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.h b/settings-daemon/touchpad/x11/synapticstouchpad.h deleted file mode 100644 index c503ce1..0000000 --- a/settings-daemon/touchpad/x11/synapticstouchpad.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - SPDX-FileCopyrightText: 2015 Weng Xuetian - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef SYNAPTICSTOUCHPAD_H -#define SYNAPTICSTOUCHPAD_H - -#include "xcbatom.h" -#include "xlibtouchpad.h" - -class SynapticsTouchpad : public QObject, public XlibTouchpad -{ - Q_OBJECT - -public: - SynapticsTouchpad(Display *display, int deviceId); - - void setTouchpadOff(int touchpadOff) override; - int touchpadOff() override; - - XcbAtom &touchpadOffAtom() override; - -protected: - double getPropertyScale(const QString &name) const override; - -private: - XcbAtom m_capsAtom, m_touchpadOffAtom; - int m_resX, m_resY; - QStringList m_scaleByResX, m_scaleByResY, m_toRadians; -}; - -#endif // SYNAPTICSTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/xcbatom.cpp b/settings-daemon/touchpad/x11/xcbatom.cpp deleted file mode 100644 index c48f9d2..0000000 --- a/settings-daemon/touchpad/x11/xcbatom.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xcbatom.h" - -#include -#include - -XcbAtom::XcbAtom() - : m_connection(nullptr) - , m_reply(nullptr) - , m_fetched(false) -{ -} - -XcbAtom::XcbAtom(xcb_connection_t *c, const char *name, bool onlyIfExists) - : m_reply(nullptr) - , m_fetched(false) -{ - intern(c, name, onlyIfExists); -} - -void XcbAtom::intern(xcb_connection_t *c, const char *name, bool onlyIfExists) -{ - m_connection = c; - m_cookie = xcb_intern_atom(c, onlyIfExists, std::strlen(name), name); -} - -XcbAtom::~XcbAtom() -{ - std::free(m_reply); -} - -xcb_atom_t XcbAtom::atom() -{ - if (!m_fetched) { - m_fetched = true; - m_reply = xcb_intern_atom_reply(m_connection, m_cookie, nullptr); - } - if (m_reply) { - return m_reply->atom; - } else { - return 0; - } -} diff --git a/settings-daemon/touchpad/x11/xcbatom.h b/settings-daemon/touchpad/x11/xcbatom.h deleted file mode 100644 index e3a8914..0000000 --- a/settings-daemon/touchpad/x11/xcbatom.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XCBATOM_H -#define XCBATOM_H - -#include - -class XcbAtom -{ -public: - XcbAtom(); - XcbAtom(xcb_connection_t *, const char *name, bool onlyIfExists = true); - ~XcbAtom(); - - void intern(xcb_connection_t *, const char *name, bool onlyIfExists = true); - xcb_atom_t atom(); - operator xcb_atom_t() - { - return atom(); - } - -private: - XcbAtom(const XcbAtom &); - XcbAtom &operator=(const XcbAtom &); - - xcb_connection_t *m_connection; - xcb_intern_atom_cookie_t m_cookie; - xcb_intern_atom_reply_t *m_reply; - bool m_fetched; -}; - -#endif // XCBATOM_H diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp deleted file mode 100644 index 0824bbe..0000000 --- a/settings-daemon/touchpad/x11/xlibbackend.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include -#include - -#include - -#include - -// Includes are ordered this way because of #defines in Xorg's headers -#include "xlibbackend.h" // krazy:exclude=includes -#include "xlibnotifications.h" // krazy:exclude=includes -#include "xrecordkeyboardmonitor.h" // krazy:exclude=includes - -#include -#include -#include -#include - -#include -#include - -struct DeviceListDeleter { - static void cleanup(XDeviceInfo *p) - { - if (p) { - XFreeDeviceList(p); - } - } -}; - -void XlibBackend::XDisplayCleanup::cleanup(Display *p) -{ - if (p) { - XCloseDisplay(p); - } -} - -XlibBackend *XlibBackend::initialize(QObject *parent) -{ - XlibBackend *backend = new XlibBackend(parent); - if (!backend->m_display) { - delete backend; - return nullptr; - } - return backend; -} - -XlibBackend::~XlibBackend() -{ -} - -XlibBackend::XlibBackend(QObject *parent) - : QObject(parent) - , m_display(XOpenDisplay(nullptr)) - , m_connection(nullptr) -{ - if (m_display) { - m_connection = XGetXCBConnection(m_display.data()); - } - - if (!m_connection) { - m_errorString = "Cannot connect to X server"; - return; - } - - m_mouseAtom.intern(m_connection, XI_MOUSE); - m_keyboardAtom.intern(m_connection, XI_KEYBOARD); - m_touchpadAtom.intern(m_connection, XI_TOUCHPAD); - m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); - - m_synapticsIdentifierAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); - m_libinputIdentifierAtom.intern(m_connection, "libinput Send Events Modes Available"); - - m_device.reset(findTouchpad()); - if (!m_device) { - m_errorString = "No touchpad found"; - } -} - -XlibTouchpad *XlibBackend::findTouchpad() -{ - int nDevices = 0; - QScopedPointer deviceInfo(XListInputDevices(m_display.data(), &nDevices)); - - for (XDeviceInfo *info = deviceInfo.data(); info < deviceInfo.data() + nDevices; info++) { - // Make sure device is touchpad - if (info->type != m_touchpadAtom.atom()) { - continue; - } - int nProperties = 0; - QSharedPointer properties(XIListProperties(m_display.data(), info->id, &nProperties), XDeleter); - - Atom *atom = properties.data(), *atomEnd = properties.data() + nProperties; - for (; atom != atomEnd; atom++) { - - if (*atom == m_libinputIdentifierAtom.atom()) { - // setMode(TouchpadInputBackendMode::XLibinput); - return new LibinputTouchpad(m_display.data(), info->id); - } - - if (*atom == m_synapticsIdentifierAtom.atom()) { - // setMode(TouchpadInputBackendMode::XSynaptics); - return new SynapticsTouchpad(m_display.data(), info->id); - } - } - } - - return nullptr; -} - -bool XlibBackend::applyConfig(const QVariantHash &p) -{ - if (!m_device) { - return false; - } - - bool success = m_device->applyConfig(p); - if (!success) { - m_errorString = "Cannot apply touchpad configuration"; - } - - return success; -} - -bool XlibBackend::applyConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->applyConfig(); - if (!success) { - m_errorString = "Cannot apply touchpad configuration"; - } - - return success; -} - -bool XlibBackend::getConfig(QVariantHash &p) -{ - if (!m_device) { - return false; - } - - bool success = m_device->getConfig(p); - if (!success) { - m_errorString = "Cannot read touchpad configuration"; - } - return success; -} - -bool XlibBackend::getConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->getConfig(); - if (!success) { - m_errorString = "Cannot read touchpad configuration"; - } - return success; -} - -bool XlibBackend::getDefaultConfig() -{ - if (!m_device) { - return false; - } - - bool success = m_device->getDefaultConfig(); - if (!success) { - m_errorString = "Cannot read default touchpad configuration"; - } - return success; -} - -bool XlibBackend::isChangedConfig() const -{ - if (!m_device) { - return false; - } - - return m_device->isChangedConfig(); -} - -void XlibBackend::setTouchpadEnabled(bool enable) -{ - if (!m_device) { - return; - } - - m_device->setEnabled(enable); - - // FIXME? This should not be needed, m_notifications should trigger - // a propertyChanged signal when we enable/disable the touchpad, - // that will Q_EMIT touchpadStateChanged, but for some reason - // XlibNotifications is not getting the property change events - // so we just Q_EMIT touchpadStateChanged from here as a workaround - Q_EMIT touchpadStateChanged(); -} - -bool XlibBackend::tapToClick() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return false; - - return object->isTapToClick(); -} - -void XlibBackend::setTapToClick(bool enabled) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setTapToClick(enabled); -} - -bool XlibBackend::naturalScroll() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return false; - - return object->isNaturalScroll(); -} - -void XlibBackend::setNaturalScroll(bool value) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setNaturalScroll(value); -} - -qreal XlibBackend::pointerAcceleration() -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return 1; - - return object->pointerAcceleration(); -} - -void XlibBackend::setPointerAcceleration(qreal value) -{ - LibinputTouchpad *object = dynamic_cast(m_device.data()); - - if (!object) - return; - - object->setPointerAcceleration(value); -} - -void XlibBackend::setTouchpadOff(XlibBackend::TouchpadOffState state) -{ - if (!m_device) { - return; - } - - int touchpadOff = 0; - switch (state) { - case TouchpadEnabled: - touchpadOff = 0; - break; - case TouchpadFullyDisabled: - touchpadOff = 1; - break; - case TouchpadTapAndScrollDisabled: - touchpadOff = 2; - break; - default: - qCritical() << "Unknown TouchpadOffState" << state; - return; - } - - m_device->setTouchpadOff(touchpadOff); -} - -bool XlibBackend::isTouchpadAvailable() -{ - return m_device; -} - -bool XlibBackend::isTouchpadEnabled() -{ - if (!m_device) { - return false; - } - - return m_device->enabled(); -} - -XlibBackend::TouchpadOffState XlibBackend::getTouchpadOff() -{ - if (!m_device) { - return TouchpadFullyDisabled; - } - int value = m_device->touchpadOff(); - switch (value) { - case 0: - return TouchpadEnabled; - case 1: - return TouchpadFullyDisabled; - case 2: - return TouchpadTapAndScrollDisabled; - default: - qCritical() << "Unknown TouchpadOff value" << value; - return TouchpadFullyDisabled; - } -} - -void XlibBackend::touchpadDetached() -{ - qWarning() << "Touchpad detached"; - m_device.reset(); - Q_EMIT touchpadReset(); -} - -void XlibBackend::devicePlugged(int device) -{ - if (!m_device) { - m_device.reset(findTouchpad()); - if (m_device) { - qWarning() << "Touchpad reset"; - m_notifications.reset(); - watchForEvents(m_keyboard); - Q_EMIT touchpadReset(); - } - } - if (!m_device || device != m_device->deviceId()) { - Q_EMIT mousesChanged(); - } -} - -void XlibBackend::propertyChanged(xcb_atom_t prop) -{ - if ((m_device && prop == m_device->touchpadOffAtom().atom()) || prop == m_enabledAtom.atom()) { - Q_EMIT touchpadStateChanged(); - } -} - -QStringList XlibBackend::listMouses(const QStringList &blacklist) -{ - int nDevices = 0; - QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); - QStringList list; - for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { - if (m_device && i->id == static_cast(m_device->deviceId())) { - continue; - } - if (i->use != IsXExtensionPointer && i->use != IsXPointer) { - continue; - } - // type = KEYBOARD && use = Pointer means usb receiver for both keyboard - // and mouse - if (i->type != m_mouseAtom.atom() && i->type != m_keyboardAtom.atom()) { - continue; - } - QString name(i->name); - if (blacklist.contains(name, Qt::CaseInsensitive)) { - continue; - } - PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); - if (enabled.value(0) == false) { - continue; - } - list.append(name); - } - - return list; -} - -QVector XlibBackend::getDevices() const -{ - QVector touchpads; - - LibinputTouchpad *libinputtouchpad = dynamic_cast(m_device.data()); - if (libinputtouchpad) { - touchpads.push_back(libinputtouchpad); - } - - SynapticsTouchpad *synaptics = dynamic_cast(m_device.data()); - if (synaptics) { - touchpads.push_back(synaptics); - } - - return touchpads; -} - -void XlibBackend::watchForEvents(bool keyboard) -{ - if (!m_notifications) { - m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); - connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); - connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); - connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); - } - - if (keyboard == !m_keyboard.isNull()) { - return; - } - - if (!keyboard) { - m_keyboard.reset(); - return; - } - - m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); - connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); - connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); -} diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h deleted file mode 100644 index c4af163..0000000 --- a/settings-daemon/touchpad/x11/xlibbackend.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBBACKEND_H -#define XLIBBACKEND_H - -#include -#include -#include -#include -#include -#include -#include - -#include "libinputtouchpad.h" -#include "synapticstouchpad.h" -#include "xlibtouchpad.h" - -#include - -#include "propertyinfo.h" -#include "xcbatom.h" - -class XlibTouchpad; -class XlibNotifications; -class XRecordKeyboardMonitor; - -class XlibBackend : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int touchpadCount READ touchpadCount CONSTANT) - -public: - enum TouchpadOffState { - TouchpadEnabled, - TouchpadTapAndScrollDisabled, - TouchpadFullyDisabled, - }; - - static XlibBackend *initialize(QObject *parent = nullptr); - ~XlibBackend(); - - bool applyConfig(const QVariantHash &); - bool applyConfig(); - bool getConfig(QVariantHash &); - bool getConfig(); - bool getDefaultConfig(); - bool isChangedConfig() const; - QStringList supportedParameters() const - { - return m_device ? m_device->supportedParameters() : QStringList(); - } - QString errorString() const - { - return m_errorString; - } - int touchpadCount() const - { - return m_device ? 1 : 0; - } - - void setTouchpadOff(TouchpadOffState); - TouchpadOffState getTouchpadOff(); - - bool isTouchpadAvailable(); - bool isTouchpadEnabled(); - void setTouchpadEnabled(bool); - - bool tapToClick(); - void setTapToClick(bool enabled); - - bool naturalScroll(); - void setNaturalScroll(bool value); - - qreal pointerAcceleration(); - void setPointerAcceleration(qreal value); - - void watchForEvents(bool keyboard); - - QStringList listMouses(const QStringList &blacklist); - QVector getDevices() const; - -signals: - void touchpadStateChanged(); - void mousesChanged(); - void touchpadReset(); - void keyboardActivityStarted(); - void keyboardActivityFinished(); - - void touchpadAdded(bool success); - void touchpadRemoved(int index); - -private Q_SLOTS: - void propertyChanged(xcb_atom_t); - void touchpadDetached(); - void devicePlugged(int); - -protected: - explicit XlibBackend(QObject *parent); - - struct XDisplayCleanup { - static void cleanup(Display *); - }; - - QScopedPointer m_display; - xcb_connection_t *m_connection; - - XcbAtom m_enabledAtom, m_mouseAtom, m_keyboardAtom, m_touchpadAtom; - XcbAtom m_synapticsIdentifierAtom; - XcbAtom m_libinputIdentifierAtom; - - XlibTouchpad *findTouchpad(); - QScopedPointer m_device; - - QString m_errorString; - QScopedPointer m_notifications; - QScopedPointer m_keyboard; -}; - -#endif // XLIBBACKEND_H diff --git a/settings-daemon/touchpad/x11/xlibnotifications.cpp b/settings-daemon/touchpad/x11/xlibnotifications.cpp deleted file mode 100644 index 13037c2..0000000 --- a/settings-daemon/touchpad/x11/xlibnotifications.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xlibnotifications.h" - -#include - -#include -#include -#include -#include - -XlibNotifications::XlibNotifications(Display *display, int device) - : m_display(display) - , m_device(device) -{ - m_connection = XGetXCBConnection(display); - - m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); - - xcb_query_extension_cookie_t inputExtCookie = xcb_query_extension(m_connection, std::strlen(INAME), INAME); - QScopedPointer inputExt(xcb_query_extension_reply(m_connection, inputExtCookie, nullptr)); - if (!inputExt) { - return; - } - m_inputOpcode = inputExt->major_opcode; - - const xcb_setup_t *setup = xcb_get_setup(m_connection); - xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup); - xcb_screen_t *screen = iter.data; - - m_inputWindow = xcb_generate_id(m_connection); - xcb_create_window(m_connection, 0, m_inputWindow, screen->root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, 0, 0, nullptr); - xcb_flush(m_connection); - - XIEventMask masks[2]; - - unsigned char touchpadMask[] = {0, 0, 0, 0}; - masks[0].deviceid = device; - masks[0].mask = touchpadMask; - masks[0].mask_len = sizeof(touchpadMask); - XISetMask(touchpadMask, XI_PropertyEvent); - - unsigned char allMask[] = {0, 0, 0, 0}; - masks[1].deviceid = XIAllDevices; - masks[1].mask = allMask; - masks[1].mask_len = sizeof(allMask); - XISetMask(allMask, XI_HierarchyChanged); - - XISelectEvents(display, XDefaultRootWindow(display), masks, sizeof(masks) / sizeof(XIEventMask)); - XFlush(display); - - connect(m_notifier, SIGNAL(activated(int)), SLOT(processEvents())); - m_notifier->setEnabled(true); -} - -void XlibNotifications::processEvents() -{ - while (XPending(m_display)) { - XEvent event; - XNextEvent(m_display, &event); - processEvent(&event); - } -} - -struct XEventDataDeleter { - XEventDataDeleter(Display *display, XGenericEventCookie *cookie) - : m_display(display) - , m_cookie(cookie) - { - XGetEventData(m_display, m_cookie); - } - - ~XEventDataDeleter() - { - if (m_cookie->data) { - XFreeEventData(m_display, m_cookie); - } - } - - Display *m_display; - XGenericEventCookie *m_cookie; -}; - -void XlibNotifications::processEvent(XEvent *event) -{ - if (event->xcookie.type != GenericEvent) { - return; - } - if (event->xcookie.extension != m_inputOpcode) { - return; - } - - if (event->xcookie.evtype == XI_PropertyEvent) { - XEventDataDeleter helper(m_display, &event->xcookie); - if (!event->xcookie.data) { - return; - } - - XIPropertyEvent *propEvent = reinterpret_cast(event->xcookie.data); - Q_EMIT propertyChanged(propEvent->property); - } else if (event->xcookie.evtype == XI_HierarchyChanged) { - XEventDataDeleter helper(m_display, &event->xcookie); - if (!event->xcookie.data) { - return; - } - - XIHierarchyEvent *hierarchyEvent = reinterpret_cast(event->xcookie.data); - for (uint16_t i = 0; i < hierarchyEvent->num_info; i++) { - if (hierarchyEvent->info[i].deviceid == m_device) { - if (hierarchyEvent->info[i].flags & XISlaveRemoved) { - Q_EMIT touchpadDetached(); - return; - } - } - if (hierarchyEvent->info[i].use != XISlavePointer) { - continue; - } - if (hierarchyEvent->info[i].flags & (XIDeviceEnabled | XIDeviceDisabled)) { - Q_EMIT devicePlugged(hierarchyEvent->info[i].deviceid); - } - } - } -} - -XlibNotifications::~XlibNotifications() -{ - xcb_destroy_window(m_connection, m_inputWindow); - xcb_flush(m_connection); -} - -#include "moc_xlibnotifications.cpp" diff --git a/settings-daemon/touchpad/x11/xlibnotifications.h b/settings-daemon/touchpad/x11/xlibnotifications.h deleted file mode 100644 index 5ca6f1d..0000000 --- a/settings-daemon/touchpad/x11/xlibnotifications.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBNOTIFICATIONS_H -#define XLIBNOTIFICATIONS_H - -#include - -#include -#include - -class XlibNotifications : public QObject -{ - Q_OBJECT -public: - XlibNotifications(Display *display, int device); - ~XlibNotifications(); - -Q_SIGNALS: - void propertyChanged(xcb_atom_t); - void devicePlugged(int); - void touchpadDetached(); - -private Q_SLOTS: - void processEvents(); - -private: - void processEvent(XEvent *); - - Display *m_display; - xcb_connection_t *m_connection; - QSocketNotifier *m_notifier; - xcb_window_t m_inputWindow; - uint8_t m_inputOpcode; - int m_device; -}; - -#endif // XLIBNOTIFICATIONS_H diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.cpp b/settings-daemon/touchpad/x11/xlibtouchpad.cpp deleted file mode 100644 index 7581c9a..0000000 --- a/settings-daemon/touchpad/x11/xlibtouchpad.cpp +++ /dev/null @@ -1,257 +0,0 @@ -#include - -#include "xlibtouchpad.h" -#include -#include -#include -#include - -static QVariant negateVariant(const QVariant &value) -{ - if (value.type() == QVariant::Double) { - return QVariant(-value.toDouble()); - } else if (value.type() == QVariant::Int) { - return QVariant(-value.toInt()); - } - return value; -} - -XlibTouchpad::XlibTouchpad(Display *display, int deviceId) - : m_display(display) - , m_connection(XGetXCBConnection(display)) - , m_deviceId(deviceId) -{ - m_floatType.intern(m_connection, "FLOAT"); - m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); -} - -bool XlibTouchpad::applyConfig(const QVariantHash &p) -{ - m_props.clear(); - - bool error = false; - for (const QString &name : qAsConst(m_supported)) { - QVariantHash::ConstIterator i = p.find(name); - if (i == p.end()) { - continue; - } - const Parameter *par = findParameter(name); - if (par) { - QVariant value(i.value()); - - double k = getPropertyScale(name); - if (k != 1.0) { - bool ok = false; - value = QVariant(value.toDouble(&ok) * k); - if (!ok) { - error = true; - continue; - } - } - - if (m_negate.contains(name)) { - QVariantHash::ConstIterator i = p.find(m_negate[name]); - if (i != p.end() && i.value().toBool()) { - value = negateVariant(value); - } - } - - if (name == "CoastingSpeed") { - QVariantHash::ConstIterator coastingEnabled = p.find("Coasting"); - if (coastingEnabled != p.end() && !coastingEnabled.value().toBool()) { - value = QVariant(0); - } - } - - if (!setParameter(par, value)) { - error = true; - } - } - } - - flush(); - - return !error; -} - -bool XlibTouchpad::getConfig(QVariantHash &p) -{ - if (m_supported.isEmpty()) { - return false; - } - - m_props.clear(); - - bool error = false; - for (const QString &name : qAsConst(m_supported)) { - const Parameter *par = findParameter(name); - if (!par) { - continue; - } - - QVariant value(getParameter(par)); - if (!value.isValid()) { - error = true; - continue; - } - - double k = getPropertyScale(name); - if (k != 1.0) { - bool ok = false; - value = QVariant(value.toDouble(&ok) / k); - if (!ok) { - error = true; - continue; - } - } - - if (m_negate.contains(name)) { - bool negative = value.toDouble() < 0.0; - p[m_negate[name]] = QVariant(negative); - if (negative) { - value = negateVariant(value); - } - } - - if (name == "CoastingSpeed") { - bool coasting = value.toDouble() != 0.0; - p["Coasting"] = QVariant(coasting); - if (!coasting) { - continue; - } - } - - p[name] = value; - } - - return !error; -} - -void XlibTouchpad::loadSupportedProperties(const Parameter *props) -{ - m_paramList = props; - for (const Parameter *param = props; param->name; param++) { - QLatin1String name(param->prop_name); - - if (!m_atoms.contains(name)) { - m_atoms.insert(name, QSharedPointer(new XcbAtom(m_connection, param->prop_name))); - } - } - - for (const Parameter *p = props; p->name; p++) { - if (getParameter(p).isValid()) { - m_supported.append(p->name); - } - } -} - -QVariant XlibTouchpad::getParameter(const Parameter *par) -{ - PropertyInfo *p = getDevProperty(QLatin1String(par->prop_name)); - if (!p || par->prop_offset >= p->nitems) { - return QVariant(); - } - - return p->value(par->prop_offset); -} - -void XlibTouchpad::flush() -{ - for (const QLatin1String &name : qAsConst(m_changed)) { - m_props[name].set(); - } - m_changed.clear(); - - XFlush(m_display); -} - -double XlibTouchpad::getPropertyScale(const QString &name) const -{ - Q_UNUSED(name); - return 1.0; -} - -PropertyInfo *XlibTouchpad::getDevProperty(const QLatin1String &propName) -{ - if (m_props.contains(propName)) { - return &m_props[propName]; - } - - if (!m_atoms.contains(propName) || !m_atoms[propName]) { - return nullptr; - } - - xcb_atom_t prop = m_atoms[propName]->atom(); - if (!prop) { - return nullptr; - } - - PropertyInfo p(m_display, m_deviceId, prop, m_floatType.atom()); - if (!p.b && !p.f && !p.i) { - return nullptr; - } - return &m_props.insert(propName, p).value(); -} - -bool XlibTouchpad::setParameter(const Parameter *par, const QVariant &value) -{ - QLatin1String propName(par->prop_name); - PropertyInfo *p = getDevProperty(propName); - if (!p || par->prop_offset >= p->nitems) { - return false; - } - - QVariant converted(value); - QVariant::Type convType = QVariant::Int; - if (p->f) { - convType = QVariant::Double; - } else if (value.type() == QVariant::Double) { - converted = QVariant(qRound(static_cast(value.toDouble()))); - } - - if (!converted.convert(convType)) { - return false; - } - - if (converted == p->value(par->prop_offset)) { - return true; - } - - if (p->b) { - p->b[par->prop_offset] = static_cast(converted.toInt()); - } else if (p->i) { - p->i[par->prop_offset] = converted.toInt(); - } else if (p->f) { - p->f[par->prop_offset] = converted.toDouble(); - } - - m_changed.insert(propName); - return true; -} - -void XlibTouchpad::setEnabled(bool enable) -{ - PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); - if (enabled.b && *(enabled.b) != enable) { - *(enabled.b) = enable; - enabled.set(); - } - - flush(); -} - -bool XlibTouchpad::enabled() -{ - PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); - return enabled.value(0).toBool(); -} - -const Parameter *XlibTouchpad::findParameter(const QString &name) -{ - for (const Parameter *par = m_paramList; par->name; par++) { - if (name == par->name) { - return par; - } - } - return nullptr; -} diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.h b/settings-daemon/touchpad/x11/xlibtouchpad.h deleted file mode 100644 index f20bb66..0000000 --- a/settings-daemon/touchpad/x11/xlibtouchpad.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - SPDX-FileCopyrightText: 2015 Weng Xuetian - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XLIBTOUCHPAD_H -#define XLIBTOUCHPAD_H - -#include -#include -#include - -#include "propertyinfo.h" -#include "xcbatom.h" -#include - -enum ParaType { - PT_INT, - PT_BOOL, - PT_DOUBLE, -}; - -struct Parameter { - const char *name; /* Name of parameter */ - enum ParaType type; /* Type of parameter */ - double min_val; /* Minimum allowed value */ - double max_val; /* Maximum allowed value */ - const char *prop_name; /* Property name */ - int prop_format; /* Property format (0 for floats) */ - unsigned prop_offset; /* Offset inside property */ -}; - -class XlibTouchpad -{ -public: - XlibTouchpad(Display *display, int deviceId); - virtual ~XlibTouchpad() - { - } - - int deviceId() - { - return m_deviceId; - } - const QStringList &supportedParameters() const - { - return m_supported; - } - bool applyConfig(const QVariantHash &p); - bool getConfig(QVariantHash &p); - virtual bool getConfig() - { - return false; - } - virtual bool applyConfig() - { - return false; - } - virtual bool getDefaultConfig() - { - return false; - } - virtual bool isChangedConfig() - { - return false; - } - void setEnabled(bool enable); - bool enabled(); - virtual void setTouchpadOff(int /*touchpadOff*/) - { - } - virtual int touchpadOff() = 0; - - virtual XcbAtom &touchpadOffAtom() = 0; - -protected: - void loadSupportedProperties(const Parameter *props); - bool setParameter(const struct Parameter *, const QVariant &); - QVariant getParameter(const struct Parameter *); - struct PropertyInfo *getDevProperty(const QLatin1String &propName); - void flush(); - virtual double getPropertyScale(const QString &name) const; - const Parameter *findParameter(const QString &name); - - Display *m_display; - xcb_connection_t *m_connection; - int m_deviceId; - - XcbAtom m_floatType, m_enabledAtom; - - QMap> m_atoms; - - QMap m_negate; - QMap m_props; - QSet m_changed; - QStringList m_supported; - const struct Parameter *m_paramList; -}; - -#endif diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp deleted file mode 100644 index c9fe99b..0000000 --- a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "xrecordkeyboardmonitor.h" - -#include -#include - -#include - -#include -#include - -XRecordKeyboardMonitor::XRecordKeyboardMonitor(Display *display) - : m_connection(xcb_connect(XDisplayString(display), nullptr)) - , m_modifiersPressed(0) - , m_keysPressed(0) -{ - if (!m_connection) { - return; - } - - xcb_get_modifier_mapping_cookie_t modmapCookie = xcb_get_modifier_mapping(m_connection); - - m_context = xcb_generate_id(m_connection); - xcb_record_range_t range; - memset(&range, 0, sizeof(range)); - range.device_events.first = XCB_KEY_PRESS; - range.device_events.last = XCB_KEY_RELEASE; - xcb_record_client_spec_t cs = XCB_RECORD_CS_ALL_CLIENTS; - xcb_record_create_context(m_connection, m_context, 0, 1, 1, &cs, &range); - xcb_flush(m_connection); - - QScopedPointer modmap(xcb_get_modifier_mapping_reply(m_connection, modmapCookie, nullptr)); - if (!modmap) { - return; - } - - int nModifiers = xcb_get_modifier_mapping_keycodes_length(modmap.data()); - xcb_keycode_t *modifiers = xcb_get_modifier_mapping_keycodes(modmap.data()); - m_modifier.fill(false, std::numeric_limits::max() + 1); - for (xcb_keycode_t *i = modifiers; i < modifiers + nModifiers; i++) { - m_modifier[*i] = true; - } - m_ignore.fill(false, std::numeric_limits::max() + 1); - for (xcb_keycode_t *i = modifiers; i < modifiers + modmap->keycodes_per_modifier; i++) { - m_ignore[*i] = true; - } - m_pressed.fill(false, std::numeric_limits::max() + 1); - - m_cookie = xcb_record_enable_context(m_connection, m_context); - xcb_flush(m_connection); - - m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); - connect(m_notifier, &QSocketNotifier::activated, this, &XRecordKeyboardMonitor::processNextReply); - m_notifier->setEnabled(true); -} - -XRecordKeyboardMonitor::~XRecordKeyboardMonitor() -{ - if (!m_connection) { - return; - } - - xcb_record_disable_context(m_connection, m_context); - xcb_record_free_context(m_connection, m_context); - xcb_disconnect(m_connection); -} - -void XRecordKeyboardMonitor::processNextReply() -{ - xcb_generic_event_t *event; - while ((event = xcb_poll_for_event(m_connection))) { - std::free(event); - } - - void *reply = nullptr; - xcb_generic_error_t *error = nullptr; - while (m_cookie.sequence && xcb_poll_for_reply(m_connection, m_cookie.sequence, &reply, &error)) { - // xcb_poll_for_reply may set both reply and error to null if connection has error. - // break if xcb_connection has error, no point to continue anyway. - if (xcb_connection_has_error(m_connection)) { - break; - } - - if (error) { - std::free(error); - break; - } - - if (!reply) { - continue; - } - - QScopedPointer data(reinterpret_cast(reply)); - process(data.data()); - } -} - -void XRecordKeyboardMonitor::process(xcb_record_enable_context_reply_t *reply) -{ - bool prevActivity = activity(); - - xcb_key_press_event_t *events = reinterpret_cast(xcb_record_enable_context_data(reply)); - int nEvents = xcb_record_enable_context_data_length(reply) / sizeof(xcb_key_press_event_t); - bool wasActivity = prevActivity; - for (xcb_key_press_event_t *e = events; e < events + nEvents; e++) { - if (e->response_type != XCB_KEY_PRESS && e->response_type != XCB_KEY_RELEASE) { - continue; - } - - if (m_ignore[e->detail]) { - continue; - } - - bool pressed = (e->response_type == XCB_KEY_PRESS); - if (m_pressed[e->detail] == pressed) { - continue; - } - m_pressed[e->detail] = pressed; - - int &counter = m_modifier[e->detail] ? m_modifiersPressed : m_keysPressed; - if (pressed) { - counter++; - } else { - counter--; - } - - wasActivity = wasActivity || activity(); - } - - if (!prevActivity && activity()) { - Q_EMIT keyboardActivityStarted(); - } else if (!activity() && wasActivity) { - Q_EMIT keyboardActivityFinished(); - } -} diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h deleted file mode 100644 index 6abec2f..0000000 --- a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - SPDX-FileCopyrightText: 2013 Alexander Mezin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef XRECORDKEYBOARDMONITOR_H -#define XRECORDKEYBOARDMONITOR_H - -#include -#include - -#include -#include - -class XRecordKeyboardMonitor : public QObject -{ - Q_OBJECT - -public: - XRecordKeyboardMonitor(Display *display); - ~XRecordKeyboardMonitor(); - -Q_SIGNALS: - void keyboardActivityStarted(); - void keyboardActivityFinished(); - -private Q_SLOTS: - void processNextReply(); - -private: - void process(xcb_record_enable_context_reply_t *reply); - bool activity() const - { - return m_keysPressed && !m_modifiersPressed; - } - - QSocketNotifier *m_notifier; - xcb_connection_t *m_connection; - xcb_record_context_t m_context; - xcb_record_enable_context_cookie_t m_cookie; - - QVector m_modifier, m_ignore, m_pressed; - int m_modifiersPressed, m_keysPressed; -}; - -#endif // XRECORDKEYBOARDMONITOR_H From 19129ac2fd27f6a9dd66ea9161f67663ee42f633 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:48:47 +0800 Subject: [PATCH 235/254] modified: settings-daemon/application.h --- settings-daemon/application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index b0659c6..73fbcfd 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -49,7 +49,7 @@ class Application : public QApplication UPowerManager *m_upowerManager; Language *m_language; Mouse *m_mouse; - TouchpadManager *m_touchpad; + // TouchpadManager *m_touchpad; DefaultApplications *m_defaultApps; // QTimer *m_kwinTimer; From 736fc3ea436b10eeefaa25e3560790bef5994828 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:50:41 +0800 Subject: [PATCH 236/254] modified: settings-daemon/mouse/x11libinputdummydevice.h --- settings-daemon/mouse/x11libinputdummydevice.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings-daemon/mouse/x11libinputdummydevice.h b/settings-daemon/mouse/x11libinputdummydevice.h index 1ad0c23..070f803 100755 --- a/settings-daemon/mouse/x11libinputdummydevice.h +++ b/settings-daemon/mouse/x11libinputdummydevice.h @@ -18,6 +18,8 @@ #include #include +#undef Bool + struct LibinputSettings; class X11LibinputDummyDevice : public QObject From a412c0cb7247306f8833db5c7c1cafd6109f6720 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 20:58:43 +0800 Subject: [PATCH 237/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index e959586..8438497 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -13,21 +13,21 @@ pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) file (GLOB_RECURSE SRCS - "*.cpp" - "*.h" - "theme/*.h" - "theme/*.cpp" - "brightness/*.h" - "brightness/*.cpp" - "brightness/*.c" - "battery/*.cpp" - "battery/*.h" - "language/*.cpp" - "language/*.h" - "dock/*.cpp" - "dock/*.h" - "mouse/*.h" - "mouse/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.c" + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.cpp" ) set(SOURCES ${SRCS}) @@ -56,6 +56,7 @@ qt_add_dbus_adaptor(DBUS_SOURCES # qt_add_dbus_adaptor(DBUS_SOURCES # touchpad/com.lingmo.Touchpad.xml # touchpad/touchpadmanager.h TouchpadManager) + set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 14ff625d8177c3164e08d775d8752c490b607662 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:06:41 +0800 Subject: [PATCH 238/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 8438497..98c6bb6 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -13,23 +13,24 @@ pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) file (GLOB_RECURSE SRCS - "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.c" - "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/language/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/language/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.cpp" + "*.cpp" + "*.h" + "theme/*.h" + "theme/*.cpp" + "brightness/*.h" + "brightness/*.cpp" + "brightness/*.c" + "battery/*.cpp" + "battery/*.h" + "language/*.cpp" + "language/*.h" + "dock/*.cpp" + "dock/*.h" + "mouse/*.h" + "mouse/*.cpp" ) +list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") set(SOURCES ${SRCS}) set(HEADERS "") set(FORMS "") @@ -56,7 +57,6 @@ qt_add_dbus_adaptor(DBUS_SOURCES # qt_add_dbus_adaptor(DBUS_SOURCES # touchpad/com.lingmo.Touchpad.xml # touchpad/touchpadmanager.h TouchpadManager) - set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 492971f64499877e8b0f3e1724fa62e8d301c6a8 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:08:45 +0800 Subject: [PATCH 239/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/application.cpp modified: settings-daemon/application.h --- settings-daemon/CMakeLists.txt | 10 +++++++--- settings-daemon/application.cpp | 2 +- settings-daemon/application.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 98c6bb6..01ff895 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -28,6 +28,10 @@ file (GLOB_RECURSE SRCS "dock/*.h" "mouse/*.h" "mouse/*.cpp" + "touchpad/*.h" + "touchpad/*.cpp" + "touchpad/x11/*.h" + "touchpad/x11/*.cpp" ) list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") @@ -54,9 +58,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/application.cpp b/settings-daemon/application.cpp index c98ff5f..9b3c544 100755 --- a/settings-daemon/application.cpp +++ b/settings-daemon/application.cpp @@ -43,7 +43,7 @@ Application::Application(int &argc, char **argv) , m_upowerManager(new UPowerManager(this)) , m_language(Language::self()) , m_mouse(new Mouse) - // , m_touchpad(new TouchpadManager) + , m_touchpad(new TouchpadManager) , m_defaultApps(new DefaultApplications) // , m_kwinTimer(new QTimer(this)) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index 73fbcfd..a0661e7 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -26,7 +26,7 @@ #include "battery/upowermanager.h" #include "language/language.h" #include "mouse/mousemanager.h" -// #include "touchpad/touchpadmanager.h" +#include "touchpad/touchpadmanager.h" #include "defaultapplications.h" #include @@ -49,7 +49,7 @@ class Application : public QApplication UPowerManager *m_upowerManager; Language *m_language; Mouse *m_mouse; - // TouchpadManager *m_touchpad; + TouchpadManager *m_touchpad; DefaultApplications *m_defaultApps; // QTimer *m_kwinTimer; From 13d8481d6b13a06dfcb5dd58c7b9cfc5791e3f4a Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:10:10 +0800 Subject: [PATCH 240/254] new file: settings-daemon/touchpad.zip new file: settings-daemon/touchpad/com.lingmo.Touchpad.xml new file: settings-daemon/touchpad/libinputcommon.cpp new file: settings-daemon/touchpad/libinputcommon.h new file: settings-daemon/touchpad/touchpadmanager.cpp new file: settings-daemon/touchpad/touchpadmanager.h new file: settings-daemon/touchpad/x11/libinputtouchpad.cpp new file: settings-daemon/touchpad/x11/libinputtouchpad.h new file: settings-daemon/touchpad/x11/propertyinfo.cpp new file: settings-daemon/touchpad/x11/propertyinfo.h new file: settings-daemon/touchpad/x11/synapticstouchpad.cpp new file: settings-daemon/touchpad/x11/synapticstouchpad.h new file: settings-daemon/touchpad/x11/xcbatom.cpp new file: settings-daemon/touchpad/x11/xcbatom.h new file: settings-daemon/touchpad/x11/xlibbackend.cpp new file: settings-daemon/touchpad/x11/xlibbackend.h new file: settings-daemon/touchpad/x11/xlibnotifications.cpp new file: settings-daemon/touchpad/x11/xlibnotifications.h new file: settings-daemon/touchpad/x11/xlibtouchpad.cpp new file: settings-daemon/touchpad/x11/xlibtouchpad.h new file: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp new file: settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h --- settings-daemon/touchpad.zip | Bin 0 -> 25447 bytes .../touchpad/com.lingmo.Touchpad.xml | 26 + settings-daemon/touchpad/libinputcommon.cpp | 9 + settings-daemon/touchpad/libinputcommon.h | 566 ++++++++++++++++++ settings-daemon/touchpad/touchpadmanager.cpp | 67 +++ settings-daemon/touchpad/touchpadmanager.h | 37 ++ .../touchpad/x11/libinputtouchpad.cpp | 402 +++++++++++++ .../touchpad/x11/libinputtouchpad.h | 149 +++++ settings-daemon/touchpad/x11/propertyinfo.cpp | 86 +++ settings-daemon/touchpad/x11/propertyinfo.h | 37 ++ .../touchpad/x11/synapticstouchpad.cpp | 225 +++++++ .../touchpad/x11/synapticstouchpad.h | 34 ++ settings-daemon/touchpad/x11/xcbatom.cpp | 48 ++ settings-daemon/touchpad/x11/xcbatom.h | 36 ++ settings-daemon/touchpad/x11/xlibbackend.cpp | 425 +++++++++++++ settings-daemon/touchpad/x11/xlibbackend.h | 124 ++++ .../touchpad/x11/xlibnotifications.cpp | 135 +++++ .../touchpad/x11/xlibnotifications.h | 41 ++ settings-daemon/touchpad/x11/xlibtouchpad.cpp | 257 ++++++++ settings-daemon/touchpad/x11/xlibtouchpad.h | 101 ++++ .../touchpad/x11/xrecordkeyboardmonitor.cpp | 140 +++++ .../touchpad/x11/xrecordkeyboardmonitor.h | 47 ++ 22 files changed, 2992 insertions(+) create mode 100644 settings-daemon/touchpad.zip create mode 100644 settings-daemon/touchpad/com.lingmo.Touchpad.xml create mode 100644 settings-daemon/touchpad/libinputcommon.cpp create mode 100644 settings-daemon/touchpad/libinputcommon.h create mode 100644 settings-daemon/touchpad/touchpadmanager.cpp create mode 100644 settings-daemon/touchpad/touchpadmanager.h create mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/libinputtouchpad.h create mode 100644 settings-daemon/touchpad/x11/propertyinfo.cpp create mode 100644 settings-daemon/touchpad/x11/propertyinfo.h create mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/synapticstouchpad.h create mode 100644 settings-daemon/touchpad/x11/xcbatom.cpp create mode 100644 settings-daemon/touchpad/x11/xcbatom.h create mode 100644 settings-daemon/touchpad/x11/xlibbackend.cpp create mode 100644 settings-daemon/touchpad/x11/xlibbackend.h create mode 100644 settings-daemon/touchpad/x11/xlibnotifications.cpp create mode 100644 settings-daemon/touchpad/x11/xlibnotifications.h create mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.cpp create mode 100644 settings-daemon/touchpad/x11/xlibtouchpad.h create mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp create mode 100644 settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h diff --git a/settings-daemon/touchpad.zip b/settings-daemon/touchpad.zip new file mode 100644 index 0000000000000000000000000000000000000000..08f16e61cd7db844cb3547625ff9a97667f4c7a9 GIT binary patch literal 25447 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 literal 0 HcmV?d00001 diff --git a/settings-daemon/touchpad/com.lingmo.Touchpad.xml b/settings-daemon/touchpad/com.lingmo.Touchpad.xml new file mode 100644 index 0000000..c32ef00 --- /dev/null +++ b/settings-daemon/touchpad/com.lingmo.Touchpad.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/settings-daemon/touchpad/libinputcommon.cpp b/settings-daemon/touchpad/libinputcommon.cpp new file mode 100644 index 0000000..2d0a92d --- /dev/null +++ b/settings-daemon/touchpad/libinputcommon.cpp @@ -0,0 +1,9 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "libinputcommon.h" + +#include "moc_libinputcommon.cpp" diff --git a/settings-daemon/touchpad/libinputcommon.h b/settings-daemon/touchpad/libinputcommon.h new file mode 100644 index 0000000..7d18def --- /dev/null +++ b/settings-daemon/touchpad/libinputcommon.h @@ -0,0 +1,566 @@ +/* + SPDX-FileCopyrightText: 2017 Roman Gilg + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef LIBINPUTCOMMON_H +#define LIBINPUTCOMMON_H + +#include +#include + +namespace +{ +template +inline T valueLoaderPart(QVariant const &reply) +{ + Q_UNUSED(reply); + return T(); +} + +template<> +inline bool valueLoaderPart(QVariant const &reply) +{ + return reply.toBool(); +} + +template<> +inline int valueLoaderPart(QVariant const &reply) +{ + return reply.toInt(); +} + +template<> +inline quint32 valueLoaderPart(QVariant const &reply) +{ + return reply.toInt(); +} + +template<> +inline qreal valueLoaderPart(QVariant const &reply) +{ + return reply.toReal(); +} + +template<> +inline QString valueLoaderPart(QVariant const &reply) +{ + return reply.toString(); +} + +template<> +inline Qt::MouseButtons valueLoaderPart(QVariant const &reply) +{ + return static_cast(reply.toInt()); +} +} + +class LibinputCommon : public QObject +{ + Q_OBJECT + + // + // general + Q_PROPERTY(QString name READ name CONSTANT) + Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) + + // + // advanced + Q_PROPERTY(Qt::MouseButtons supportedButtons READ supportedButtons CONSTANT) + + Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT) + Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT) + Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged) + + Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT) + + Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT) + Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT) + Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged) + + Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT) + Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT) + Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged) + + // + // acceleration speed and profile + Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT) + Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged) + + Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT) + Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT) + Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY + pointerAccelerationProfileChanged) + + Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT) + Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT) + Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY + pointerAccelerationProfileChanged) + + // + // tapping + Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT) + Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged) + + Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT) + Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT) + Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY lmrTapButtonMapChanged) + + Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged) + + Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT) + Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged) + + // + // scrolling + Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT) + Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT) + Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged) + + Q_PROPERTY(bool supportsHorizontalScrolling READ supportsHorizontalScrolling CONSTANT) + Q_PROPERTY(bool horizontalScrollingByDefault READ horizontalScrollingByDefault CONSTANT) + Q_PROPERTY(bool horizontalScrolling READ horizontalScrolling WRITE setHorizontalScrolling NOTIFY horizontalScrollingChanged) + + Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT) + Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged) + + Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT) + Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged) + + Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT) + Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT) + Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged) + + Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT) + Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged) + + // Click Methods + Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT) + Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT) + Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged) + + Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT) + Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT) + Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged) + + Q_PROPERTY(bool supportsScrollFactor READ supportsScrollFactor CONSTANT) +public: + LibinputCommon() + { + } + virtual ~LibinputCommon() + { + } + + virtual QString name() const = 0; + virtual bool supportsDisableEvents() const = 0; + virtual bool isEnabled() const = 0; + virtual void setEnabled(bool set) = 0; + + // + // advanced + Qt::MouseButtons supportedButtons() const + { + return m_supportedButtons.val; + } + + virtual bool supportsLeftHanded() const = 0; + bool leftHandedEnabledByDefault() const + { + return m_leftHandedEnabledByDefault.val; + } + bool isLeftHanded() const + { + return m_leftHanded.val; + } + void setLeftHanded(bool set) + { + m_leftHanded.set(set); + } + + virtual bool supportsDisableEventsOnExternalMouse() const = 0; + + virtual bool supportsDisableWhileTyping() const = 0; + bool disableWhileTypingEnabledByDefault() const + { + return m_disableWhileTypingEnabledByDefault.val; + } + bool isDisableWhileTyping() const + { + return m_disableWhileTyping.val; + } + void setDisableWhileTyping(bool set) + { + m_disableWhileTyping.set(set); + } + + virtual bool supportsMiddleEmulation() const = 0; + bool middleEmulationEnabledByDefault() const + { + return m_middleEmulationEnabledByDefault.val; + } + bool isMiddleEmulation() const + { + return m_middleEmulation.val; + } + void setMiddleEmulation(bool set) + { + m_middleEmulation.set(set); + } + + virtual bool supportsPointerAcceleration() const = 0; + qreal pointerAcceleration() const + { + return m_pointerAcceleration.val; + } + void setPointerAcceleration(qreal acceleration) + { + m_pointerAcceleration.set(acceleration); + } + + virtual bool supportsPointerAccelerationProfileFlat() const = 0; + bool defaultPointerAccelerationProfileFlat() const + { + return m_defaultPointerAccelerationProfileFlat.val; + } + bool pointerAccelerationProfileFlat() const + { + return m_pointerAccelerationProfileFlat.val; + } + void setPointerAccelerationProfileFlat(bool set) + { + m_pointerAccelerationProfileFlat.set(set); + } + + virtual bool supportsPointerAccelerationProfileAdaptive() const = 0; + bool defaultPointerAccelerationProfileAdaptive() const + { + return m_defaultPointerAccelerationProfileAdaptive.val; + } + bool pointerAccelerationProfileAdaptive() const + { + return m_pointerAccelerationProfileAdaptive.val; + } + void setPointerAccelerationProfileAdaptive(bool set) + { + m_pointerAccelerationProfileAdaptive.set(set); + } + + // + // scrolling + virtual bool supportsNaturalScroll() const = 0; + bool naturalScrollEnabledByDefault() const + { + return m_naturalScrollEnabledByDefault.val; + } + bool isNaturalScroll() const + { + return m_naturalScroll.val; + } + void setNaturalScroll(bool set) + { + m_naturalScroll.set(set); + } + + virtual bool supportsHorizontalScrolling() const = 0; + bool horizontalScrollingByDefault() const + { + return true; + } + bool horizontalScrolling() const + { + return m_horizontalScrolling.val; + } + void setHorizontalScrolling(bool set) + { + m_horizontalScrolling.set(set); + } + + virtual bool supportsScrollTwoFinger() const = 0; + bool scrollTwoFingerEnabledByDefault() const + { + return m_scrollTwoFingerEnabledByDefault.val; + } + bool isScrollTwoFinger() const + { + return m_isScrollTwoFinger.val; + } + void setScrollTwoFinger(bool set) + { + m_isScrollTwoFinger.set(set); + } + + virtual bool supportsScrollEdge() const = 0; + bool scrollEdgeEnabledByDefault() const + { + return m_scrollEdgeEnabledByDefault.val; + } + bool isScrollEdge() const + { + return m_isScrollEdge.val; + } + void setScrollEdge(bool set) + { + m_isScrollEdge.set(set); + } + + virtual bool supportsScrollOnButtonDown() const = 0; + bool scrollOnButtonDownEnabledByDefault() const + { + return m_scrollOnButtonDownEnabledByDefault.val; + } + bool isScrollOnButtonDown() const + { + return m_isScrollOnButtonDown.val; + } + void setScrollOnButtonDown(bool set) + { + m_isScrollOnButtonDown.set(set); + } + + quint32 defaultScrollButton() const + { + return m_defaultScrollButton.val; + } + quint32 scrollButton() const + { + return m_scrollButton.val; + } + void setScrollButton(quint32 button) + { + m_scrollButton.set(button); + } + + // + // tapping + int tapFingerCount() const + { + return m_tapFingerCount.val; + } + bool tapToClickEnabledByDefault() const + { + return m_tapToClickEnabledByDefault.val; + } + bool isTapToClick() const + { + return m_tapToClick.val; + } + void setTapToClick(bool set) + { + m_tapToClick.set(set); + } + + bool supportsLmrTapButtonMap() const + { + return m_tapFingerCount.val > 1; + } + bool lmrTapButtonMapEnabledByDefault() const + { + return m_lmrTapButtonMapEnabledByDefault.val; + } + bool lmrTapButtonMap() const + { + return m_lmrTapButtonMap.val; + } + virtual void setLmrTapButtonMap(bool set) = 0; + + bool tapAndDragEnabledByDefault() const + { + return m_tapAndDragEnabledByDefault.val; + } + bool isTapAndDrag() const + { + return m_tapAndDrag.val; + } + void setTapAndDrag(bool set) + { + m_tapAndDrag.set(set); + } + + bool tapDragLockEnabledByDefault() const + { + return m_tapDragLockEnabledByDefault.val; + } + bool isTapDragLock() const + { + return m_tapDragLock.val; + } + void setTapDragLock(bool set) + { + m_tapDragLock.set(set); + } + + // + // click method + virtual bool supportsClickMethodAreas() const = 0; + bool defaultClickMethodAreas() const + { + return m_defaultClickMethodAreas.val; + } + bool isClickMethodAreas() const + { + return m_clickMethodAreas.val; + } + void setClickMethodAreas(bool set) + { + m_clickMethodAreas.set(set); + } + + virtual bool supportsClickMethodClickfinger() const = 0; + bool defaultClickMethodClickfinger() const + { + return m_defaultClickMethodClickfinger.val; + } + bool isClickMethodClickfinger() const + { + return m_clickMethodClickfinger.val; + } + void setClickMethodClickfinger(bool set) + { + m_clickMethodClickfinger.set(set); + } + + virtual bool supportsScrollFactor() const = 0; + +Q_SIGNALS: + void enabledChanged(); + // Tapping + void tapToClickChanged(); + void lmrTapButtonMapChanged(); + void tapAndDragChanged(); + void tapDragLockChanged(); + // Advanced + void leftHandedChanged(); + void disableWhileTypingChanged(); + void middleEmulationChanged(); + // acceleration speed and profile + void pointerAccelerationChanged(); + void pointerAccelerationProfileChanged(); + // scrolling + void naturalScrollChanged(); + void horizontalScrollingChanged(); + void scrollMethodChanged(); + void scrollButtonChanged(); + // click methods + void clickMethodChanged(); + +protected: + template + struct Prop { + explicit Prop(const QByteArray &name) + : name(name) + { + } + + void set(T newVal) + { + if (avail && val != newVal) { + val = newVal; + } + } + void set(const Prop &p) + { + if (avail && val != p.val) { + val = p.val; + } + } + bool changed() const + { + return avail && (old != val); + } + + // In wayland, name will be dbus name + QByteArray name; + bool avail; + T old; + T val; + }; + + // + // general + Prop m_supportsDisableEvents = Prop("supportsDisableEvents"); + Prop m_enabledDefault = Prop("enabledDefault"); + Prop m_enabled = Prop("enabled"); + + // + // advanced + Prop m_supportedButtons = Prop("supportedButtons"); + + Prop m_leftHandedEnabledByDefault = Prop("leftHandedEnabledByDefault"); + Prop m_leftHanded = Prop("leftHanded"); + + Prop m_supportsDisableEventsOnExternalMouse = Prop("supportsDisableEventsOnExternalMouse"); + + Prop m_disableWhileTypingEnabledByDefault = Prop("disableWhileTypingEnabledByDefault"); + Prop m_disableWhileTyping = Prop("disableWhileTyping"); + + Prop m_middleEmulationEnabledByDefault = Prop("middleEmulationEnabledByDefault"); + Prop m_middleEmulation = Prop("middleEmulation"); + + // + // acceleration speed and profile + Prop m_defaultPointerAcceleration = Prop("defaultPointerAcceleration"); + Prop m_pointerAcceleration = Prop("pointerAcceleration"); + + Prop m_supportsPointerAccelerationProfileFlat = Prop("supportsPointerAccelerationProfileFlat"); + Prop m_defaultPointerAccelerationProfileFlat = Prop("defaultPointerAccelerationProfileFlat"); + Prop m_pointerAccelerationProfileFlat = Prop("pointerAccelerationProfileFlat"); + + Prop m_supportsPointerAccelerationProfileAdaptive = Prop("supportsPointerAccelerationProfileAdaptive"); + Prop m_defaultPointerAccelerationProfileAdaptive = Prop("defaultPointerAccelerationProfileAdaptive"); + Prop m_pointerAccelerationProfileAdaptive = Prop("pointerAccelerationProfileAdaptive"); + + // + // tapping + Prop m_tapFingerCount = Prop("tapFingerCount"); + Prop m_tapToClickEnabledByDefault = Prop("tapToClickEnabledByDefault"); + Prop m_tapToClick = Prop("tapToClick"); + + Prop m_lmrTapButtonMapEnabledByDefault = Prop("lmrTapButtonMapEnabledByDefault"); + Prop m_lmrTapButtonMap = Prop("lmrTapButtonMap"); + + Prop m_tapAndDragEnabledByDefault = Prop("tapAndDragEnabledByDefault"); + Prop m_tapAndDrag = Prop("tapAndDrag"); + Prop m_tapDragLockEnabledByDefault = Prop("tapDragLockEnabledByDefault"); + Prop m_tapDragLock = Prop("tapDragLock"); + + // + // scrolling + Prop m_naturalScrollEnabledByDefault = Prop("naturalScrollEnabledByDefault"); + Prop m_naturalScroll = Prop("naturalScroll"); + + Prop m_horizontalScrolling = Prop("horizontalScrolling"); + + Prop m_supportsScrollTwoFinger = Prop("supportsScrollTwoFinger"); + Prop m_scrollTwoFingerEnabledByDefault = Prop("scrollTwoFingerEnabledByDefault"); + Prop m_isScrollTwoFinger = Prop("scrollTwoFinger"); + + Prop m_supportsScrollEdge = Prop("supportsScrollEdge"); + Prop m_scrollEdgeEnabledByDefault = Prop("scrollEdgeEnabledByDefault"); + Prop m_isScrollEdge = Prop("scrollEdge"); + + Prop m_supportsScrollOnButtonDown = Prop("supportsScrollOnButtonDown"); + Prop m_scrollOnButtonDownEnabledByDefault = Prop("scrollOnButtonDownEnabledByDefault"); + Prop m_isScrollOnButtonDown = Prop("scrollOnButtonDown"); + + Prop m_defaultScrollButton = Prop("defaultScrollButton"); + Prop m_scrollButton = Prop("scrollButton"); + + // Click Method + Prop m_supportsClickMethodAreas = Prop("supportsClickMethodAreas"); + Prop m_defaultClickMethodAreas = Prop("defaultClickMethodAreas"); + Prop m_clickMethodAreas = Prop("clickMethodAreas"); + + Prop m_supportsClickMethodClickfinger = Prop("supportsClickMethodClickfinger"); + Prop m_defaultClickMethodClickfinger = Prop("defaultClickMethodClickfinger"); + Prop m_clickMethodClickfinger = Prop("clickMethodClickfinger"); +}; + +#endif // LIBINPUTCOMMON_H diff --git a/settings-daemon/touchpad/touchpadmanager.cpp b/settings-daemon/touchpad/touchpadmanager.cpp new file mode 100644 index 0000000..26266d5 --- /dev/null +++ b/settings-daemon/touchpad/touchpadmanager.cpp @@ -0,0 +1,67 @@ +#include "touchpadmanager.h" +#include "touchpadadaptor.h" + +#include +#include + +TouchpadManager::TouchpadManager(QObject *parent) + : QObject(parent) + , m_backend(XlibBackend::initialize()) +{ + // init dbus + new TouchpadAdaptor(this); + QDBusConnection::sessionBus().registerObject(QStringLiteral("/Touchpad"), this); + + m_backend->getConfig(); + m_backend->applyConfig(); +} + +bool TouchpadManager::available() const +{ + return m_backend->isTouchpadAvailable(); +} + +bool TouchpadManager::enabled() const +{ + return m_backend->isTouchpadEnabled(); +} + +void TouchpadManager::setEnabled(bool enabled) +{ + m_backend->setTouchpadEnabled(enabled); + m_backend->applyConfig(); +} + +bool TouchpadManager::tapToClick() const +{ + return m_backend->tapToClick(); +} + +void TouchpadManager::setTapToClick(bool value) +{ + m_backend->setTapToClick(value); + m_backend->applyConfig(); +} + +bool TouchpadManager::naturalScroll() const +{ + return m_backend->naturalScroll(); +} + +void TouchpadManager::setNaturalScroll(bool naturalScroll) +{ + m_backend->setNaturalScroll(naturalScroll); + m_backend->applyConfig(); +} + +qreal TouchpadManager::pointerAcceleration() const +{ + return m_backend->pointerAcceleration(); +} + +void TouchpadManager::setPointerAcceleration(qreal value) +{ + qDebug() << value; + m_backend->setPointerAcceleration(value); + m_backend->applyConfig(); +} diff --git a/settings-daemon/touchpad/touchpadmanager.h b/settings-daemon/touchpad/touchpadmanager.h new file mode 100644 index 0000000..d8f84d6 --- /dev/null +++ b/settings-daemon/touchpad/touchpadmanager.h @@ -0,0 +1,37 @@ +#ifndef TOUCHPADMANAGER_H +#define TOUCHPADMANAGER_H + +#include +#include "x11/xlibbackend.h" + +class TouchpadManager : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool available READ available CONSTANT) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled CONSTANT) + Q_PROPERTY(bool tapToClick READ tapToClick WRITE setTapToClick CONSTANT) + Q_PROPERTY(bool naturalScroll READ naturalScroll WRITE setNaturalScroll CONSTANT) + Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration CONSTANT) + +public: + explicit TouchpadManager(QObject *parent = nullptr); + + bool available() const; + + bool enabled() const; + void setEnabled(bool enabled); + + bool tapToClick() const; + void setTapToClick(bool value); + + bool naturalScroll() const; + void setNaturalScroll(bool naturalScroll); + + qreal pointerAcceleration() const; + void setPointerAcceleration(qreal value); + +private: + XlibBackend *m_backend; +}; + +#endif // TOUCHPADMANAGER_H diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.cpp b/settings-daemon/touchpad/x11/libinputtouchpad.cpp new file mode 100644 index 0000000..814b7eb --- /dev/null +++ b/settings-daemon/touchpad/x11/libinputtouchpad.cpp @@ -0,0 +1,402 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "libinputtouchpad.h" + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +const Parameter libinputProperties[] = { + + /* libinput disable supports property */ + {"supportsDisableEvents", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 0}, + {"enabled", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 0}, + {"enabledDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 0}, + + /* LeftHandSupport */ + {"leftHandedEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED_DEFAULT, 8, 0}, + {"leftHanded", PT_INT, 0, 1, LIBINPUT_PROP_LEFT_HANDED, 8, 0}, + + /* Disable on external mouse */ + {"supportsDisableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_AVAILABLE, 8, 1}, + {"disableEventsOnExternalMouse", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED, 8, 1}, + {"disableEventsOnExternalMouseDefault", PT_INT, 0, 1, LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT, 8, 1}, + + /* Disable while typing */ + {"disableWhileTypingEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT, 8, 0}, + {"disableWhileTyping", PT_INT, 0, 1, LIBINPUT_PROP_DISABLE_WHILE_TYPING, 8, 0}, + + /* Middle Emulation */ + {"middleEmulationEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT, 8, 0}, + {"middleEmulation", PT_INT, 0, 1, LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED, 8, 0}, + + /* This is a boolean for all three fingers, no per-finger config */ + {"tapToClick", PT_INT, 0, 1, LIBINPUT_PROP_TAP, 8, 0}, + {"tapToClickEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DEFAULT, 8, 0}, + + /* LMR */ + {"lrmTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 0}, + {"lrmTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 0}, + {"lmrTapButtonMapEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT, 8, 1}, + {"lmrTapButtonMap", PT_INT, 0, 1, LIBINPUT_PROP_TAP_BUTTONMAP, 8, 1}, + + /* Tap and Drag Enabled */ + {"tapAndDragEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_DEFAULT, 8, 0}, + {"tapAndDrag", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG, 8, 0}, + + /* Tap and Drag Lock Enabled */ + {"tapDragLockEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT, 8, 0}, + {"tapDragLock", PT_INT, 0, 1, LIBINPUT_PROP_TAP_DRAG_LOCK, 8, 0}, + + /* libinput normalizes the accel to -1/1 */ + {"defaultPointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL_DEFAULT, 0 /*float */, 0}, + {"pointerAcceleration", PT_DOUBLE, -1.0, 1.0, LIBINPUT_PROP_ACCEL, 0 /*float */, 0}, + + /* Libinput Accel Profile */ + {"supportsPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 0}, + {"defaultPointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 0}, + {"pointerAccelerationProfileAdaptive", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 0}, + {"supportsPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE, 8, 1}, + {"defaultPointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT, 8, 1}, + {"pointerAccelerationProfileFlat", PT_BOOL, 0, 1, LIBINPUT_PROP_ACCEL_PROFILE_ENABLED, 8, 1}, + + /* Natural Scrolling */ + {"naturalScrollEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT, 8, 0}, + {"naturalScroll", PT_INT, 0, 1, LIBINPUT_PROP_NATURAL_SCROLL, 8, 0}, + + /* Horizontal scrolling */ + {"horizontalScrolling", PT_INT, 0, 1, LIBINPUT_PROP_HORIZ_SCROLL_ENABLED, 8, 0}, + + /* Two-Finger Scrolling */ + {"supportsScrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 0}, + {"scrollTwoFingerEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 0}, + {"scrollTwoFinger", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 0}, + + /* Edge Scrolling */ + {"supportsScrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 1}, + {"scrollEdgeEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 1}, + {"scrollEdge", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 1}, + + /* scroll on button */ + {"supportsScrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE, 8, 2}, + {"scrollOnButtonDownEnabledByDefault", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT, 8, 2}, + {"scrollOnButtonDown", PT_INT, 0, 1, LIBINPUT_PROP_SCROLL_METHOD_ENABLED, 8, 2}, + + /* Scroll Button for scroll on button Down */ + {"defaultScrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT, 32, 0}, + {"scrollButton", PT_INT, 0, INT_MAX, LIBINPUT_PROP_SCROLL_BUTTON, 32, 0}, + + /* Click Methods */ + {"supportsClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 0}, + {"defaultClickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 0}, + {"clickMethodAreas", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 0}, + + {"supportsClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHODS_AVAILABLE, 8, 1}, + {"defaultClickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT, 8, 1}, + {"clickMethodClickfinger", PT_INT, 0, 1, LIBINPUT_PROP_CLICK_METHOD_ENABLED, 8, 1}, + + /* libinput doesn't have a separate toggle for horiz scrolling */ + {nullptr, PT_INT, 0, 0, nullptr, 0, 0}}; + +Qt::MouseButtons maskBtns(Display *display, XIButtonClassInfo *buttonInfo) +{ + Qt::MouseButtons buttons = Qt::NoButton; + for (int i = 0; i < buttonInfo->num_buttons; ++i) { + QByteArray reply = XGetAtomName(display, buttonInfo->labels[i]); + + if (reply == BTN_LABEL_PROP_BTN_LEFT) { + buttons |= Qt::LeftButton; + } + if (reply == BTN_LABEL_PROP_BTN_RIGHT) { + buttons |= Qt::RightButton; + } + if (reply == BTN_LABEL_PROP_BTN_MIDDLE) { + buttons |= Qt::MiddleButton; + } + if (reply == BTN_LABEL_PROP_BTN_SIDE) { + buttons |= Qt::ExtraButton1; + } + if (reply == BTN_LABEL_PROP_BTN_EXTRA) { + buttons |= Qt::ExtraButton2; + } + if (reply == BTN_LABEL_PROP_BTN_FORWARD) { + buttons |= Qt::ForwardButton; + } + if (reply == BTN_LABEL_PROP_BTN_BACK) { + buttons |= Qt::BackButton; + } + if (reply == BTN_LABEL_PROP_BTN_TASK) { + buttons |= Qt::TaskButton; + } + } + return buttons; +} + +LibinputTouchpad::LibinputTouchpad(Display *display, int deviceId) + : LibinputCommon() + , XlibTouchpad(display, deviceId) + , m_config("lingmoos", "touchpadxlibinputrc") +{ + loadSupportedProperties(libinputProperties); + + int nDevices = 0; + XIDeviceInfo *deviceInfo = XIQueryDevice(m_display, m_deviceId, &nDevices); + m_name = deviceInfo->name; + + for (int i = 0; i < deviceInfo->num_classes; ++i) { + XIAnyClassInfo *classInfo = deviceInfo->classes[i]; + + if (classInfo->type == XIButtonClass) { + XIButtonClassInfo *btnInfo = (XIButtonClassInfo *)classInfo; + m_supportedButtons.avail = true; + m_supportedButtons.set(maskBtns(m_display, btnInfo)); + } + if (classInfo->type == XITouchClass) { + XITouchClassInfo *touchInfo = (XITouchClassInfo *)classInfo; + m_tapFingerCount.avail = true; + m_tapFingerCount.set(touchInfo->num_touches); + } + } + XIFreeDeviceInfo(deviceInfo); + + /* FingerCount cannot be zero */ + if (!m_tapFingerCount.val) { + m_tapFingerCount.avail = true; + m_tapFingerCount.set(1); + } +} + +bool LibinputTouchpad::getConfig() +{ + bool success = true; + + success &= valueLoader(m_supportsDisableEvents); + success &= valueLoader(m_enabled); + success &= valueLoader(m_enabledDefault); + + success &= valueLoader(m_tapToClickEnabledByDefault); + success &= valueLoader(m_tapToClick); + success &= valueLoader(m_lrmTapButtonMapEnabledByDefault); + success &= valueLoader(m_lrmTapButtonMap); + success &= valueLoader(m_lmrTapButtonMapEnabledByDefault); + success &= valueLoader(m_lmrTapButtonMap); + success &= valueLoader(m_tapAndDragEnabledByDefault); + success &= valueLoader(m_tapAndDrag); + success &= valueLoader(m_tapDragLockEnabledByDefault); + success &= valueLoader(m_tapDragLock); + + success &= valueLoader(m_leftHandedEnabledByDefault); + success &= valueLoader(m_leftHanded); + + success &= valueLoader(m_supportsDisableEventsOnExternalMouse); + success &= valueLoader(m_disableEventsOnExternalMouse); + success &= valueLoader(m_disableEventsOnExternalMouseDefault); + + success &= valueLoader(m_disableWhileTypingEnabledByDefault); + success &= valueLoader(m_disableWhileTyping); + + success &= valueLoader(m_middleEmulationEnabledByDefault); + success &= valueLoader(m_middleEmulation); + + success &= valueLoader(m_defaultPointerAcceleration); + success &= valueLoader(m_pointerAcceleration); + + success &= valueLoader(m_supportsPointerAccelerationProfileFlat); + success &= valueLoader(m_defaultPointerAccelerationProfileFlat); + success &= valueLoader(m_pointerAccelerationProfileFlat); + success &= valueLoader(m_supportsPointerAccelerationProfileAdaptive); + success &= valueLoader(m_defaultPointerAccelerationProfileAdaptive); + success &= valueLoader(m_pointerAccelerationProfileAdaptive); + + success &= valueLoader(m_naturalScrollEnabledByDefault); + success &= valueLoader(m_naturalScroll); + + success &= valueLoader(m_horizontalScrolling); + + success &= valueLoader(m_supportsScrollTwoFinger); + success &= valueLoader(m_scrollTwoFingerEnabledByDefault); + success &= valueLoader(m_isScrollTwoFinger); + + success &= valueLoader(m_supportsScrollEdge); + success &= valueLoader(m_scrollEdgeEnabledByDefault); + success &= valueLoader(m_isScrollEdge); + + success &= valueLoader(m_supportsScrollOnButtonDown); + success &= valueLoader(m_scrollOnButtonDownEnabledByDefault); + success &= valueLoader(m_isScrollOnButtonDown); + + success &= valueLoader(m_defaultScrollButton); + success &= valueLoader(m_scrollButton); + + // click methods + success &= valueLoader(m_supportsClickMethodAreas); + success &= valueLoader(m_supportsClickMethodClickfinger); + success &= valueLoader(m_defaultClickMethodAreas); + success &= valueLoader(m_defaultClickMethodClickfinger); + success &= valueLoader(m_clickMethodAreas); + success &= valueLoader(m_clickMethodClickfinger); + + return success; +} + +bool LibinputTouchpad::applyConfig() +{ + QVector msgs; + + msgs << valueWriter(m_enabled) << valueWriter(m_tapToClick) << valueWriter(m_lrmTapButtonMap) << valueWriter(m_lmrTapButtonMap) << valueWriter(m_tapAndDrag) + << valueWriter(m_tapDragLock) << valueWriter(m_leftHanded) << valueWriter(m_disableWhileTyping) << valueWriter(m_middleEmulation) + << valueWriter(m_pointerAcceleration) << valueWriter(m_pointerAccelerationProfileFlat) << valueWriter(m_pointerAccelerationProfileAdaptive) + << valueWriter(m_naturalScroll) << valueWriter(m_horizontalScrolling) << valueWriter(m_isScrollTwoFinger) << valueWriter(m_isScrollEdge) + << valueWriter(m_isScrollOnButtonDown) << valueWriter(m_scrollButton) << valueWriter(m_clickMethodAreas) << valueWriter(m_clickMethodClickfinger); + + bool success = true; + QString error_msg; + + for (QString m : msgs) { + if (!m.isNull()) { + // qCCritical(KCM_TOUCHPAD) << "in error:" << m; + if (!success) { + error_msg.append("\n"); + } + error_msg.append(m); + success = false; + } + } + + if (!success) { + // qCCritical(KCM_TOUCHPAD) << error_msg; + } + + flush(); + return success; +} + +bool LibinputTouchpad::getDefaultConfig() +{ + m_enabled.set(m_enabledDefault); + m_tapToClick.set(m_tapToClickEnabledByDefault); + m_lrmTapButtonMap.set(m_lrmTapButtonMap); + m_lmrTapButtonMap.set(m_lmrTapButtonMapEnabledByDefault); + m_tapAndDrag.set(m_tapAndDragEnabledByDefault); + m_tapDragLock.set(m_tapDragLockEnabledByDefault); + m_leftHanded.set(m_leftHandedEnabledByDefault); + m_disableEventsOnExternalMouse.set(m_disableEventsOnExternalMouseDefault); + m_disableWhileTyping.set(m_disableWhileTypingEnabledByDefault); + m_middleEmulation.set(m_middleEmulationEnabledByDefault); + m_pointerAcceleration.set(m_defaultPointerAcceleration); + m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); + m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); + m_naturalScroll.set(m_naturalScrollEnabledByDefault); + m_horizontalScrolling.set(true); + m_isScrollTwoFinger.set(m_scrollTwoFingerEnabledByDefault); + m_isScrollEdge.set(m_scrollEdgeEnabledByDefault); + m_isScrollOnButtonDown.set(m_scrollOnButtonDownEnabledByDefault); + m_scrollButton.set(m_defaultScrollButton); + m_clickMethodAreas.set(m_defaultClickMethodAreas); + m_clickMethodClickfinger.set(m_defaultClickMethodClickfinger); + + return true; +} + +bool LibinputTouchpad::isChangedConfig() +{ + // clang-format off + bool changed = m_enabled.changed() || + m_tapToClick.changed() || + m_lrmTapButtonMap.changed() || + m_lmrTapButtonMap.changed() || + m_tapAndDrag.changed() || + m_tapDragLock.changed() || + m_leftHanded.changed() || + m_disableEventsOnExternalMouse.changed() || + m_disableWhileTyping.changed() || + m_middleEmulation.changed() || + m_pointerAcceleration.changed() || + m_pointerAccelerationProfileFlat.changed() || + m_pointerAccelerationProfileAdaptive.changed() || + m_naturalScroll.changed() || + m_horizontalScrolling.changed() || + m_isScrollTwoFinger.changed() || + m_isScrollEdge.changed() || + m_isScrollOnButtonDown.changed() || + m_scrollButton.changed() || + m_clickMethodAreas.changed() || + m_clickMethodClickfinger.changed(); + // clang-format on + + return changed; +} + +int LibinputTouchpad::touchpadOff() +{ + return m_enabled.val; +} + +XcbAtom &LibinputTouchpad::touchpadOffAtom() +{ + return *m_atoms[QLatin1String(LIBINPUT_PROP_SENDEVENTS_ENABLED)].data(); +} + +template +bool LibinputTouchpad::valueLoader(Prop &prop) +{ + const Parameter *p = findParameter(QString::fromLatin1(prop.name)); + + if (!p) { + // qCCritical(KCM_TOUCHPAD) << "Error on read of " << QString::fromLatin1(prop.name); + } + + QVariant reply = getParameter(p); + if (!reply.isValid()) { + prop.avail = false; + return true; + } + prop.avail = true; + + m_config.beginGroup(m_name); + + const T replyValue = valueLoaderPart(reply); + const T loadedValue = m_config.value(prop.name, replyValue).toBool(); + prop.old = replyValue; + prop.val = loadedValue; + + m_config.endGroup(); + + return true; +} + +template +QString LibinputTouchpad::valueWriter(const Prop &prop) +{ + const Parameter *p = findParameter(QString::fromLatin1(prop.name)); + + // Reion + if (!p /*|| !prop.changed()*/) { + return QString(); + } + + bool error = !setParameter(p, prop.val); + if (error) { + // qCCritical(KCM_TOUCHPAD) << "Cannot set property " + QString::fromLatin1(prop.name); + return QStringLiteral("Cannot set property ") + QString::fromLatin1(prop.name); + } + + m_config.beginGroup(m_name); + m_config.setValue(prop.name, prop.val); + m_config.endGroup(); + m_config.sync(); + + return QString(); +} diff --git a/settings-daemon/touchpad/x11/libinputtouchpad.h b/settings-daemon/touchpad/x11/libinputtouchpad.h new file mode 100644 index 0000000..4d1733b --- /dev/null +++ b/settings-daemon/touchpad/x11/libinputtouchpad.h @@ -0,0 +1,149 @@ +/* + SPDX-FileCopyrightText: 2019 Atul Bisht + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef LIBINPUTTOUCHPAD_H +#define LIBINPUTTOUCHPAD_H + +#include +#include + +#include "../libinputcommon.h" +#include "xlibtouchpad.h" + +class LibinputTouchpad : public LibinputCommon, public XlibTouchpad +{ + Q_OBJECT + +public: + LibinputTouchpad(Display *display, int deviceId); + ~LibinputTouchpad() override + { + } + + bool getConfig() override; + bool applyConfig() override; + bool getDefaultConfig() override; + bool isChangedConfig() override; + + int touchpadOff() override; + XcbAtom &touchpadOffAtom() override; + +private: + template + bool valueLoader(Prop &prop); + + template + QString valueWriter(const Prop &prop); + + QSettings m_config; + + // + // general + QString name() const override + { + return m_name; + } + bool supportsDisableEvents() const override + { + return m_supportsDisableEvents.avail && m_supportsDisableEvents.val; + } + bool isEnabled() const override + { + return !m_enabled.val; + } + void setEnabled(bool set) override + { + m_enabled.set(!set); + } + // + // Tapping + void setLmrTapButtonMap(bool set) override + { + m_lrmTapButtonMap.set(!set); + m_lmrTapButtonMap.set(set); + } + // + // advanced + bool supportsLeftHanded() const override + { + return m_leftHanded.avail; + } + bool supportsDisableEventsOnExternalMouse() const override + { + return m_supportsDisableEventsOnExternalMouse.avail && m_supportsDisableEventsOnExternalMouse.val; + } + bool supportsDisableWhileTyping() const override + { + return m_disableWhileTyping.avail; + } + bool supportsMiddleEmulation() const override + { + return m_middleEmulation.avail; + } + // + // acceleration speed and profile + bool supportsPointerAcceleration() const override + { + return m_pointerAcceleration.avail; + } + bool supportsPointerAccelerationProfileFlat() const override + { + return m_supportsPointerAccelerationProfileFlat.avail && m_supportsPointerAccelerationProfileFlat.val; + } + bool supportsPointerAccelerationProfileAdaptive() const override + { + return m_supportsPointerAccelerationProfileAdaptive.avail && m_supportsPointerAccelerationProfileAdaptive.val; + } + // + // scrolling + bool supportsNaturalScroll() const override + { + return m_naturalScroll.avail; + } + bool supportsHorizontalScrolling() const override + { + return true; + } + bool supportsScrollTwoFinger() const override + { + return m_supportsScrollTwoFinger.avail && m_supportsScrollTwoFinger.val; + } + bool supportsScrollEdge() const override + { + return m_supportsScrollEdge.avail && m_supportsScrollEdge.val; + } + bool supportsScrollOnButtonDown() const override + { + return m_supportsScrollOnButtonDown.avail && m_supportsScrollOnButtonDown.val; + } + // + // click method + bool supportsClickMethodAreas() const override + { + return m_supportsClickMethodAreas.avail && m_supportsClickMethodAreas.val; + } + bool supportsClickMethodClickfinger() const override + { + return m_supportsClickMethodClickfinger.avail && m_supportsClickMethodClickfinger.val; + } + + bool supportsScrollFactor() const override + { + return false; + } + + // Tapping + Prop m_lrmTapButtonMapEnabledByDefault = Prop("lrmTapButtonMapEnabledByDefault"); + Prop m_lrmTapButtonMap = Prop("lrmTapButtonMap"); + // + // advanced + Prop m_disableEventsOnExternalMouse = Prop("disableEventsOnExternalMouse"); + Prop m_disableEventsOnExternalMouseDefault = Prop("disableEventsOnExternalMouseDefault"); + + QString m_name; +}; + +#endif // LIBINPUTTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/propertyinfo.cpp b/settings-daemon/touchpad/x11/propertyinfo.cpp new file mode 100644 index 0000000..c8acf79 --- /dev/null +++ b/settings-daemon/touchpad/x11/propertyinfo.cpp @@ -0,0 +1,86 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include +#include + +#include "propertyinfo.h" + +#include +#include +#include + +void XDeleter(void *p) +{ + if (p) { + XFree(p); + } +} + +PropertyInfo::PropertyInfo() + : type(0) + , format(0) + , nitems(0) + , f(nullptr) + , i(nullptr) + , b(nullptr) + , display(nullptr) + , device(0) + , prop(0) +{ +} + +PropertyInfo::PropertyInfo(Display *display, int device, Atom prop, Atom floatType) + : type(0) + , format(0) + , nitems(0) + , f(nullptr) + , i(nullptr) + , b(nullptr) + , display(display) + , device(device) + , prop(prop) +{ + unsigned char *dataPtr = nullptr; + unsigned long bytes_after; + XIGetProperty(display, device, prop, 0, 1000, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &dataPtr); + data = QSharedPointer(dataPtr, XDeleter); + + if (format == CHAR_BIT && type == XA_INTEGER) { + b = reinterpret_cast(dataPtr); + } + if (format == sizeof(int) * CHAR_BIT && (type == XA_INTEGER || type == XA_CARDINAL)) { + i = reinterpret_cast(dataPtr); + } + if (format == sizeof(float) * CHAR_BIT && floatType && type == floatType) { + f = reinterpret_cast(dataPtr); + } +} + +QVariant PropertyInfo::value(unsigned offset) const +{ + QVariant v; + if (offset >= nitems) { + return v; + } + + if (b) { + v = QVariant(static_cast(b[offset])); + } + if (i) { + v = QVariant(i[offset]); + } + if (f) { + v = QVariant(f[offset]); + } + + return v; +} + +void PropertyInfo::set() +{ + XIChangeProperty(display, device, prop, type, format, XIPropModeReplace, data.data(), nitems); +} diff --git a/settings-daemon/touchpad/x11/propertyinfo.h b/settings-daemon/touchpad/x11/propertyinfo.h new file mode 100644 index 0000000..37e60e5 --- /dev/null +++ b/settings-daemon/touchpad/x11/propertyinfo.h @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef PROPERTYINFO_H +#define PROPERTYINFO_H + +#include +#include +#include + +void XDeleter(void *p); + +struct PropertyInfo { + Atom type; + int format; + QSharedPointer data; + unsigned long nitems; + + float *f; + int *i; + char *b; + + Display *display; + int device; + Atom prop; + + PropertyInfo(); + PropertyInfo(Display *display, int device, Atom prop, Atom floatType); + QVariant value(unsigned offset) const; + + void set(); +}; + +#endif // PROPERTYINFO_H diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.cpp b/settings-daemon/touchpad/x11/synapticstouchpad.cpp new file mode 100644 index 0000000..37d60aa --- /dev/null +++ b/settings-daemon/touchpad/x11/synapticstouchpad.cpp @@ -0,0 +1,225 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + SPDX-FileContributor: 2002-2005, 2007 Peter Osterlund + + SPDX-License-Identifier: GPL-2.0-or-later AND LicenseRef-synaptics +*/ + +#include +#include + +#include "synapticstouchpad.h" + +#include +#include +#include + +#define SYN_MAX_BUTTONS 12 + +const struct Parameter synapticsProperties[] = { + {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0}, + {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, + {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, + {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, + {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, + {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, + {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0}, + {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0}, + {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1}, + {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0}, + {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2}, + {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, + {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32, 0}, + {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, + {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, + {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, + {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, + {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, + {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, + {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, + {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 0}, + {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8, 1}, + {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0}, + {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1}, + {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2}, + /*{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},*/ + {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0}, + {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0}, + {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0}, + {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 1}, + {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 2}, + {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 3}, + {"OneFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4}, + {"TwoFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5}, + {"ThreeFingerTapButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6}, + {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 0}, + {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 1}, + {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8, 2}, + {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0}, + {"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0}, + {"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0}, + {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0}, + {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0}, + {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1}, + {"CoastingSpeed", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 0}, + {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/, 1}, + {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0}, + {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1}, + {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 0}, + {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float*/, 1}, + {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0}, + {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0}, + {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0}, + {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1}, + {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2}, + {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3}, + {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 0}, + {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 1}, + {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0}, + {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0}, + {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1}, + {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2}, + {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3}, + {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4}, + {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5}, + {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6}, + {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7}, + {NULL, PT_INT, 0, 0, nullptr, 0, 0}, +}; + +SynapticsTouchpad::SynapticsTouchpad(Display *display, int deviceId) + : XlibTouchpad(display, deviceId) + , m_resX(1) + , m_resY(1) +{ + m_capsAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); + m_touchpadOffAtom.intern(m_connection, SYNAPTICS_PROP_OFF); + XcbAtom resolutionAtom(m_connection, SYNAPTICS_PROP_RESOLUTION); + XcbAtom edgesAtom(m_connection, SYNAPTICS_PROP_EDGES); + + loadSupportedProperties(synapticsProperties); + + m_toRadians.append("CircScrollDelta"); + + PropertyInfo edges(m_display, m_deviceId, edgesAtom, 0); + if (edges.i && edges.nitems == 4) { + int w = qAbs(edges.i[1] - edges.i[0]); + int h = qAbs(edges.i[3] - edges.i[2]); + m_resX = w / 90; + m_resY = h / 50; + qDebug() << "Width: " << w << " height: " << h; + qDebug() << "Approx. resX: " << m_resX << " resY: " << m_resY; + } + + PropertyInfo resolution(m_display, m_deviceId, resolutionAtom, 0); + if (resolution.i && resolution.nitems == 2 && resolution.i[0] > 1 && resolution.i[1] > 1) { + m_resY = qMin(static_cast(resolution.i[0]), static_cast(INT_MAX)); + m_resX = qMin(static_cast(resolution.i[1]), static_cast(INT_MAX)); + qDebug() << "Touchpad resolution: x: " << m_resX << " y: " << m_resY; + } + + m_scaleByResX.append("HorizScrollDelta"); + m_scaleByResY.append("VertScrollDelta"); + m_scaleByResX.append("MaxTapMove"); + m_scaleByResY.append("MaxTapMove"); + + m_resX = qMax(10, m_resX); + m_resY = qMax(10, m_resY); + qDebug() << "Final resolution x:" << m_resX << " y:" << m_resY; + m_negate["HorizScrollDelta"] = "InvertHorizScroll"; + m_negate["VertScrollDelta"] = "InvertVertScroll"; + m_supported.append(m_negate.values()); + m_supported.append("Coasting"); + + PropertyInfo caps(m_display, m_deviceId, m_capsAtom.atom(), 0); + if (!caps.b) { + return; + } + + enum TouchpadCapabilitiy { + TouchpadHasLeftButton, + TouchpadHasMiddleButton, + TouchpadHasRightButton, + TouchpadTwoFingerDetect, + TouchpadThreeFingerDetect, + TouchpadPressureDetect, + TouchpadPalmDetect, + TouchpadCapsCount, + }; + + QVector cap(TouchpadCapsCount, false); + std::copy(caps.b, caps.b + qMin(cap.size(), static_cast(caps.nitems)), cap.begin()); + + if (!cap[TouchpadTwoFingerDetect]) { + m_supported.removeAll("HorizTwoFingerScroll"); + m_supported.removeAll("VertTwoFingerScroll"); + m_supported.removeAll("TwoFingerTapButton"); + } + + if (!cap[TouchpadThreeFingerDetect]) { + m_supported.removeAll("ThreeFingerTapButton"); + } + + if (!cap[TouchpadPressureDetect]) { + m_supported.removeAll("FingerHigh"); + m_supported.removeAll("FingerLow"); + + m_supported.removeAll("PalmMinZ"); + m_supported.removeAll("PressureMotionMinZ"); + m_supported.removeAll("PressureMotionMinFactor"); + m_supported.removeAll("PressureMotionMaxZ"); + m_supported.removeAll("PressureMotionMaxFactor"); + m_supported.removeAll("EmulateTwoFingerMinZ"); + } + + if (!cap[TouchpadPalmDetect]) { + m_supported.removeAll("PalmDetect"); + m_supported.removeAll("PalmMinWidth"); + m_supported.removeAll("PalmMinZ"); + m_supported.removeAll("EmulateTwoFingerMinW"); + } + + for (QMap::Iterator i = m_negate.begin(); i != m_negate.end(); ++i) { + if (!m_supported.contains(i.key())) { + m_supported.removeAll(i.value()); + } + } + + m_paramList = synapticsProperties; +} + +void SynapticsTouchpad::setTouchpadOff(int touchpadOff) +{ + PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); + if (off.b && *(off.b) != touchpadOff) { + *(off.b) = touchpadOff; + off.set(); + } + + flush(); +} + +int SynapticsTouchpad::touchpadOff() +{ + PropertyInfo off(m_display, m_deviceId, m_touchpadOffAtom.atom(), 0); + return off.value(0).toInt(); +} + +XcbAtom &SynapticsTouchpad::touchpadOffAtom() +{ + return m_touchpadOffAtom; +} + +double SynapticsTouchpad::getPropertyScale(const QString &name) const +{ + if (m_scaleByResX.contains(name) && m_scaleByResY.contains(name)) { + return std::sqrt(static_cast(m_resX) * m_resX + static_cast(m_resY) * m_resY); + } else if (m_scaleByResX.contains(name)) { + return m_resX; + } else if (m_scaleByResY.contains(name)) { + return m_resY; + } else if (m_toRadians.contains(name)) { + return M_PI_4 / 45.0; + } + return 1.0; +} diff --git a/settings-daemon/touchpad/x11/synapticstouchpad.h b/settings-daemon/touchpad/x11/synapticstouchpad.h new file mode 100644 index 0000000..c503ce1 --- /dev/null +++ b/settings-daemon/touchpad/x11/synapticstouchpad.h @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2015 Weng Xuetian + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef SYNAPTICSTOUCHPAD_H +#define SYNAPTICSTOUCHPAD_H + +#include "xcbatom.h" +#include "xlibtouchpad.h" + +class SynapticsTouchpad : public QObject, public XlibTouchpad +{ + Q_OBJECT + +public: + SynapticsTouchpad(Display *display, int deviceId); + + void setTouchpadOff(int touchpadOff) override; + int touchpadOff() override; + + XcbAtom &touchpadOffAtom() override; + +protected: + double getPropertyScale(const QString &name) const override; + +private: + XcbAtom m_capsAtom, m_touchpadOffAtom; + int m_resX, m_resY; + QStringList m_scaleByResX, m_scaleByResY, m_toRadians; +}; + +#endif // SYNAPTICSTOUCHPAD_H diff --git a/settings-daemon/touchpad/x11/xcbatom.cpp b/settings-daemon/touchpad/x11/xcbatom.cpp new file mode 100644 index 0000000..c48f9d2 --- /dev/null +++ b/settings-daemon/touchpad/x11/xcbatom.cpp @@ -0,0 +1,48 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xcbatom.h" + +#include +#include + +XcbAtom::XcbAtom() + : m_connection(nullptr) + , m_reply(nullptr) + , m_fetched(false) +{ +} + +XcbAtom::XcbAtom(xcb_connection_t *c, const char *name, bool onlyIfExists) + : m_reply(nullptr) + , m_fetched(false) +{ + intern(c, name, onlyIfExists); +} + +void XcbAtom::intern(xcb_connection_t *c, const char *name, bool onlyIfExists) +{ + m_connection = c; + m_cookie = xcb_intern_atom(c, onlyIfExists, std::strlen(name), name); +} + +XcbAtom::~XcbAtom() +{ + std::free(m_reply); +} + +xcb_atom_t XcbAtom::atom() +{ + if (!m_fetched) { + m_fetched = true; + m_reply = xcb_intern_atom_reply(m_connection, m_cookie, nullptr); + } + if (m_reply) { + return m_reply->atom; + } else { + return 0; + } +} diff --git a/settings-daemon/touchpad/x11/xcbatom.h b/settings-daemon/touchpad/x11/xcbatom.h new file mode 100644 index 0000000..e3a8914 --- /dev/null +++ b/settings-daemon/touchpad/x11/xcbatom.h @@ -0,0 +1,36 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XCBATOM_H +#define XCBATOM_H + +#include + +class XcbAtom +{ +public: + XcbAtom(); + XcbAtom(xcb_connection_t *, const char *name, bool onlyIfExists = true); + ~XcbAtom(); + + void intern(xcb_connection_t *, const char *name, bool onlyIfExists = true); + xcb_atom_t atom(); + operator xcb_atom_t() + { + return atom(); + } + +private: + XcbAtom(const XcbAtom &); + XcbAtom &operator=(const XcbAtom &); + + xcb_connection_t *m_connection; + xcb_intern_atom_cookie_t m_cookie; + xcb_intern_atom_reply_t *m_reply; + bool m_fetched; +}; + +#endif // XCBATOM_H diff --git a/settings-daemon/touchpad/x11/xlibbackend.cpp b/settings-daemon/touchpad/x11/xlibbackend.cpp new file mode 100644 index 0000000..0824bbe --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibbackend.cpp @@ -0,0 +1,425 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include +#include + +#include + +#include + +// Includes are ordered this way because of #defines in Xorg's headers +#include "xlibbackend.h" // krazy:exclude=includes +#include "xlibnotifications.h" // krazy:exclude=includes +#include "xrecordkeyboardmonitor.h" // krazy:exclude=includes + +#include +#include +#include +#include + +#include +#include + +struct DeviceListDeleter { + static void cleanup(XDeviceInfo *p) + { + if (p) { + XFreeDeviceList(p); + } + } +}; + +void XlibBackend::XDisplayCleanup::cleanup(Display *p) +{ + if (p) { + XCloseDisplay(p); + } +} + +XlibBackend *XlibBackend::initialize(QObject *parent) +{ + XlibBackend *backend = new XlibBackend(parent); + if (!backend->m_display) { + delete backend; + return nullptr; + } + return backend; +} + +XlibBackend::~XlibBackend() +{ +} + +XlibBackend::XlibBackend(QObject *parent) + : QObject(parent) + , m_display(XOpenDisplay(nullptr)) + , m_connection(nullptr) +{ + if (m_display) { + m_connection = XGetXCBConnection(m_display.data()); + } + + if (!m_connection) { + m_errorString = "Cannot connect to X server"; + return; + } + + m_mouseAtom.intern(m_connection, XI_MOUSE); + m_keyboardAtom.intern(m_connection, XI_KEYBOARD); + m_touchpadAtom.intern(m_connection, XI_TOUCHPAD); + m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); + + m_synapticsIdentifierAtom.intern(m_connection, SYNAPTICS_PROP_CAPABILITIES); + m_libinputIdentifierAtom.intern(m_connection, "libinput Send Events Modes Available"); + + m_device.reset(findTouchpad()); + if (!m_device) { + m_errorString = "No touchpad found"; + } +} + +XlibTouchpad *XlibBackend::findTouchpad() +{ + int nDevices = 0; + QScopedPointer deviceInfo(XListInputDevices(m_display.data(), &nDevices)); + + for (XDeviceInfo *info = deviceInfo.data(); info < deviceInfo.data() + nDevices; info++) { + // Make sure device is touchpad + if (info->type != m_touchpadAtom.atom()) { + continue; + } + int nProperties = 0; + QSharedPointer properties(XIListProperties(m_display.data(), info->id, &nProperties), XDeleter); + + Atom *atom = properties.data(), *atomEnd = properties.data() + nProperties; + for (; atom != atomEnd; atom++) { + + if (*atom == m_libinputIdentifierAtom.atom()) { + // setMode(TouchpadInputBackendMode::XLibinput); + return new LibinputTouchpad(m_display.data(), info->id); + } + + if (*atom == m_synapticsIdentifierAtom.atom()) { + // setMode(TouchpadInputBackendMode::XSynaptics); + return new SynapticsTouchpad(m_display.data(), info->id); + } + } + } + + return nullptr; +} + +bool XlibBackend::applyConfig(const QVariantHash &p) +{ + if (!m_device) { + return false; + } + + bool success = m_device->applyConfig(p); + if (!success) { + m_errorString = "Cannot apply touchpad configuration"; + } + + return success; +} + +bool XlibBackend::applyConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->applyConfig(); + if (!success) { + m_errorString = "Cannot apply touchpad configuration"; + } + + return success; +} + +bool XlibBackend::getConfig(QVariantHash &p) +{ + if (!m_device) { + return false; + } + + bool success = m_device->getConfig(p); + if (!success) { + m_errorString = "Cannot read touchpad configuration"; + } + return success; +} + +bool XlibBackend::getConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->getConfig(); + if (!success) { + m_errorString = "Cannot read touchpad configuration"; + } + return success; +} + +bool XlibBackend::getDefaultConfig() +{ + if (!m_device) { + return false; + } + + bool success = m_device->getDefaultConfig(); + if (!success) { + m_errorString = "Cannot read default touchpad configuration"; + } + return success; +} + +bool XlibBackend::isChangedConfig() const +{ + if (!m_device) { + return false; + } + + return m_device->isChangedConfig(); +} + +void XlibBackend::setTouchpadEnabled(bool enable) +{ + if (!m_device) { + return; + } + + m_device->setEnabled(enable); + + // FIXME? This should not be needed, m_notifications should trigger + // a propertyChanged signal when we enable/disable the touchpad, + // that will Q_EMIT touchpadStateChanged, but for some reason + // XlibNotifications is not getting the property change events + // so we just Q_EMIT touchpadStateChanged from here as a workaround + Q_EMIT touchpadStateChanged(); +} + +bool XlibBackend::tapToClick() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return false; + + return object->isTapToClick(); +} + +void XlibBackend::setTapToClick(bool enabled) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setTapToClick(enabled); +} + +bool XlibBackend::naturalScroll() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return false; + + return object->isNaturalScroll(); +} + +void XlibBackend::setNaturalScroll(bool value) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setNaturalScroll(value); +} + +qreal XlibBackend::pointerAcceleration() +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return 1; + + return object->pointerAcceleration(); +} + +void XlibBackend::setPointerAcceleration(qreal value) +{ + LibinputTouchpad *object = dynamic_cast(m_device.data()); + + if (!object) + return; + + object->setPointerAcceleration(value); +} + +void XlibBackend::setTouchpadOff(XlibBackend::TouchpadOffState state) +{ + if (!m_device) { + return; + } + + int touchpadOff = 0; + switch (state) { + case TouchpadEnabled: + touchpadOff = 0; + break; + case TouchpadFullyDisabled: + touchpadOff = 1; + break; + case TouchpadTapAndScrollDisabled: + touchpadOff = 2; + break; + default: + qCritical() << "Unknown TouchpadOffState" << state; + return; + } + + m_device->setTouchpadOff(touchpadOff); +} + +bool XlibBackend::isTouchpadAvailable() +{ + return m_device; +} + +bool XlibBackend::isTouchpadEnabled() +{ + if (!m_device) { + return false; + } + + return m_device->enabled(); +} + +XlibBackend::TouchpadOffState XlibBackend::getTouchpadOff() +{ + if (!m_device) { + return TouchpadFullyDisabled; + } + int value = m_device->touchpadOff(); + switch (value) { + case 0: + return TouchpadEnabled; + case 1: + return TouchpadFullyDisabled; + case 2: + return TouchpadTapAndScrollDisabled; + default: + qCritical() << "Unknown TouchpadOff value" << value; + return TouchpadFullyDisabled; + } +} + +void XlibBackend::touchpadDetached() +{ + qWarning() << "Touchpad detached"; + m_device.reset(); + Q_EMIT touchpadReset(); +} + +void XlibBackend::devicePlugged(int device) +{ + if (!m_device) { + m_device.reset(findTouchpad()); + if (m_device) { + qWarning() << "Touchpad reset"; + m_notifications.reset(); + watchForEvents(m_keyboard); + Q_EMIT touchpadReset(); + } + } + if (!m_device || device != m_device->deviceId()) { + Q_EMIT mousesChanged(); + } +} + +void XlibBackend::propertyChanged(xcb_atom_t prop) +{ + if ((m_device && prop == m_device->touchpadOffAtom().atom()) || prop == m_enabledAtom.atom()) { + Q_EMIT touchpadStateChanged(); + } +} + +QStringList XlibBackend::listMouses(const QStringList &blacklist) +{ + int nDevices = 0; + QScopedPointer info(XListInputDevices(m_display.data(), &nDevices)); + QStringList list; + for (XDeviceInfo *i = info.data(); i != info.data() + nDevices; i++) { + if (m_device && i->id == static_cast(m_device->deviceId())) { + continue; + } + if (i->use != IsXExtensionPointer && i->use != IsXPointer) { + continue; + } + // type = KEYBOARD && use = Pointer means usb receiver for both keyboard + // and mouse + if (i->type != m_mouseAtom.atom() && i->type != m_keyboardAtom.atom()) { + continue; + } + QString name(i->name); + if (blacklist.contains(name, Qt::CaseInsensitive)) { + continue; + } + PropertyInfo enabled(m_display.data(), i->id, m_enabledAtom.atom(), 0); + if (enabled.value(0) == false) { + continue; + } + list.append(name); + } + + return list; +} + +QVector XlibBackend::getDevices() const +{ + QVector touchpads; + + LibinputTouchpad *libinputtouchpad = dynamic_cast(m_device.data()); + if (libinputtouchpad) { + touchpads.push_back(libinputtouchpad); + } + + SynapticsTouchpad *synaptics = dynamic_cast(m_device.data()); + if (synaptics) { + touchpads.push_back(synaptics); + } + + return touchpads; +} + +void XlibBackend::watchForEvents(bool keyboard) +{ + if (!m_notifications) { + m_notifications.reset(new XlibNotifications(m_display.data(), m_device ? m_device->deviceId() : XIAllDevices)); + connect(m_notifications.data(), SIGNAL(devicePlugged(int)), SLOT(devicePlugged(int))); + connect(m_notifications.data(), SIGNAL(touchpadDetached()), SLOT(touchpadDetached())); + connect(m_notifications.data(), SIGNAL(propertyChanged(xcb_atom_t)), SLOT(propertyChanged(xcb_atom_t))); + } + + if (keyboard == !m_keyboard.isNull()) { + return; + } + + if (!keyboard) { + m_keyboard.reset(); + return; + } + + m_keyboard.reset(new XRecordKeyboardMonitor(m_display.data())); + connect(m_keyboard.data(), SIGNAL(keyboardActivityStarted()), SIGNAL(keyboardActivityStarted())); + connect(m_keyboard.data(), SIGNAL(keyboardActivityFinished()), SIGNAL(keyboardActivityFinished())); +} diff --git a/settings-daemon/touchpad/x11/xlibbackend.h b/settings-daemon/touchpad/x11/xlibbackend.h new file mode 100644 index 0000000..c4af163 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibbackend.h @@ -0,0 +1,124 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBBACKEND_H +#define XLIBBACKEND_H + +#include +#include +#include +#include +#include +#include +#include + +#include "libinputtouchpad.h" +#include "synapticstouchpad.h" +#include "xlibtouchpad.h" + +#include + +#include "propertyinfo.h" +#include "xcbatom.h" + +class XlibTouchpad; +class XlibNotifications; +class XRecordKeyboardMonitor; + +class XlibBackend : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int touchpadCount READ touchpadCount CONSTANT) + +public: + enum TouchpadOffState { + TouchpadEnabled, + TouchpadTapAndScrollDisabled, + TouchpadFullyDisabled, + }; + + static XlibBackend *initialize(QObject *parent = nullptr); + ~XlibBackend(); + + bool applyConfig(const QVariantHash &); + bool applyConfig(); + bool getConfig(QVariantHash &); + bool getConfig(); + bool getDefaultConfig(); + bool isChangedConfig() const; + QStringList supportedParameters() const + { + return m_device ? m_device->supportedParameters() : QStringList(); + } + QString errorString() const + { + return m_errorString; + } + int touchpadCount() const + { + return m_device ? 1 : 0; + } + + void setTouchpadOff(TouchpadOffState); + TouchpadOffState getTouchpadOff(); + + bool isTouchpadAvailable(); + bool isTouchpadEnabled(); + void setTouchpadEnabled(bool); + + bool tapToClick(); + void setTapToClick(bool enabled); + + bool naturalScroll(); + void setNaturalScroll(bool value); + + qreal pointerAcceleration(); + void setPointerAcceleration(qreal value); + + void watchForEvents(bool keyboard); + + QStringList listMouses(const QStringList &blacklist); + QVector getDevices() const; + +signals: + void touchpadStateChanged(); + void mousesChanged(); + void touchpadReset(); + void keyboardActivityStarted(); + void keyboardActivityFinished(); + + void touchpadAdded(bool success); + void touchpadRemoved(int index); + +private Q_SLOTS: + void propertyChanged(xcb_atom_t); + void touchpadDetached(); + void devicePlugged(int); + +protected: + explicit XlibBackend(QObject *parent); + + struct XDisplayCleanup { + static void cleanup(Display *); + }; + + QScopedPointer m_display; + xcb_connection_t *m_connection; + + XcbAtom m_enabledAtom, m_mouseAtom, m_keyboardAtom, m_touchpadAtom; + XcbAtom m_synapticsIdentifierAtom; + XcbAtom m_libinputIdentifierAtom; + + XlibTouchpad *findTouchpad(); + QScopedPointer m_device; + + QString m_errorString; + QScopedPointer m_notifications; + QScopedPointer m_keyboard; +}; + +#endif // XLIBBACKEND_H diff --git a/settings-daemon/touchpad/x11/xlibnotifications.cpp b/settings-daemon/touchpad/x11/xlibnotifications.cpp new file mode 100644 index 0000000..13037c2 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibnotifications.cpp @@ -0,0 +1,135 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xlibnotifications.h" + +#include + +#include +#include +#include +#include + +XlibNotifications::XlibNotifications(Display *display, int device) + : m_display(display) + , m_device(device) +{ + m_connection = XGetXCBConnection(display); + + m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); + + xcb_query_extension_cookie_t inputExtCookie = xcb_query_extension(m_connection, std::strlen(INAME), INAME); + QScopedPointer inputExt(xcb_query_extension_reply(m_connection, inputExtCookie, nullptr)); + if (!inputExt) { + return; + } + m_inputOpcode = inputExt->major_opcode; + + const xcb_setup_t *setup = xcb_get_setup(m_connection); + xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup); + xcb_screen_t *screen = iter.data; + + m_inputWindow = xcb_generate_id(m_connection); + xcb_create_window(m_connection, 0, m_inputWindow, screen->root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, 0, 0, nullptr); + xcb_flush(m_connection); + + XIEventMask masks[2]; + + unsigned char touchpadMask[] = {0, 0, 0, 0}; + masks[0].deviceid = device; + masks[0].mask = touchpadMask; + masks[0].mask_len = sizeof(touchpadMask); + XISetMask(touchpadMask, XI_PropertyEvent); + + unsigned char allMask[] = {0, 0, 0, 0}; + masks[1].deviceid = XIAllDevices; + masks[1].mask = allMask; + masks[1].mask_len = sizeof(allMask); + XISetMask(allMask, XI_HierarchyChanged); + + XISelectEvents(display, XDefaultRootWindow(display), masks, sizeof(masks) / sizeof(XIEventMask)); + XFlush(display); + + connect(m_notifier, SIGNAL(activated(int)), SLOT(processEvents())); + m_notifier->setEnabled(true); +} + +void XlibNotifications::processEvents() +{ + while (XPending(m_display)) { + XEvent event; + XNextEvent(m_display, &event); + processEvent(&event); + } +} + +struct XEventDataDeleter { + XEventDataDeleter(Display *display, XGenericEventCookie *cookie) + : m_display(display) + , m_cookie(cookie) + { + XGetEventData(m_display, m_cookie); + } + + ~XEventDataDeleter() + { + if (m_cookie->data) { + XFreeEventData(m_display, m_cookie); + } + } + + Display *m_display; + XGenericEventCookie *m_cookie; +}; + +void XlibNotifications::processEvent(XEvent *event) +{ + if (event->xcookie.type != GenericEvent) { + return; + } + if (event->xcookie.extension != m_inputOpcode) { + return; + } + + if (event->xcookie.evtype == XI_PropertyEvent) { + XEventDataDeleter helper(m_display, &event->xcookie); + if (!event->xcookie.data) { + return; + } + + XIPropertyEvent *propEvent = reinterpret_cast(event->xcookie.data); + Q_EMIT propertyChanged(propEvent->property); + } else if (event->xcookie.evtype == XI_HierarchyChanged) { + XEventDataDeleter helper(m_display, &event->xcookie); + if (!event->xcookie.data) { + return; + } + + XIHierarchyEvent *hierarchyEvent = reinterpret_cast(event->xcookie.data); + for (uint16_t i = 0; i < hierarchyEvent->num_info; i++) { + if (hierarchyEvent->info[i].deviceid == m_device) { + if (hierarchyEvent->info[i].flags & XISlaveRemoved) { + Q_EMIT touchpadDetached(); + return; + } + } + if (hierarchyEvent->info[i].use != XISlavePointer) { + continue; + } + if (hierarchyEvent->info[i].flags & (XIDeviceEnabled | XIDeviceDisabled)) { + Q_EMIT devicePlugged(hierarchyEvent->info[i].deviceid); + } + } + } +} + +XlibNotifications::~XlibNotifications() +{ + xcb_destroy_window(m_connection, m_inputWindow); + xcb_flush(m_connection); +} + +#include "moc_xlibnotifications.cpp" diff --git a/settings-daemon/touchpad/x11/xlibnotifications.h b/settings-daemon/touchpad/x11/xlibnotifications.h new file mode 100644 index 0000000..5ca6f1d --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibnotifications.h @@ -0,0 +1,41 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBNOTIFICATIONS_H +#define XLIBNOTIFICATIONS_H + +#include + +#include +#include + +class XlibNotifications : public QObject +{ + Q_OBJECT +public: + XlibNotifications(Display *display, int device); + ~XlibNotifications(); + +Q_SIGNALS: + void propertyChanged(xcb_atom_t); + void devicePlugged(int); + void touchpadDetached(); + +private Q_SLOTS: + void processEvents(); + +private: + void processEvent(XEvent *); + + Display *m_display; + xcb_connection_t *m_connection; + QSocketNotifier *m_notifier; + xcb_window_t m_inputWindow; + uint8_t m_inputOpcode; + int m_device; +}; + +#endif // XLIBNOTIFICATIONS_H diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.cpp b/settings-daemon/touchpad/x11/xlibtouchpad.cpp new file mode 100644 index 0000000..7581c9a --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibtouchpad.cpp @@ -0,0 +1,257 @@ +#include + +#include "xlibtouchpad.h" +#include +#include +#include +#include + +static QVariant negateVariant(const QVariant &value) +{ + if (value.type() == QVariant::Double) { + return QVariant(-value.toDouble()); + } else if (value.type() == QVariant::Int) { + return QVariant(-value.toInt()); + } + return value; +} + +XlibTouchpad::XlibTouchpad(Display *display, int deviceId) + : m_display(display) + , m_connection(XGetXCBConnection(display)) + , m_deviceId(deviceId) +{ + m_floatType.intern(m_connection, "FLOAT"); + m_enabledAtom.intern(m_connection, XI_PROP_ENABLED); +} + +bool XlibTouchpad::applyConfig(const QVariantHash &p) +{ + m_props.clear(); + + bool error = false; + for (const QString &name : qAsConst(m_supported)) { + QVariantHash::ConstIterator i = p.find(name); + if (i == p.end()) { + continue; + } + const Parameter *par = findParameter(name); + if (par) { + QVariant value(i.value()); + + double k = getPropertyScale(name); + if (k != 1.0) { + bool ok = false; + value = QVariant(value.toDouble(&ok) * k); + if (!ok) { + error = true; + continue; + } + } + + if (m_negate.contains(name)) { + QVariantHash::ConstIterator i = p.find(m_negate[name]); + if (i != p.end() && i.value().toBool()) { + value = negateVariant(value); + } + } + + if (name == "CoastingSpeed") { + QVariantHash::ConstIterator coastingEnabled = p.find("Coasting"); + if (coastingEnabled != p.end() && !coastingEnabled.value().toBool()) { + value = QVariant(0); + } + } + + if (!setParameter(par, value)) { + error = true; + } + } + } + + flush(); + + return !error; +} + +bool XlibTouchpad::getConfig(QVariantHash &p) +{ + if (m_supported.isEmpty()) { + return false; + } + + m_props.clear(); + + bool error = false; + for (const QString &name : qAsConst(m_supported)) { + const Parameter *par = findParameter(name); + if (!par) { + continue; + } + + QVariant value(getParameter(par)); + if (!value.isValid()) { + error = true; + continue; + } + + double k = getPropertyScale(name); + if (k != 1.0) { + bool ok = false; + value = QVariant(value.toDouble(&ok) / k); + if (!ok) { + error = true; + continue; + } + } + + if (m_negate.contains(name)) { + bool negative = value.toDouble() < 0.0; + p[m_negate[name]] = QVariant(negative); + if (negative) { + value = negateVariant(value); + } + } + + if (name == "CoastingSpeed") { + bool coasting = value.toDouble() != 0.0; + p["Coasting"] = QVariant(coasting); + if (!coasting) { + continue; + } + } + + p[name] = value; + } + + return !error; +} + +void XlibTouchpad::loadSupportedProperties(const Parameter *props) +{ + m_paramList = props; + for (const Parameter *param = props; param->name; param++) { + QLatin1String name(param->prop_name); + + if (!m_atoms.contains(name)) { + m_atoms.insert(name, QSharedPointer(new XcbAtom(m_connection, param->prop_name))); + } + } + + for (const Parameter *p = props; p->name; p++) { + if (getParameter(p).isValid()) { + m_supported.append(p->name); + } + } +} + +QVariant XlibTouchpad::getParameter(const Parameter *par) +{ + PropertyInfo *p = getDevProperty(QLatin1String(par->prop_name)); + if (!p || par->prop_offset >= p->nitems) { + return QVariant(); + } + + return p->value(par->prop_offset); +} + +void XlibTouchpad::flush() +{ + for (const QLatin1String &name : qAsConst(m_changed)) { + m_props[name].set(); + } + m_changed.clear(); + + XFlush(m_display); +} + +double XlibTouchpad::getPropertyScale(const QString &name) const +{ + Q_UNUSED(name); + return 1.0; +} + +PropertyInfo *XlibTouchpad::getDevProperty(const QLatin1String &propName) +{ + if (m_props.contains(propName)) { + return &m_props[propName]; + } + + if (!m_atoms.contains(propName) || !m_atoms[propName]) { + return nullptr; + } + + xcb_atom_t prop = m_atoms[propName]->atom(); + if (!prop) { + return nullptr; + } + + PropertyInfo p(m_display, m_deviceId, prop, m_floatType.atom()); + if (!p.b && !p.f && !p.i) { + return nullptr; + } + return &m_props.insert(propName, p).value(); +} + +bool XlibTouchpad::setParameter(const Parameter *par, const QVariant &value) +{ + QLatin1String propName(par->prop_name); + PropertyInfo *p = getDevProperty(propName); + if (!p || par->prop_offset >= p->nitems) { + return false; + } + + QVariant converted(value); + QVariant::Type convType = QVariant::Int; + if (p->f) { + convType = QVariant::Double; + } else if (value.type() == QVariant::Double) { + converted = QVariant(qRound(static_cast(value.toDouble()))); + } + + if (!converted.convert(convType)) { + return false; + } + + if (converted == p->value(par->prop_offset)) { + return true; + } + + if (p->b) { + p->b[par->prop_offset] = static_cast(converted.toInt()); + } else if (p->i) { + p->i[par->prop_offset] = converted.toInt(); + } else if (p->f) { + p->f[par->prop_offset] = converted.toDouble(); + } + + m_changed.insert(propName); + return true; +} + +void XlibTouchpad::setEnabled(bool enable) +{ + PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); + if (enabled.b && *(enabled.b) != enable) { + *(enabled.b) = enable; + enabled.set(); + } + + flush(); +} + +bool XlibTouchpad::enabled() +{ + PropertyInfo enabled(m_display, m_deviceId, m_enabledAtom.atom(), 0); + return enabled.value(0).toBool(); +} + +const Parameter *XlibTouchpad::findParameter(const QString &name) +{ + for (const Parameter *par = m_paramList; par->name; par++) { + if (name == par->name) { + return par; + } + } + return nullptr; +} diff --git a/settings-daemon/touchpad/x11/xlibtouchpad.h b/settings-daemon/touchpad/x11/xlibtouchpad.h new file mode 100644 index 0000000..f20bb66 --- /dev/null +++ b/settings-daemon/touchpad/x11/xlibtouchpad.h @@ -0,0 +1,101 @@ +/* + SPDX-FileCopyrightText: 2015 Weng Xuetian + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XLIBTOUCHPAD_H +#define XLIBTOUCHPAD_H + +#include +#include +#include + +#include "propertyinfo.h" +#include "xcbatom.h" +#include + +enum ParaType { + PT_INT, + PT_BOOL, + PT_DOUBLE, +}; + +struct Parameter { + const char *name; /* Name of parameter */ + enum ParaType type; /* Type of parameter */ + double min_val; /* Minimum allowed value */ + double max_val; /* Maximum allowed value */ + const char *prop_name; /* Property name */ + int prop_format; /* Property format (0 for floats) */ + unsigned prop_offset; /* Offset inside property */ +}; + +class XlibTouchpad +{ +public: + XlibTouchpad(Display *display, int deviceId); + virtual ~XlibTouchpad() + { + } + + int deviceId() + { + return m_deviceId; + } + const QStringList &supportedParameters() const + { + return m_supported; + } + bool applyConfig(const QVariantHash &p); + bool getConfig(QVariantHash &p); + virtual bool getConfig() + { + return false; + } + virtual bool applyConfig() + { + return false; + } + virtual bool getDefaultConfig() + { + return false; + } + virtual bool isChangedConfig() + { + return false; + } + void setEnabled(bool enable); + bool enabled(); + virtual void setTouchpadOff(int /*touchpadOff*/) + { + } + virtual int touchpadOff() = 0; + + virtual XcbAtom &touchpadOffAtom() = 0; + +protected: + void loadSupportedProperties(const Parameter *props); + bool setParameter(const struct Parameter *, const QVariant &); + QVariant getParameter(const struct Parameter *); + struct PropertyInfo *getDevProperty(const QLatin1String &propName); + void flush(); + virtual double getPropertyScale(const QString &name) const; + const Parameter *findParameter(const QString &name); + + Display *m_display; + xcb_connection_t *m_connection; + int m_deviceId; + + XcbAtom m_floatType, m_enabledAtom; + + QMap> m_atoms; + + QMap m_negate; + QMap m_props; + QSet m_changed; + QStringList m_supported; + const struct Parameter *m_paramList; +}; + +#endif diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp new file mode 100644 index 0000000..c9fe99b --- /dev/null +++ b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.cpp @@ -0,0 +1,140 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "xrecordkeyboardmonitor.h" + +#include +#include + +#include + +#include +#include + +XRecordKeyboardMonitor::XRecordKeyboardMonitor(Display *display) + : m_connection(xcb_connect(XDisplayString(display), nullptr)) + , m_modifiersPressed(0) + , m_keysPressed(0) +{ + if (!m_connection) { + return; + } + + xcb_get_modifier_mapping_cookie_t modmapCookie = xcb_get_modifier_mapping(m_connection); + + m_context = xcb_generate_id(m_connection); + xcb_record_range_t range; + memset(&range, 0, sizeof(range)); + range.device_events.first = XCB_KEY_PRESS; + range.device_events.last = XCB_KEY_RELEASE; + xcb_record_client_spec_t cs = XCB_RECORD_CS_ALL_CLIENTS; + xcb_record_create_context(m_connection, m_context, 0, 1, 1, &cs, &range); + xcb_flush(m_connection); + + QScopedPointer modmap(xcb_get_modifier_mapping_reply(m_connection, modmapCookie, nullptr)); + if (!modmap) { + return; + } + + int nModifiers = xcb_get_modifier_mapping_keycodes_length(modmap.data()); + xcb_keycode_t *modifiers = xcb_get_modifier_mapping_keycodes(modmap.data()); + m_modifier.fill(false, std::numeric_limits::max() + 1); + for (xcb_keycode_t *i = modifiers; i < modifiers + nModifiers; i++) { + m_modifier[*i] = true; + } + m_ignore.fill(false, std::numeric_limits::max() + 1); + for (xcb_keycode_t *i = modifiers; i < modifiers + modmap->keycodes_per_modifier; i++) { + m_ignore[*i] = true; + } + m_pressed.fill(false, std::numeric_limits::max() + 1); + + m_cookie = xcb_record_enable_context(m_connection, m_context); + xcb_flush(m_connection); + + m_notifier = new QSocketNotifier(xcb_get_file_descriptor(m_connection), QSocketNotifier::Read, this); + connect(m_notifier, &QSocketNotifier::activated, this, &XRecordKeyboardMonitor::processNextReply); + m_notifier->setEnabled(true); +} + +XRecordKeyboardMonitor::~XRecordKeyboardMonitor() +{ + if (!m_connection) { + return; + } + + xcb_record_disable_context(m_connection, m_context); + xcb_record_free_context(m_connection, m_context); + xcb_disconnect(m_connection); +} + +void XRecordKeyboardMonitor::processNextReply() +{ + xcb_generic_event_t *event; + while ((event = xcb_poll_for_event(m_connection))) { + std::free(event); + } + + void *reply = nullptr; + xcb_generic_error_t *error = nullptr; + while (m_cookie.sequence && xcb_poll_for_reply(m_connection, m_cookie.sequence, &reply, &error)) { + // xcb_poll_for_reply may set both reply and error to null if connection has error. + // break if xcb_connection has error, no point to continue anyway. + if (xcb_connection_has_error(m_connection)) { + break; + } + + if (error) { + std::free(error); + break; + } + + if (!reply) { + continue; + } + + QScopedPointer data(reinterpret_cast(reply)); + process(data.data()); + } +} + +void XRecordKeyboardMonitor::process(xcb_record_enable_context_reply_t *reply) +{ + bool prevActivity = activity(); + + xcb_key_press_event_t *events = reinterpret_cast(xcb_record_enable_context_data(reply)); + int nEvents = xcb_record_enable_context_data_length(reply) / sizeof(xcb_key_press_event_t); + bool wasActivity = prevActivity; + for (xcb_key_press_event_t *e = events; e < events + nEvents; e++) { + if (e->response_type != XCB_KEY_PRESS && e->response_type != XCB_KEY_RELEASE) { + continue; + } + + if (m_ignore[e->detail]) { + continue; + } + + bool pressed = (e->response_type == XCB_KEY_PRESS); + if (m_pressed[e->detail] == pressed) { + continue; + } + m_pressed[e->detail] = pressed; + + int &counter = m_modifier[e->detail] ? m_modifiersPressed : m_keysPressed; + if (pressed) { + counter++; + } else { + counter--; + } + + wasActivity = wasActivity || activity(); + } + + if (!prevActivity && activity()) { + Q_EMIT keyboardActivityStarted(); + } else if (!activity() && wasActivity) { + Q_EMIT keyboardActivityFinished(); + } +} diff --git a/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h new file mode 100644 index 0000000..6abec2f --- /dev/null +++ b/settings-daemon/touchpad/x11/xrecordkeyboardmonitor.h @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2013 Alexander Mezin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef XRECORDKEYBOARDMONITOR_H +#define XRECORDKEYBOARDMONITOR_H + +#include +#include + +#include +#include + +class XRecordKeyboardMonitor : public QObject +{ + Q_OBJECT + +public: + XRecordKeyboardMonitor(Display *display); + ~XRecordKeyboardMonitor(); + +Q_SIGNALS: + void keyboardActivityStarted(); + void keyboardActivityFinished(); + +private Q_SLOTS: + void processNextReply(); + +private: + void process(xcb_record_enable_context_reply_t *reply); + bool activity() const + { + return m_keysPressed && !m_modifiersPressed; + } + + QSocketNotifier *m_notifier; + xcb_connection_t *m_connection; + xcb_record_context_t m_context; + xcb_record_enable_context_cookie_t m_cookie; + + QVector m_modifier, m_ignore, m_pressed; + int m_modifiersPressed, m_keysPressed; +}; + +#endif // XRECORDKEYBOARDMONITOR_H From 4abd3990c482b78a2fdd796bcfc6625d8248e139 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:12:19 +0800 Subject: [PATCH 241/254] modified: settings-daemon/CMakeLists.txt modified: settings-daemon/application.cpp modified: settings-daemon/application.h --- settings-daemon/CMakeLists.txt | 16 ++++++++-------- settings-daemon/application.cpp | 2 +- settings-daemon/application.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 01ff895..2b6ce3b 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -27,11 +27,11 @@ file (GLOB_RECURSE SRCS "dock/*.cpp" "dock/*.h" "mouse/*.h" - "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" +# "mouse/*.cpp" +# "touchpad/*.h" +# "touchpad/*.cpp" +# "touchpad/x11/*.h" +# "touchpad/x11/*.cpp" ) list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") @@ -58,9 +58,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/application.cpp b/settings-daemon/application.cpp index 9b3c544..c98ff5f 100755 --- a/settings-daemon/application.cpp +++ b/settings-daemon/application.cpp @@ -43,7 +43,7 @@ Application::Application(int &argc, char **argv) , m_upowerManager(new UPowerManager(this)) , m_language(Language::self()) , m_mouse(new Mouse) - , m_touchpad(new TouchpadManager) + // , m_touchpad(new TouchpadManager) , m_defaultApps(new DefaultApplications) // , m_kwinTimer(new QTimer(this)) diff --git a/settings-daemon/application.h b/settings-daemon/application.h index a0661e7..73fbcfd 100755 --- a/settings-daemon/application.h +++ b/settings-daemon/application.h @@ -26,7 +26,7 @@ #include "battery/upowermanager.h" #include "language/language.h" #include "mouse/mousemanager.h" -#include "touchpad/touchpadmanager.h" +// #include "touchpad/touchpadmanager.h" #include "defaultapplications.h" #include @@ -49,7 +49,7 @@ class Application : public QApplication UPowerManager *m_upowerManager; Language *m_language; Mouse *m_mouse; - TouchpadManager *m_touchpad; + // TouchpadManager *m_touchpad; DefaultApplications *m_defaultApps; // QTimer *m_kwinTimer; From 3f26526a63515d86da7a6a40e5bf6ecd2dcdb356 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:12:55 +0800 Subject: [PATCH 242/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 2b6ce3b..8213811 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -27,7 +27,7 @@ file (GLOB_RECURSE SRCS "dock/*.cpp" "dock/*.h" "mouse/*.h" -# "mouse/*.cpp" + "mouse/*.cpp" # "touchpad/*.h" # "touchpad/*.cpp" # "touchpad/x11/*.h" From 419d224994e2d0455b20eff16b6c166bf96d1ce8 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:15:48 +0800 Subject: [PATCH 243/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 8213811..46562e4 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -13,25 +13,25 @@ pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) file (GLOB_RECURSE SRCS - "*.cpp" - "*.h" - "theme/*.h" - "theme/*.cpp" - "brightness/*.h" - "brightness/*.cpp" - "brightness/*.c" - "battery/*.cpp" - "battery/*.h" - "language/*.cpp" - "language/*.h" - "dock/*.cpp" - "dock/*.h" - "mouse/*.h" - "mouse/*.cpp" -# "touchpad/*.h" -# "touchpad/*.cpp" -# "touchpad/x11/*.h" -# "touchpad/x11/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.c" + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.cpp" +# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.h" +# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.cpp" +# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.h" +# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.cpp" ) list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") From 5e14f330c609ef0984934cd1e5bbcee7f88968e2 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:18:55 +0800 Subject: [PATCH 244/254] modified: settings-daemon/CMakeLists.txt deleted: settings-daemon/touchpad.zip --- settings-daemon/CMakeLists.txt | 46 ++++++++++++++++----------------- settings-daemon/touchpad.zip | Bin 25447 -> 0 bytes 2 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 settings-daemon/touchpad.zip diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index 46562e4..bebb8d1 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -12,26 +12,26 @@ pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET) pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) -file (GLOB_RECURSE SRCS - "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.c" - "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/language/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/language/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.cpp" -# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.h" -# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.cpp" -# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.h" -# "{CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.cpp" +file (GLOB SRCS + "*.cpp" + "*.h" + "theme/*.h" + "theme/*.cpp" + "brightness/*.h" + "brightness/*.cpp" + "brightness/*.c" + "battery/*.cpp" + "battery/*.h" + "language/*.cpp" + "language/*.h" + "dock/*.cpp" + "dock/*.h" + "mouse/*.h" + "mouse/*.cpp" + "touchpad/*.h" + "touchpad/*.cpp" + "touchpad/x11/*.h" + "touchpad/x11/*.cpp" ) list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") @@ -58,9 +58,9 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -# qt_add_dbus_adaptor(DBUS_SOURCES -# touchpad/com.lingmo.Touchpad.xml -# touchpad/touchpadmanager.h TouchpadManager) +qt_add_dbus_adaptor(DBUS_SOURCES + touchpad/com.lingmo.Touchpad.xml + touchpad/touchpadmanager.h TouchpadManager) set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) diff --git a/settings-daemon/touchpad.zip b/settings-daemon/touchpad.zip deleted file mode 100644 index 08f16e61cd7db844cb3547625ff9a97667f4c7a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25447 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 From c6ec1477da9fc3ac529097217c14eb2fc5e34680 Mon Sep 17 00:00:00 2001 From: Intro Date: Sat, 29 Jun 2024 21:21:57 +0800 Subject: [PATCH 245/254] modified: settings-daemon/CMakeLists.txt --- settings-daemon/CMakeLists.txt | 84 ++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/settings-daemon/CMakeLists.txt b/settings-daemon/CMakeLists.txt index bebb8d1..57ab349 100755 --- a/settings-daemon/CMakeLists.txt +++ b/settings-daemon/CMakeLists.txt @@ -12,30 +12,63 @@ pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET) pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET) pkg_check_modules(SYNAPTICS xorg-synaptics IMPORTED_TARGET GLOBAL) -file (GLOB SRCS - "*.cpp" - "*.h" - "theme/*.h" - "theme/*.cpp" - "brightness/*.h" - "brightness/*.cpp" - "brightness/*.c" - "battery/*.cpp" - "battery/*.h" - "language/*.cpp" - "language/*.h" - "dock/*.cpp" - "dock/*.h" - "mouse/*.h" - "mouse/*.cpp" - "touchpad/*.h" - "touchpad/*.cpp" - "touchpad/x11/*.h" - "touchpad/x11/*.cpp" +# 只查找当前目录的文件,不递归 +file(GLOB SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" +) + +# 分别添加各个子目录的文件 +file(GLOB THEME_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/theme/*.h" +) + +file(GLOB BRIGHTNESS_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/brightness/*.c" +) + +file(GLOB BATTERY_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/battery/*.h" +) + +file(GLOB LANGUAGE_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/language/*.h" +) + +file(GLOB DOCK_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/dock/*.h" +) + +file(GLOB MOUSE_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/mouse/*.h" +) + +file(GLOB TOUCHPAD_SRCS + "${CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/touchpad/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/touchpad/x11/*.cpp" +) + +# 合并所有源文件 +set(SOURCES + ${SRCS} + ${THEME_SRCS} + ${BRIGHTNESS_SRCS} + ${BATTERY_SRCS} + ${LANGUAGE_SRCS} + ${DOCK_SRCS} + ${MOUSE_SRCS} + # ${TOUCHPAD_SRCS} ) -list(FILTER SRCS EXCLUDE REGEX ".*CompilerIdCXX.*") -set(SOURCES ${SRCS}) set(HEADERS "") set(FORMS "") set(RESOURCES "") @@ -58,9 +91,10 @@ qt_add_dbus_adaptor(DBUS_SOURCES qt_add_dbus_adaptor(DBUS_SOURCES mouse/com.lingmo.Mouse.xml mouse/mousemanager.h Mouse) -qt_add_dbus_adaptor(DBUS_SOURCES - touchpad/com.lingmo.Touchpad.xml - touchpad/touchpadmanager.h TouchpadManager) +# qt_add_dbus_adaptor(DBUS_SOURCES +# touchpad/com.lingmo.Touchpad.xml +# touchpad/touchpadmanager.h TouchpadManager) + set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON) add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES} ${HEADERS} ${FORMS} ${RESOURCES}) From 55fffd0e04a07f2684d3652d48f00f1a2489f3c8 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 02:51:43 +0800 Subject: [PATCH 246/254] modified: session/processmanager.cpp --- session/processmanager.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 4a346ae..72b81c7 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -178,19 +178,21 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag // ref: lxqt session if (!m_wmStarted && m_waitLoop) { - // all window managers must set their name according to the spec - - xcb_connection_t *connection = dynamic_cast(qApp)->connection(); - - if (!QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()).isEmpty()) { - qDebug() << "Window manager started"; - m_wmStarted = true; - if (m_waitLoop && m_waitLoop->isRunning()) - m_waitLoop->exit(); - - qApp->removeNativeEventFilter(this); + if (auto *native = dynamic_cast(qApp)) { // Ensure qApp is a QX11Application instance + xcb_connection_t *connection = native->connection(); + if (connection) { // Ensure connection is valid + QString wmName = QString::fromUtf8(NETRootInfo(connection, NET::SupportingWMCheck).wmName()); + if (!wmName.isEmpty()) { + qDebug() << "Window manager started"; + m_wmStarted = true; + if (m_waitLoop && m_waitLoop->isRunning()) + m_waitLoop->exit(); + qApp->removeNativeEventFilter(this); + } + } } } return false; } + From abf1bbc3b9bd5d823c52a129858f853f8fa366b6 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 03:15:23 +0800 Subject: [PATCH 247/254] modified: xembed-sni-proxy/sniproxy.cpp --- xembed-sni-proxy/sniproxy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp index 1f765a2..30b6d6b 100755 --- a/xembed-sni-proxy/sniproxy.cpp +++ b/xembed-sni-proxy/sniproxy.cpp @@ -56,7 +56,8 @@ void xembed_message_send(xcb_window_t towin, long message, long d1, long d2, lon ev.data.data32[3] = d2; ev.data.data32[4] = d3; ev.type = Xcb::atoms->xembedAtom; - xcb_send_event(qApp->nativeInterface()->connection(), false, towin, XCB_EVENT_MASK_NO_EVENT, (char *)&ev); + if(auto native = qApp->nativeInterface()) + xcb_send_event(native->connection(), false, towin, XCB_EVENT_MASK_NO_EVENT, (char *)&ev); } SNIProxy::SNIProxy(xcb_window_t wid, QObject *parent) From 27f235b3ee06904b42015f98761e8b557eb2a604 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 03:28:58 +0800 Subject: [PATCH 248/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 0ab403f..eb92d98 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -21,6 +21,7 @@ #include "sniproxy.h" #include "xcbutils.h" +#include #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 @@ -44,6 +45,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { + syslog(LOG_INFO, "FdoSelectionManager::init()"); // load damage extension if (auto *native = dynamic_cast(qApp)) { xcb_connection_t *c = native->connection(); // 使用新的接口 @@ -68,6 +70,7 @@ void FdoSelectionManager::init() connect(m_selectionOwner, &KSelectionOwner::failedToClaimOwnership, this, &FdoSelectionManager::onFailedToClaimOwnership); connect(m_selectionOwner, &KSelectionOwner::lostOwnership, this, &FdoSelectionManager::onLostOwnership); m_selectionOwner->claim(false); + syslog(LOG_INFO, "FdoSelectionManager::init() end"); } bool FdoSelectionManager::addDamageWatch(xcb_window_t client) From ce0582fcc8b153f3e66bed10d0df1b0bbdaf8df9 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 03:38:32 +0800 Subject: [PATCH 249/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp --- xembed-sni-proxy/fdoselectionmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index eb92d98..811604e 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -45,7 +45,7 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { - syslog(LOG_INFO, "FdoSelectionManager::init()"); + syslog(LOG_WARNING, "FdoSelectionManager::init() start"); // load damage extension if (auto *native = dynamic_cast(qApp)) { xcb_connection_t *c = native->connection(); // 使用新的接口 @@ -70,7 +70,7 @@ void FdoSelectionManager::init() connect(m_selectionOwner, &KSelectionOwner::failedToClaimOwnership, this, &FdoSelectionManager::onFailedToClaimOwnership); connect(m_selectionOwner, &KSelectionOwner::lostOwnership, this, &FdoSelectionManager::onLostOwnership); m_selectionOwner->claim(false); - syslog(LOG_INFO, "FdoSelectionManager::init() end"); + syslog(LOG_WARNING, "FdoSelectionManager::init() end"); } bool FdoSelectionManager::addDamageWatch(xcb_window_t client) From f77bd4514faa82719fc5cb20494556655c390f26 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 04:02:01 +0800 Subject: [PATCH 250/254] modified: xembed-sni-proxy/fdoselectionmanager.cpp modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/fdoselectionmanager.cpp | 3 --- xembed-sni-proxy/xcbutils.h | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xembed-sni-proxy/fdoselectionmanager.cpp b/xembed-sni-proxy/fdoselectionmanager.cpp index 811604e..0ab403f 100755 --- a/xembed-sni-proxy/fdoselectionmanager.cpp +++ b/xembed-sni-proxy/fdoselectionmanager.cpp @@ -21,7 +21,6 @@ #include "sniproxy.h" #include "xcbutils.h" -#include #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 @@ -45,7 +44,6 @@ FdoSelectionManager::~FdoSelectionManager() void FdoSelectionManager::init() { - syslog(LOG_WARNING, "FdoSelectionManager::init() start"); // load damage extension if (auto *native = dynamic_cast(qApp)) { xcb_connection_t *c = native->connection(); // 使用新的接口 @@ -70,7 +68,6 @@ void FdoSelectionManager::init() connect(m_selectionOwner, &KSelectionOwner::failedToClaimOwnership, this, &FdoSelectionManager::onFailedToClaimOwnership); connect(m_selectionOwner, &KSelectionOwner::lostOwnership, this, &FdoSelectionManager::onLostOwnership); m_selectionOwner->claim(false); - syslog(LOG_WARNING, "FdoSelectionManager::init() end"); } bool FdoSelectionManager::addDamageWatch(xcb_window_t client) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 29c78f8..553df76 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -41,13 +41,16 @@ using ScopedCPointer = QScopedPointer; class Atom { public: - explicit Atom(const QByteArray &name, bool onlyIfExists = false, xcb_connection_t *c = dynamic_cast(qApp)->connection()) - : m_connection(c) + explicit Atom(const QByteArray &name, bool onlyIfExists = false) + : m_connection(nullptr) , m_retrieved(false) - , m_cookie(xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData())) , m_atom(XCB_ATOM_NONE) , m_name(name) { + if (auto *native = dynamic_cast(qApp)) { + m_connection = native->connection(); + m_cookie = xcb_intern_atom_unchecked(m_connection, onlyIfExists, name.length(), name.constData()); + } } Atom() = delete; Atom(const Atom &) = delete; From 78022578de6c59f688e761d796b19dcc28cf1169 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 04:14:01 +0800 Subject: [PATCH 251/254] modified: settings-daemon/mouse/mousemanager.cpp --- settings-daemon/mouse/mousemanager.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/settings-daemon/mouse/mousemanager.cpp b/settings-daemon/mouse/mousemanager.cpp index 7c811a1..6bb629d 100755 --- a/settings-daemon/mouse/mousemanager.cpp +++ b/settings-daemon/mouse/mousemanager.cpp @@ -23,18 +23,26 @@ Mouse::Mouse(QObject *parent) : QObject(parent) - , m_inputDummydevice(new X11LibinputDummyDevice(this, dynamic_cast(qApp)->display())) + , m_inputDummydevice(nullptr) // 初始化为 nullptr { + if (auto *native = dynamic_cast(qApp)) { + m_inputDummydevice = new X11LibinputDummyDevice(this, native->display()); + } + // init dbus new MouseAdaptor(this); QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mouse"), this); - connect(m_inputDummydevice, &X11LibinputDummyDevice::leftHandedChanged, this, &Mouse::leftHandedChanged); - connect(m_inputDummydevice, &X11LibinputDummyDevice::pointerAccelerationProfileChanged, this, &Mouse::accelerationChanged); - connect(m_inputDummydevice, &X11LibinputDummyDevice::naturalScrollChanged, this, &Mouse::naturalScrollChanged); - connect(m_inputDummydevice, &X11LibinputDummyDevice::pointerAccelerationChanged, this, &Mouse::pointerAccelerationChanged); + // 确保 m_inputDummydevice 不是 nullptr 再进行连接 + if (m_inputDummydevice) { + connect(m_inputDummydevice, &X11LibinputDummyDevice::leftHandedChanged, this, &Mouse::leftHandedChanged); + connect(m_inputDummydevice, &X11LibinputDummyDevice::pointerAccelerationProfileChanged, this, &Mouse::accelerationChanged); + connect(m_inputDummydevice, &X11LibinputDummyDevice::naturalScrollChanged, this, &Mouse::naturalScrollChanged); + connect(m_inputDummydevice, &X11LibinputDummyDevice::pointerAccelerationChanged, this, &Mouse::pointerAccelerationChanged); + } } + Mouse::~Mouse() { delete m_inputDummydevice; From ab93f17b6522ab34b5a4e6720a6e86ae1dd2bbd2 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 04:22:46 +0800 Subject: [PATCH 252/254] modified: powerman/dimdisplayaction.cpp modified: xembed-sni-proxy/xcbutils.h --- powerman/dimdisplayaction.cpp | 6 +----- xembed-sni-proxy/xcbutils.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/powerman/dimdisplayaction.cpp b/powerman/dimdisplayaction.cpp index cfd0e45..7f5a3b9 100755 --- a/powerman/dimdisplayaction.cpp +++ b/powerman/dimdisplayaction.cpp @@ -37,12 +37,8 @@ DimDisplayAction::DimDisplayAction(QObject *parent) "/Brightness", "com.lingmo.Brightness", QDBusConnection::sessionBus()) { - auto isPlatformX11 = qGuiApp->nativeInterface(); - if (isPlatformX11) { - auto *native = dynamic_cast(qApp); - + if (auto *native = dynamic_cast(qApp)) { xcb_dpms_set_timeouts(native->connection(), 0, 0, 0); - XSetScreenSaver(native->display(), 0, 0, 0, 0); } } diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 553df76..9244d2f 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -57,7 +57,7 @@ class Atom ~Atom() { - if (!m_retrieved && m_cookie.sequence) { + if (!m_retrieved && m_cookie.sequence && auto *native = dynamic_cast(qApp)) { xcb_discard_reply(m_connection, m_cookie.sequence); } } From e4fd0f38d9907102f4a25bde2ec4dcbd83048784 Mon Sep 17 00:00:00 2001 From: Intro Date: Sun, 30 Jun 2024 04:26:36 +0800 Subject: [PATCH 253/254] modified: xembed-sni-proxy/xcbutils.h --- xembed-sni-proxy/xcbutils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xembed-sni-proxy/xcbutils.h b/xembed-sni-proxy/xcbutils.h index 9244d2f..d4dfc1b 100755 --- a/xembed-sni-proxy/xcbutils.h +++ b/xembed-sni-proxy/xcbutils.h @@ -57,8 +57,10 @@ class Atom ~Atom() { - if (!m_retrieved && m_cookie.sequence && auto *native = dynamic_cast(qApp)) { - xcb_discard_reply(m_connection, m_cookie.sequence); + if (!m_retrieved && m_cookie.sequence) { + if (auto *native = dynamic_cast(qApp)) { + xcb_discard_reply(m_connection, m_cookie.sequence); + } } } From 691bff6f83601a67f002bf9681ae5928d85ea09b Mon Sep 17 00:00:00 2001 From: Intro Date: Thu, 8 Aug 2024 03:49:38 +0800 Subject: [PATCH 254/254] modified: session/CMakeLists.txt modified: session/application.cpp renamed: session/lingmo-xsession.desktop -> session/lingmo-wayland.desktop modified: session/processmanager.cpp --- session/CMakeLists.txt | 2 +- session/application.cpp | 37 ++++++------------- ...session.desktop => lingmo-wayland.desktop} | 0 session/processmanager.cpp | 4 +- 4 files changed, 14 insertions(+), 29 deletions(-) rename session/{lingmo-xsession.desktop => lingmo-wayland.desktop} (100%) mode change 100755 => 100644 diff --git a/session/CMakeLists.txt b/session/CMakeLists.txt index 43c1c18..a69663f 100755 --- a/session/CMakeLists.txt +++ b/session/CMakeLists.txt @@ -36,4 +36,4 @@ target_link_libraries(${TARGET} ) install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES lingmo-xsession.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xsessions/) +install(FILES lingmo-wayland.desktop DESTINATION /usr/share/wayland-sessions) diff --git a/session/application.cpp b/session/application.cpp index 21fab00..d336cb1 100755 --- a/session/application.cpp +++ b/session/application.cpp @@ -85,24 +85,14 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) , m_processManager(new ProcessManager(this)) , m_networkProxyManager(new NetworkProxyManager) - , m_wayland(false) + , m_wayland(true) // 强制使用Wayland { new SessionAdaptor(this); - // connect to D-Bus and register as an object: + // 连接到DBus并注册为对象 QDBusConnection::sessionBus().registerService(QStringLiteral("com.lingmo.Session")); QDBusConnection::sessionBus().registerObject(QStringLiteral("/Session"), this); - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("Lingmo Session")); - parser.addHelpOption(); - - QCommandLineOption waylandOption(QStringList() << "w" << "wayland" << "Wayland Mode"); - parser.addOption(waylandOption); - parser.process(*this); - - m_wayland = parser.isSet(waylandOption); - createConfigDirectory(); initKWinConfig(); initLanguage(); @@ -112,15 +102,10 @@ Application::Application(int &argc, char **argv) initEnvironments(); if (!syncDBusEnvironment()) { - // Startup error qDebug() << "Could not sync environment to dbus."; qApp->exit(1); } - // We import systemd environment after we sync the dbus environment here. - // Otherwise it may leads to some unwanted order of applying environment - // variables (e.g. LANG and LC_*) - // ref plasma importSystemdEnvrionment(); qunsetenv("XCURSOR_THEME"); @@ -179,22 +164,22 @@ void Application::initEnvironments() qputenv("XDG_SESSION_DESKTOP", "Lingmo"); // Qt + qputenv("QT_QPA_PLATFORM", "wayland"); qputenv("QT_QPA_PLATFORMTHEME", "lingmo"); qputenv("QT_PLATFORM_PLUGIN", "lingmo"); - - // ref: https://stackoverflow.com/questions/34399993/qml-performance-issue-when-updating-an-item-in-presence-of-many-non-overlapping qputenv("QT_QPA_UPDATE_IDLE_TIME", "10"); - qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0"); - // IM Config - // qputenv("GTK_IM_MODULE", "fcitx5"); - // qputenv("QT4_IM_MODULE", "fcitx5"); - // qputenv("QT_IM_MODULE", "fcitx5"); - // qputenv("CLUTTER_IM_MODULE", "fcitx5"); - // qputenv("XMODIFIERS", "@im=fcitx"); + // Wayland + qputenv("XDG_SESSION_TYPE", "wayland"); + qputenv("XDG_CURRENT_DESKTOP", "Lingmo:GNOME"); + qputenv("GDK_BACKEND", "wayland"); + qputenv("CLUTTER_BACKEND", "wayland"); + qputenv("SDL_VIDEODRIVER", "wayland"); + qputenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1"); } + void Application::initLanguage() { QSettings settings(QSettings::UserScope, "lingmoos", "language"); diff --git a/session/lingmo-xsession.desktop b/session/lingmo-wayland.desktop old mode 100755 new mode 100644 similarity index 100% rename from session/lingmo-xsession.desktop rename to session/lingmo-wayland.desktop diff --git a/session/processmanager.cpp b/session/processmanager.cpp index 72b81c7..9850edb 100755 --- a/session/processmanager.cpp +++ b/session/processmanager.cpp @@ -82,18 +82,18 @@ void ProcessManager::startWindowManager() { QProcess *wmProcess = new QProcess; - wmProcess->start(m_app->wayland() ? "kwin_wayland" : "kwin_x11", QStringList()); + wmProcess->start("kwin_wayland", QStringList()); if (!m_app->wayland()) { QEventLoop waitLoop; m_waitLoop = &waitLoop; - // add a timeout to avoid infinite blocking if a WM fail to execute. QTimer::singleShot(30 * 1000, &waitLoop, SLOT(quit())); waitLoop.exec(); m_waitLoop = nullptr; } } + void ProcessManager::startDesktopProcess() { // When the lingmo-settings-daemon theme module is loaded, start the desktop.