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

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

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

Reply via email to