summaryrefslogtreecommitdiffhomepage
path: root/qxt-mini
diff options
context:
space:
mode:
Diffstat (limited to 'qxt-mini')
-rw-r--r--qxt-mini/CMakeLists.txt4
-rw-r--r--qxt-mini/lang/de_DE.ts4
-rw-r--r--qxt-mini/lang/zh_CN.ts2
-rw-r--r--qxt-mini/powerset.hpp2
-rw-r--r--qxt-mini/qxtglobalshortcut.cpp8
-rw-r--r--qxt-mini/qxtglobalshortcut_mac.cpp17
-rw-r--r--qxt-mini/qxtglobalshortcut_x11.cpp4
7 files changed, 25 insertions, 16 deletions
diff --git a/qxt-mini/CMakeLists.txt b/qxt-mini/CMakeLists.txt
index 21b2b160..1b2496f6 100644
--- a/qxt-mini/CMakeLists.txt
+++ b/qxt-mini/CMakeLists.txt
@@ -3,7 +3,9 @@ if(UNIX OR APPLE)
include_directories(SYSTEM ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
otr_module(qxt-mini NO-COMPAT BIN)
if(APPLE)
- target_link_options(${self} PUBLIC -framework Carbon -framework CoreFoundation)
+ find_library(CoreFoundation CoreFoundation)
+ find_library(Carbon Carbon)
+ target_link_options(${self} PUBLIC -framework Carbon -I ${CoreFoundation})
else()
otr_pkgconfig(${self} x11 xcb xproto)
endif()
diff --git a/qxt-mini/lang/de_DE.ts b/qxt-mini/lang/de_DE.ts
new file mode 100644
index 00000000..1552582e
--- /dev/null
+++ b/qxt-mini/lang/de_DE.ts
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+</TS>
diff --git a/qxt-mini/lang/zh_CN.ts b/qxt-mini/lang/zh_CN.ts
index 6401616d..e5ca8aa9 100644
--- a/qxt-mini/lang/zh_CN.ts
+++ b/qxt-mini/lang/zh_CN.ts
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1">
+<TS version="2.1" language="zh_CN">
</TS>
diff --git a/qxt-mini/powerset.hpp b/qxt-mini/powerset.hpp
index d8a8ec9b..901ff0c7 100644
--- a/qxt-mini/powerset.hpp
+++ b/qxt-mini/powerset.hpp
@@ -1,7 +1,5 @@
#pragma once
-#include "compat/macros.hpp"
-
#include <type_traits>
#include <cinttypes>
#include <vector>
diff --git a/qxt-mini/qxtglobalshortcut.cpp b/qxt-mini/qxtglobalshortcut.cpp
index 69514f88..dec11dc4 100644
--- a/qxt-mini/qxtglobalshortcut.cpp
+++ b/qxt-mini/qxtglobalshortcut.cpp
@@ -36,6 +36,10 @@
#include <QtDebug>
#include <QtGlobal>
+#ifdef __GNUG__
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
QHash<QPair<quint32, quint32>, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts;
void QxtGlobalShortcutPrivate::event_filter_installer::ensure_event_filter()
@@ -55,7 +59,7 @@ void QxtGlobalShortcutPrivate::event_filter_installer::ensure_event_filter()
QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate(QxtGlobalShortcutPrivate::tag) :
keystate(false), enabled(false), key(Qt::Key(0)), mods(Qt::NoModifier)
{
- qDebug() << "qxt-mini: adding event filter";
+ //qDebug() << "qxt-mini: adding event filter";
}
QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() :
@@ -176,7 +180,7 @@ void QxtGlobalShortcutPrivate::activateShortcut(quint32 nativeKey, quint32 nativ
shortcut->qxt_d().keystate = false;
if (shortcut->isEnabled())
- emit shortcut->activated(true);
+ emit shortcut->activated(is_down);
}
#endif
}
diff --git a/qxt-mini/qxtglobalshortcut_mac.cpp b/qxt-mini/qxtglobalshortcut_mac.cpp
index d7cd7f84..c91d763d 100644
--- a/qxt-mini/qxtglobalshortcut_mac.cpp
+++ b/qxt-mini/qxtglobalshortcut_mac.cpp
@@ -49,13 +49,14 @@ OSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRef event,
{
Q_UNUSED(nextHandler);
Q_UNUSED(data);
- if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed)
+ if (GetEventClass(event) == kEventClassKeyboard && (GetEventKind(event) == kEventHotKeyPressed || GetEventKind(event) == kEventHotKeyReleased))
{
EventHotKeyID keyID;
GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(keyID), NULL, &keyID);
Identifier id = keyIDs.key(keyID.id);
- if(id != Identifier())
- QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first, true);
+ if(id != Identifier()) {
+ QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first, GetEventKind(event) == kEventHotKeyPressed);
+ }
}
return noErr;
}
@@ -233,10 +234,12 @@ bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativ
if (!qxt_mac_handler_installed)
{
qxt_mac_handler_installed = true;
- EventTypeSpec t;
- t.eventClass = kEventClassKeyboard;
- t.eventKind = kEventHotKeyPressed;
- InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 1, &t, NULL, NULL);
+ EventTypeSpec t[2];
+ t[0].eventClass = kEventClassKeyboard;
+ t[0].eventKind = kEventHotKeyPressed;
+ t[1].eventClass = kEventClassKeyboard;
+ t[1].eventKind = kEventHotKeyReleased;
+ InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 2, t, NULL, NULL);
}
EventHotKeyID keyID;
diff --git a/qxt-mini/qxtglobalshortcut_x11.cpp b/qxt-mini/qxtglobalshortcut_x11.cpp
index 6647d803..01894cfc 100644
--- a/qxt-mini/qxtglobalshortcut_x11.cpp
+++ b/qxt-mini/qxtglobalshortcut_x11.cpp
@@ -355,9 +355,7 @@ bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType,
(void) XkbSetDetectableAutoRepeat(x11.display(), True, &val);
- if (val)
- qDebug() << "qxt-mini: fixed x11 autorepeat";
- else
+ if (!val)
qDebug() << "qxt-mini: can't fix x11 autorepeat";
}
}