Skip to content

Commit

Permalink
Paste to and focus correct window after closing the main window
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed May 9, 2013
1 parent eff1934 commit 2b06a00
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,18 @@ void MainWindow::activateCurrentItem()
resetStatus();

// Perform custom actions on item activation.
WId lastWindow = m_lastWindow;
WId pasteWindow = m_pasteWindow;
if (m_activateCloses)
close();
if (m_activateFocuses || m_activatePastes) {
PlatformPtr platform = createPlatformNativeInterface();
if (m_activateFocuses && isForeignWindow(m_lastWindow))
platform->raiseWindow(m_lastWindow);
if (m_activatePastes && isForeignWindow(m_pasteWindow))
platform->pasteToWindow(m_pasteWindow);
if (m_activateFocuses && isForeignWindow(lastWindow))
platform->raiseWindow(lastWindow);
if (m_activatePastes && isForeignWindow(pasteWindow)) {
QApplication::processEvents();
platform->pasteToWindow(pasteWindow);
}
}
}

Expand Down

0 comments on commit 2b06a00

Please sign in to comment.