Bug 442238 - Closing a DnD'd view also closes the window it came from
Summary: Closing a DnD'd view also closes the window it came from
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: split-view (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-09 20:49 UTC by nsprangers@gmail.com
Modified: 2021-11-15 20:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 22.04
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nsprangers@gmail.com 2021-09-09 20:49:59 UTC
SUMMARY
Ran with kdesrc-build konsole && kdesrc-run konsole

No bug if there are multiple splits or multiple tabs in the previous window.

STEPS TO REPRODUCE
1. Open a second window
2. Create a split-view in second window
3. Drag and drop one view to first window
4. Close the dropped view (by any means: headerbar button, ctl-shift-w, ctl-d, 'exit')

OBSERVED RESULT
Also closes the window the view was dragged from.

EXPECTED RESULT
Only close the focused view.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 nsprangers@gmail.com 2021-09-09 20:50:39 UTC
Also, not present on 21.08.1
Comment 2 Kurt Hindenburg 2021-09-09 20:58:26 UTC
yep thanks confirmed on master - I'll have to check 21.08
Comment 3 Kurt Hindenburg 2021-09-09 21:16:17 UTC
I see the same issue on the 21.08 branch.  Are you sure you don't see it there?
Comment 4 nsprangers@gmail.com 2021-09-09 21:58:13 UTC
Not on 21.08.1 Manjaro...
Comment 5 nsprangers@gmail.com 2021-09-11 07:49:56 UTC
I was able trace it to this commit on 21.08 branch https://invent.kde.org/utilities/konsole/-/commit/58d526f83b924732b8c82306fcc177f0bbe63295

AFAICT the issue is that both ViewManagers are hanging onto the session after a dnd, so that commit is just causing both to hit empty() in sessionFinished (kind of expected I think, but I was able to verify it).

I can see how ViewManager disconnects from sessions when *detaching* a view or tab, but I don't see how they are supposed to be released after drag-and-drop.

Both the ViewSplitter and SessionController from the source window get deleted, so maybe there's a missing connection to one of those signals?
Comment 6 nsprangers@gmail.com 2021-09-13 07:32:08 UTC
Added a commit to MR 480
Comment 7 tcanabrava 2021-11-15 14:05:51 UTC
Git commit 29977a23645e2401f9e108f06692176c7d7f8366 by Tomaz  Canabrava, on behalf of Nathan Sprangers.
Committed on 15/11/2021 at 14:02.
Pushed by tcanabrava into branch 'master'.

Disconnect view/session after drag-and-drop

Adds a missing signal/slot connection for when a split-view is drag-and-
dropped to a new window. Use an existing method to handle it the same
way as drag-and-dropping or detaching a tab.

M  +12   -5    src/ViewManager.cpp
M  +7    -0    src/ViewManager.h
M  +5    -0    src/session/SessionController.h
M  +1    -1    src/widgets/ViewContainer.cpp

https://invent.kde.org/utilities/konsole/commit/29977a23645e2401f9e108f06692176c7d7f8366