https://bugs.kde.org/show_bug.cgi?id=507180

            Bug ID: 507180
           Summary: Thumbnail Grid GUI opens much slower than other tabbox
                    GUI styles, solution likely found, needs to be
                    implemented.
    Classification: Plasma
           Product: kwin
      Version First 6.3.4
       Reported In:
          Platform: Kubuntu
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: effects-tabbox
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

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--

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to