From fa6a856ed58b6226aa457e6f8001b4e4563770f1 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Thu, 17 Nov 2011 17:01:42 +0400 Subject: [PATCH] Fix hotkeys registration under Windows --- hotkeywrapper.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hotkeywrapper.cc b/hotkeywrapper.cc index bf592c32..7bfe5556 100644 --- a/hotkeywrapper.cc +++ b/hotkeywrapper.cc @@ -69,8 +69,11 @@ HotkeyStruct::HotkeyStruct( quint32 key_, quint32 key2_, quint32 modifier_, HotkeyWrapper::HotkeyWrapper(QObject *parent) : QThread( parent ), state2(false) { +#ifdef Q_OS_WIN + hwnd=(HWND)((static_cast(parent))->winId()); +#else init(); - +#endif (static_cast(qApp))->registerWrapper(this); } @@ -182,6 +185,8 @@ bool HotkeyWrapper::setGlobalKey( int key, int key2, return false; // We don't monitor empty combinations static int id = 0; + if( id > 0xBFFF - 1 ) + id = 0; quint32 mod = 0; if (modifier & Qt::CTRL)