summaryrefslogtreecommitdiff
path: root/indra/newview/llkeyconflict.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-10-28 18:27:13 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-23 14:50:03 +0300
commit62214b53f09c453dc410465ba6e64a772562e6db (patch)
treeb3f0f8797c7efa3c1f7da0c436dde685e0d9290c /indra/newview/llkeyconflict.cpp
parent6597c7696783ce56f89b34a4b6440363635be6a6 (diff)
SL-6109 Fixed conflict resolution issue caused by menu accelerators
Diffstat (limited to 'indra/newview/llkeyconflict.cpp')
-rw-r--r--indra/newview/llkeyconflict.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp
index 71ba0d37b3..fcf1a7953c 100644
--- a/indra/newview/llkeyconflict.cpp
+++ b/indra/newview/llkeyconflict.cpp
@@ -174,17 +174,23 @@ bool LLKeyConflictHandler::canAssignControl(const std::string &control_name)
// static
bool LLKeyConflictHandler::isReservedByMenu(const KEY &key, const MASK &mask)
{
- return gMenuBarView->hasAccelerator(key, mask) || gLoginMenuBarView->hasAccelerator(key, mask);
+ if (key == KEY_NONE)
+ {
+ return false;
+ }
+ return (gMenuBarView && gMenuBarView->hasAccelerator(key, mask))
+ || (gLoginMenuBarView && gLoginMenuBarView->hasAccelerator(key, mask));
}
// static
bool LLKeyConflictHandler::isReservedByMenu(const LLKeyData &data)
{
- if (data.mMouse != CLICK_NONE)
+ if (data.mMouse != CLICK_NONE || data.mKey == KEY_NONE)
{
return false;
}
- return gMenuBarView->hasAccelerator(data.mKey, data.mMask) || gLoginMenuBarView->hasAccelerator(data.mKey, data.mMask);
+ return (gMenuBarView && gMenuBarView->hasAccelerator(data.mKey, data.mMask))
+ || (gLoginMenuBarView && gLoginMenuBarView->hasAccelerator(data.mKey, data.mMask));
}
bool LLKeyConflictHandler::registerControl(const std::string &control_name, U32 index, EMouseClickType mouse, KEY key, MASK mask, bool ignore_mask)