diff options
author | McCabe Maxsted | 2011-03-15 17:12:51 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-03-15 17:12:51 -0700 |
commit | a47ebd7864f6dceedd52ceef56a30786f38a00c2 (patch) | |
tree | cd713b19c451eb722f61bd5e4605ac08f8cb1b65 /linden/indra | |
parent | Use a buffer for debug console output (improves speed on Windows when console... (diff) | |
download | meta-impy-a47ebd7864f6dceedd52ceef56a30786f38a00c2.zip meta-impy-a47ebd7864f6dceedd52ceef56a30786f38a00c2.tar.gz meta-impy-a47ebd7864f6dceedd52ceef56a30786f38a00c2.tar.bz2 meta-impy-a47ebd7864f6dceedd52ceef56a30786f38a00c2.tar.xz |
Don't use the build window keyboard shortcuts when the UI has focus (except for the chatbar)
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/lltoolmgr.cpp | 21 | ||||
-rw-r--r-- | linden/indra/newview/llviewerwindow.cpp | 10 | ||||
-rw-r--r-- | linden/indra/newview/llviewerwindow.h | 3 |
3 files changed, 30 insertions, 4 deletions
diff --git a/linden/indra/newview/lltoolmgr.cpp b/linden/indra/newview/lltoolmgr.cpp index 8204374..764ca9d 100644 --- a/linden/indra/newview/lltoolmgr.cpp +++ b/linden/indra/newview/lltoolmgr.cpp | |||
@@ -34,6 +34,8 @@ | |||
34 | 34 | ||
35 | #include "lltoolmgr.h" | 35 | #include "lltoolmgr.h" |
36 | 36 | ||
37 | #include "llchatbar.h" | ||
38 | #include "llfloatertools.h" | ||
37 | #include "lltool.h" | 39 | #include "lltool.h" |
38 | // tools and manipulators | 40 | // tools and manipulators |
39 | #include "llmanipscale.h" | 41 | #include "llmanipscale.h" |
@@ -191,11 +193,22 @@ LLTool* LLToolMgr::getCurrentTool() | |||
191 | else | 193 | else |
192 | { | 194 | { |
193 | // due to window management weirdness we can get here with gToolNull | 195 | // due to window management weirdness we can get here with gToolNull |
194 | bool can_override = mBaseTool && (mBaseTool != gToolNull); | 196 | // Don't use keyboard overrides when the edit window doesn't have focus. The chatbar is an unfortunate exception -- MC |
195 | mOverrideTool = can_override ? mBaseTool->getOverrideTool(override_mask) : NULL; | 197 | if (gViewerWindow && gViewerWindow->getUIHasFocus() |
198 | && gFloaterTools && !gFloaterTools->hasFocus() | ||
199 | && gChatBar && !gChatBar->getVisible()) | ||
200 | { | ||
201 | cur_tool = mBaseTool; | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | bool can_override = mBaseTool && (mBaseTool != gToolNull) ; | ||
206 | |||
207 | mOverrideTool = can_override ? mBaseTool->getOverrideTool(override_mask) : NULL; | ||
196 | 208 | ||
197 | // use keyboard-override tool if available otherwise drop back to base tool | 209 | // use keyboard-override tool if available otherwise drop back to base tool |
198 | cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; | 210 | cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; |
211 | } | ||
199 | } | 212 | } |
200 | 213 | ||
201 | LLTool* prev_tool = mSelectedTool; | 214 | LLTool* prev_tool = mSelectedTool; |
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index b4ef3ff..8423f4b 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -5011,6 +5011,16 @@ LLRect LLViewerWindow::getChatConsoleRect() | |||
5011 | 5011 | ||
5012 | return console_rect; | 5012 | return console_rect; |
5013 | } | 5013 | } |
5014 | |||
5015 | bool LLViewerWindow::getUIHasFocus() | ||
5016 | { | ||
5017 | return gFocusMgr.getKeyboardFocus() != NULL | ||
5018 | || LLMenuGL::getKeyboardMode() | ||
5019 | || (gMenuBarView && gMenuBarView->getHighlightedItem() && gMenuBarView->getHighlightedItem()->isActive()) | ||
5020 | || gFocusMgr.childHasKeyboardFocus(mRootView); | ||
5021 | } | ||
5022 | |||
5023 | |||
5014 | //---------------------------------------------------------------------------- | 5024 | //---------------------------------------------------------------------------- |
5015 | 5025 | ||
5016 | 5026 | ||
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h index fd159e1..6b8e2b7 100644 --- a/linden/indra/newview/llviewerwindow.h +++ b/linden/indra/newview/llviewerwindow.h | |||
@@ -195,6 +195,9 @@ public: | |||
195 | S32 getWindowDisplayHeight() const; | 195 | S32 getWindowDisplayHeight() const; |
196 | S32 getWindowDisplayWidth() const; | 196 | S32 getWindowDisplayWidth() const; |
197 | 197 | ||
198 | // Returns true when the UI has focus, false when the 3D world does | ||
199 | bool getUIHasFocus(); | ||
200 | |||
198 | // Window in scaled pixels (via UI scale), use this for | 201 | // Window in scaled pixels (via UI scale), use this for |
199 | // UI elements checking size. | 202 | // UI elements checking size. |
200 | const LLRect& getVirtualWindowRect() const { return mVirtualWindowRect; }; | 203 | const LLRect& getVirtualWindowRect() const { return mVirtualWindowRect; }; |