From 4e40fe810d324e69eeb824e40011e509e6676aaf Mon Sep 17 00:00:00 2001 From: "Adrián Chaves Fernández (Gallaecio)" Date: Thu, 18 Jan 2018 18:49:54 +0100 Subject: Set the focus to the active view, after leaving the terminal panel Summary: BUG: 298467 Set the focus to the active view, after leaving the terminal panel. This is a fork of the patch at https://git.reviewboard.kde.org/r/116118/ by @emmanuelp which should fix the issue with the original patch reported by Frank Reininghaus. Test Plan: Works for me. Reviewers: #dolphin, emmanuelp, ngraham Reviewed By: #dolphin, ngraham Subscribers: ngraham, emmanuelp Differential Revision: https://phabricator.kde.org/D9955 --- src/dolphinmainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 7b3d63fd6..ad1952361 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -629,6 +629,13 @@ void DolphinMainWindow::togglePanelLockState() GeneralSettings::setLockPanels(newLockState); } +void DolphinMainWindow::slotTerminalPanelVisibilityChanged() +{ + if (m_terminalPanel->isHiddenInVisibleWindow()) { + m_activeViewContainer->view()->setFocus(); + } +} + void DolphinMainWindow::goBack() { KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator(); @@ -1297,6 +1304,8 @@ void DolphinMainWindow::setupDockWidgets() connect(m_terminalPanel, &TerminalPanel::changeUrl, this, &DolphinMainWindow::slotTerminalDirectoryChanged); connect(terminalDock, &DolphinDockWidget::visibilityChanged, m_terminalPanel, &TerminalPanel::dockVisibilityChanged); + connect(terminalDock, &DolphinDockWidget::visibilityChanged, + this, &DolphinMainWindow::slotTerminalPanelVisibilityChanged); QAction* terminalAction = terminalDock->toggleViewAction(); createPanelAction(QIcon::fromTheme(QStringLiteral("utilities-terminal")), Qt::Key_F4, terminalAction, QStringLiteral("show_terminal_panel")); -- cgit v1.3