https://bugs.kde.org/show_bug.cgi?id=522005

--- Comment #5 from Simeon Andreev <[email protected]> ---
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...

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to