Bug 487034 - Cannot close last card "Untilted" when is opened several
Summary: Cannot close last card "Untilted" when is opened several
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: Git
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: qt6, wayland-only
Depends on:
Blocks:
 
Reported: 2024-05-14 22:44 UTC by Piotr Mierzwinski
Modified: 2024-09-13 16:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
duplicated several untilted (14.80 KB, image/png)
2024-05-14 22:44 UTC, Piotr Mierzwinski
Details
the try of close last "Untilted" document (76.72 KB, video/webm)
2024-06-20 22:20 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2024-05-14 22:44:26 UTC
Created attachment 169487 [details]
duplicated several untilted

SUMMARY
I use Document view instead of tabs. In this case I opened one new document, typed something, didn't save and logged off the Plasma session. Next day logged in (Kate was restored with empty Untilted), and I logged off. I repeated this several times and in result I got 8 "Untilted" documents (check screenshot). Of course I lost all what I wrote in first one, because saving data in "Untilted" doesn't work since several months (issue reported). Shame.

STEPS TO REPRODUCE
1. Turn on save session in Plasma
2. Start Kate
3.  Hide tabs
4. Turn on Documents (left side) view
5. click New
6. Type something
7. Log off from Plasma session
8. Log on to Plasma session
 (Plasma restored recently opened apps. and in Kate we have empty Untilted - lost data)
9. Log off from Plasma session
10. Log on to Plasma session
Repeat two last steps couple times
11. Try to close last Untilted document by hover mouse cursor on end of right side of highlighting entry (you will see red close button)

OBSERVED RESULT
Happens nothing - is not possible to close last document

EXPECTED RESULT
Should be possible to close last document

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Yes
(available in About System)
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Comment 1 Piotr Mierzwinski 2024-06-20 22:20:51 UTC
Created attachment 170710 [details]
the try of close last "Untilted" document
Comment 2 Christoph Cullmann 2024-07-05 20:26:54 UTC
Ok, I can reproduce if I open x untitled, then open a second window and then try to close the one doc that is there the only tab.
Comment 3 Piotr Mierzwinski 2024-07-15 23:21:28 UTC
(In reply to Christoph Cullmann from comment #2)
> Ok, I can reproduce if I open x untitled, then open a second window and then
> try to close the one doc that is there the only tab.

I have only one window opened. I don't open second. Only I open another file in currently running (Kate).

I noticed that this usually happens, after restore of KDE session with running Kate. I can call it as "failed", because no any previously opened files are opened and only appear "untilted" in amount  n+1 comparing to original session (all empty, even if originally I had filled any with text.

Fresh example.
Today. after start of KDE session, I got only 2 "untilted". Please note that originally was opened only 1 "untilted" (filled with text) + 2 normal files. All happened 2 days ago. And these normal files disappeared from "my session".

BTW. After such restore of KDE session with  "failed" restore of Kate session, it also loses list of files in "recent" option.
Comment 4 Bug Janitor Service 2024-09-10 11:52:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1580
Comment 5 Christoph Cullmann 2024-09-13 16:57:07 UTC
Git commit e09a2a552bcd003f281492a2fb86e22145391da6 by Christoph Cullmann.
Committed on 13/09/2024 at 16:57.
Pushed by cullmann into branch 'release/24.08'.

fix strange behavior on document close after restore

aggregate all registered documents & views in view space (LRU ordered)
we need even the documents without tabs to avoid that we later have issues with closing
documents and not the right ones being used as replacement if you have a limit on tabs


(cherry picked from commit edb586451852f92c96971a6c1928d69dfec05306)

edb58645 fix strange behavior on document close after restore

Co-authored-by: Christoph Cullmann <cullmann@kde.org>

M  +15   -0    apps/lib/katetabbar.cpp
M  +7    -0    apps/lib/katetabbar.h
M  +6    -10   apps/lib/kateviewspace.cpp

https://invent.kde.org/utilities/kate/-/commit/e09a2a552bcd003f281492a2fb86e22145391da6