Fix an issue with focus lost after closing terminal panel

Authored by AndreyYashkin on Aug 11 2019, 11:11 AM.

Description

Fix an issue with focus lost after closing terminal panel

Summary:
After leaving terminal with Ctrl-D or exit commands the input focus isn't set back to the folder view.
The problem appears, because TerminalPanel::isHiddenInVisibleWindow returns not what it supposed to return,
since when the terminal process exits, m_terminal is set to nullptr.

I moved unwanted checks from it inside TerminalPanel::dockVisibilityChanged

This change also exposes a crash in DolphinMainWindow::slotTerminalPanelVisibilityChanged(),
which was previously working only by luck.
Now we check whether m_activeViewContainer is not null before using it.

BUG: 407979
FIXED-IN: 19.11.80

Test Plan:

  1. Open Dolphin
  2. Press F4 to open the terminal panel
  3. Type exit<Enter> or press Ctrl-D
  4. Check current focus widget

Reviewers: Dolphin

Subscribers: ngraham, elvisangelaccio, kfm-devel

Tags: Dolphin

Differential Revision: https://phabricator.kde.org/D22420

Details

Committed
elvisangelaccioAug 11 2019, 11:14 AM
Differential Revision
D22420: Fix an issue with focus lost after closing terminal panel
Parents
R318:4a25f01b7c13: Move variables closer to their usage
Branches
Unknown
Tags
Unknown