Skip to content

Commit

Permalink
+ fixes #1797: Fix focus problem with Quarter based viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 27, 2014
1 parent 30d38e6 commit a239e7b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Gui/MainWindow.cpp
Expand Up @@ -952,7 +952,7 @@ void MainWindow::onWindowActivated(QWidget* w)
if (!w) return;
MDIView* view = dynamic_cast<MDIView*>(w->widget());
#else
MDIView* view = dynamic_cast<MDIView*>(w);
MDIView* view = dynamic_cast<MDIView*>(w);
#endif

// Even if windowActivated() signal is emitted mdi doesn't need to be a top-level window.
Expand Down Expand Up @@ -1625,6 +1625,18 @@ void MainWindow::changeEvent(QEvent *e)
Workbench* wb = WorkbenchManager::instance()->active();
if (wb) wb->retranslate();
}
else if (e->type() == QEvent::ActivationChange) {
if (isActiveWindow()) {
QMdiSubWindow* mdi = d->mdiArea->currentSubWindow();
if (mdi) {
MDIView* view =dynamic_cast<MDIView*>(mdi->widget());
if (getMainWindow()->activeWindow() != view) {
d->activeView = view;
Application::Instance->viewActivated(view);
}
}
}
}
else {
QMainWindow::changeEvent(e);
}
Expand Down

0 comments on commit a239e7b

Please sign in to comment.