diff --git a/CMakeLists.txt b/CMakeLists.txt index e7183f1691..8705b439c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,11 +114,6 @@ if(NOT WITH_XC_NETWORKING AND WITH_XC_UPDATECHECK) set(WITH_XC_UPDATECHECK OFF) endif() -if(UNIX AND NOT APPLE AND NOT WITH_XC_X11) - message(STATUS "Disabling WITH_XC_AUTOTYPE because WITH_XC_X11 is disabled") - set(WITH_XC_AUTOTYPE OFF) -endif() - set(KEEPASSXC_VERSION_MAJOR "2") set(KEEPASSXC_VERSION_MINOR "8") set(KEEPASSXC_VERSION_PATCH "0") diff --git a/cmake/FindXkbcommon.cmake b/cmake/FindXkbcommon.cmake index 75a55649d6..7e8badec46 100644 --- a/cmake/FindXkbcommon.cmake +++ b/cmake/FindXkbcommon.cmake @@ -1,6 +1,34 @@ +# Copyright (C) 2021 KeePassXC Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 or (at your option) +# version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . -find_package(PkgConfig) -pkg_check_modules(Xkbcommon xkbcommon) +# This only works with CMake 3.18 and newer +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18") + find_package(PkgConfig QUIET) + pkg_check_modules(Xkbcommon xkbcommon) +endif() + +if(NOT Xkbcommon_FOUND) + find_path(Xkbcommon_INCLUDE_DIRS xkbcommon/xkbcommon.h) + find_library(Xkbcommon_LIBRARIES xkbcommon) + + if(Xkbcommon_INCLUDE_DIRS AND Xkbcommon_LIBRARIES) + set(Xkbcommon_FOUND TRUE) + endif() +endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Xkbcommon DEFAULT_MSG Xkbcommon_LIBRARIES Xkbcommon_INCLUDE_DIRS) + +mark_as_advanced(Xkbcommon_LIBRARIES Xkbcommon_INCLUDE_DIRS) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index f94e32afef..0c09b71b29 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -442,7 +442,7 @@ void AutoType::performGlobalAutoType(const QList>& dbLi return; } - if (m_windowTitleForGlobal.isEmpty() && QApplication::platformName().compare("wayland", Qt::CaseInsensitive) == 0) { + if (m_windowTitleForGlobal.isEmpty() && QApplication::platformName().compare("wayland", Qt::CaseInsensitive) != 0) { m_inGlobalAutoTypeDialog.unlock(); return; } diff --git a/src/autotype/wayland/AutoTypeWayland.cpp b/src/autotype/wayland/AutoTypeWayland.cpp index 07db2b23d5..1b593940fd 100644 --- a/src/autotype/wayland/AutoTypeWayland.cpp +++ b/src/autotype/wayland/AutoTypeWayland.cpp @@ -81,7 +81,7 @@ void AutoTypePlatformWayland::handleCreateSession(uint response, QVariantMap res selectDevicesOptions.insert("restore_token", m_restore_token); } - m_remote_desktop.call("SelectDevices", m_session_handle, selectDevicesOptions); + m_remote_desktop.call("SelectDevices", QVariant::fromValue(m_session_handle), selectDevicesOptions); QString startRequestHandle = generateToken(); m_handlers.insert(startRequestHandle, @@ -93,7 +93,7 @@ void AutoTypePlatformWayland::handleCreateSession(uint response, QVariantMap res // TODO: Pass window identifier here instead of empty string if we want the dialog to appear on top of the // application window, need to be able to get active window and handle from Wayland - m_remote_desktop.call("Start", m_session_handle, "", startOptions); + m_remote_desktop.call("Start", QVariant::fromValue(m_session_handle), "", startOptions); } } @@ -127,15 +127,19 @@ void AutoTypePlatformWayland::portalResponse(uint response, QVariantMap results, AutoTypeAction::Result AutoTypePlatformWayland::sendKey(xkb_keysym_t keysym, QVector modifiers) { for (auto modifier : modifiers) { - m_remote_desktop.call("NotifyKeyboardKeysym", m_session_handle, QVariantMap(), int(modifier), uint(1)); + m_remote_desktop.call( + "NotifyKeyboardKeysym", QVariant::fromValue(m_session_handle), QVariantMap(), int(modifier), uint(1)); } - m_remote_desktop.call("NotifyKeyboardKeysym", m_session_handle, QVariantMap(), int(keysym), uint(1)); + m_remote_desktop.call( + "NotifyKeyboardKeysym", QVariant::fromValue(m_session_handle), QVariantMap(), int(keysym), uint(1)); - m_remote_desktop.call("NotifyKeyboardKeysym", m_session_handle, QVariantMap(), int(keysym), uint(0)); + m_remote_desktop.call( + "NotifyKeyboardKeysym", QVariant::fromValue(m_session_handle), QVariantMap(), int(keysym), uint(0)); for (auto modifier : modifiers) { - m_remote_desktop.call("NotifyKeyboardKeysym", m_session_handle, QVariantMap(), int(modifier), uint(0)); + m_remote_desktop.call( + "NotifyKeyboardKeysym", QVariant::fromValue(m_session_handle), QVariantMap(), int(modifier), uint(0)); } return AutoTypeAction::Result::Ok(); }