Bug 454296

Summary: Present windows broken with 5.24.90
Product: [Unmaintained] lattedock Reporter: Nico <nico>
Component: applicationAssignee: Michail Vourlakos <mvourlakos>
Status: RESOLVED FIXED    
Severity: normal CC: b.mitsov, ilikefoss, nate, thubble+kdebugs
Priority: NOR    
Version First Reported In: 0.10.8   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 0.10.9
Sentry Crash Report:
Attachments: Fix Present Windows not working in 5.25 (0.10 branch)

Description Nico 2022-05-23 20:01:03 UTC
SUMMARY
Present windows broken with 5.24.90


STEPS TO REPRODUCE
1. Be on Plasma 5.24.90
2. Tasks → Left click → Present Windows
3. Try to click an application with multiple windows

OBSERVED RESULT
Does not present windows

EXPECTED RESULT
Should use the new "Show windows side-by-side" effect

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
Also tried with master @ 8c26f50f and it didn't work
Comment 1 Michail Vourlakos 2022-06-06 19:03:47 UTC
Git commit 3c3b5c6d115e1e6b1339b8828f24a0c6d043b36a by Michail Vourlakos.
Committed on 06/06/2022 at 19:02.
Pushed by mvourlakos into branch 'master'.

tasks:support plasma 5.25 window view effect

--support window view effect from plasma 5.25 when
the user tries to activate a grouped task

M  +14   -2    plasmoid/package/contents/ui/main.qml
M  +12   -3    plasmoid/package/contents/ui/task/TaskItem.qml

https://invent.kde.org/plasma/latte-dock/commit/3c3b5c6d115e1e6b1339b8828f24a0c6d043b36a
Comment 2 Michail Vourlakos 2022-06-06 19:05:33 UTC
Git commit ad60f33563b75534f9083be0d302d679fd6dc1dd by Michail Vourlakos.
Committed on 06/06/2022 at 19:05.
Pushed by mvourlakos into branch 'v0.10'.

tasks:support plasma 5.25 window view effect

--support window view effect from plasma 5.25 when
the user tries to activate a grouped task
FIXED-IN:0.10.9

M  +14   -2    plasmoid/package/contents/ui/main.qml
M  +12   -3    plasmoid/package/contents/ui/task/TaskItem.qml

https://invent.kde.org/plasma/latte-dock/commit/ad60f33563b75534f9083be0d302d679fd6dc1dd
Comment 3 Michail Vourlakos 2022-06-06 19:06:13 UTC
is it possible for someone to confirm the fix for Plasma 5.25?
Comment 4 Nico 2022-06-06 19:07:25 UTC
I tried it @ 3c3b5c6d right now, but it didn't work for me. Also, the dot indicators were gone after updating from 0.10.8 to that version
Comment 5 Michail Vourlakos 2022-06-06 19:20:00 UTC
(In reply to Nico from comment #4)
> I tried it @ 3c3b5c6d right now, but it didn't work for me. Also, the dot
> indicators were gone after updating from 0.10.8 to that version

the fact that indicators are lost points to weird installation.. Users have reported that Arch git version package is broken
Comment 6 Nico 2022-06-06 19:22:19 UTC
(In reply to Michail Vourlakos from comment #5)

Could that Arch git package breakage also be the reason why presenting the windows doesn't work for me? I will try to manually locally build and run it from there with a clean configuration.
Comment 7 Michail Vourlakos 2022-06-06 19:24:29 UTC
(In reply to Nico from comment #6)
> (In reply to Michail Vourlakos from comment #5)
> 
> Could that Arch git package breakage also be the reason why presenting the
> windows doesn't work for me? I will try to manually locally build and run it
> from there with a clean configuration.

Present Windows does not work in Plasma 5.25 because it has been removed from plasma devs in favor of Windows View effect that was introduced in 5.25
Comment 8 Nico 2022-06-06 19:25:16 UTC
(In reply to Michail Vourlakos from comment #7)
> (In reply to Nico from comment #6)
> > (In reply to Michail Vourlakos from comment #5)
> > 
> > Could that Arch git package breakage also be the reason why presenting the
> > windows doesn't work for me? I will try to manually locally build and run it
> > from there with a clean configuration.
> 
> Present Windows does not work in Plasma 5.25 because it has been removed
> from plasma devs in favor of Windows View effect that was introduced in 5.25

Yeah that's what I mean. Sorry I haven't used the right terminology
Comment 9 Nico 2022-06-06 19:28:50 UTC
Hm, I have now cloned the git repo, did a `cmake -S . -B build && cmake --build build -j24`, then renamed `~/.config/latte`
and ran the binary from `./build/bin/latte-dock` and it still misses the indicators and fails to launch the Windows View effect.
Comment 10 Michail Vourlakos 2022-06-06 19:32:23 UTC
(In reply to Nico from comment #9)
> Hm, I have now cloned the git repo, did a `cmake -S . -B build && cmake
> --build build -j24`, then renamed `~/.config/latte`
> and ran the binary from `./build/bin/latte-dock` and it still misses the
> indicators and fails to launch the Windows View effect.

You will have to wait then until plasma 5.25 has officially landed in my Tumbleweed system.
Comment 11 Nico 2022-06-06 19:33:23 UTC
So you're saying that it will work with the 5.25 release but not with 5.24.90, right?
Comment 12 Michail Vourlakos 2022-06-06 20:21:31 UTC
(In reply to Nico from comment #11)
> So you're saying that it will work with the 5.25 release but not with
> 5.24.90, right?

No, i am saying that plasma 5.25 must reach first my system to confirm the fix if the issue. Currently I am at plasma 5.24.5
Comment 13 Nico 2022-06-06 20:23:45 UTC
Can't you test this in a VM with KDE Neon Testing Edition? I think it would be good if a new latte dock version that fixes this issue will be released before Plasma 5.25 is going to be released.
Comment 14 Michail Vourlakos 2022-06-07 04:16:06 UTC
(In reply to Nico from comment #13)
> Can't you test this in a VM with KDE Neon Testing Edition? I think it would
> be good if a new latte dock version that fixes this issue will be released
> before Plasma 5.25 is going to be released.

I have no time. It is open source so anyone can take part to fix this. It falls to open source community shoulders to provide such professional support.
Comment 15 Nico 2022-06-07 06:36:38 UTC
I understand. I could look into this but I have very little experience in C++ and Qt and especially none with Plasma development
Comment 16 Tiernan Hubble 2022-06-16 03:25:58 UTC
Created attachment 149771 [details]
Fix Present Windows not working in 5.25 (0.10 branch)

It needed one more change to properly support 5.25 Window View. The original change correctly implemented the call to Window View, but there was code that detected whether Present Windows was enabled (which it won't be, in 5.25) and swallowed the left click before it ever got to the Present Windows call.

I attached a simple 1-line patch (against the latest 0.10 git branch) to correctly detect 5.25 Window View and allow the call to proceed. I'm not currently set up to submit MRs for Latte Dock, plus I'm not sure if there's a better way to implement that check - the nested conditionals are getting a bit convoluted.
Comment 17 Michail Vourlakos 2022-06-16 05:33:24 UTC
*** Bug 455363 has been marked as a duplicate of this bug. ***
Comment 18 Nico 2022-06-16 10:08:46 UTC
(In reply to Tiernan Hubble from comment #16)
> Created attachment 149771 [details]
> Fix Present Windows not working in 5.25 (0.10 branch)
> 
> It needed one more change to properly support 5.25 Window View. The original
> change correctly implemented the call to Window View, but there was code
> that detected whether Present Windows was enabled (which it won't be, in
> 5.25) and swallowed the left click before it ever got to the Present Windows
> call.
> 
> I attached a simple 1-line patch (against the latest 0.10 git branch) to
> correctly detect 5.25 Window View and allow the call to proceed. I'm not
> currently set up to submit MRs for Latte Dock, plus I'm not sure if there's
> a better way to implement that check - the nested conditionals are getting a
> bit convoluted.

Can you post that patch here? It's kinda annoying to always be forced to use the overview in my workflow.
Comment 19 Tiernan Hubble 2022-06-16 12:21:49 UTC
--- a/plasmoid/package/contents/ui/task/TaskMouseArea.qml	2022-06-15 20:53:32.948565850 -0600
+++ b/plasmoid/package/contents/ui/task/TaskMouseArea.qml	2022-06-15 20:55:19.836562872 -0600
@@ -177,7 +177,7 @@
                     activateTask();
                 }
             } else if (mouse.button == Qt.LeftButton){
-                var canPresentWindowsIsSupported = LatteCore.WindowSystem.compositingActive && (root.plasmaGreaterThan522 ? backend.canPresentWindows : backend.canPresentWindows());
+                var canPresentWindowsIsSupported = LatteCore.WindowSystem.compositingActive && (root.plasmaAtLeast525 ? backend.windowViewAvailable : (root.plasmaGreaterThan522 ? backend.canPresentWindows : backend.canPresentWindows()));
 
                 if( !taskItem.isLauncher && !root.disableAllWindowsFunctionality ){
                     if ( (root.leftClickAction === LatteTasks.Types.PreviewWindows && isGroupParent)
Comment 20 Michail Vourlakos 2022-06-16 13:17:08 UTC
Git commit 6009db61636e1156613d330803ac0889a66dfc26 by Michail Vourlakos.
Committed on 16/06/2022 at 13:16.
Pushed by mvourlakos into branch 'master'.

tasks:support plasma 5.25 present windows

M  +12   -1    plasmoid/package/contents/ui/task/TaskMouseArea.qml

https://invent.kde.org/plasma/latte-dock/commit/6009db61636e1156613d330803ac0889a66dfc26
Comment 21 Michail Vourlakos 2022-06-16 13:18:44 UTC
Git commit 6a96a2c8caaf4ec3ff4813320d7c4405952034bb by Michail Vourlakos.
Committed on 16/06/2022 at 13:18.
Pushed by mvourlakos into branch 'v0.10'.

tasks:support plasma 5.25 present windows
FIXED-IN:0.10.9

M  +12   -1    plasmoid/package/contents/ui/task/TaskMouseArea.qml

https://invent.kde.org/plasma/latte-dock/commit/6a96a2c8caaf4ec3ff4813320d7c4405952034bb