Bug 440976 - When terminal is splitted, exit or ctrl-d or close split asks to quit Konsole
Summary: When terminal is splitted, exit or ctrl-d or close split asks to quit Konsole
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: split-view (show other bugs)
Version: 21.08.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 441217 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-14 16:33 UTC by Julien Delquié
Modified: 2021-08-20 12:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Delquié 2021-08-14 16:33:35 UTC
SUMMARY

Konsole is not able to close only the concerned split view.
Instead, it asks Konsole to close the window and warns about split view left opened.
Yes -> close Konsole
No -> crash Konsole!
Cancel -> crash Konsole!


STEPS TO REPRODUCE
1. Open Konsole
2. Split view
3. Try to close one of the splitted view

OBSERVED RESULT

Konsole asks if we are sure to close Konsole because there are still opened splitted view.
Yes -> close Konsole
No -> crash Konsole!
Cancel -> crash Konsole!

EXPECTED RESULT

Close the concerned splitted view without asking.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.13.10-gentoo-x86_64 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Julien Delquié 2021-08-14 21:41:53 UTC
Here is a backtrace:

Application: Konsole (konsole), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fedc40be45e in QObject::startTimer(int, Qt::TimerType) () from /usr/lib64/libQt5Core.so.5
#5  0x00007fedc40c83bc in QTimer::start() () from /usr/lib64/libQt5Core.so.5
#6  0x00007fedc40c423f in ?? () from /usr/lib64/libQt5Core.so.5
#7  0x00007fedc52abcf2 in Konsole::TerminalDisplay::compositeFocusChanged(bool) () from /usr/lib64/libkonsoleprivate.so.21
#8  0x00007fedc40c423f in ?? () from /usr/lib64/libQt5Core.so.5
#9  0x00007fedc52abdaf in ?? () from /usr/lib64/libkonsoleprivate.so.21
#10 0x00007fedc53166a8 in ?? () from /usr/lib64/libkonsoleprivate.so.21
#11 0x00007fedc4091685 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#12 0x00007fedc4b7673e in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007fedc40918c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#14 0x00007fedc4b7ab49 in QApplicationPrivate::setFocusWidget(QWidget*, Qt::FocusReason) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007fedc4bb2646 in QWidget::setFocus(Qt::FocusReason) () from /usr/lib64/libQt5Widgets.so.5
#16 0x00007fedc4b7b022 in QApplication::setActiveWindow(QWidget*) () from /usr/lib64/libQt5Widgets.so.5
#17 0x00007fedc4b7b09b in QApplicationPrivate::notifyActiveWindowChange(QWindow*) () from /usr/lib64/libQt5Widgets.so.5
#18 0x00007fedc4539975 in QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent*) () from /usr/lib64/libQt5Gui.so.5
#19 0x00007fedc451d1bc in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5
#20 0x00007fedb0f47f7a in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#21 0x00007fedc22daacb in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#22 0x00007fedc22dad78 in ?? () from /usr/lib64/libglib-2.0.so.0
#23 0x00007fedc22dae2f in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#24 0x00007fedc40e24d0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#25 0x00007fedc409039b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#26 0x00007fedc4098630 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#27 0x000055a5f5dbfb9c in ?? ()
#28 0x00007fedc3ab07fd in __libc_start_main () from /lib64/libc.so.6
#29 0x000055a5f5dbff1a in ?? ()
[Inferior 1 (process 3169) detached]
Comment 2 Paul Worrall 2021-08-15 09:28:27 UTC
Reproducible on Neon Unstable

Konsole 21.11.70

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.22.80
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-25-generic (64-bit)
Graphics Platform: Wayland
Processors: 2 × AMD A6-6400K APU with Radeon(tm) HD Graphics
Memory: 7.7 GiB of RAM
Graphics Processor: AMD CEDAR
Comment 3 Bug Janitor Service 2021-08-15 18:40:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/458
Comment 4 Ahmad Samir 2021-08-16 11:28:55 UTC
@Julien: are you also using wayland?

Unfortunately the backtrace is incomplete; please install the debuginfo packages (or whatever they're called in your distro) and provide the crash bt again.
Comment 5 Julien Delquié 2021-08-16 15:35:28 UTC
@Ahmad no I'm using X11, it's just that I tested with wayland just to see what happens.

You can see in my first post:
Graphics Platform: X11

I will try to build with debug USE flag in my Gentoo as soon as possible.
Comment 6 Julien Delquié 2021-08-16 17:37:46 UTC
So, unfortunately I didn't managed to get a better backtrace… but! I just applied the patch you have developed here: https://invent.kde.org/utilities/konsole/-/commit/4a3cab03f5d853f4dd48531979fc3fb57dde5e2e?merge_request_iid=458

And with this, everything works like a charm! Good job. :)
Comment 7 Ahmad Samir 2021-08-16 22:01:32 UTC
Thanks for the feedback.
Comment 8 Ahmad Samir 2021-08-18 14:37:33 UTC
Git commit 4a3cab03f5d853f4dd48531979fc3fb57dde5e2e by Ahmad Samir.
Committed on 15/08/2021 at 18:57.
Pushed by hindenburg into branch 'master'.

When closing a session, don't close the whole window if there are splits

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.
FIXED-IN: 21.12

M  +3    -3    src/ViewManager.cpp
M  +9    -0    src/widgets/ViewContainer.cpp
M  +6    -0    src/widgets/ViewContainer.h

https://invent.kde.org/utilities/konsole/commit/4a3cab03f5d853f4dd48531979fc3fb57dde5e2e
Comment 9 Nate Graham 2021-08-18 14:41:19 UTC
Is this fully fixed now, or is there more to do?
Comment 10 Kurt Hindenburg 2021-08-18 14:41:48 UTC
Git commit 2591a9489a4d3a43c7a7f00764e9f84822d4946c by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 18/08/2021 at 14:41.
Pushed by hindenburg into branch 'release/21.08'.

When closing a session, don't close the whole window if there are splits

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.
FIXED-IN: 21.08.1
(cherry picked from commit 4a3cab03f5d853f4dd48531979fc3fb57dde5e2e)

M  +3    -3    src/ViewManager.cpp
M  +9    -0    src/widgets/ViewContainer.cpp
M  +6    -0    src/widgets/ViewContainer.h

https://invent.kde.org/utilities/konsole/commit/2591a9489a4d3a43c7a7f00764e9f84822d4946c
Comment 11 Ahmad Samir 2021-08-20 12:12:52 UTC
*** Bug 441217 has been marked as a duplicate of this bug. ***