Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package plasma5-integration for openSUSE:Factory checked in at 2021-06-07 22:42:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plasma5-integration (Old) and /work/SRC/openSUSE:Factory/.plasma5-integration.new.32437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plasma5-integration" Mon Jun 7 22:42:42 2021 rev:97 rq:897496 version:5.22.0 Changes: -------- --- /work/SRC/openSUSE:Factory/plasma5-integration/plasma5-integration.changes 2021-05-06 22:52:42.450729648 +0200 +++ /work/SRC/openSUSE:Factory/.plasma5-integration.new.32437/plasma5-integration.changes 2021-06-07 22:43:02.184438107 +0200 @@ -1,0 +2,27 @@ +Thu Jun 3 13:06:16 UTC 2021 - Fabian Vogt <fab...@ritter-vogt.de> + +- Update to 5.22.0 + * New bugfix release + * For more details please see: + * https://kde.org/announcements/plasma/5/5.22.0 +- No code changes since 5.21.90 + +------------------------------------------------------------------- +Thu May 13 18:15:45 UTC 2021 - Fabian Vogt <fab...@ritter-vogt.de> + +- Update to 5.21.90 + * New feature release + * For more details please see: + * https://kde.org/announcements/plasma/5/5.21.90 +- Changes since 5.21.5: + * Migrate to KDECompilerSettings + * Port away from WId-based KWindowEffects API + * Do not set default font style names, and just rely on weights + * Use QFont::Normal (50) instead of -1 constant for default font weight + * platforminputcontextplugin: Make F1-F10 valid for selecting keys (kde#430162) + * Raise minimum CMake version to 3.16 + * Remove unused cmake code + * Use versionless Qt cmake target + * Revert held-key behaviour + +------------------------------------------------------------------- Old: ---- plasma-integration-5.21.5.tar.xz plasma-integration-5.21.5.tar.xz.sig New: ---- plasma-integration-5.22.0.tar.xz plasma-integration-5.22.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plasma5-integration.spec ++++++ --- /var/tmp/diff_new_pack.MQjr4N/_old 2021-06-07 22:43:02.700438979 +0200 +++ /var/tmp/diff_new_pack.MQjr4N/_new 2021-06-07 22:43:02.700438979 +0200 @@ -18,7 +18,7 @@ %bcond_without lang Name: plasma5-integration -Version: 5.21.5 +Version: 5.22.0 Release: 0 # Full Plasma 5 version (e.g. 5.8.95) %{!?_plasma5_bugfix: %define _plasma5_bugfix %{version}} @@ -28,9 +28,9 @@ License: GPL-2.0+ Group: System/GUI/KDE Url: http://www.kde.org -Source: https://download.kde.org/stable/plasma/%{version}/plasma-integration-%{version}.tar.xz +Source: plasma-integration-%{version}.tar.xz %if %{with lang} -Source1: https://download.kde.org/stable/plasma/%{version}/plasma-integration-%{version}.tar.xz.sig +Source1: plasma-integration-%{version}.tar.xz.sig Source2: plasma.keyring %endif BuildRequires: extra-cmake-modules >= 5.17.0 @@ -76,6 +76,16 @@ Applications do not need to link to this directly. +%package devel +Summary: plasma5-integration development headers +Group: System/GUI/KDE +Requires: plasma5-integration-plugin + +%description devel +This package provides development headers for plasma5-integration. They +are not meant to be used standalone, but are required for building other +Plasma components. + %lang_package -n plasma5-integration-plugin %prep @@ -97,6 +107,12 @@ %{_kf5_plugindir}/ %{_kf5_sharedir}/kconf_update/ +%files devel +%license COPYING* +%dir %{_includedir}/PlasmaKeyData/ +%{_includedir}/PlasmaKeyData/plasmakeydata.h +%{_kf5_libdir}/pkgconfig/plasma-key-data.pc + %if %{with lang} %files -n plasma5-integration-plugin-lang -f plasmaintegration5.lang %endif ++++++ plasma-integration-5.21.5.tar.xz -> plasma-integration-5.22.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/.gitignore new/plasma-integration-5.22.0/.gitignore --- old/plasma-integration-5.21.5/.gitignore 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/.gitignore 2021-06-03 16:14:33.000000000 +0200 @@ -21,3 +21,8 @@ *.unc-backup* .clang-format /build*/ +/compile_commands.json +.clangd +.idea +/cmake-build* +.cache diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/CMakeLists.txt new/plasma-integration-5.22.0/CMakeLists.txt --- old/plasma-integration-5.21.5/CMakeLists.txt 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -1,18 +1,18 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.16) project(PlasmaIntegration) -set(PROJECT_VERSION "5.21.5") +set(PROJECT_VERSION "5.22.0") set(PROJECT_VERSION_MAJOR 5) set(QT_MIN_VERSION "5.15.0") -set(KF5_MIN_VERSION "5.78") +set(KF5_MIN_VERSION "5.82") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ) include(KDEInstallDirs) include(KDECMakeSettings) -include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) +include(KDECompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) include(GenerateExportHeader) include(KDEClangFormat) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/autotests/CMakeLists.txt new/plasma-integration-5.22.0/autotests/CMakeLists.txt --- old/plasma-integration-5.21.5/autotests/CMakeLists.txt 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/autotests/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -28,7 +28,7 @@ ecm_mark_as_test(${_testname}) ecm_mark_nongui_executable(${_testname}) target_include_directories(${_testname} PRIVATE ${CMAKE_BINARY_DIR}/src/platformtheme) - target_link_libraries(${_testname} Qt5::GuiPrivate Qt5::Test Qt5::DBus Qt5::X11Extras Qt5::QuickControls2 ${QT5PLATFORMSUPPORT_LIBS} KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::KIOFileWidgets KF5::I18n KF5::Notifications KF5::WindowSystem KF5::WaylandClient XCB::XCB) + target_link_libraries(${_testname} Qt::GuiPrivate Qt::Test Qt::DBus Qt::X11Extras Qt::QuickControls2 ${QT5PLATFORMSUPPORT_LIBS} KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::KIOFileWidgets KF5::I18n KF5::Notifications KF5::WindowSystem KF5::WaylandClient XCB::XCB) endmacro() set(dbus_interface) @@ -90,5 +90,5 @@ add_test(NAME qmltests COMMAND qmltestrunner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) frameworkintegration_tests(kfiledialogqml_unittest) - target_link_libraries(kfiledialogqml_unittest Qt5::Qml) + target_link_libraries(kfiledialogqml_unittest Qt::Qml) endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/po/zh_CN/plasmaintegration5.po new/plasma-integration-5.22.0/po/zh_CN/plasmaintegration5.po --- old/plasma-integration-5.21.5/po/zh_CN/plasmaintegration5.po 2021-05-04 14:35:27.000000000 +0200 +++ new/plasma-integration-5.22.0/po/zh_CN/plasmaintegration5.po 2021-06-03 16:14:54.000000000 +0200 @@ -7,7 +7,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2020-10-25 02:32+0200\n" -"PO-Revision-Date: 2021-04-24 15:44\n" +"PO-Revision-Date: 2021-05-25 16:23\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/CMakeLists.txt new/plasma-integration-5.22.0/src/CMakeLists.txt --- old/plasma-integration-5.21.5/src/CMakeLists.txt 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/src/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -1 +1,2 @@ add_subdirectory(platformtheme) +add_subdirectory(platforminputcontextplugin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/CMakeLists.txt new/plasma-integration-5.22.0/src/platforminputcontextplugin/CMakeLists.txt --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,26 @@ +# keyholdmanager has a ton of definitions where +# needing explicit qstringliteral would negatively affect +# code readability +remove_definitions(-DQT_NO_CAST_FROM_ASCII) + +add_library(input_plugin MODULE + main.cpp + plasmaimcontext.cpp +) + +target_link_libraries(input_plugin + Qt::Core + Qt::Gui + Qt::Quick + Qt::Widgets + Qt::GuiPrivate + KF5::ConfigCore +) +set_target_properties(input_plugin PROPERTIES OUTPUT_NAME plasmaimplatforminputcontextplugin) + +install(TARGETS input_plugin LIBRARY DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/platforminputcontexts) + +# we want to share this data with some other parts of Plasma; this isn't an API for anyone to use but us +install(DIRECTORY data/ DESTINATION ${KDE_INSTALL_INCLUDEDIR}/PlasmaKeyData) +configure_file(plasma-key-data.pc.in plasma-key-data.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma-key-data.pc DESTINATION ${KDE_INSTALL_LIBDIR}/pkgconfig) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/data/plasmakeydata.h new/plasma-integration-5.22.0/src/platforminputcontextplugin/data/plasmakeydata.h --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/data/plasmakeydata.h 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/data/plasmakeydata.h 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,170 @@ +/* + * Copyright 2020 Carson Black <uhh...@gmail.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <QString> +#include <QMap> +#include <QList> + +// Curating key data +// ================= +// +// There are two main goals with key data here: +// - to allow users to input letters related to but not in their keyboard language (e.g. Persian glyphs on top of the Arabic set) +// - to allow users to input useful symbols, such as proper arithmetic symbols and various dashes +// +// The former generally is used for letters, while the latter is generally used for punctuation and numbers +// +// Latin Letters: +// +// Generally, these are going to be diacritics (a + ` = ??) or diagraphs (a + e = ??). +// Letters should be roughly ordered first by amount of speakers of languages that use them, +// and then by commonality in languages as a secondary factor. For example, the character ?? is +// found mostly in northern Germanic languages, which don't have nearly as many speakers as +// romance languages such as Spanish, which has ??. For this reason, ?? should be ordered before ??. +// Rinse and repeat this process until all the variants you want to offer are well placed. +// +// Cyrilic Letters: +// +// The same principles as Latin letters apply here. For example, the character ?? (Ka with a vertical stroke; Azerbaijani) +// is found in a much less common language than ?? (Ka with a descender; many languages found in former Soviet Union territories) +// so it should be placed after ?? in the list of options for ?? (Ka; lot of languages) +// +// Arabic characters: +// +// Same deal as Latin and Cyrilic, except now it's going to render poorly in your text editors. +// Most of these characters only have one alternate form, mostly to add some extra diacritics +// in order to use a less common form or a form not found in Arabic, e.g. Persian ?? from Arabic ??. +// Alef is a special case here, as it has a lot of "variants" in common use. For example, there's the +// alef with a hamza sitting on it (?? + ?? = ??) or a hamza sitting below it (??). These can be inputted +// as diagraphs on keyboards, but can also be represented as a held-key variant of alef for input purposes. +// +// Hebrew characters: +// +// The characters here are the iffiest of the selection, since most don't add anything new to input, just a +// "convenience" way for inputting characters with a ?? added, when you can already type it without extra modifiers. +// However, we're still having them there since they're a logical "variant" of the characters they're for. +// +// On the other hand, the ???? ?? ?? ?? work as held keys to offer a meaningful alternative to other methods of inputting +// them, since these typically require the usage of AltGr to input on most Hebrew keyboards. +// +// Numbers: +// +// These are mostly exponents and fractions. Their ordering should be self explanatory. +// +// Symbols: +// +// These are mostly things that look like the key being held, with the exception +// of ^ being used for directional arrows. +// + +namespace KeyData { + +const QMap<QString,QList<QString>> KeyMappings = { + // + // Latin + // + {"a", {"??", "??", "??", "??", "??", "??", "??", "??"}}, + {"c", {"??", "??", "??"}}, + {"d", {"??"}}, + {"e", {"??", "??", "??", "??", "??", "??", "??", "??"}}, + {"g", {"??"}}, + {"i", {"??", "??", "??", "??", "??", "??", "??"}}, + {"l", {"??"}}, + {"n", {"??", "??"}}, + {"o", {"??", "??", "??", "??", "??", "??", "??", "??"}}, + {"s", {"??", "??", "??", "??"}}, + {"u", {"??", "??", "??", "??", "??"}}, + {"x", {"??"}}, + {"y", {"??", "??", "??", "??", "??"}}, + {"z", {"??", "??", "??"}}, + // + // Cyrilic + // + {"??", {"??"}}, + {"??", {"??"}}, // this in fact NOT the same E as before + {"??", {"??", "??"}}, // ?? is not i + {"??", {"??"}}, // ?? is not j + {"??", {"??", "??",}}, + {"??", {"??", "??"}}, // ?? is not h + {"??", {"??", "??"}}, + {"??", {"??", "??"}}, + {"??", {"??"}}, + // + // Arabic + // + // This renders weirdly in text editors, but is valid code. + {"??", {"??", "??", "??", "??"}}, + {"??", {"??"}}, + {"??", {"??"}}, + {"??", {"??"}}, + {"??", {"??"}}, + {"??", {"??"}}, + {"??", {"????"}}, + {"??", {"??"}}, + {"??", {"??"}}, + // + // Hebrew + // + // Likewise, this will render oddly, but is still valid code. + {"??",{"????"}}, + {"??",{"????"}}, + {"??",{"????"}}, + {"????",{"????"}}, + {"??",{"????"}}, + {"??",{"????"}}, + {"??", {"??"}}, + {"??", {"??"}}, + {"??", {"??"}}, + // + // Numbers + // + {"0", {"???", "???", "???"}}, + {"1", {"??", "??", "???", "??", "???", "???", "???", "???", "???", "???"}}, + {"2", {"??", "???", "???"}}, + {"3", {"??", "???", "??", "???"}}, + {"4", {"???", "???", "???", "???", "???"}}, + {"5", {"???", "???", "???"}}, + {"6", {"???"}}, + {"7", {"???", "???"}}, + {"8", {"???"}}, + {"9", {"???"}}, + // + // Punctuation + // + {R"(-)", {"???", "???", "??"}}, + {R"(?)", {"??", "???"}}, + {R"(')", {"???", "???", "???", "???", "???"}}, + {R"(!)", {"??"}}, + {R"(")", {"???", "???", "???", "??", "??"}}, + {R"(/)", {"??"}}, + {R"(#)", {"???"}}, + {R"(%)", {"???", "???"}}, + {R"(^)", {"???", "???", "???", "???"}}, + {R"(+)", {"??"}}, + {R"(<)", {"??", "???", "???", "???"}}, + {R"(=)", {"???", "???", "???"}}, + {R"(>)", {"???", "??", "???", "???"}}, + // + // Currency + // + {"$", {"??", "???", "??", "??", "???", "???", "???", "???", "???", "???"}}, +}; + +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/main.cpp new/plasma-integration-5.22.0/src/platforminputcontextplugin/main.cpp --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/main.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/main.cpp 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright 2020 Carson Black <uhh...@gmail.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <QObject> +#include <QtPlugin> +#include <qpa/qplatforminputcontextplugin_p.h> + +#include "plasmaimcontext.h" + +QT_BEGIN_NAMESPACE + +class PlasmaIM : public QPlatformInputContextPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "plasmaim.json") + +public: + QPlatformInputContext *create(const QString&, const QStringList&) Q_DECL_OVERRIDE; +}; + +QPlatformInputContext *PlasmaIM::create(const QString& system, const QStringList&) +{ + if (system == "plasmaim") { + return new PlasmaIMContext; + } + + return nullptr; +} + +QT_END_NAMESPACE + +#include "main.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasma-key-data.pc.in new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasma-key-data.pc.in --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasma-key-data.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasma-key-data.pc.in 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,8 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/include + +Name: PlasmaKeyData +Description: Plasma's key data used for key-holding behaviour +Version: 1.0 +Cflags: -I${includedir}/PlasmaKeyData +Libs: \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaim.json new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaim.json --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaim.json 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaim.json 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,3 @@ +{ + "Keys": [ "plasmaim" ] +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaimcontext.cpp new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaimcontext.cpp --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaimcontext.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaimcontext.cpp 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,225 @@ +/* + * Copyright 2020 Carson Black <uhh...@gmail.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/// Qt Utilities +#include <QGuiApplication> +#include <QInputMethod> +#include <QInputMethodEvent> +#include <QKeyEvent> +#include <QQuickWindow> +#include <QStringBuilder> +#include <QToolTip> + +// Widgets for the popup +#include <QGridLayout> +#include <QLabel> +#include <QPushButton> + +#include "data/plasmakeydata.h" + +#include "plasmaimcontext.h" + +static QList<TooltipData> dataForIndex(const QString &ch, bool upperCase) +{ + QList<TooltipData> ret; + int i = 0; + for (auto item : KeyData::KeyMappings[ch]) { + ret << TooltipData {upperCase ? item.toUpper() : item, QString::number((i + 1) < 10 ? (i + 1) : 0, 10), i}; + i++; + } + return ret; +} + +PlasmaIMContext::PlasmaIMContext() +{ + connect(watcher.data(), &KConfigWatcher::configChanged, this, &PlasmaIMContext::configChangedHandler); +} + +PlasmaIMContext::~PlasmaIMContext() +{ + if (!popup.isNull()) { + popup->hide(); + popup->deleteLater(); + } +} + +bool PlasmaIMContext::isValid() const +{ + return true; +} + +void PlasmaIMContext::cleanUpState() +{ + if (!popup.isNull()) { + popup->hide(); + popup->deleteLater(); + } + + isPreHold = false; + preHoldText = QString(); +} + +void PlasmaIMContext::setFocusObject(QObject *object) +{ + m_focusObject = object; +} + +void PlasmaIMContext::configChangedHandler(const KConfigGroup&, const QByteArrayList&) +{ + config->reparseConfiguration(); +} + +void PlasmaIMContext::showPopup(const QList<TooltipData> &text) +{ + QPoint position; + QWindow *parentWin = nullptr; + + auto im = QGuiApplication::inputMethod(); + if (im != nullptr && im->cursorRectangle().isValid()) { + position = im->cursorRectangle().topRight().toPoint(); + parentWin = QGuiApplication::focusWindow(); + } + + auto isRtl = + text[0].character[0].script() == QChar::Script_Arabic || text[0].character[0].script() == QChar::Script_Hebrew; + + popup = new QWidget; + auto grid = new QGridLayout(popup.data()); + popup->setLayoutDirection(isRtl ? Qt::RightToLeft : Qt::LeftToRight); + popup->setLayout(grid); + int col = 0; + for (auto item : text) { + auto label = new QLabel(item.character, popup.data()); + auto button = new QPushButton(item.number, popup.data()); + + button->setMaximumWidth(button->height()); + + grid->addWidget(label, 0, col, Qt::AlignCenter); + grid->addWidget(button, 1, col, Qt::AlignHCenter); + + connect(button, &QPushButton::clicked, [=]() { + applyReplacement(item.character); + popup->hide(); + popup->deleteLater(); + }); + + col++; + } + + connect(parentWin, &QWindow::activeChanged, this, &PlasmaIMContext::cleanUpState, Qt::UniqueConnection); + + if (parentWin != nullptr) { + popup->setWindowFlags(Qt::WindowDoesNotAcceptFocus | Qt::ToolTip); + popup->adjustSize(); + popup->move(position + parentWin->framePosition() - QPoint((isRtl ? popup->width() : 0), 0)); + popup->show(); + } +} + +void PlasmaIMContext::applyReplacement(const QString &data) +{ + if (m_focusObject != nullptr) { + QInputMethodEvent ev; + ev.setCommitString(data, -1, 1); + QCoreApplication::sendEvent(m_focusObject, &ev); + } +} + +inline bool between(int min, int val, int max) { + qDebug() << min << val << max << !(val < min || max < val); + return !(val < min || max < val); +} + +bool PlasmaIMContext::filterEvent(const QEvent *event) +{ + bool isAccent = keyboard.readEntry("KeyRepeat", "accent") == QLatin1String("accent"); + bool isNothing = keyboard.readEntry("KeyRepeat", "accent") == QLatin1String("nothing"); + + if (!isAccent && !isNothing) { + return false; + } + + if (event->type() == QEvent::KeyPress) { + auto ev = static_cast<const QKeyEvent *>(event); + + // this is the state when we have a held key + if (isPreHold) { + if (ev->isAutoRepeat() && ev->text() == preHoldText) + return true; + + if (!between(Qt::Key_0, ev->key(), Qt::Key_9) && !between(Qt::Key_F1, ev->key(), Qt::Key_F10)) { + cleanUpState(); + return false; + } + + auto str = preHoldText; + bool isUpper = str.isUpper(); + str = str.toLower(); + + int keyDataIndex; + if (ev->key() > Qt::Key_9) { + keyDataIndex = ev->key() - Qt::Key_F1; + keyDataIndex++; + } else { + keyDataIndex = ev->key() - Qt::Key_0; + if (keyDataIndex == 0) { + keyDataIndex = 10; + } + } + + if (KeyData::KeyMappings[str].count() < keyDataIndex) { + cleanUpState(); + return false; + } + + auto data = KeyData::KeyMappings[str][keyDataIndex - 1]; + applyReplacement(isUpper ? data.toUpper() : data); + isPreHold = false; + preHoldText = QString(); + popup->hide(); + return true; + } + + // this is the state before we have a held key + if (ev->isAutoRepeat()) { + if (isNothing) + return true; + + if (!isPreHold) { + if (ev->text().isEmpty()) + return false; + if (!KeyData::KeyMappings.contains(ev->text().toLower())) + return false; + + auto tooltipText = dataForIndex(ev->text().toLower(), ev->text().isUpper()); + showPopup(tooltipText); + + isPreHold = true; + preHoldText = ev->text(); + } + + return true; + } + + cleanUpState(); + } + + return false; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaimcontext.h new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaimcontext.h --- old/plasma-integration-5.21.5/src/platforminputcontextplugin/plasmaimcontext.h 1970-01-01 01:00:00.000000000 +0100 +++ new/plasma-integration-5.22.0/src/platforminputcontextplugin/plasmaimcontext.h 2021-06-03 16:14:33.000000000 +0200 @@ -0,0 +1,73 @@ +/* + * Copyright 2020 Carson Black <uhh...@gmail.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef PLASMAIMCONTEXT_H +#define PLASMAIMCONTEXT_H + +#include <QPointer> +#include <QWidget> + +#include <KConfigGroup> +#include <KSharedConfig> +#include <KConfigWatcher> + +#include <qpa/qplatforminputcontext.h> + +QT_BEGIN_NAMESPACE + +struct TooltipData { + QString character; + QString number; + int idx; +}; + +class PlasmaIMContext : public QPlatformInputContext +{ + Q_OBJECT + +public: + PlasmaIMContext(); + ~PlasmaIMContext(); + + bool isValid() const Q_DECL_OVERRIDE; + void setFocusObject(QObject *object) Q_DECL_OVERRIDE; + bool filterEvent(const QEvent* event) Q_DECL_OVERRIDE; + +private: + + void cleanUpState(); + void applyReplacement(const QString& data); + void showPopup(const QList<TooltipData>& text); + void configChangedHandler(const KConfigGroup& grp, const QByteArrayList& names); + + QPointer<QWidget> popup; + QPointer<QObject> m_focusObject = nullptr; + + bool isPreHold = false; + QString preHoldText = QString(); + KSharedConfig::Ptr config = KSharedConfig::openConfig( QStringLiteral("kcminputrc") ); + KConfigGroup keyboard = KConfigGroup(config, "Keyboard"); + KConfigWatcher::Ptr watcher = KConfigWatcher::create(config); + +}; + +QT_END_NAMESPACE + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platformtheme/CMakeLists.txt new/plasma-integration-5.22.0/src/platformtheme/CMakeLists.txt --- old/plasma-integration-5.21.5/src/platformtheme/CMakeLists.txt 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/src/platformtheme/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -39,10 +39,10 @@ target_link_libraries(KDEPlasmaPlatformTheme PRIVATE - Qt5::GuiPrivate - Qt5::DBus - Qt5::X11Extras - Qt5::QuickControls2 + Qt::GuiPrivate + Qt::DBus + Qt::X11Extras + Qt::QuickControls2 KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes @@ -58,7 +58,7 @@ ) if(HAVE_X11) - target_link_libraries(KDEPlasmaPlatformTheme PRIVATE Qt5::X11Extras ${X11_Xcursor_LIB} ${XCB_XCB_LIBRARY}) + target_link_libraries(KDEPlasmaPlatformTheme PRIVATE Qt::X11Extras ${X11_Xcursor_LIB} ${XCB_XCB_LIBRARY}) endif() set_target_properties(KDEPlasmaPlatformTheme PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/platformthemes/") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platformtheme/kfontsettingsdata.cpp new/plasma-integration-5.22.0/src/platformtheme/kfontsettingsdata.cpp --- old/plasma-integration-5.21.5/src/platformtheme/kfontsettingsdata.cpp 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/src/platformtheme/kfontsettingsdata.cpp 2021-06-03 16:14:33.000000000 +0200 @@ -60,13 +60,13 @@ static const char DefaultFont[] = "Noto Sans"; static const KFontData DefaultFontData[KFontSettingsData::FontTypesCount] = { - { GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif, "Regular" }, - { GeneralId, "fixed", "Hack", 10, -1, QFont::Monospace, "Regular" }, - { GeneralId, "toolBarFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" }, - { GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" }, - { "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" }, - { GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" }, - { GeneralId, "smallestReadableFont", DefaultFont, 8, -1, QFont::SansSerif, "Regular" } + { GeneralId, "font", DefaultFont, 10, QFont::Normal, QFont::SansSerif, "Regular" }, + { GeneralId, "fixed", "Hack", 10, QFont::Normal, QFont::Monospace, "Regular" }, + { GeneralId, "toolBarFont", DefaultFont, 10, QFont::Normal, QFont::SansSerif, "Regular" }, + { GeneralId, "menuFont", DefaultFont, 10, QFont::Normal, QFont::SansSerif, "Regular" }, + { "WM", "activeFont", DefaultFont, 10, QFont::Normal, QFont::SansSerif, "Regular" }, + { GeneralId, "taskbarFont", DefaultFont, 10, QFont::Normal, QFont::SansSerif, "Regular" }, + { GeneralId, "smallestReadableFont", DefaultFont, 8, QFont::Normal, QFont::SansSerif, "Regular" } }; QFont *KFontSettingsData::font(FontTypes fontType) @@ -84,11 +84,8 @@ //NOTE: We are not using KConfig directly because we can't call QFont::QFont from here if (!fontInfo.isEmpty()) { cachedFont->fromString(fontInfo); - } else { - // set the canonical stylename here, where it cannot override - // user-specific font attributes if those do not include a stylename. - cachedFont->setStyleName(QLatin1String(fontData.StyleName)); } + // Don't set default font style names, as it prevents different font weights from being used (the QFont::Normal weight should work) mFonts[fontType] = cachedFont; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platformtheme/kwaylandintegration.cpp new/plasma-integration-5.22.0/src/platformtheme/kwaylandintegration.cpp --- old/plasma-integration-5.21.5/src/platformtheme/kwaylandintegration.cpp 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/src/platformtheme/kwaylandintegration.cpp 2021-06-03 16:14:33.000000000 +0200 @@ -103,7 +103,7 @@ } const auto blurBehindProperty = w->property(s_blurBehindPropertyName.constData()); if (blurBehindProperty.isValid()) { - KWindowEffects::enableBlurBehind(w->winId(), blurBehindProperty.toBool()); + KWindowEffects::enableBlurBehind(w, blurBehindProperty.toBool()); } // create deco Surface *s = Surface::fromWindow(w); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/src/platformtheme/x11integration.cpp new/plasma-integration-5.22.0/src/platformtheme/x11integration.cpp --- old/plasma-integration-5.21.5/src/platformtheme/x11integration.cpp 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/src/platformtheme/x11integration.cpp 2021-06-03 16:14:33.000000000 +0200 @@ -88,7 +88,7 @@ } const auto blurBehindProperty = w->property(s_blurBehindPropertyName.constData()); if (blurBehindProperty.isValid()) { - KWindowEffects::enableBlurBehind(w->winId(), blurBehindProperty.toBool()); + KWindowEffects::enableBlurBehind(w, blurBehindProperty.toBool()); } installDesktopFileName(w); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plasma-integration-5.21.5/tests/CMakeLists.txt new/plasma-integration-5.22.0/tests/CMakeLists.txt --- old/plasma-integration-5.21.5/tests/CMakeLists.txt 2021-05-04 14:34:11.000000000 +0200 +++ new/plasma-integration-5.22.0/tests/CMakeLists.txt 2021-06-03 16:14:33.000000000 +0200 @@ -1,8 +1,8 @@ add_executable(qfiledialogtest qfiledialogtest.cpp) -target_link_libraries(qfiledialogtest Qt5::Core Qt5::Widgets) +target_link_libraries(qfiledialogtest Qt::Core Qt::Widgets) add_executable(windowdecotest windowdecotest.cpp) -target_link_libraries(windowdecotest Qt5::Core Qt5::Widgets KF5::ConfigWidgets) +target_link_libraries(windowdecotest Qt::Core Qt::Widgets KF5::ConfigWidgets) add_executable(systraymenuexclusiveactionstest systraymenuexclusiveactionstest.cpp) -target_link_libraries(systraymenuexclusiveactionstest Qt5::Core Qt5::Widgets) +target_link_libraries(systraymenuexclusiveactionstest Qt::Core Qt::Widgets)