[BUGFIX] Fix macOS not properly skipping hotkey registration/unregistration
This commit is contained in:
parent
bd1408d87a
commit
37299c2d2e
|
@ -336,7 +336,7 @@ OSXScreen::registerHotKey(KeyID key, KeyModifierMask mask, bool registerGlobalHo
|
||||||
|
|
||||||
// if this hot key has modifiers only then we'll handle it specially
|
// if this hot key has modifiers only then we'll handle it specially
|
||||||
EventHotKeyRef ref = NULL;
|
EventHotKeyRef ref = NULL;
|
||||||
bool okay;
|
bool okay = true;
|
||||||
if (key == kKeyNone) {
|
if (key == kKeyNone) {
|
||||||
if (m_modifierHotKeys.count(mask) > 0) {
|
if (m_modifierHotKeys.count(mask) > 0) {
|
||||||
// already registered
|
// already registered
|
||||||
|
@ -381,10 +381,12 @@ OSXScreen::unregisterHotKey(UInt32 id, bool unregisterGlobalHotkey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// unregister with OS
|
// unregister with OS
|
||||||
bool okay;
|
bool okay = true;
|
||||||
if (unregisterGlobalHotkey && i->second.getRef() != NULL) {
|
if (i->second.getRef() != NULL) {
|
||||||
|
if (unregisterGlobalHotkey) {
|
||||||
okay = (UnregisterEventHotKey(i->second.getRef()) == noErr);
|
okay = (UnregisterEventHotKey(i->second.getRef()) == noErr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
okay = false;
|
okay = false;
|
||||||
// XXX -- this is inefficient
|
// XXX -- this is inefficient
|
||||||
|
|
Loading…
Reference in New Issue