From 0a7c5997df75455c08e951233d8b87720409c865 Mon Sep 17 00:00:00 2001 From: Sebastian Dörner Date: Wed, 1 Jun 2011 21:51:22 +0100 Subject: 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 --- src/panels/terminal/terminalpanel.cpp | 9 ++++++--- src/panels/terminal/terminalpanel.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/panels') 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(); -- cgit v1.3