From 1f9364cee59778ab4f3506a0f4f96cce62e8963b Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Mon, 4 Dec 2017 21:45:56 +0100 Subject: [PATCH] Cherry-picking upstream version 0.12.0. --- AUTHORS | 2 +- CHANGELOG | 44 ++++++++++++++++++- CMakeLists.txt | 17 +++++-- autostart/CMakeLists.txt | 17 +++++++ autostart/lxqt-globalkeyshortcuts.desktop.in | 9 ++++ .../lxqt-globalkeyshortcuts_cs.desktop | 2 + .../lxqt-globalkeyshortcuts_cs_CZ.desktop | 2 + .../lxqt-globalkeyshortcuts_da.desktop | 2 + .../lxqt-globalkeyshortcuts_de.desktop | 2 + .../lxqt-globalkeyshortcuts_el.desktop | 2 + .../lxqt-globalkeyshortcuts_es.desktop | 2 + .../lxqt-globalkeyshortcuts_es_VE.desktop | 2 + .../lxqt-globalkeyshortcuts_eu.desktop | 2 + .../lxqt-globalkeyshortcuts_fi.desktop | 2 + .../lxqt-globalkeyshortcuts_fr.desktop | 1 + .../lxqt-globalkeyshortcuts_it_IT.desktop | 2 + .../lxqt-globalkeyshortcuts_lt.desktop | 2 + .../lxqt-globalkeyshortcuts_pl_PL.desktop | 2 + .../lxqt-globalkeyshortcuts_pt.desktop | 2 + .../lxqt-globalkeyshortcuts_pt_BR.desktop | 2 + .../lxqt-globalkeyshortcuts_ro_RO.desktop | 2 + .../lxqt-globalkeyshortcuts_ru.desktop | 2 + .../lxqt-globalkeyshortcuts_ru_RU.desktop | 2 + .../lxqt-globalkeyshortcuts_th_TH.desktop | 2 + .../lxqt-globalkeyshortcuts_uk.desktop | 2 + .../lxqt-globalkeyshortcuts_zh_CN.desktop | 2 + .../lxqt-globalkeyshortcuts_zh_TW.desktop | 2 + config/main.cpp | 12 +++++ .../lxqt-config-globalkeyshortcuts_lt.desktop | 4 ++ daemon/core.cpp | 37 +++++++++------- xdg/CMakeLists.txt | 6 +++ xdg/globalkeyshortcuts.conf | 41 +++++++++++++++++ 32 files changed, 211 insertions(+), 21 deletions(-) create mode 100644 autostart/CMakeLists.txt create mode 100644 autostart/lxqt-globalkeyshortcuts.desktop.in create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_cs.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_cs_CZ.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_da.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_de.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_el.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_es.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_es_VE.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_eu.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_fi.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_fr.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_it_IT.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_lt.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_pl_PL.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_pt.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_pt_BR.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_ro_RO.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_ru.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_ru_RU.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_th_TH.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_uk.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_zh_CN.desktop create mode 100644 autostart/translations/lxqt-globalkeyshortcuts_zh_TW.desktop create mode 100644 config/translations/lxqt-config-globalkeyshortcuts_lt.desktop create mode 100644 xdg/CMakeLists.txt create mode 100644 xdg/globalkeyshortcuts.conf diff --git a/AUTHORS b/AUTHORS index a66be6d..abb6e1f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,7 +4,7 @@ Upstream Authors: Copyright: Copyright (c) 2010-2012 Razor team - Copyright (c) 2012-2016 LXQt team + Copyright (c) 2012-2017 LXQt team License: LGPL-2.1+ The full text of the licenses can be found in the 'COPYING' file. diff --git a/CHANGELOG b/CHANGELOG index e69b534..f2e363a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,49 @@ -lxqt-globalkeys-0.11.1 / 2017-01-01 +lxqt-globalkeys-0.12.0 / 2017-10-21 =================================== + * Set patch version + * Don't export github templates + * fix deadlock - don't accept keyPress when processing dbus call (#56) + * Added Lithuanian language + * lxqt-config-globalkeys: set Qt::AA_UseHighDpiPixmaps to true + * Added QCommandLineParser and basic cli interface to lxqt-config-globalkeys + * Adeed LXQT_GLOBALKEYS_PATCH_VERSION + * Fixes a FTBFS in superbuild mode (#51) + * Added autostart and xdg to CMakeLists.txt + * changed xdg/CmakeLists.txt + * fixed xdg/CMakeLists.txt renamed config to xdg - merge preparation + * Use const iterators + * globalkeys: Open "empty" browser on activation + * Updated *_da.desktop files and removed *_da_DK.desktop files + * Update AUTHORS + * Open https://duckduckgo.com instead of google.com as default + * Update desktop entries and Replace fr_FR by fr + * lxqt-rc.xml: Change default config install path + * Settings Openbox updated. + * Screenshot (Shift+Print), file manager (ctl+Alt+e) and web browser (Ctl+atl+i) key shortcuts added. + * Default key shortcuts added to lxqt-globalkeysd. + * Update Greek translation (el) Remove country variant from language code + * CMake: Adds Runtime and Devel install COMPONENTs + * Coding style changes + * Adds double quotes to everything that may break + * Updates the build system to use the Targets infrastructure + * Drops hardcoded /etc/xdg paths + * Updated german translation, replaced Qt4 by Qt in all xsession/translations + * Updates translations infrastructure + * Update the required minimum cmake version + * remove dead template lines switch OnlyShowIn from Razor -> LXQt stringchanges LxQt -> LXQt + * Add session.conf and windowmanagers.conf. + * Support lxqt-session and add necessary xdg autostart desktop entry files. + * Rename dirs and replace razor with lxqt. Install lxqt.conf to /etc/xdg/lxqt and provide theme config. + * Properly set default wallpaper for pcmanfm-qt. Comment out openbox config handling in startlxde-qt since it's not needed. + * Fix file paths, replacing razor with lxqt. * Remove Alt+F2 and Ctrl+Esc from openbox config file to avoid conflicts with lxqt-panel & lxqt-globalkeys. + * Add default configuration files for lxde-qt session. + +0.11.1 / 2017-01-01 +=================== + + * Release 0.11.1: Update changelog * Added *da.desktop * Use the lxqt-build-tools/lxqt_create_portable_headers * Use the new lxqt-build-tools package diff --git a/CMakeLists.txt b/CMakeLists.txt index 5acc35c..9b5b47e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -set(LXQTBT_MINIMUM_VERSION "0.1.0") +set(LXQTBT_MINIMUM_VERSION "0.4.0") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -20,11 +20,17 @@ set(CMAKE_AUTOUIC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5DBus REQUIRED) -find_package(Qt5LinguistTools REQUIRED QUIET) +find_package(Qt5LinguistTools REQUIRED) find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) -find_package(lxqt REQUIRED QUIET) +find_package(lxqt REQUIRED) +# Patch Version +set(LXQT_GLOBALKEYS_PATCH_VERSION 0) + +set(LXQT_GLOBALKEYS_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_GLOBALKEYS_PATCH_VERSION}) +add_definitions("-DLXQT_GLOBALKEYS_VERSION=\"${LXQT_GLOBALKEYS_VERSION}\"") + include(LXQtTranslate) include(LXQtCreatePkgConfigFile) include(LXQtCreatePortableHeaders) @@ -93,3 +99,8 @@ install(FILES "${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config-version.cmake" DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}" ) + +# merged from lxqt-common +add_subdirectory(autostart) +add_subdirectory(xdg) + diff --git a/autostart/CMakeLists.txt b/autostart/CMakeLists.txt new file mode 100644 index 0000000..4557a4d --- /dev/null +++ b/autostart/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) + +file(GLOB DESKTOP_FILES_IN *.desktop.in) + +# Translations ********************************** +lxqt_translate_desktop(DESKTOP_FILES + SOURCES + ${DESKTOP_FILES_IN} +) +add_custom_target(lxqt_globlalkeys_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES}) +#************************************************ + +install(FILES + ${DESKTOP_FILES} + DESTINATION "${LXQT_ETC_XDG_DIR}/autostart" + COMPONENT Runtime +) diff --git a/autostart/lxqt-globalkeyshortcuts.desktop.in b/autostart/lxqt-globalkeyshortcuts.desktop.in new file mode 100644 index 0000000..354060a --- /dev/null +++ b/autostart/lxqt-globalkeyshortcuts.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Global Keyboard Shortcuts +TryExec=lxqt-globalkeysd +Exec=lxqt-globalkeysd +OnlyShowIn=LXQt; +X-LXQt-Module=true + +#TRANSLATIONS_DIR=translations diff --git a/autostart/translations/lxqt-globalkeyshortcuts_cs.desktop b/autostart/translations/lxqt-globalkeyshortcuts_cs.desktop new file mode 100644 index 0000000..cadeb1b --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_cs.desktop @@ -0,0 +1,2 @@ +# Translations +Name[cs]=Celkové klávesové zkratky diff --git a/autostart/translations/lxqt-globalkeyshortcuts_cs_CZ.desktop b/autostart/translations/lxqt-globalkeyshortcuts_cs_CZ.desktop new file mode 100644 index 0000000..ef14b6f --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_cs_CZ.desktop @@ -0,0 +1,2 @@ +# Translations +Name[cs_CZ]=Celkové klávesové zkratky diff --git a/autostart/translations/lxqt-globalkeyshortcuts_da.desktop b/autostart/translations/lxqt-globalkeyshortcuts_da.desktop new file mode 100644 index 0000000..408f9c8 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_da.desktop @@ -0,0 +1,2 @@ +# Translations +Name[da]=Globale tastaturgenveje diff --git a/autostart/translations/lxqt-globalkeyshortcuts_de.desktop b/autostart/translations/lxqt-globalkeyshortcuts_de.desktop new file mode 100644 index 0000000..f4b5f51 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_de.desktop @@ -0,0 +1,2 @@ +# Translations +Name[de]=Globale Kurzbefehle diff --git a/autostart/translations/lxqt-globalkeyshortcuts_el.desktop b/autostart/translations/lxqt-globalkeyshortcuts_el.desktop new file mode 100644 index 0000000..9637104 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_el.desktop @@ -0,0 +1,2 @@ +# Translations +Name[el]=Καθολικές συντομεύσεις πληκτρολογίου diff --git a/autostart/translations/lxqt-globalkeyshortcuts_es.desktop b/autostart/translations/lxqt-globalkeyshortcuts_es.desktop new file mode 100644 index 0000000..2d39a4c --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_es.desktop @@ -0,0 +1,2 @@ +# Translations +Name[es]=Atajos Globales del Teclado diff --git a/autostart/translations/lxqt-globalkeyshortcuts_es_VE.desktop b/autostart/translations/lxqt-globalkeyshortcuts_es_VE.desktop new file mode 100644 index 0000000..10176a2 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_es_VE.desktop @@ -0,0 +1,2 @@ +# Translations +Name[es_VE]=Atajos de teclados de LXQt diff --git a/autostart/translations/lxqt-globalkeyshortcuts_eu.desktop b/autostart/translations/lxqt-globalkeyshortcuts_eu.desktop new file mode 100644 index 0000000..352dc5c --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_eu.desktop @@ -0,0 +1,2 @@ +# Translations +Name[eu]=Teklatuko lasterbide orokorrak diff --git a/autostart/translations/lxqt-globalkeyshortcuts_fi.desktop b/autostart/translations/lxqt-globalkeyshortcuts_fi.desktop new file mode 100644 index 0000000..6d7a6e4 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_fi.desktop @@ -0,0 +1,2 @@ +# Translations +Name[fi]=Yleiset pikanäppäimet diff --git a/autostart/translations/lxqt-globalkeyshortcuts_fr.desktop b/autostart/translations/lxqt-globalkeyshortcuts_fr.desktop new file mode 100644 index 0000000..73b54b2 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_fr.desktop @@ -0,0 +1 @@ +Name[fr]=Raccourcis clavier globaux diff --git a/autostart/translations/lxqt-globalkeyshortcuts_it_IT.desktop b/autostart/translations/lxqt-globalkeyshortcuts_it_IT.desktop new file mode 100644 index 0000000..d6b17ba --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_it_IT.desktop @@ -0,0 +1,2 @@ +# Translations +Name[it_IT]=Scorciatoie globali della tastiera diff --git a/autostart/translations/lxqt-globalkeyshortcuts_lt.desktop b/autostart/translations/lxqt-globalkeyshortcuts_lt.desktop new file mode 100644 index 0000000..8788f9f --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_lt.desktop @@ -0,0 +1,2 @@ +# Translations +Name[lt]=Visuotiniai spartieji klavišai diff --git a/autostart/translations/lxqt-globalkeyshortcuts_pl_PL.desktop b/autostart/translations/lxqt-globalkeyshortcuts_pl_PL.desktop new file mode 100644 index 0000000..3f2b4f2 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_pl_PL.desktop @@ -0,0 +1,2 @@ +# Translations +Name[pl_PL]=Globalne Skróty Klawiszowe diff --git a/autostart/translations/lxqt-globalkeyshortcuts_pt.desktop b/autostart/translations/lxqt-globalkeyshortcuts_pt.desktop new file mode 100644 index 0000000..bb4c421 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_pt.desktop @@ -0,0 +1,2 @@ +# Translations +Name[pt]=Teclas de atalho globais diff --git a/autostart/translations/lxqt-globalkeyshortcuts_pt_BR.desktop b/autostart/translations/lxqt-globalkeyshortcuts_pt_BR.desktop new file mode 100644 index 0000000..f3a1712 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_pt_BR.desktop @@ -0,0 +1,2 @@ +# Translations +Name[pt_BR]=Atalhos Globais Do Teclado diff --git a/autostart/translations/lxqt-globalkeyshortcuts_ro_RO.desktop b/autostart/translations/lxqt-globalkeyshortcuts_ro_RO.desktop new file mode 100644 index 0000000..411cf13 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_ro_RO.desktop @@ -0,0 +1,2 @@ +# Translations +Name[ro_RO]=Taste rapide globale diff --git a/autostart/translations/lxqt-globalkeyshortcuts_ru.desktop b/autostart/translations/lxqt-globalkeyshortcuts_ru.desktop new file mode 100644 index 0000000..a7d8af0 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_ru.desktop @@ -0,0 +1,2 @@ +# Translations +Name[ru]=Глобальные горячих клавиш diff --git a/autostart/translations/lxqt-globalkeyshortcuts_ru_RU.desktop b/autostart/translations/lxqt-globalkeyshortcuts_ru_RU.desktop new file mode 100644 index 0000000..93ec5ef --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_ru_RU.desktop @@ -0,0 +1,2 @@ +# Translations +Name[ru_RU]=Глобальные сочетания клавиш diff --git a/autostart/translations/lxqt-globalkeyshortcuts_th_TH.desktop b/autostart/translations/lxqt-globalkeyshortcuts_th_TH.desktop new file mode 100644 index 0000000..6717886 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_th_TH.desktop @@ -0,0 +1,2 @@ +# Translations +Name[th_TH]=ปุ่มลัดหลักต่างๆ diff --git a/autostart/translations/lxqt-globalkeyshortcuts_uk.desktop b/autostart/translations/lxqt-globalkeyshortcuts_uk.desktop new file mode 100644 index 0000000..4981df8 --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_uk.desktop @@ -0,0 +1,2 @@ +# Translations +Name[uk]=Глобальні клавіатурні скорочення diff --git a/autostart/translations/lxqt-globalkeyshortcuts_zh_CN.desktop b/autostart/translations/lxqt-globalkeyshortcuts_zh_CN.desktop new file mode 100644 index 0000000..92de84e --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_zh_CN.desktop @@ -0,0 +1,2 @@ +# Translations +Name[zh_CN]=全局键盘快捷键 diff --git a/autostart/translations/lxqt-globalkeyshortcuts_zh_TW.desktop b/autostart/translations/lxqt-globalkeyshortcuts_zh_TW.desktop new file mode 100644 index 0000000..9a6ea8f --- /dev/null +++ b/autostart/translations/lxqt-globalkeyshortcuts_zh_TW.desktop @@ -0,0 +1,2 @@ +# Translations +Name[zh_TW]=全域鍵盤快捷鍵 diff --git a/config/main.cpp b/config/main.cpp index 0bde3d1..2015828 100644 --- a/config/main.cpp +++ b/config/main.cpp @@ -27,11 +27,23 @@ #include +#include #include "main_window.h" int main(int argc, char *argv[]) { LXQt::SingleApplication a(argc, argv); + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); + + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt Config Globalkeys ")); + const QString VERINFO = QStringLiteral(LXQT_GLOBALKEYS_VERSION + "\nliblxqt " LXQT_VERSION + "\nQt " QT_VERSION_STR); + a.setApplicationVersion(VERINFO); + parser.addVersionOption(); + parser.addHelpOption(); + parser.process(a); MainWindow w; a.setActivationWindow(&w); diff --git a/config/translations/lxqt-config-globalkeyshortcuts_lt.desktop b/config/translations/lxqt-config-globalkeyshortcuts_lt.desktop new file mode 100644 index 0000000..010d5a6 --- /dev/null +++ b/config/translations/lxqt-config-globalkeyshortcuts_lt.desktop @@ -0,0 +1,4 @@ +# Translations +Name[lt]=Spartieji klavišai +GenericName[lt]=Sparčiųjų klavišų nustatymai +Comment[lt]=Konfigūruoti LXQt sparčiuosius klavišus diff --git a/daemon/core.cpp b/daemon/core.cpp index b461e0e..bac45b2 100644 --- a/daemon/core.cpp +++ b/daemon/core.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -760,8 +761,8 @@ void Core::saveConfig() settings.setValue(/* General/ */"AllowGrabBaseKeypad", mAllowGrabBaseKeypad); settings.setValue(/* General/ */"AllowGrabMiscKeypad", mAllowGrabMiscKeypad); - ShortcutAndActionById::const_iterator lastShortcutAndActionById = mShortcutAndActionById.end(); - for (ShortcutAndActionById::const_iterator shortcutAndActionById = mShortcutAndActionById.begin(); shortcutAndActionById != lastShortcutAndActionById; ++shortcutAndActionById) + ShortcutAndActionById::const_iterator lastShortcutAndActionById = mShortcutAndActionById.constEnd(); + for (ShortcutAndActionById::const_iterator shortcutAndActionById = mShortcutAndActionById.constBegin(); shortcutAndActionById != lastShortcutAndActionById; ++shortcutAndActionById) { const BaseAction *action = shortcutAndActionById.value().second; QString section = shortcutAndActionById.value().first + "." + QString::number(shortcutAndActionById.key()); @@ -1146,17 +1147,18 @@ void Core::run() XEvent event; while (mX11EventLoopActive) { - XNextEvent(mDisplay, &event); + XPeekEvent(mDisplay, &event); if (!mX11EventLoopActive) { break; } - switch (event.type) - { - case KeyPress: + if (event.type == KeyPress && mDataMutex.tryLock(0)) { - QMutexLocker lock(&mDataMutex); + std::unique_lock unlocker(mDataMutex, std::adopt_lock); + + // pop event from the x11 queue and process it + XNextEvent(mDisplay, &event); if (mGrabbingShortcut) { @@ -1370,11 +1372,15 @@ void Core::run() } } } - } - break; - default: + } + else + // check for pending pipe requests from other thread { + if (event.type != KeyPress) { + XNextEvent(mDisplay, &event); + } + pollfd fds[1]; fds[0].fd = mX11RequestPipe[STDIN_FILENO]; fds[0].events = POLLIN | POLLERR | POLLHUP; @@ -1644,7 +1650,6 @@ void Core::run() } } } - } } } @@ -2033,8 +2038,8 @@ QString Core::checkShortcut(const QString &shortcut, X11Shortcut &X11shortcut) try { - ShortcutByX11::const_iterator shortcutByX11 = mShortcutByX11.find(X11shortcut); - if (shortcutByX11 != mShortcutByX11.end()) + ShortcutByX11::const_iterator shortcutByX11 = mShortcutByX11.constFind(X11shortcut); + if (shortcutByX11 != mShortcutByX11.constEnd()) { usedShortcut = shortcutByX11.value(); } @@ -2055,8 +2060,8 @@ QString Core::checkShortcut(const QString &shortcut, X11Shortcut &X11shortcut) log(LOG_INFO, "Using shortcut '%s' instead of '%s'", qPrintable(usedShortcut), qPrintable(shortcut)); } - X11ByShortcut::const_iterator x11ByShortcut = mX11ByShortcut.find(usedShortcut); - if (x11ByShortcut == mX11ByShortcut.end()) + X11ByShortcut::const_iterator x11ByShortcut = mX11ByShortcut.constFind(usedShortcut); + if (x11ByShortcut == mX11ByShortcut.constEnd()) { mX11ByShortcut[usedShortcut] = X11shortcut; } @@ -2129,7 +2134,7 @@ void Core::addClientAction(QPair &result, const QString &sh QString useShortcut = shortcut; if (shortcut.isEmpty()) { - IdByClientPath::ConstIterator idByClientPath = mIdByClientPath.find(path); + IdByClientPath::ConstIterator idByClientPath = mIdByClientPath.constFind(path); if (idByClientPath != mIdByClientPath.constEnd()) { useShortcut = mShortcutAndActionById[idByClientPath.value()].first;; diff --git a/xdg/CMakeLists.txt b/xdg/CMakeLists.txt new file mode 100644 index 0000000..1210921 --- /dev/null +++ b/xdg/CMakeLists.txt @@ -0,0 +1,6 @@ +# install default config files to /etc/xdg +install(FILES + globalkeyshortcuts.conf + DESTINATION "${LXQT_ETC_XDG_DIR}/lxqt" + COMPONENT Runtime +) diff --git a/xdg/globalkeyshortcuts.conf b/xdg/globalkeyshortcuts.conf new file mode 100644 index 0000000..3dc1e27 --- /dev/null +++ b/xdg/globalkeyshortcuts.conf @@ -0,0 +1,41 @@ + +[Control%2BAlt%2BT.1] +Comment=QTerminal +Enabled=true +Exec=qterminal + +[Shift%2BControl%2BF6.2] +Comment=\x2600 \x2193 +Enabled=true +Exec=lxqt-config-brightness, -d + +[Shift%2BControl%2BF7.3] +Comment=\x2600 \x2191 +Enabled=true +Exec=lxqt-config-brightness, -i + +[XF86MonBrightnessDown.4] +Comment=\x2600 \x2193 +Enabled=true +Exec=lxqt-config-brightness, -d + +[XF86MonBrightnessUp.5] +Comment=\x2600 \x2191 +Enabled=true +Exec=lxqt-config-brightness, -i + + +[Control%2BAlt%2BE.6] +Comment=Pcmanfm +Enabled=true +Exec=pcmanfm-qt + +[Control%2BAlt%2BI.7] +Comment=Web browser +Enabled=true +Exec=xdg-open, about:blank + +[Print.8] +Comment=screen shot +Enabled=true +Exec=lximage-qt, -s