Bug 315660

Summary: Close Inactive Views does not close all other views
Product: [Applications] kate Reporter: Christoph Feck <cfeck>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: 0inkane
Priority: NOR    
Version First Reported In: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Christoph Feck 2013-02-22 23:34:18 UTC
Trying today's master after commit for bug 297619:

To reproduce:
- start Kate
- Split View > Split Horizontal
- in the upper view: Split Horizontal again
- in the lower view: Split Horizontal again
(now you have 4 views)
- Split View > Close Inactive Views

Actual result:
- closes two of the views, leaving two open

Expected result:
- closes three views, leaving only one open
Comment 1 Christoph Feck 2013-02-22 23:39:54 UTC
Clarification:

(now you have 4 views)
- click into third view to activate it
- Split View > Close Inactive Views

It works when you had the fourth view activated
Comment 2 Dominik Haumann 2013-02-23 08:32:15 UTC
Maybe this is a bug of the activeViewSpace() then? I'd need to look into the code further.
Comment 3 Fabian 2013-02-23 09:20:27 UTC
Hm, that seems indeed like a bug in activeViewSpace(). When I cache the return value of it, the bug doesn't seem to occur.
Comment 4 Fabian 2013-02-23 17:46:14 UTC
Git commit 2e38699a04fc804b7619d0c48b6bea48b2dfa40f by Fabian Kosmale.
Committed on 23/02/2013 at 13:47.
Pushed by fabiank into branch 'master'.

Works around what is probably a bug in activeViewSpace
Anyway, it might be a good idea to use a variable instead of calling the
function each time in the loop

M  +1    -1    kate/app/kateappcommands.cpp
M  +2    -1    kate/app/kateviewmanager.cpp

http://commits.kde.org/kate/2e38699a04fc804b7619d0c48b6bea48b2dfa40f
Comment 5 Dominik Haumann 2013-02-25 20:08:36 UTC
Ok, it works now, I guess. So I close this issue.

Still, Fabian and Christoph: I could not reproduce that several view spaces remain open.
However, this is a bug I'd like to have properly fixed. As you said you can reproduce, can you please debug the application and find out where the active view spaces is set wrongly?
That would be really awesome, since I remember we once had another bug hit by this.
Comment 6 Fabian 2013-02-25 20:21:58 UTC
Dominik, Christoph: I've created a new bug report for it https://bugs.kde.org/show_bug.cgi?id=315767 . Let's see if we can find the root cause.