TabbedNavigation is when we have a MainWindow, i.e. the typical use case;
whereas NoNavigation is when using Konsole Part. The code in Part calls
setNavigationMethod(NoNavigation), so things should work as before.
I made a wrong assumption that TabbedNavigation was already the default.
CCBUG: 432077
It looks like switching virtual desktops in OpenBox invokes a show event
(this doesn't happen while running Plasma).
The code in MainWindow::showEvent() should only be run once on first show,
so guard it with a bool member.
BUG: 441610
FIXED-IN: 21.08.1
empty() is emitted so that MainWindow calls close() and we get rid of the
colours-flashing bug when closing the last session/tab in a window, see
commit bbec72250d. However all that isn't relevant when we are in
konsole Part mode, where there are no tabs or MainWindows.
This fixes a crash in Dolphin when closing its window while the embedded
Konsole Part is open. The crash would happen as calling
ViewContainer::currentTabViewCount() would end up in the ViewSplitter code
path, which is no-op in Konsole Part.
To test:
- Open dolphin, make sure the terminal panel isn't open to begin with
- open the terminal panel
- close the dolphin window while the terminal panel is open
BUG: 441206
FIXED-IN: 21.08.1
When closing a session, we check if that is the last tab, and make the code
close the whole window, but we also need to make sure it's the last view,
i.e. no split views.
CCBUG: 440976
FIXED-IN: 21.12
the new session close behavior is again the old
- first send SIGHUP and wait one second if that works
- then hard kill
before we tried to send an EOF character
this needed workaround to not kill "non shell" programs
unexpected and doesn't work e.g. if
- you have some not finished command input in your shell
- on e.g. FreeBSD in general
When closing the session with some background process still running:
- using Ctrl+D (which sends EOF) will leave that background process running
(which is the expected behaviour with e.g. BASH:
https://lists.gnu.org/archive/html/bug-bash/2009-03/msg00091.html)
- using e.g. the close button on the titlebar will close the session and kill any background processes
You can also use 'somecommand & disown', if you want to ensure background processes
aren't killed when you close a konsole window.
BUG: 401898
CCBUG: 185140
There are two scenarios when closing a window:
A) clicking the close button on the title bar (or Ctrl+Shift+Q):
~MainWindow()
~ViewManager()
~TabbedViewContainer()
~TerminalDisplay()
~Session()
B) closing the last session/tab in a window:
SessionController::sessionFinished()
~Session()
~TerminalDisplay()
~TabbedViewContainer()
~MainWindow()
~ViewManager()
the issue with the second case is that the TerminalDisplay is torn down
first, which exposes the TabbedViewContainer widget, the latter has the same
Qt::Window colour as the system colour scheme window background colour, if
you're using a dark terminal colour scheme and a light-coloured system colour
scheme, you could see some "flashing" when you close the last session with
e.g. Ctrl+D.
To fix this, in sessionFinished() check if TabbedViewContainer::count() is
1 (i.e. closing last tab/session), and emit the empty() signal in that case,
which is connected to MainwWindow::close(), then the order of tear down
becomes:
SessionController::sessionFinished()
~Session()
~MainWindow()
~ViewManager()
~TabbedViewContainer()
~TerminalDisplay()
BUG: 432077
FIXED-IN: 21.12
Looking at the crash backtraces from the bug reports, it seems this is what
happens, when you have two tabs open, then click the close button on the
non-current tab:
- QTabBar::currentChanged() is emitted, the TerminalDisplay pointer is
still not null at this point (the code checks for that)
- TabbedViewContainer::currentTabChanged()
- TabbedViewContainer::activeViewChanged()
- ViewManager::activateView(), at this point the TerminalDisplay pointer
could be null, which then crashes when we call Widget::setFocus()
BUG: 411962
FIXED-IN: 21.12
This is similar to commit c413d543c1, EditProfileDialog's base class
(KPageDialog) already connects OK button clicked signal to accepted() signal;
creating another connection to accepted() in SessionController (which
creates the EditProfileDialog object), means the code will be run twice, not
ideal. Instead put the logic in EditProfileDialog::save() which is called by
the EditProfileDialog::accept() slot.
The same goes when ProfileSettings creates an EditProfileDialog.
The very first time a user runs Konsole, where is no konsolerc file in $HOME,
there is no saved size to restore, instead use the sizeHint(), which ideally
will be the size set in the default profile (based on lines/columns setting).
CCBUG: 437791
Call setupGUI(), which will call createGUI (since we set the
KXmlGuiWindow::Create flag), omit the StatusBar flag since we don't have a
statusbar and don't want the "Show StatusBar" menu action.
TabbedViewContainer::sizeHint() calculates an optimum size for itself,
including the sizes of its child widgets; added in efb621d091 by
Mariusz Glebocki; following the code:
MainWindow creates a ViewManager
ViewManager creates a TabbedViewContainer and then a TerminalDisplay
which means that the first time TabbedViewContainer::sizeHint() is called
the TerminalDisplay widget size is 0, then TabbedViewContainer::sizeHint()
would return 0.
Which is why calling resize() in MainWindow was delayed to the showEvent(),
(and even delayed more by a QTimer::singleShot() call in Application),
at which point all the child widgets have been created and
MainWindow::sizeHint() (which logically takes into account the sizeHint()
of its child widgets) would return a sensible size.
CCBUG: 430036
CCBUG: 439339
BUG: 436471
Basically to use QWidget::windowHandle() to get a QWindow*, we need to first
set the Qt::WA_NativeWindow attribute on the QWidget. See:
https://phabricator.kde.org/D23108
BUG: 439871
FIXED-IN: 21.12
clearImage() just clears until _columns. To prevent characters from
beyond _columns from reappearing, e.g. due to DCH (Delete CHaracters)
requests, make clearImage() resize lines when clearing to the end of
line.
BUG: 432669
It is crashing several times a day for me, and every time it closes all
Konsole windows I have open (including the ones I'm working in), so I
suggest it should be turned off by default for this release.
(cherry picked from commit 2a788380f648ed95a76508a10a327521ccb098f6)