Skip to content

Commit

Permalink
fix: activate window when opening files
Browse files Browse the repository at this point in the history
If the main window is minimized, open new files should bring the
main window to the front end, not just open files in the background.

Change-Id: I27180b66d4596bff038258cee4a950d4fd635c3f
  • Loading branch information
hualet committed Apr 11, 2019
1 parent 56c9973 commit 437e8d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ build/
*.qm
*.autosave
*.txt.user

.vscode/*
8 changes: 6 additions & 2 deletions src/startmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ void StartManager::openFilesInTab(QStringList files)
}
// Open file tab in first window of window list.
else {
m_windows[0]->addTab(file);
Window *window = m_windows[0];
window->addTab(file);
window->activateWindow();

qDebug() << "Open " << file << " in first window";
}
Expand Down Expand Up @@ -196,7 +198,9 @@ void StartManager::initWindowPosition(Window *window, bool alwaysCenter)

void StartManager::popupExistTabs(FileTabInfo info)
{
m_windows[info.windowIndex]->activeTab(info.tabIndex);
Window *window = m_windows[info.windowIndex];
window->activeTab(info.tabIndex);
window->activateWindow();
}

StartManager::FileTabInfo StartManager::getFileTabInfo(QString file)
Expand Down

0 comments on commit 437e8d7

Please sign in to comment.