Bug 507180

Summary: Thumbnail Grid GUI opens much slower than other tabbox GUI styles, solution likely found, needs to be implemented.
Product: [Plasma] kwin Reporter: miroslavekon
Component: effects-tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: minor CC: kdedev
Priority: NOR    
Version First Reported In: 6.3.4   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description miroslavekon 2025-07-18 00:44:58 UTC
SUMMARY
Thumbnail Grid GUI opens much slower than other tabbox GUI styles

STEPS TO REPRODUCE
1. Select Thumbnail Grid visualization style in system settings
2. Press and hold alt+tab, wait for GUI to load, release and press and hold alt tab again
3. Notice the ~700ms - 1.1s delay between shortcut input and GUI showing
4. Select any other visualization style in system settings
5. Press and hold alt+tab, wait for GUI to load, release and press and hold alt tab again
6. Notice that the second opening of the GUI was much faster

OBSERVED RESULT
After the first initialization of the GUI script files, Styles other than Thumbnail Grid load instantly, whereas Thumbnail Grid takes a significant amount of time which impedes its functionality

EXPECTED RESULT
After the first initialization of the GUI script files, Thumbnail Grid should also load instantly

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Note: all files mentioned here are in the directory /usr/share/kwin/tabbox/

After doing some digging i believe this is due to an inconsistency in the code structures between thumbnail_grid and other styles such as sidebar or big_icons namely the file thumbnail_grid/contents/ui/main.qml has a slightly different structure to similar styles such as big_icons/contents/ui/main.qml or sidebar/contents/ui/main.qml, the main difference being that big_icons/sidebar start with KWin.TabBoxSwitcher and then go directly into PlasmaCore.Dialog after some style specific properties, where as thumbnail_grid goes KWin.TabBoxSwitcher => Instantiator => delegate: PlasmaCore.Dialog.

The Instantiator call causes the entire style to be reloaded every time tabbox is made visible which causes the excessive delay between the shortcut press and the displaying of the GUI.

This is why in the steps to reproduce i specifically mention opening ALT+TAB Twice because upon switching a visualization  style, the first tabbox call has to initialize the .qml file for said style, however the difference is that once initialized all styles remain loaded except for Thumbnail Grid which is Re-loaded on every tabbox call, thus causing the delay on successive tabbox calls.

Proposed Solution: removing the Instantiator, thus changing the code structure to : KWin.TabBoxSwitcher => PlasmaCore.Dialog instead of KWin.TabBoxSwitcher => Instantiator => PlasmaCore.Dialog and changing the PlasmaCore.Dialog line : "visible: true" to "visible: tabBox.visible",

i have made a local copy of the Thumbnail Grid style in my .local/share/kwin/tabbox directory and having done exactly this seems to have completely fixed the problem, i haven't done any excessive testing however from simple observation it performs much better than before

Original Code Snippet:
//--Imports--
KWin.TabBoxSwitcher {
    id: tabBox

    Instantiator {
        active: tabBox.visible
        delegate: PlasmaCore.Dialog {
            location: PlasmaCore.Types.Floating
            visible: true
            //--Rest Of Code--

Edited Snippet:
//--Imports--
KWin.TabBoxSwitcher {
    id: tabBox

    PlasmaCore.Dialog {
        location: PlasmaCore.Types.Floating
        visible: tabBox.visible
        //--Rest Of Code--
Comment 1 TraceyC 2025-07-23 00:22:54 UTC
Thanks for the report, and the analysis. The KDE bug tracker is for bugs rather than development work, however.

The next step is to create a merge request. In the MR, please add "Fixes: Bug xxx" so it gets linked to this report.
https://community.kde.org/Infrastructure/GitLab#Submitting_a_merge_request

If you want to discuss the development work, please reach out in our Matrix channel for new contributors
https://community.kde.org/Get_Involved#New_Contributor?_Say_Hello_In_Matrix

If you need information on getting started with KDE development, please see
[https://community.kde.org/Get_Involved/development](https://community.kde.org/Get_Involved/development)

Thanks again.
Comment 2 Bug Janitor Service 2025-08-07 03:46:41 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2025-08-22 03:47:20 UTC
๐Ÿ›๐Ÿงน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.