Bug 451150

Summary: On X11, clicking the close button only works every other time
Product: [Plasma] kwin Reporter: Adam Fontenot <adam.m.fontenot+kde>
Component: effects-present-windowsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: dan1elcastro, emaster987, joey.joey586, nate, qydwhotmail
Priority: NOR Flags: qydwhotmail: X11+
Version: 5.24.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=451450
Latest Commit: Version Fixed In:

Description Adam Fontenot 2022-03-05 01:53:30 UTC
SUMMARY

If you have "Provide buttons to close the windows" enabled for the Present Windows effect (the default, I think?) clicking on the close button frequently doesn't work the first time, but always(?) works the second time.

I reproduced this bug on KDE installations on two separate computers.

STEPS TO REPRODUCE
1. Open the Present Windows effect (for example, the Icons-Only Task Manager has an option to open it when you click an icon)
2. Click the close button on a window

OBSERVED RESULT
The window sometimes doesn't close. I think it always closes when you click a second time.

EXPECTED RESULT
The window should always close.

SOFTWARE/OS VERSIONS
Linux: Arch Linux kernel 5.16.11 x86_64
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

Graphics platform is X11.

I have a screencast of the problem, though it is too large to upload here. https://0x0.st/oP_g.mp4
Mirror / backup link: https://ipfs.io/ipfs/QmcXt2g9QQ1mioUeB2sLHvb8G9mh3ApRmVPacoBjAjhJCp

The first time I try closing a window it works on one click. The second time it requires two clicks. If you look closely at the screencast, you can see that in both cases the close button detected the mouse hover condition and outlines itself in blue. However, in the second case my click seems to get eaten entirely - the button never enters the active state.
Comment 1 Adam Fontenot 2022-04-06 00:23:32 UTC
Need to revise one point slightly: for some reason I was going off the video when I said the button didn't activate. This is not actually true. In Present Windows, I can hold the button down with the cursor over a close button for half a second or so, enough time to for the button animation to take effect, and it is clearly activating. Despite this, the window does not close when I release the button.
Comment 2 Fushan Wen 2022-04-22 13:04:03 UTC
My observation is the first click on the close button is always successful, but the second click is always invalid. Same in the Window View effect.
Comment 3 Adam Fontenot 2022-04-22 23:18:52 UTC
(In reply to Fushan Wen from comment #2)
> My observation is the first click on the close button is always successful,
> but the second click is always invalid. Same in the Window View effect.

Interesting. Your report got me to investigate further, and it looks like we are experiencing the same issue. More precisely, what we are both seeing (I think) is that the close button click fails *every other* time, even if the present windows effect has been closed in between attempts to close windows.

So in this report, I say it frequently fails the first time, but what is actually happening (it seems, based on testing) is that it's failing 50% of the time. Half the time it works the first time, but then it will fail the next time you use it, even if that's minutes or hours later. I noticed this aspect of the problem and reported it as this bug.

In your bug report, you're noticing that it fails the *second* time, because you were testing trying to close multiple windows in one go. But actually, I think you will discover that if you successfully close a window, then it will fail the next time you try to use it.

@Nate or other devs not experiencing this issue: I can record another screencast showing the problem if the above description isn't clear enough.
Comment 4 Fushan Wen 2022-04-23 01:42:06 UTC
Can confirm.
Comment 5 Nate Graham 2022-04-25 15:57:54 UTC
*** Bug 452858 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2022-04-25 15:58:27 UTC
*** Bug 451450 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2022-04-25 15:58:32 UTC
*** Bug 451537 has been marked as a duplicate of this bug. ***
Comment 8 Emanuele Spirito 2022-04-25 18:40:21 UTC
I have the same issue on my system and the description Adam does is exactly what I see. 

System information:
Kwin version: 5.24.4
Operating System: Fedora Linux 35
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.18-200.fc35.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Comment 9 Emanuele Spirito 2022-04-25 18:43:34 UTC
I have the videorecording of the double-click needed to close the windows in this drive link:
https://drive.google.com/drive/folders/1k5cL2s3UbpQUq4D4W9hNcUztSGX9CDZC?usp=sharing
Comment 10 Marco Martin 2022-05-06 11:38:39 UTC
Git commit ae1937badc097a864ecfc62e79e7a3899c3be572 by Marco Martin.
Committed on 06/05/2022 at 11:37.
Pushed by mart into branch 'master'.

Remove completely present windows

since it has been replaced by windowview, and Desktop Grid
is ported as well, remove present windows which is effectively dead code
now
Related: bug 447001, bug 362844, bug 450487, bug 453426, bug 374481, bug 185381, bug 413342, bug 283333, bug 315314, bug 397500, bug 321236, bug 436572, bug 335782

M  +0    -1    src/effects/CMakeLists.txt
D  +0    -45   src/effects/presentwindows/CMakeLists.txt
D  +0    -17   src/effects/presentwindows/main.cpp
D  +0    -18   src/effects/presentwindows/main.qml
D  +0    -75   src/effects/presentwindows/metadata.json
D  +0    -2054 src/effects/presentwindows/presentwindows.cpp
D  +0    -343  src/effects/presentwindows/presentwindows.h
D  +0    -51   src/effects/presentwindows/presentwindows.kcfg
D  +0    -104  src/effects/presentwindows/presentwindows_config.cpp
D  +0    -46   src/effects/presentwindows/presentwindows_config.h
D  +0    -487  src/effects/presentwindows/presentwindows_config.ui
D  +0    -36   src/effects/presentwindows/presentwindows_proxy.cpp
D  +0    -35   src/effects/presentwindows/presentwindows_proxy.h
D  +0    -6    src/effects/presentwindows/presentwindowsconfig.kcfgc

https://invent.kde.org/plasma/kwin/commit/ae1937badc097a864ecfc62e79e7a3899c3be572
Comment 11 Nate Graham 2022-05-06 13:27:42 UTC
This is still a problem in the new QML-based Present Windows effect; re-opening.
Comment 12 Nate Graham 2022-05-23 14:27:40 UTC

*** This bug has been marked as a duplicate of bug 454275 ***