Bug 458778 - Windows disappear after snapping
Summary: Windows disappear after snapping
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.25.5
Platform: Arch Linux Linux
: NOR critical
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 456763 460028 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-06 08:35 UTC by Krešimir Čohar
Modified: 2023-02-02 10:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Dragging the window makes it invisible (first problem) (2.38 MB, video/x-matroska)
2022-09-07 14:59 UTC, Krešimir Čohar
Details
If you let go of the window, it remains invisible (141.52 KB, image/jpeg)
2022-09-07 15:00 UTC, Krešimir Čohar
Details
Snap, Un-snap, POOF, re-snap, re-shown (3.57 MB, video/mp4)
2022-09-07 17:09 UTC, jakubby
Details
Snap, unsnap, invissible, restart kwin, snap, unsnap, vissible (3.55 KB, text/x-log)
2022-09-07 17:34 UTC, jakubby
Details
This is what happens on my end, BadDamage but no bug (1.39 KB, text/plain)
2022-09-07 17:39 UTC, Krešimir Čohar
Details
My kwinrc (1.07 KB, text/plain)
2022-09-07 17:52 UTC, Krešimir Čohar
Details
kwinrc+video (3.68 MB, application/gzip)
2022-09-07 17:56 UTC, jakubby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krešimir Čohar 2022-09-06 08:35:23 UTC
In certain situations, windows disappear (become invisible and cannot be interacted with) while still running after you move them from their window snapped positions (left or right half of the screen). If you restart kwin (kwin_x11 --replace) they reappear. I believe this bug has been around for a while now. Initially I thought it was a Chromium bug; but now I've seen my Okular disappear as well.

STEPS TO REPRODUCE
1.  Unknown. So far, Chromium and Okular have exhibited this kind of behavior. Run either one of those.
2. Snap them to the left or to the right side of the screen. (How many times? Unknown.)
3. Don't close them.

OBSERVED RESULT
The window you dragged from the snap zone disappears, but it remains open in the panel task manager.

EXPECTED RESULT
The window does not disappear (it hasn't been closed).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
I've seen this happen on both Intel and AMD GPUs, irrespective of scaling.
I haven't experienced this on Plasma Wayland (yet).
Comment 1 Krešimir Čohar 2022-09-06 11:11:39 UTC
*** This bug has been marked as a duplicate of bug 456763 ***
Comment 2 Krešimir Čohar 2022-09-07 14:58:08 UTC
I've reopened this bug because the Dolphin bug doesn't include the other windows that can be subject to this bug.

I've also managed to elicit it (somehow?) and I'll try to attach the video to the thread.
Comment 3 Krešimir Čohar 2022-09-07 14:59:14 UTC
Created attachment 151887 [details]
Dragging the window makes it invisible (first problem)
Comment 4 Krešimir Čohar 2022-09-07 15:00:25 UTC
Created attachment 151888 [details]
If you let go of the window, it remains invisible
Comment 5 Krešimir Čohar 2022-09-07 15:01:10 UTC
*** Bug 456763 has been marked as a duplicate of this bug. ***
Comment 6 jakubby 2022-09-07 17:09:25 UTC
Created attachment 151894 [details]
Snap, Un-snap, POOF, re-snap, re-shown

It happens when a window got snapped to a side, and you move it out of it's snapped position.
If you move it into a snapped position(like maximize position), then the window will reshow up.
The window can't be grabbed once it goes invisible.

Not sure about corner snapping.
Also this seems to only windows created after kwin process was created or so it seems?
But not quiet, outside of the video I restarted the kwin first, then tried the snap, un-snap, and the window disappeared.

With some programs it seems to happen 100% of the time.
For awhile it happend 100% of the time with dolphin(also firefox) as on video.
But a 100% replicable way seems to be with mpv.
Comment 7 Krešimir Čohar 2022-09-07 17:27:18 UTC
(In reply to jakubby from comment #6)
> Created attachment 151894 [details]
> Snap, Un-snap, POOF, re-snap, re-shown
> 
> It happens when a window got snapped to a side, and you move it out of it's
> snapped position.
> If you move it into a snapped position(like maximize position), then the
> window will reshow up.
> The window can't be grabbed once it goes invisible.
> 
> Not sure about corner snapping.
> Also this seems to only windows created after kwin process was created or so
> it seems?
> But not quiet, outside of the video I restarted the kwin first, then tried
> the snap, un-snap, and the window disappeared.
> 
> With some programs it seems to happen 100% of the time.
> For awhile it happend 100% of the time with dolphin(also firefox) as on
> video.
> But a 100% replicable way seems to be with mpv.

Fantastic video, thank you.(In reply to jakubby from comment #6)
> Created attachment 151894 [details]
> Snap, Un-snap, POOF, re-snap, re-shown
> 
> It happens when a window got snapped to a side, and you move it out of it's
> snapped position.
> If you move it into a snapped position(like maximize position), then the
> window will reshow up.
> The window can't be grabbed once it goes invisible.
> 
> Not sure about corner snapping.
> Also this seems to only windows created after kwin process was created or so
> it seems?
> But not quiet, outside of the video I restarted the kwin first, then tried
> the snap, un-snap, and the window disappeared.
> 
> With some programs it seems to happen 100% of the time.
> For awhile it happend 100% of the time with dolphin(also firefox) as on
> video.
> But a 100% replicable way seems to be with mpv.

Thank you so much for the video.
I can't get mpv to do this :D And it doesn't happen with Dolphin.
Can you run kwin_x11 in a terminal and tell me what its output is?

Whenever I try to snap then unsnap mpv i get a:
"kwin_core: XCB error: 152 (BadDamage), sequence: ..."
error.
Comment 8 jakubby 2022-09-07 17:34:56 UTC
Created attachment 151895 [details]
Snap, unsnap, invissible, restart kwin, snap, unsnap, vissible

(In reply to Krešimir Čohar from comment #7)
> Thank you so much for the video.
> I can't get mpv to do this :D And it doesn't happen with Dolphin.
> Can you run kwin_x11 in a terminal and tell me what its output is?
> 
> Whenever I try to snap then unsnap mpv i get a:
> "kwin_core: XCB error: 152 (BadDamage), sequence: ..."
> error.
Here you go
Comment 9 jakubby 2022-09-07 17:36:37 UTC
My bad btw
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27470, resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27471, resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27472, resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27474, resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
this shows up after unsnapping not when snapping
Comment 10 Krešimir Čohar 2022-09-07 17:39:20 UTC
Created attachment 151896 [details]
This is what happens on my end, BadDamage but no bug
Comment 11 Krešimir Čohar 2022-09-07 17:40:17 UTC
(In reply to jakubby from comment #9)
> My bad btw
> qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27470,
> resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
> qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27471,
> resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
> qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27472,
> resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
> qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 27474,
> resource id: 0, major code: 12 (ConfigureWindow), minor code: 0
> this shows up after unsnapping not when snapping

Yeah BadValue i wonder if that was the thing in my video too.
I just wasn't running kwin in a terminal and I can't seem to replicate this at all..
Comment 12 Krešimir Čohar 2022-09-07 17:52:30 UTC
Created attachment 151897 [details]
My kwinrc

What about your kwinrc? If I copy yours, I may be able to replicate the bug.
Comment 13 jakubby 2022-09-07 17:56:57 UTC
Created attachment 151898 [details]
kwinrc+video

(In reply to Krešimir Čohar from comment #11)
What seems to happen is that the window get resized to 0x0px and the decoration doesn't get rendered either, but there's clearly a "resize window" cursor.
(In reply to Krešimir Čohar from comment #12)
Here you go another video file(showing that this behavior can be cancelled and disabled by user without restarting kwin) +kwinrc in the archive
Comment 14 Krešimir Čohar 2022-09-07 18:01:07 UTC
Thanks for the video. It's definitely the BadValue line.

I can't make it happen with your kwinrc either...
I agree though, I think the window becomes 0x0 px.
Could this be a Qt bug?
Comment 15 Krešimir Čohar 2022-09-07 18:43:27 UTC
I just managed to reproduce it using Chromium somehow, but there was no mention of any kind of bug in journalctl...
Comment 16 Marco Martin 2022-09-08 14:34:21 UTC
to rule possible things out..
can the bug be reproduced also using the upstream breeze decoration?
Comment 17 Vlad Zahorodnii 2022-09-08 14:39:45 UTC
also do you have any third party scripts installed?
Comment 18 jakubby 2022-09-08 14:42:10 UTC
(In reply to Vlad Zahorodnii from comment #17)
> also do you have any third party scripts installed?
None
Comment 19 jakubby 2022-09-08 21:49:27 UTC
(In reply to Marco Martin from comment #16)
> to rule possible things out..
> can the bug be reproduced also using the upstream breeze decoration?
Version tagged upstream(5.25.5)?
Or Master HEAD 022df2baadb4177c5baa965548437a45958b1238 ?
https://invent.kde.org/plasma/breeze/-/commit/022df2baadb4177c5baa965548437a45958b1238
Comment 20 Vlad Zahorodnii 2022-09-09 08:20:13 UTC
> Version tagged upstream(5.25.5)?

5.25.5, i.e. plasma version that you're able to reproduce the bug with
Comment 21 jakubby 2022-09-09 08:30:42 UTC
(In reply to Vlad Zahorodnii from comment #20)
> > Version tagged upstream(5.25.5)?
> 
> 5.25.5, i.e. plasma version that you're able to reproduce the bug with
I just updated to 5.25.5 and gtk apps don't match the breeze-dark theme;
Still happens on 5.25.5
Comment 22 Vlad Zahorodnii 2022-09-09 08:45:09 UTC
Do you have any window rules, can you attach you ~/.config/kwinrulesrc?
Comment 23 Vlad Zahorodnii 2022-09-09 08:45:15 UTC
your*
Comment 24 jakubby 2022-09-09 08:48:31 UTC
(In reply to Vlad Zahorodnii from comment #22)
> Do you have any window rules, can you attach you ~/.config/kwinrulesrc?
No I don't think so, contents:
[$Version]
update_info=kwinrules.upd:replace-placement-string-to-enum,kwinrules.upd:use-virtual-desktop-ids
Comment 25 jakubby 2022-09-09 10:00:22 UTC
(In reply to Vlad Zahorodnii from comment #22)
This turns out the mpv method isn't reproducible in:
1. In a fresh VM enivornment.
2. Non-reproducible on my amd laptop(1 year old install, wayland and x.org).

Gonna single out the issue:
0. Changed to nouveau and removed the x.org config.
1. I removed all kde related ~/.config/*rc files it doesn't make a difference
2. mv ~/.config ~/backup.config still persists
3. created new user still persists.
4. Removed non-essential aur packages.
I don't really change a lot of things in /etc/;(I got tripple buffering x.org, fstab setup, enabled concurrent package manager updates, enabled english locale, enabled xdg portals for gtk).
My ssds have no bad blocks registered.

Right now I've removed the package manager cache and I am re-downloading and re-installing all system packages(well tbf it won't replace the user configuration).
I might end up just reinstalling the system on this machine and see if the problem persists.
Comment 26 jakubby 2022-09-09 20:32:26 UTC
(In reply to jakubby from comment #25)
> re-installing all system packages(well tbf it won't replace the user
> configuration).
No longer 100% reproducible; ssd corruption?
Comment 27 jakubby 2022-09-11 16:44:11 UTC Comment hidden (spam)
Comment 28 Nate Graham 2022-09-12 19:01:09 UTC Comment hidden (spam)
Comment 29 Vlad Zahorodnii 2022-10-07 08:50:11 UTC
*** Bug 460028 has been marked as a duplicate of this bug. ***
Comment 30 Vlad Zahorodnii 2023-02-02 10:16:22 UTC
Git commit abd59be23274a0c76709a8c587d9ed14d154d995 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 02/02/2023 at 09:14.
Pushed by vladz into branch 'master'.

x11window: round framegeometry on moveresize

If this isn't done, the size check in SurfacePixmapX11::create will stop
the window from being updated
Related: bug 460934

M  +1    -1    src/x11window.cpp

https://invent.kde.org/plasma/kwin/commit/abd59be23274a0c76709a8c587d9ed14d154d995
Comment 31 Vlad Zahorodnii 2023-02-02 10:31:58 UTC
Git commit e8d5f1e62de979f35c37cf5cd05dc049555a0673 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 02/02/2023 at 10:17.
Pushed by vladz into branch 'Plasma/5.27'.

x11window: round framegeometry on moveresize

If this isn't done, the size check in SurfacePixmapX11::create will stop
the window from being updated
Related: bug 460934
(cherry picked from commit abd59be23274a0c76709a8c587d9ed14d154d995)

M  +1    -1    src/x11window.cpp

https://invent.kde.org/plasma/kwin/commit/e8d5f1e62de979f35c37cf5cd05dc049555a0673