From: Sebastian Dörner Date: Wed, 1 Jun 2011 20:51:22 +0000 (+0100) Subject: Fix problems with commit 8d789f2626243d X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0a7c5997df75455c08e951233d8b87720409c865 Fix problems with commit 8d789f2626243d - fix crash when Ctrl-D-ing in the terminal - don't respond to window manager actions, only when the dock itself is hidden Refers to commit 8d789f2626243ddc6c763c84e582e8e20afe7689 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3b5f493ca..4c584cdf9 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1801,7 +1801,7 @@ void DolphinMainWindow::setupDockWidgets() 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); diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index b45be621a..b3bf0506f 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -50,13 +50,16 @@ TerminalPanel::~TerminalPanel() void TerminalPanel::terminalExited() { - emit hideTerminalPanel(); m_terminal = 0; + 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("/")); } diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 288cb05d3..cc27212e8 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -44,7 +44,7 @@ public: public slots: void terminalExited(); - void visibilityChanged(bool visible); + void dockVisibilityChanged(); signals: void hideTerminalPanel();