Bug 452858

Summary: Clicking the close button in Overview/Window View/Present Windows effects always fails for the second time
Product: [Plasma] kwin Reporter: Fushan Wen <qydwhotmail>
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, zawertun
Priority: NOR Flags: qydwhotmail: X11+
Version: git master   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Fushan Wen 2022-04-22 13:10:41 UTC
SUMMARY
The first click on the close button is always successful, but the second click is always invalid. The same behavior can be observed in Overview/Window View/Present Windows effects.


STEPS TO REPRODUCE
1. Open many windows
2. Open effect
3. Click the close button in one window, the window should be closed.
4. Click the close button in another window again, nothing happens.

OBSERVED RESULT
The second window is not closed.
The log says:
file:///usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml: Writing to "client" broke the binding to the underlying model

EXPECTED RESULT
The second window is closed.

SOFTWARE/OS VERSIONS
KWin version: https://invent.kde.org/plasma/kwin/-/commit/a4a2ee0428b80de0a13bb72e92c43f0b5c2230bd
Comment 1 Nate Graham 2022-04-22 15:16:27 UTC
We have a lot of weird click rejection issues in the Overview effect that only seem to affect people on X11.
Comment 2 Nate Graham 2022-04-25 15:57:54 UTC

*** This bug has been marked as a duplicate of bug 451150 ***
Comment 3 Nate Graham 2022-04-25 16:00:41 UTC

*** This bug has been marked as a duplicate of bug 451450 ***
Comment 4 Nate Graham 2022-05-23 14:28:10 UTC

*** This bug has been marked as a duplicate of bug 454275 ***
Comment 5 Yaroslav Sidlovsky 2022-09-20 07:09:16 UTC
(In reply to Nate Graham from comment #1)
> We have a lot of weird click rejection issues in the Overview effect that
> only seem to affect people on X11.

It's not only click but key press rejection as well. And it's happend only on combination NVidia + X11 (on Intel all is fine).
Happens to me with plasma-5.25.5.

While trying to press keyboard keys I see this messages in journalctl (for kwin_x11 process):
```
Sep 20 10:05:00 rapidus kwin_x11[3047]: file:///usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml:56:9: Unable to assign null to QUuid
Sep 20 10:05:00 rapidus kwin_x11[3047]: file:///usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml:56:9: Unable to assign null to QUuid
Sep 20 10:05:02 rapidus kwin_x11[3047]: file:///usr/share/kwin/effects/overview/qml/ScreenView.qml: Writing to "client" broke the binding to the underlying model
Sep 20 10:05:09 rapidus kwin_x11[3047]: file:///usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml:56:9: Unable to assign null to QUuid
Sep 20 10:05:09 rapidus kwin_x11[3047]: file:///usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml:56:9: Unable to assign null to QUuid
```
Comment 6 Yaroslav Sidlovsky 2022-09-20 07:27:07 UTC
This patch fixes issue for me:
```
--- /usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml.orig 2022-09-20 10:23:00.392314248 +0300
+++ /usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml      2022-09-20 10:23:12.725415620 +0300
@@ -53,7 +53,7 @@
         z: 2
         property KWinComponents.WindowThumbnailItem cloneOf
         visible: false
-        wId: cloneOf ? cloneOf.wId : null
+        wId: cloneOf ? cloneOf.wId : "00000000-0000-0000-0000-000000000000"
         width: cloneOf ? cloneOf.width : 0
         height: cloneOf ? cloneOf.height : 0
         onCloneOfChanged: {
```
Comment 7 Vlad Zahorodnii 2022-09-20 08:06:03 UTC
(In reply to Yaroslav Sidlovsky from comment #6)
> This patch fixes issue for me:
> ```
> --- /usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml.orig
> 2022-09-20 10:23:00.392314248 +0300
> +++ /usr/lib64/qt5/qml/org/kde/kwin/private/effects/WindowHeap.qml     
> 2022-09-20 10:23:12.725415620 +0300
> @@ -53,7 +53,7 @@
>          z: 2
>          property KWinComponents.WindowThumbnailItem cloneOf
>          visible: false
> -        wId: cloneOf ? cloneOf.wId : null
> +        wId: cloneOf ? cloneOf.wId : "00000000-0000-0000-0000-000000000000"
>          width: cloneOf ? cloneOf.width : 0
>          height: cloneOf ? cloneOf.height : 0
>          onCloneOfChanged: {
> ```

FTR we fixed that in 5.26. https://invent.kde.org/plasma/kwin/-/blob/d6234d0411401a55ca700c75f6425e6f3fbfc4d6/src/effects/private/qml/WindowHeap.qml#L72