summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp51
1 files changed, 40 insertions, 11 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5f95e9ccf1..b574a9c110 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -32,6 +32,10 @@
#include "llviewerprecompiledheaders.h"
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
// system library includes
#include <stdio.h>
#include <iostream>
@@ -138,7 +142,6 @@
#include "llstatview.h"
#include "llsurface.h"
#include "llsurfacepatch.h"
-#include "llimview.h"
#include "lltexlayer.h"
#include "lltextbox.h"
#include "lltexturecache.h"
@@ -195,6 +198,7 @@
#include "llfloaternotificationsconsole.h"
#include "llnearbychat.h"
+#include "llviewerwindowlistener.h"
#if LL_WINDOWS
#include <tchar.h> // For Unicode conversion methods
@@ -1204,7 +1208,8 @@ LLViewerWindow::LLViewerWindow(
mResDirty(false),
mStatesDirty(false),
mIsFullscreenChecked(false),
- mCurrResolutionIndex(0)
+ mCurrResolutionIndex(0),
+ mViewerWindowListener(new LLViewerWindowListener("LLViewerWindow", this))
{
LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert"));
LLNotificationChannel::buildChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
@@ -1513,11 +1518,12 @@ void LLViewerWindow::initWorldUI()
getRootView()->addChild(gMorphView);
// Make space for nav bar.
+ LLNavigationBar* navbar = LLNavigationBar::getInstance();
LLRect floater_view_rect = gFloaterView->getRect();
LLRect notify_view_rect = gNotifyBoxView->getRect();
- floater_view_rect.mTop -= NAVIGATION_BAR_HEIGHT;
+ floater_view_rect.mTop -= navbar->getDefNavBarHeight();
floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight();
- notify_view_rect.mTop -= NAVIGATION_BAR_HEIGHT;
+ notify_view_rect.mTop -= navbar->getDefNavBarHeight();
notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight();
gFloaterView->setRect(floater_view_rect);
gNotifyBoxView->setRect(notify_view_rect);
@@ -1544,20 +1550,19 @@ void LLViewerWindow::initWorldUI()
gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() );
// Navigation bar
-
- LLNavigationBar* navbar = LLNavigationBar::getInstance();
navbar->reshape(root_rect.getWidth(), navbar->getRect().getHeight(), TRUE); // *TODO: redundant?
navbar->translate(0, root_rect.getHeight() - menu_bar_height - navbar->getRect().getHeight()); // FIXME
navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
+
if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel"))
{
- navbar->showNavigationPanel(FALSE);
+ toggle_show_navigation_panel(LLSD(0));
}
if (!gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"))
{
- navbar->showFavoritesPanel(FALSE);
+ toggle_show_favorites_panel(LLSD(0));
}
if (!gSavedSettings.getBOOL("ShowCameraButton"))
@@ -1627,6 +1632,14 @@ void LLViewerWindow::shutdownViews()
{
gMorphView->setVisible(FALSE);
}
+
+ // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open
+ // will crump with LL_ERRS.
+ LLModalDialog::shutdownModals();
+
+ // destroy the nav bar, not currently part of gViewerWindow
+ // *TODO: Make LLNavigationBar part of gViewerWindow
+ delete LLNavigationBar::getInstance();
// Delete all child views.
delete mRootView;
@@ -2411,19 +2424,35 @@ void LLViewerWindow::updateUI()
BOOL handled_by_top_ctrl = FALSE;
LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
+ LLView* captor_view = dynamic_cast<LLView*>(mouse_captor);
+
+ //FIXME: only include captor and captor's ancestors if mouse is truly over them --RN
//build set of views containing mouse cursor by traversing UI hierarchy and testing
//screen rect against mouse cursor
view_handle_set_t mouse_hover_set;
- // start at current mouse captor (if is a view) or UI root
- LLView* root_view = NULL;
- root_view = dynamic_cast<LLView*>(mouse_captor);
+ // constraint mouse enter events to children of mouse captor
+ LLView* root_view = captor_view;
+
+ // if mouse captor doesn't exist or isn't a LLView
+ // then allow mouse enter events on entire UI hierarchy
if (!root_view)
{
root_view = mRootView;
}
+ // include all ancestors of captor_view as automatically having mouse
+ if (captor_view)
+ {
+ LLView* captor_parent_view = captor_view->getParent();
+ while(captor_parent_view)
+ {
+ mouse_hover_set.insert(captor_parent_view->getHandle());
+ captor_parent_view = captor_parent_view->getParent();
+ }
+ }
+
// aggregate visible views that contain mouse cursor in display order
// while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events