connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
connect(terminalDock, SIGNAL(visibilityChanged(bool)),
connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
connect(terminalDock, SIGNAL(visibilityChanged(bool)),
- terminalPanel, SLOT(visibilityChanged(bool)));
+ terminalPanel, SLOT(dockVisibilityChanged()));
QAction* terminalAction = terminalDock->toggleViewAction();
terminalAction->setShortcut(Qt::Key_F4);
QAction* terminalAction = terminalDock->toggleViewAction();
terminalAction->setShortcut(Qt::Key_F4);
void TerminalPanel::terminalExited()
{
void TerminalPanel::terminalExited()
{
- emit hideTerminalPanel();
+ emit hideTerminalPanel();
-void TerminalPanel::visibilityChanged(bool visible)
+void TerminalPanel::dockVisibilityChanged()
- if (!visible && m_terminal && (m_terminal->foregroundProcessId() == -1)) {
+ // Only react when the DockWidget itself (not some parent) is hidden. This way we don't
+ // respond when e.g. Dolphin is minimized.
+ if (parentWidget() && parentWidget()->isHidden() &&
+ m_terminal && (m_terminal->foregroundProcessId() == -1)) {
// Make sure this terminal does not prevent unmounting any removable drives
changeDir(KUrl::fromPath("/"));
}
// Make sure this terminal does not prevent unmounting any removable drives
changeDir(KUrl::fromPath("/"));
}
public slots:
void terminalExited();
public slots:
void terminalExited();
- void visibilityChanged(bool visible);
+ void dockVisibilityChanged();
signals:
void hideTerminalPanel();
signals:
void hideTerminalPanel();