Bug 474848 - Toolbar items sometimes move to weird places when creating split view
Summary: Toolbar items sometimes move to weird places when creating split view
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: split-view (show other bugs)
Version: 23.08.1
Platform: NixOS Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-25 08:48 UTC by Alois Wohlschlager
Modified: 2024-04-05 17:30 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alois Wohlschlager 2023-09-25 08:48:12 UTC
SUMMARY

When creating a split view in Konsole, toolbar items (most often the hamburger menu or the session toolbar) sometimes move to places where they don't belong at all.

STEPS TO REPRODUCE
1. Open Konsole, and ensure that session toolbar is enabled and menu bar disabled (the latter is not required, ignore steps talking about the hamburger button then)
2. Create a vertical split view
3. Right-click in the left part of the split, without left-clicking into it first

OBSERVED RESULT

The session toolbar now weirdly floats above the left part of the split. The hamburger menu is now moved to the right-click menu of the left part of the split.

EXPECTED RESULT

Both the session toolbar and the hamburger button remain where they belong.

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

ADDITIONAL INFORMATION

When the bug happens, "Adding a KHamburgerMenu directly to a QMenu. This will look odd. Use addToMenu() instead." is logged four times. But I think that's a symptom rather than a cause of the bug.
Comment 1 Alfonso Murolo 2024-03-16 18:14:32 UTC
Hi Alois,
Yeah I can replicate it. The whole thing seems kinda weird to me in other cases too, such as when the hamburger icon sometimes seems to disappear:

1. Open Konsole, hamburger icon is visible top right
2. Split vertically. Split right is preselected, hamburger icon is gone.
3. Focus the split left (original). Hamburger icon is back.
4. Split vertically again.
5. Now new preselected tab is the first of three. Hamburger icon is gone.
6. Focus center split.
7. Hamburger icon is back.
8. Close center split.
9. No split offers a hamburger icon any longer.

Does this behaviour seem erratic only to me? Or is there some kind of logic behind it? If it needs to be reworked/fixed, I'd be happy to look into it.

Cheers
Alfonso
Comment 2 Alois Wohlschlager 2024-03-17 10:14:53 UTC
The behavior seems very erratic to me as well, that's why I reported the bug to begin with. If this wasn't clear from my description ("the session toolbar and hamburger menu remain where they belong"), I meant that it should stay in the toolbar where it was before creating the splits.
Comment 3 Bug Janitor Service 2024-04-01 13:05:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/981
Comment 4 Alfonso Murolo 2024-04-01 13:10:20 UTC
Hi, 

I have started a merge request to solve the two aforementioned strange behaviours.
https://invent.kde.org/utilities/konsole/-/merge_requests/981

Since one of my changes removes a detail of the signal that handles the change of the active view, I'd be happy to get some feedback if I need to study an alternative approach to this one.

Cheers
Alfonso
Comment 5 auxsvr 2024-04-02 19:08:41 UTC
https://bugs.kde.org/show_bug.cgi?id=479316 might be related to this.
Comment 6 Kurt Hindenburg 2024-04-05 17:30:07 UTC
Git commit b93f44a90e1fafb1a32286c97509e7c145b018d4 by Kurt Hindenburg, on behalf of Alfonso Murolo.
Committed on 05/04/2024 at 17:30.
Pushed by hindenburg into branch 'master'.

Fix hamburger menu/toolbar issues when splitting tabs

Preventing hamburger menu from being lost when splitting tabs,
and toolbar from being broken in split view in special case

M  +1    -2    src/MainWindow.cpp
M  +1    -0    src/ViewManager.cpp

https://invent.kde.org/utilities/konsole/-/commit/b93f44a90e1fafb1a32286c97509e7c145b018d4