--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: kwin_wayland uses 100% CPU when I drag window to top edge multiple times and freezes desktop
- From: Antonio <antdev66@gmail.com>
- Date: Fri, 14 Feb 2025 08:45:32 +0100
- Message-id: <aef7e975-ad2f-44bc-b1ad-f2a1b053a183@gmail.com>
Package: kwin-wayland
Version: 4:6.3.0-2
Severity: important
Dear Maintainer,
I report a bug that already exists since version 6.2.5 of plasma and that
remained in version 6.3.0:
- if you set both the "screen edge snap zone" and "windows snap zone"
flags to
0 (systemsettings->windows management->window behavior->movement) and move a
window to the top edge and then down several times, after a few seconds the
desktop freezes, even though it is accessible in ssh, where you can see the
kwin-wayland process at 100%; by killing the process everything is back to
normal, but if you don't have a second server you can only reboot with the
REISUB kernel emergency reboot sequence because the keyboard and mouse don't
respond
- by entering a value greater than 0 in these fields, it seems that version
6.2.5 works
However, in version 6.3.0 the problem remains and it is not only on
Debian sid,
but it also appeared on OpenSuse after updating the desktop to version
6.3.0.
So I opened a ticket https://bugs.kde.org/show_bug.cgi?id=499913
Thanks,
Antonio
-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (700, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.13-2-liquorix-amd64 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages kwin-wayland depends on:
ii libc6 2.40-6
ii libcanberra0 0.30-17+b1
ii libcap2-bin 1:2.66-5+b1
ii libepoxy0 1.5.10-2
ii libkdecorations3-6 4:6.3.0-1
ii libkf6configcore6 6.10.0-1
ii libkf6configgui6 6.10.0-1
ii libkf6configwidgets6 6.10.0-1
ii libkf6coreaddons6 6.10.0-1
ii libkf6crash6 6.10.0-1
ii libkf6dbusaddons6 6.10.0-1
ii libkf6globalaccel6 6.10.0-1
ii libkf6i18n6 6.10.0-1
ii libkf6idletime6 6.10.0-1
ii libkf6notifications6 6.10.0-1
ii libkf6service-bin 6.10.0-1
ii libkf6service6 6.10.0-1
ii libkf6svg6 6.10.0-1
ii libkf6windowsystem6 6.10.0-1
ii libkglobalacceld0 6.3.0-1
ii libkwin6 4:6.3.0-2
ii libqaccessibilityclient-qt6-0 0.6.0-3
ii libqt6core6t64 [qt6-base-private-abi] 6.7.2+dfsg-6
ii libqt6dbus6 6.7.2+dfsg-6
ii libqt6gui6 6.7.2+dfsg-6
ii libqt6qml6 6.7.2+dfsg-11
ii libqt6quick6 6.7.2+dfsg-11
ii libqt6widgets6 6.7.2+dfsg-6
ii libstdc++6 14.2.0-17
ii libsystemd0 257.3-1
ii libxcb-composite0 1.17.0-2+b1
ii libxcb-randr0 1.17.0-2+b1
ii libxcb-xfixes0 1.17.0-2+b1
ii libxcb1 1.17.0-2+b1
ii xwayland 2:24.1.5-1
--- End Message ---
--- Begin Message ---
control: fixed -1 4:6.3.2.1-1
Le samedi 22 février 2025, 08:10:53 UTC+1 Antonio a écrit :
> Dear Maintainer,
>
> I found a patch that avoids the desktop freeze, at least until the
> problem is solved. Using the system I have not seen any side effects, so
> I think it might be useful to include it in the "kwin-wayland" package
> to avoid unwanted desktop freezes.
>
> The path (see below) affects the "libkwin6_6.3.0.1-2_amd64.deb" package
> that contains the "/usr/lib/x86_64-linux-gnu/libkwin.so.6.3.0" library.
>
> see also https://bugs.kde.org/show_bug.cgi?id=499913
>
> Thanks,
> Antonio
>
>
> --- a/kwin-6.3.0/src/window.cpp 2025-02-06 12:01:48.000000000 +0100
> +++ b/kwin-6.3.0/src/window.cpp 2025-02-21 15:06:37.885455302 +0100
> @@ -50,6 +50,12 @@
> #include <QMouseEvent>
> #include <QStyleHints>
>
> +#include <time.h>
> +#include <unistd.h>
> +time_t maxtime=1;
> +useconds_t waitmsec=10;
> +
> +
> namespace KWin
> {
>
> @@ -1542,7 +1548,9 @@
> int lastVisiblePixels = -1;
> QRectF lastTry = nextMoveResizeGeom;
> bool titleFailed = false;
> - for (;;) {
> + time_t starttime=time(NULL);
> + while((time(NULL)-starttime)<maxtime) {
> + usleep(waitmsec);
> const QRect titleRect =
> bTitleRect.translated(nextMoveResizeGeom.topLeft()).toRect();
> const int requiredPixels = std::min(100 * (transposed ?
> titleRect.width() : titleRect.height()), titleRect.width() *
> titleRect.height());
>
> @@ -1665,7 +1673,9 @@
> }
> bool transposed = false;
> QRectF bTitleRect = titleBarRect(nextMoveResizeGeom, transposed);
> - for (;;) {
> + time_t starttime=time(NULL);
> + while((time(NULL)-starttime)<maxtime) {
> + usleep(waitmsec);
> QRectF currentTry = nextMoveResizeGeom;
> const QRect titleRect =
> bTitleRect.translated(currentTry.topLeft()).toRect();
> const int requiredPixels = std::min(100 * (transposed ?
> titleRect.width() : titleRect.height()), titleRect.width() *
> titleRect.height());
>
>
--- End Message ---