Fix an issue with focus lost after closing terminal panel
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.
- Open Dolphin
- Press F4 to open the terminal panel
- Type exit<Enter> or press Ctrl-D
- Check current focus widget
Subscribers: ngraham, elvisangelaccio, kfm-devel
Differential Revision: https://phabricator.kde.org/D22420