UGlobalHotkey fix

[skip ci]
This commit is contained in:
DavidXanatos 2023-07-30 14:42:18 +02:00
parent 3912dbfd53
commit c132b91a0d
3 changed files with 14 additions and 5 deletions

View File

@ -22,7 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed issue with link argument handling [#2969](https://github.com/sandboxie-plus/Sandboxie/issues/2969) - fixed issue with link argument handling [#2969](https://github.com/sandboxie-plus/Sandboxie/issues/2969)
- fixed IPC issue introduced in 1.10.1 [#3132](https://github.com/sandboxie-plus/Sandboxie/issues/3132) [#3134](https://github.com/sandboxie-plus/Sandboxie/issues/3134) - fixed IPC issue introduced in 1.10.1 [#3132](https://github.com/sandboxie-plus/Sandboxie/issues/3132) [#3134](https://github.com/sandboxie-plus/Sandboxie/issues/3134)
- fixed issue with pinned run entry icons - fixed issue with pinned run entry icons
- fixed UGlobalHotkey lib not being compatible with Qt6

View File

@ -154,8 +154,7 @@ void UGlobalHotkeys::onHotkeyPressed(size_t id) {
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
bool UGlobalHotkeys::winEvent(MSG * message, long * result) { bool UGlobalHotkeys::winEvent(MSG * message) {
Q_UNUSED(result);
if (message->message == WM_HOTKEY) { if (message->message == WM_HOTKEY) {
size_t id = message->wParam; size_t id = message->wParam;
Q_ASSERT(Registered.find(id) != Registered.end() && "Unregistered hotkey"); Q_ASSERT(Registered.find(id) != Registered.end() && "Unregistered hotkey");
@ -164,11 +163,17 @@ bool UGlobalHotkeys::winEvent(MSG * message, long * result) {
return false; return false;
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool UGlobalHotkeys::nativeEvent(const QByteArray &eventType,
void *message, qintptr *result)
#else
bool UGlobalHotkeys::nativeEvent(const QByteArray &eventType, bool UGlobalHotkeys::nativeEvent(const QByteArray &eventType,
void *message, long *result) void *message, long *result)
#endif
{ {
Q_UNUSED(eventType); Q_UNUSED(eventType);
return winEvent((MSG*)message, result); Q_UNUSED(result);
return winEvent((MSG*)message);
} }
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)

View File

@ -40,8 +40,12 @@ public:
~UGlobalHotkeys(); ~UGlobalHotkeys();
protected: protected:
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
bool winEvent (MSG * message, long * result); bool winEvent (MSG * message);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
#else
bool nativeEvent(const QByteArray &eventType, void *message, long *result); bool nativeEvent(const QByteArray &eventType, void *message, long *result);
#endif
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
bool linuxEvent(xcb_generic_event_t *message); bool linuxEvent(xcb_generic_event_t *message);