Bug 522005 - UI hangs after starting GW2 via Steam Proton with kwin and drkonqi 6.7
Summary: UI hangs after starting GW2 via Steam Proton with kwin and drkonqi 6.7
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.7.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2026-06-22 15:21 UTC by Simeon Andreev
Modified: 2026-07-04 18:49 UTC (History)
3 users (show)

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


Attachments
Logs from two sessions, the 1st part of the file is the session without a hang, the 2nd part has the hang. (247.48 KB, text/plain)
2026-06-22 15:21 UTC, Simeon Andreev
Details
Periodic gstack calls for the kwin_wayland process, at the time of the UI hang. (416.00 KB, text/plain)
2026-06-24 17:20 UTC, Simeon Andreev
Details
Periodic gstack calls for kwin_wayland process, when no hang is seen. (399.73 KB, text/plain)
2026-06-24 19:33 UTC, Simeon Andreev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Andreev 2026-06-22 15:21:38 UTC
Created attachment 193544 [details]
Logs from two sessions, the 1st part of the file is the session without a hang, the 2nd part has the hang.

DESCRIPTION

When I launch the game Guild Wars 2 via Steam Proton 9.0-4 (same for 8), its launcher comes up and then I cannot interact with my system anymore.

OBSERVED RESULT

My system hangs, I cannot start another session via e.g. Ctrl+Alt+F3 to check what is going on. I can only reboot via the PCs power button.

EXPECTED RESULT

No hang.

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a terminal window):

Operating System: Arch Linux 
KDE Plasma Version: 6.7.0
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.12-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 32 GiB of RAM (31.2 GiB usable)
Graphics Processor: AMD Radeon RX 6900 XT

ADDITIONAL INFORMATION

My system is up-to-date, aside from these 2 downgrades:

pacman -U /var/cache/pacman/pkg/kwin-6.6.5-4-x86_64.pkg.tar.zst /var/cache/pacman/pkg/drkonqi-6.6.5-2-x86_64.pkg.tar.zst

As per https://community.kde.org/KWin/Debugging, I've added this to my ~/.zshrc:

export QT_LOGGING_RULES="kwin_*.debug=true"

Logs from a not hanging and hanging sessions are attached as one file

Looking at these entries in the logs of the hanging session (not seen in the not hanging session):

kwin_wayland[1221]: Could not create udmabuf: Invalid argument

And this blog post:

https://zamundaaa.github.io/wayland/2026/05/06/making-wl-shm-fast.html

Maybe its related to this feature.

Is there a way to disable it for now?
Comment 1 Simeon Andreev 2026-06-22 15:23:40 UTC
Forgot to clarify, I've downgraded kwin and drkonqi to not experience the hang. With the 6.7 versions I see the hang.
Comment 2 Zamundaaa 2026-06-24 16:52:51 UTC
> My system hangs, I cannot start another session via e.g. Ctrl+Alt+F3 to check what is going on. I can only reboot via the PCs power button.
Can you still ssh in?
If yes, please get a backtrace for KWin. You can do it with
> sudo gdb -p $(pidof kwin_wayland)
> bt

> kwin_wayland[1221]: Could not create udmabuf: Invalid argument
It's likely not related, but you can try disabling it with KWIN_DISABLE_UDMABUF_IMPORT=1
Comment 3 Simeon Andreev 2026-06-24 17:20:50 UTC
Created attachment 193651 [details]
Periodic gstack calls for the kwin_wayland process, at the time of the UI hang.

Thank you for the reply!

I don't have ssh configured, instead I started this at the time of the launcher start (it takes a few seconds after that for the UI to hang):

rm ~/kwin_gstack.txt ; for i in {1..20}; do echo -e "\n*** iteration $i***\n" >> ~/kwin_gstack.txt;  sudo gstack $(pidof kwin_wayland) >> ~/kwin_gstack.txt; sleep 5; done

Do I need to install debug symbols for any library, if any info is missing in the stack traces?

I tried to put "KWIN_DISABLE_UDMABUF_IMPORT=1" in my ~/.zshrc, it doesn't help. I believe I tried setting the same ENV variable in the Steam launch command. Do I need to define it in some specific place for the kwin process to pick it up at session start?
Comment 4 Simeon Andreev 2026-06-24 19:33:16 UTC
Created attachment 193657 [details]
Periodic gstack calls for kwin_wayland process, when no hang is seen.

I decreased the sleep to 1 sec and captured some stack traces with downgraded packages (and so without a hang).

The "Thread 1" stack trace with the downgraded packages:

Thread 1 (Thread 0x7f4d348a1c80 (LWP 174024) "kwin_wayland"):
#0  0x00007f4d3e7c6244 in ??? () at /usr/lib/libkwin.so.6
#1  0x00007f4d3e7c6602 in KWin::Region::sliceBand(QSpan<KWin::Rect const, 18446744073709551615ul>, int, int, KWin::Region::BandRef const&) () at /usr/lib/libkwin.so.6
#2  0x00007f4d3e7c6a78 in KWin::Region::unite(QSpan<KWin::Rect const, 18446744073709551615ul>, QSpan<KWin::Rect const, 18446744073709551615ul>) () at /usr/lib/libkwin.so.6
#3  0x00007f4d3e7c6ee0 in KWin::Region::united(KWin::Region const&) const () at /usr/lib/libkwin.so.6
#4  0x00007f4d3e7bb7b9 in ??? () at /usr/lib/libkwin.so.6
#5  0x00007f4d3e975731 in KWin::SurfaceItemXwayland::opaque() const () at /usr/lib/libkwin.so.6
#6  0x00007f4d3e97f47b in ??? () at /usr/lib/libkwin.so.6
#7  0x00007f4d3e97f889 in ??? () at /usr/lib/libkwin.so.6
#8  0x00007f4d3e97f889 in ??? () at /usr/lib/libkwin.so.6
#9  0x00007f4d3e97fccc in KWin::WorkspaceScene::preparePaintSimpleScreen() () at /usr/lib/libkwin.so.6
#10 0x00007f4d3e97a126 in KWin::WorkspaceScene::prePaint(KWin::SceneView*) () at /usr/lib/libkwin.so.6
#11 0x00007f4d3e79b978 in KWin::Compositor::composite(KWin::RenderLoop*) () at /usr/lib/libkwin.so.6
#12 0x00007f4d3bbf081b in ??? () at /usr/lib/libQt6Core.so.6
#13 0x00007f4d3e7cc5db in KWin::RenderLoop::frameRequested(KWin::RenderLoop*) () at /usr/lib/libkwin.so.6
#14 0x00007f4d3bbe7cf9 in QObject::event(QEvent*) () at /usr/lib/libQt6Core.so.6
#15 0x00007f4d3cf0411f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#16 0x00007f4d3bb83658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#17 0x00007f4d3bd6b2f5 in QTimerInfoList::activateTimers() () at /usr/lib/libQt6Core.so.6
#18 0x00007f4d3bd76bd2 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#19 0x00007f4d3cb83543 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Gui.so.6
#20 0x00007f4d3bb91983 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#21 0x00007f4d3bb86eaa in QCoreApplication::exec() () at /usr/lib/libQt6Core.so.6
#22 0x000055c0ff36601e in ??? ()
#23 0x00007f4d3b227741 in ??? () at /usr/lib/libc.so.6
#24 0x00007f4d3b227879 in __libc_start_main () at /usr/lib/libc.so.6
#25 0x000055c0ff36a485 in ??? ()

From the hanging session, the stack traces look like this:

Thread 1 (Thread 0x7fbfa423a180 (LWP 1224) "kwin_wayland"):
#0  0x00007fbfae3e3174 in KWin::RegionF::coalesceBands(KWin::RegionF::BandRef const&, KWin::RegionF::BandRef const&) () from /usr/lib/libkwin.so.6
#1  0x00007fbfae3e3ea1 in KWin::RegionF::sliceBand(QSpan<KWin::RectF const, 18446744073709551615ul>, double, double, KWin::RegionF::BandRef const&) () from /usr/lib/libkwin.so.6
#2  0x00007fbfae3e42fc in KWin::RegionF::unite(QSpan<KWin::RectF const, 18446744073709551615ul>, QSpan<KWin::RectF const, 18446744073709551615ul>) () from /usr/lib/libkwin.so.6
#3  0x00007fbfae3e4873 in KWin::RegionF::united(KWin::RegionF const&) const () from /usr/lib/libkwin.so.6
#4  0x00007fbfae6dee54 in KWin::X11Window::updateShapeRegion() () from /usr/lib/libkwin.so.6
#5  0x00007fbfae6ca1fa in KWin::X11Window::windowEvent(xcb_generic_event_t*) () from /usr/lib/libkwin.so.6
#6  0x00007fbfae6ca433 in KWin::Workspace::workspaceEvent(xcb_generic_event_t*) () from /usr/lib/libkwin.so.6
#7  0x00005625538b8efe in ?? ()
#8  0x00007fbfab7f081b in ?? () from /usr/lib/libQt6Core.so.6
#9  0x00007fbfab803dc0 in QSocketNotifier::event(QEvent*) () from /usr/lib/libQt6Core.so.6
#10 0x00007fbfac90411f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
#11 0x00007fbfab783658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
#12 0x00007fbfab976277 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () from /usr/lib/libQt6Core.so.6
#13 0x00007fbfab976ea4 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
#14 0x00007fbfac583543 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Gui.so.6
#15 0x00007fbfab791983 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
#16 0x00007fbfab786eaa in QCoreApplication::exec() () from /usr/lib/libQt6Core.so.6
#17 0x00005625538a2020 in ?? ()
#18 0x00007fbfaae27741 in ?? () from /usr/lib/libc.so.6
#19 0x00007fbfaae27879 in __libc_start_main () from /usr/lib/libc.so.6
#20 0x00005625538a6635 in ?? ()

I'm not sure this helps much. I did follow the guide to compile plasma-desktop here: https://github.com/KDE/kwin/blob/master/CONTRIBUTING.md

I now have a developer session I can log into, I do see the hang in the session. I assume I can also change kwin code, e.g. adding extra log entries, checking out / reverting commits and so on - anything that helps. Bisecting will probably be too much for me, considering how long it takes to start a session, test for the hang, reboot my PC from the power button (I try not to do that often also).
Comment 5 Simeon Andreev 2026-06-25 21:15:18 UTC
I've made a few more observations, when running the built kwin_wayland binary as instructed in the kwin contribution guide:

env QT_PLUGIN_PATH="$(pwd)":"$QT_PLUGIN_PATH" dbus-run-session ./kwin_wayland --xwayland konsole

If I don't touch the started window, there is no hang. The launcher does flicker a lot (for the last 2-3 months it has been slowing my session noticeably while its running, but it usually doesn't run for long so I ignored this).

If I make the started window bigger, it hangs. If I make it smaller, there is no hang.

I see this output spammed on the console which launched the process:

kwin_core: KWin::X11Window(0x560515cf5d80, surface=KWin::SurfaceInterface(0x560515c73800), caption="Guild Wars 2") true false false
kwin_core: PERMITTED KWin::X11Window(0x560515cf5d80, surface=KWin::SurfaceInterface(0x560515c73800), caption="Guild Wars 2") true

With a bigger window, the message spam slows down noticeably.

With some debug outputs:

diff --git a/src/x11window.cpp b/src/x11window.cpp
index ac6987a10c..504e26e0db 100644
--- a/src/x11window.cpp
+++ b/src/x11window.cpp
@@ -3273,6 +3273,7 @@ void X11Window::configureRequest(int value_mask, qreal rx, qreal ry, qreal rw, q
             geometry = keepInArea(geometry, area);
         }
 
+        qCDebug(KWIN_CORE) << "moveResize configurePositionMask " << geometry;
         moveResize(geometry);
     }

During a hang I see:

kwin_core: KWin::X11Window(0x55e23876a6e0, surface=KWin::SurfaceInterface(0x55e2387b9fc0), caption="Guild Wars 2") true false false
kwin_core: PERMITTED KWin::X11Window(0x55e23876a6e0, surface=KWin::SurfaceInterface(0x55e2387b9fc0), caption="Guild Wars 2") true
kwin_core: moveResize configurePositionMask  KWin::RectF(-34,-9 1120x976)

Without making the window bigger, I see:

kwin_core: KWin::X11Window(0x56187f45dfa0, surface=KWin::SurfaceInterface(0x56187f3c93a0), caption="Guild Wars 2") true false false
kwin_core: PERMITTED KWin::X11Window(0x56187f45dfa0, surface=KWin::SurfaceInterface(0x56187f3c93a0), caption="Guild Wars 2") true
kwin_core: moveResize configurePositionMask  KWin::RectF(0,0 1024x768)

With some more debug outputs I see constant XCB_CONFIGURE_REQUEST events.

I do see there is some floating point code added between 6.6.5 and 6.7.0 (when comparing the source releases). Maybe that code is just slower than the integer code. So the constant resize events (maybe caused by the launcher itself) are just not processed on time anymore and the UI is not repainted. Maybe this code doesn't scale well with window size (I've not checked the actual code, sorry if I'm making a lot of assumptions here).

There are also line numbers shown by gstack now, in both hang and no hang cases I often see this stack trace:

Thread 1 (Thread 0x7f68e5b2fc80 (LWP 576156) "kwin_wayland"):
#0  0x00007f68ee39d449 in QtPrivate::QPodArrayOps<KWin::RectF>::emplace<KWin::RectF> (this=0x7ffd7e8faf60, i=246) at /usr/include/qt6/QtCore/qarraydataops.h:148
#1  QList<KWin::RectF>::emplaceBack<KWin::RectF> (this=this@entry=0x7ffd7e8faf60) at /usr/include/qt6/QtCore/qlist.h:958
#2  0x00007f68ee3984a8 in KWin::RegionF::sliceBand (this=this@entry=0x7ffd7e8faf60, rects=..., top=102, bottom=bottom@entry=103, previousBand=...) at /home/sandreev/kde/src/kwin/src/core/region.cpp:1553
#3  0x00007f68ee39894e in KWin::RegionF::unite (this=this@entry=0x7ffd7e8faf60, left=..., right=...) at /usr/include/c++/16.1.1/bits/ptr_traits.h:232
#4  0x00007f68ee398f31 in KWin::RegionF::united (this=this@entry=0x56187f45e670, other=...) at /home/sandreev/kde/src/kwin/src/core/region.cpp:1959
#5  0x00007f68ee6b7875 in KWin::RegionF::united (this=0x56187f45e670, other=...) at /home/sandreev/kde/src/kwin/src/core/region.h:1300
#6  KWin::RegionF::operator+= (this=0x56187f45e670, other=...) at /home/sandreev/kde/src/kwin/src/core/region.h:1407
#7  KWin::X11Window::updateShapeRegion (this=0x56187f45dfa0) at /home/sandreev/kde/src/kwin/src/x11window.cpp:3989
#8  0x00007f68ee6a7852 in KWin::X11Window::windowEvent (this=0x56187f45dfa0, e=e@entry=0x56187f4d5890) at /home/sandreev/kde/src/kwin/src/events.cpp:375
#9  0x00007f68ee6a8029 in KWin::Workspace::workspaceEvent (this=0x56187ec5caa0, e=0x56187f4d5890) at /home/sandreev/kde/src/kwin/src/events.cpp:137
#10 0x0000561871d02521 in KWin::Xwl::Xwayland::dispatchEvents (this=0x56187edf17d0, mode=<optimized out>) at /usr/include/qt6/QtCore/qcoreapplication.h:98
#11 0x00007f68eb1f081b in ??? () at /usr/lib/libQt6Core.so.6
#12 0x00007f68eb203dc0 in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt6Core.so.6
#13 0x00007f68ec50411f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#14 0x00007f68eb183658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#15 0x00007f68eb376277 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /usr/lib/libQt6Core.so.6
#16 0x00007f68eb376ea4 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#17 0x00007f68ebf83543 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Gui.so.6
#18 0x00007f68eb191983 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#19 0x00007f68eb186eaa in QCoreApplication::exec() () at /usr/lib/libQt6Core.so.6
#20 0x0000561871cedadf in main (argc=<optimized out>, argv=<optimized out>) at /home/sandreev/kde/src/kwin/src/main_wayland.cpp:688

There was a mention on the games forum of getting Proton to run under Wayland, after which the launcher didn't lag the session... I did try that but it didn't seem to help. I guess I'll try again...
Comment 6 Simeon Andreev 2026-06-26 16:57:50 UTC
For anyone who also has the problem, Wine with Wayland doesn't have the problem. I couldn't get Steam Proton to switch to Wayland.
Comment 7 Zamundaaa 2026-06-26 21:05:49 UTC
> I do see there is some floating point code added between 6.6.5 and 6.7.0 (when comparing the source releases). Maybe that code is just slower than the integer code.
I doubt it would make that large of a difference... but what can happen way too easily when porting anything to floats is that comparisons to integers can fail where before they succeeded, just because the calculations can be ever so slightly different.
I don't see anything immediately obvious, but if you set a breakpoint in X11Window::configure, you should be able to find out what's triggering all the configure events.
Comment 8 Simeon Andreev 2026-06-28 17:43:17 UTC
I'm not sure what changed: I update my PC daily (for now ignoring kwin and drkonqi), I also run "kde-builder --no-src kwin" to compile (so I guess I get code changes in dependencies). But the GW2 launcher window no longer flickers. 

Hang behavior is unchanged, at default window size when launching the locally compiled kwin_wayland, there is no hang. When I increase window size, I do see a hang.

The console is no longer spammed with these debug outputs:

kwin_core: KWin::X11Window(0x55e23876a6e0, surface=KWin::SurfaceInterface(0x55e2387b9fc0), caption="Guild Wars 2") true false false
kwin_core: PERMITTED KWin::X11Window(0x55e23876a6e0, surface=KWin::SurfaceInterface(0x55e2387b9fc0), caption="Guild Wars 2") true

I also see no breakpoint hits in X11Window::configure.

I see gdb bt pointing to Window::updateShapeRegion():

#0  0x00007f918919d08f in QList<KWin::RectF>::iterator::operator- (this=<optimized out>, j=<optimized out>) at /usr/include/qt6/QtCore/qlist.h:125
#1  QList<KWin::RectF>::emplaceBack<KWin::RectF> (this=this@entry=0x7ffebb734e60) at /usr/include/qt6/QtCore/qlist.h:959
#2  0x00007f91891981e8 in KWin::RegionF::sliceBand (this=this@entry=0x7ffebb734e60, rects=..., top=459, bottom=bottom@entry=460, previousBand=...) at /home/sandreev/kde/src/kwin/src/core/region.cpp:1553
#3  0x00007f918919868e in KWin::RegionF::unite (this=this@entry=0x7ffebb734e60, left=..., right=...) at /usr/include/c++/16/bits/ptr_traits.h:232
#4  0x00007f9189198c71 in KWin::RegionF::united (this=this@entry=0x55b9c7734ff0, other=...) at /home/sandreev/kde/src/kwin/src/core/region.cpp:1959
#5  0x00007f91894b60f5 in KWin::RegionF::united (this=0x55b9c7734ff0, other=...) at /home/sandreev/kde/src/kwin/src/core/region.h:1300
#6  KWin::RegionF::operator+= (this=0x55b9c7734ff0, other=...) at /home/sandreev/kde/src/kwin/src/core/region.h:1407
#7  KWin::X11Window::updateShapeRegion (this=0x55b9c7734920) at /home/sandreev/kde/src/kwin/src/x11window.cpp:3984
#8  0x00007f91894a6ee9 in KWin::X11Window::windowEvent (this=0x55b9c7734920, e=e@entry=0x55b9c72b97d0) at /home/sandreev/kde/src/kwin/src/events.cpp:359
#9  0x00007f91894a70d9 in KWin::Workspace::workspaceEvent (this=0x55b9c6fdb590, e=0x55b9c72b97d0) at /home/sandreev/kde/src/kwin/src/events.cpp:137
#10 0x00007f91892bf9b4 in KWin::Application::dispatchEvent (this=<optimized out>, event=<optimized out>) at /home/sandreev/kde/src/kwin/src/main.cpp:438
#11 0x000055b9b60df4e9 in KWin::Xwl::Xwayland::dispatchEvents (this=0x55b9c72e6bf0, mode=<optimized out>) at /usr/include/qt6/QtCore/qcoreapplication.h:98
#12 0x00007f9185df081b in QtPrivate::QSlotObjectBase::call (this=0x55b9c7717600, r=<optimized out>, a=0x7ffebb735360, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:462
#13 doActivate<false> (sender=0x55b9c7715de0, signal_index=3, argv=0x7ffebb735360) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4372
#14 0x00007f9185e03dc0 in QMetaObject::activate<void, QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal> (sender=0x55b9c7715de0, mo=<optimized out>, local_signal_index=0, ret=0x0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:320
#15 QSocketNotifier::activated (this=0x55b9c7715de0, _t1=..., _t2=<optimized out>, _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qsocketnotifier.cpp:161
#16 QSocketNotifier::event (this=0x55b9c7715de0, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qsocketnotifier.cpp:325
#17 0x00007f918710411f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55b9c7715de0, e=0x7ffebb7354e0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3276
#18 0x00007f9185d83658 in QCoreApplication::notifyInternal2 (receiver=0x55b9c7715de0, event=0x7ffebb7354e0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1114
#19 0x00007f9185f76277 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7ffebb7354e0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1559
#20 QEventDispatcherUNIXPrivate::activateSocketNotifiers (this=this@entry=0x55b9c64c9af0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:277
#21 0x00007f9185f76ea4 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=..., flags@entry=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:499
#22 0x00007f9186b83543 in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qunixeventdispatcher.cpp:28
#23 0x00007f9185d91983 in QEventLoop::processEvents (this=0x7ffebb7356b0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:109
#24 QEventLoop::exec (this=0x7ffebb7356b0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:198
#25 0x00007f9185d86eaa in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1457
#26 0x00007f918710033a in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2546
#27 0x000055b9b60caadf in main (argc=<optimized out>, argv=<optimized out>) at /home/sandreev/kde/src/kwin/src/main_wayland.cpp:688

So I added this debug output:

diff --git a/src/x11window.cpp b/src/x11window.cpp
index ac6987a10c..2f4bc2beef 100644
--- a/src/x11window.cpp
+++ b/src/x11window.cpp
@@ -3979,8 +3979,9 @@ void X11Window::updateShapeRegion()
             for (int i = 0; i < rectCount; ++i) {
                 RectF region = Xcb::fromXNative(Rect(rects[i].x, rects[i].y, rects[i].width, rects[i].height));
                 // make sure the shape is sane (X is async, maybe even XShape is broken)
-                region = region.intersected(RectF(QPointF(0, 0), bufferGeometry.size()));
-
+                RectF intersectedRegion = region.intersected(RectF(QPointF(0, 0), bufferGeometry.size()));
+                qCDebug(KWIN_CORE) << "updateShapeRegion rects[" << i << "] x=" << rects[i].x << ", y=" << rects[i].y << ", w=" << rects[i].width << ", h=" << rects[i].height << ", region=" << region << ", bufferGeometry.size()=" << bufferGeometry.size() << ", intersected region=" << region;
+                region = intersectedRegion;
                 m_shapeRegion += region;
             }
         } else {
@@ -3990,6 +3991,7 @@ void X11Window::updateShapeRegion()
         m_shapeRegion = {RectF(0, 0, bufferGeometry.width(), bufferGeometry.height())};
     }
     if (m_shapeRegion != previousRegion) {
+        qCDebug(KWIN_CORE) << "updateShapeRegion Q_EMIT shapeChanged()\n\tm_shapeRegion=" << m_shapeRegion << "\n\tpreviousRegion=" << previousRegion;
         Q_EMIT shapeChanged();
     }
 }

While hanging, I'm seeing alternating values in the output, where the values differ slightly:

KWin::RectF(1653,977 60x2)
KWin::RectF(1653,978 60x1)

kwin_core: updateShapeRegion rects[ 2470 ] x= 1653 , y= 977 , w= 60 , h= 2 , region= KWin::RectF(1653,977 60x2) , bufferGeometry.size()= QSizeF(1920, 1012) , intersected region= KWin::RectF(1653,977 60x2)
kwin_core: updateShapeRegion rects[ 2470 ] x= 1653 , y= 978 , w= 60 , h= 1 , region= KWin::RectF(1653,978 60x1) , bufferGeometry.size()= QSizeF(1920, 1012) , intersected region= KWin::RectF(1653,978 60x1)

There are more rectangles which alternate like this and this seems to just repeat. The differences I've seen are always by one and they are always on the Y axis - the y value and the height. The are a lot of rectangles though, maybe I missed some other types of differences.

Any pointers where to debug next? I couldn't find which code sets the values retrieved with 'xcb_shape_get_rectangles_reply', I also couldn't find the code which sends the 'xcb_shape_notify_event_t' events.
Comment 9 Vlad Zahorodnii 2026-06-29 10:57:48 UTC
> Any pointers where to debug next? I couldn't find which code sets the values retrieved with 'xcb_shape_get_rectangles_reply', I also couldn't find the code which sends the 'xcb_shape_notify_event_t' events.

Those come from the X server. `xcb_shape_notify_event_t` events should arrive if the client (GW2) changes the shape. kwin itself shouldn't change the geometry.

Can you add some qDebug()s in configure() to see if kwin flips back and forth between two geometries?

---

How many times updateShapeRegion() gets called per second? Once or twice or many many times?
Comment 10 Vlad Zahorodnii 2026-06-29 11:01:10 UTC
JIC I'm installing Guild Wars 2 to see if the issue happens on my computer.
Comment 11 Simeon Andreev 2026-06-29 11:36:07 UTC
(In reply to Vlad Zahorodnii from comment #9)
> Those come from the X server. `xcb_shape_notify_event_t` events should
> arrive if the client (GW2) changes the shape. kwin itself shouldn't change
> the geometry.

Then this must be a problem with the client (or the constellation of the client on Wine/Proton on xwayland), that is only now becoming apparent? :/

> Can you add some qDebug()s in configure() to see if kwin flips back and
> forth between two geometries?

I only see one call when I maximize the kwin_wayland window, I don't see calls after maximizing (and hanging).

> How many times updateShapeRegion() gets called per second? Once or twice or
> many many times?

By the looks of it once every ~30 ms:

diff --git a/src/x11window.cpp b/src/x11window.cpp
index ac6987a10c..3dbcff0e3b 100644
--- a/src/x11window.cpp
+++ b/src/x11window.cpp
@@ -3554,6 +3554,7 @@ void X11Window::moveResizeInternal(const RectF &rect, MoveResizeMode mode)
 
 void X11Window::configure(const Rect &nativeGeometry)
 {
+    qCDebug(KWIN_CORE) << "X11Window::configure()";
     // handle xrandr emulation: If a fullscreen client requests mode changes,
     // - Xwayland will set _XWAYLAND_RANDR_EMU_MONITOR_RECTS on all windows of the client
     // - we need to configure the window to match the emulated size
@@ -3967,6 +3968,14 @@ RegionF X11Window::shapeRegion() const
 
 void X11Window::updateShapeRegion()
 {
+    struct timeval current;
+    gettimeofday(&current, NULL);
+    if (m_updateShaepRegionCalled) {
+      const auto elapsed = (current.tv_sec - m_updateShapeRegionPrevTime.tv_sec) * 1000000 + current.tv_usec - m_updateShapeRegionPrevTime.tv_usec;
+      qCDebug(KWIN_CORE) << "updateShapeRegion, time since last call: " << elapsed << " us";
+    }
+    m_updateShaepRegionCalled = true;
+    m_updateShapeRegionPrevTime = current;
     const RectF bufferGeometry = this->bufferGeometry();
     const auto previousRegion = m_shapeRegion;
     if (Xcb::Extensions::self()->hasShape(window())) {
diff --git a/src/x11window.h b/src/x11window.h
index dd2fb969b2..b6943d8a6b 100644
--- a/src/x11window.h
+++ b/src/x11window.h
@@ -11,6 +11,8 @@
 #pragma once
 #include "config-kwin.h"
 
+#include <sys/time.h>
+
 #if !KWIN_BUILD_X11
 #error Do not include on non-X11 builds
 #endif
@@ -397,6 +399,8 @@ private:
     int bit_depth = 24;
     RegionF opaque_region;
     RegionF m_shapeRegion;
+    bool m_updateShaepRegionCalled;
+    struct timeval m_updateShapeRegionPrevTime;
 
     Xcb::StringProperty fetchActivities() const;
     void readActivities(Xcb::StringProperty &property);

kwin_core: updateShapeRegion, time since last call:  30197  us
kwin_core: updateShapeRegion, time since last call:  28687  us
kwin_core: updateShapeRegion, time since last call:  33315  us

> JIC I'm installing Guild Wars 2 to see if the issue happens on my computer.

Thank you very much!
Comment 12 Vlad Zahorodnii 2026-06-29 11:55:52 UTC
Do you also see the hang when moving the splash screen around?
Comment 13 Vlad Zahorodnii 2026-06-29 11:56:02 UTC
well, not a hang, but some slow down
Comment 14 Simeon Andreev 2026-06-29 12:21:04 UTC
(In reply to Vlad Zahorodnii from comment #12)
> Do you also see the hang when moving the splash screen around?

When I run kwin_wayland with "--width=1800 --height=980" (so that there is some area to move), I can move the launcher window around without a hang. It does seem sluggish compared to normal window moving (I've never moved it before, I cant say if this is normal). There is no hang until I resize the kwin_wayland window.

Also if I start with "--fullscreen" there is no hang. I'm not sure why there is a hang in my regular session. With full screen the session itself (any window in it) becomes sluggish while the launcher is running, the mouse pointer also feel sluggish (just like my regular session, before I started seeing the hangs). With  "--width=1800 --height=980" I think I notice some slowdown but its not so bad when compared to full screen.
Comment 15 Vlad Zahorodnii 2026-06-29 12:24:28 UTC
The shape region is veeeery complex (like around 3K), which, yeah can cause issues.

Can you try applying https://invent.kde.org/plasma/kwin/-/commits/work%2Fzzag%2Foptimize-xregion-to-regionf?ref_type=heads ? Does it improve things?
Comment 16 Simeon Andreev 2026-06-29 12:35:59 UTC
(In reply to Vlad Zahorodnii from comment #15)
> Can you try applying
> https://invent.kde.org/plasma/kwin/-/commits/work%2Fzzag%2Foptimize-xregion-
> to-regionf?ref_type=heads ? Does it improve things?

That does help, I can resize, maximize and I can still interact with the launcher. The repaints seem odd but I assume this won't be an issue for my regular session - where I don't resize the session.

https://i.imgur.com/8axoFAE.mp4

HEAD is at:

commit 018041f5041136c3d6394c9ec93f020c9b37d9ff (HEAD -> work/zzag/optimize-xregion-to-regionf, origin/work/zzag/optimize-xregion-to-regionf)
Author: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date:   Mon Jun 29 15:23:15 2026 +0300

    foo
Comment 17 Bug Janitor Service 2026-06-29 12:43:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9484
Comment 18 Vlad Zahorodnii 2026-06-29 19:04:12 UTC
Git commit 5fe17928a8d6ea21b0dada01862ca3cf65bacfa3 by Vlad Zahorodnii.
Committed on 29/06/2026 at 16:51.
Pushed by vladz into branch 'master'.

Optimize querying X window shape

The += operator effectively constructs a new region. If the number of
rectangles in the X shape is huge, it can take a while to construct a
RegionF. For example, the launcher in Guild Wars 2 video game, sets a
region with more than 3000 rectangles.

We can skip that heavy step by taking into account that the shape
rectangles will be sorted in the y-x lexicographical order so we can
pass the shape rects to Region/RegionF as is and later clip any rects
that stick outside the buffer rect. In most cases, the intersected()
step will be a noop.

While on this, the moveResizeInternal() function doesn't need to fetch
the shape region every time the window moves. The size check used to not
exist because things were easier that way when kwin had still been a
reparenting window manager.

M  +20   -13   src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/5fe17928a8d6ea21b0dada01862ca3cf65bacfa3
Comment 19 Simeon Andreev 2026-06-29 20:19:23 UTC
Thank you for fixing this so quickly!

Which kwin version will have the fix?
Comment 20 Vlad Zahorodnii 2026-06-30 05:01:16 UTC
(In reply to Simeon Andreev from comment #19)
> Thank you for fixing this so quickly!
> 
> Which kwin version will have the fix?

6.7.2
Comment 21 Bug Janitor Service 2026-06-30 05:05:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9494
Comment 22 Vlad Zahorodnii 2026-06-30 05:21:16 UTC
Git commit 2229d680c27a45b4497ab6bc91a6709d18affe26 by Vlad Zahorodnii.
Committed on 30/06/2026 at 04:59.
Pushed by vladz into branch 'Plasma/6.7'.

Optimize querying X window shape

The += operator effectively constructs a new region. If the number of
rectangles in the X shape is huge, it can take a while to construct a
RegionF. For example, the launcher in Guild Wars 2 video game, sets a
region with more than 3000 rectangles.

We can skip that heavy step by taking into account that the shape
rectangles will be sorted in the y-x lexicographical order so we can
pass the shape rects to Region/RegionF as is and later clip any rects
that stick outside the buffer rect. In most cases, the intersected()
step will be a noop.

While on this, the moveResizeInternal() function doesn't need to fetch
the shape region every time the window moves. The size check used to not
exist because things were easier that way when kwin had still been a
reparenting window manager.


(cherry picked from commit 5fe17928a8d6ea21b0dada01862ca3cf65bacfa3)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +20   -13   src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/2229d680c27a45b4497ab6bc91a6709d18affe26
Comment 23 Vlad Zahorodnii 2026-06-30 19:45:06 UTC
Git commit 74913571a6a66fb879e2f66af17eebaba4e7e3e3 by Vlad Zahorodnii.
Committed on 30/06/2026 at 18:04.
Pushed by vladz into branch 'master'.

Avoid updating shape when an override-redirect window is moved

If the buffer geometry size doesn't change, the shape region doesn't
need to be updated.

The updateShapeRegion() is moved down to match what the
X11Window::moveResizeInternal() function does.

M  +4    -1    src/events.cpp

https://invent.kde.org/plasma/kwin/-/commit/74913571a6a66fb879e2f66af17eebaba4e7e3e3
Comment 24 Simeon Andreev 2026-06-30 19:54:33 UTC
I updated to kwin 6.7.2-1, the problem is gone. Also my session no longer slows down when the launcher is running.

Thank you again for the fixes!
Comment 25 Bug Janitor Service 2026-07-01 07:40:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9509
Comment 26 Vlad Zahorodnii 2026-07-01 08:12:41 UTC
Git commit a3e7cdd97480073672dbd7c99d4c8611c0a0f92f by Vlad Zahorodnii.
Committed on 01/07/2026 at 07:40.
Pushed by vladz into branch 'Plasma/6.7'.

Avoid updating shape when an override-redirect window is moved

If the buffer geometry size doesn't change, the shape region doesn't
need to be updated.

The updateShapeRegion() is moved down to match what the
X11Window::moveResizeInternal() function does.


(cherry picked from commit 74913571a6a66fb879e2f66af17eebaba4e7e3e3)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +4    -1    src/events.cpp

https://invent.kde.org/plasma/kwin/-/commit/a3e7cdd97480073672dbd7c99d4c8611c0a0f92f