#1411 Fixed the window activation bug introduced by 442d9d2e

This commit is contained in:
Jacob Støren 2017-04-07 18:00:14 +02:00
parent f59f52c848
commit 03ab71f82f
2 changed files with 7 additions and 4 deletions

View File

@ -64,6 +64,7 @@
RiuMainPlotWindow::RiuMainPlotWindow()
: m_pdmRoot(NULL),
m_mainViewer(NULL),
m_activePlotViewWindow(nullptr),
m_windowMenu(NULL),
m_blockSlotSubWindowActivated(false)
{
@ -484,7 +485,6 @@ void RiuMainPlotWindow::setPdmRoot(caf::PdmObject* pdmRoot)
void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
{
if (!subWindow) return;
if (m_blockSlotSubWindowActivated) return;
RimProject * proj = RiaApplication::instance()->project();
if (!proj) return;
@ -493,9 +493,10 @@ void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
RimViewWindow* viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget(subWindow->widget());
if (viewWindow)
if (viewWindow && viewWindow != m_activePlotViewWindow)
{
projectTreeView()->selectAsCurrentItem(viewWindow);
if (!m_blockSlotSubWindowActivated) projectTreeView()->selectAsCurrentItem(viewWindow);
m_activePlotViewWindow = viewWindow;
}
}

View File

@ -31,6 +31,7 @@ class QMdiSubWindow;
class RiuViewer;
struct RimMdiWindowGeometry;
class RimViewWindow;
namespace caf
{
@ -114,7 +115,8 @@ private:
QMdiArea* m_mdiArea;
RiuViewer* m_mainViewer;
RimViewWindow* m_activePlotViewWindow;
QMenu* m_windowMenu;
caf::PdmUiTreeView* m_projectTreeView;