scene: Do not clamp 1x1 windows
Without the margins, they become 0x0 and we crash.
(gdb) where
#0 0x00007fe5e92f8811 in __memmove_avx_unaligned_erms () at /usr/lib/libc.so.6
#1 0x00007fe5ecd7c467 in std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<unsigned int>(unsigned int const*, unsigned int const*, unsigned int*) (__first=0x563ce58c7938, __last=0x563ce58c7934, __result=0x563ce58c7918) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/stl_algobase.h:431
#2 0x00007fe5ecd7c415 in std::__copy_move_a2<false, unsigned int const*, unsigned int*>(unsigned int const*, unsigned int const*, unsigned int*) (__first=0x563ce58c7938, __last=0x563ce58c7934, __result=0x563ce58c7918) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/stl_algobase.h:494
#3 0x00007fe5ecd7c3c5 in std::__copy_move_a1<false, unsigned int const*, unsigned int*>(unsigned int const*, unsigned int const*, unsigned int*) (__first=0x563ce58c7938, __last=0x563ce58c7934, __result=0x563ce58c7918) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/stl_algobase.h:522
#4 0x00007fe5ecd7c334 in std::__copy_move_a<false, unsigned int const*, unsigned int*>(unsigned int const*, unsigned int const*, unsigned int*) (__first=0x563ce58c7938, __last=0x563ce58c7934, __result=0x563ce58c7918) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/stl_algobase.h:530
#5 0x00007fe5ecd7c1da in std::copy<unsigned int const*, unsigned int*>(unsigned int const*, unsigned int const*, unsigned int*) (__first=0x563ce58c7938, __last=0x563ce58c7934, __result=0x563ce58c7918) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/stl_algobase.h:619
#6 0x00007fe5ecd78d00 in KWin::clamp_row(int, int, int, unsigned int const*, unsigned int*) (left=2, width=-1, right=3, src=0x563ce58c7938, dest=0x563ce58c7910) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1622
#7 0x00007fe5ecd78962 in KWin::clamp(QImage&, QRect const&) (image=..., viewport=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1651
#8 0x00007fe5ecd784f8 in KWin::SceneOpenGLDecorationRenderer::render(QRegion const&)::$_5::operator()(QRect const&, QRect const&, QPoint const&, bool) const (this=0x7ffcb434ceb0, geo=..., partRect=..., position=..., rotated=false) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1723
#9 0x00007fe5ecd77cab in KWin::SceneOpenGLDecorationRenderer::render(QRegion const&) (this=0x563ce595b3a0, region=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1743
#10 0x00007fe5ecabebe7 in KWin::DecorationItem::preprocess() (this=0x563ce58825a0) at /home/apol/devel/frameworks/kwin/src/decorationitem.cpp:134
#11 0x00007fe5ecd712eb in KWin::OpenGLWindow::createRenderNode(KWin::Item*, KWin::OpenGLWindow::RenderContext*) (this=0x563ce572c750, item=0x563ce58825a0, context=0x7ffcb434d7d0) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:711
#12 0x00007fe5ecd71890 in KWin::OpenGLWindow::createRenderNode(KWin::Item*, KWin::OpenGLWindow::RenderContext*) (this=0x563ce572c750, item=0x563ce58829f0, context=0x7ffcb434d7d0) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:762
#13 0x00007fe5ecd722c8 in KWin::OpenGLWindow::performPaint(int, QRegion const&, KWin::WindowPaintData const&) (this=0x563ce572c750, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:834
#14 0x00007fe5ecd70dc0 in KWin::SceneOpenGL::performPaintWindow(KWin::EffectWindowImpl*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce44968b0, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:598
#15 0x00007fe5ecd70c83 in KWin::SceneOpenGL::finalDrawWindow(KWin::EffectWindowImpl*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce44968b0, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:580
#16 0x00007fe5ecae99fa in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:472
#17 0x0000563ce38f2f42 in KWin::BlurEffect::drawWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce53a2050, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects/blur/blur.cpp:599
#18 0x00007fe5ecae99c2 in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:469
#19 0x00007fe5ec4a068d in KWin::Effect::drawWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce530a010, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/libkwineffects/kwineffects.cpp:606
#20 0x00007fe5ecae99c2 in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:469
#21 0x00007fe5ecbe335d in KWin::Scene::finalPaintWindow(KWin::EffectWindowImpl*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce44968b0, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/scene.cpp:560
#22 0x00007fe5ecae961f in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:435
#23 0x00007fe5ec4a0555 in KWin::Effect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) (this=0x563ce53a2050, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/libkwineffects/kwineffects.cpp:576
#24 0x00007fe5ecae95e2 in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:432
#25 0x00007fe5ec48d5b3 in KWin::AnimationEffect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) (this=0x563ce530a010, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/libkwineffects/kwinanimationeffect.cpp:605
#26 0x00007fe5ecae95e2 in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion const&, KWin::WindowPaintData&) (this=0x563ce4b8bb60, w=0x563ce5939530, mask=9, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:432
#27 0x00007fe5ecbe320e in KWin::Scene::paintWindow(KWin::Scene::Window*, int, QRegion const&) (this=0x563ce44968b0, w=0x563ce572c750, mask=9, _region=...) at /home/apol/devel/frameworks/kwin/src/scene.cpp:543
#28 0x00007fe5ecbe2b04 in KWin::Scene::paintSimpleScreen(int, QRegion const&) (this=0x563ce44968b0, orig_mask=8, region=...) at /home/apol/devel/frameworks/kwin/src/scene.cpp:471
#29 0x00007fe5ecd70aa3 in KWin::SceneOpenGL::paintSimpleScreen(int, QRegion const&) (this=0x563ce44968b0, mask=8, region=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:545
#30 0x00007fe5ecbe1944 in KWin::Scene::finalPaintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce44968b0, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/scene.cpp:274
#31 0x00007fe5ecae9347 in KWin::EffectsHandlerImpl::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce4b8bb60, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:392
#32 0x00007fe5ec4a0472 in KWin::Effect::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce53a2050, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/libkwineffects/kwineffects.cpp:561
#33 0x00007fe5ecae9317 in KWin::EffectsHandlerImpl::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce4b8bb60, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:389
#34 0x00007fe5ec4a0472 in KWin::Effect::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce530a010, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/libkwineffects/kwineffects.cpp:561
#35 0x00007fe5ecae9317 in KWin::EffectsHandlerImpl::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x563ce4b8bb60, mask=8, region=..., data=...) at /home/apol/devel/frameworks/kwin/src/effects.cpp:389
#36 0x00007fe5ecbe168b in KWin::Scene::paintScreen(QRegion const&, QRegion const&, QRegion*, QRegion*, KWin::RenderLoop*, QMatrix4x4 const&) (this=0x563ce44968b0, damage=..., repaint=..., updateRegion=0x7ffcb434e9a8, validRegion=0x7ffcb434e9a0, renderLoop=0x563ce47624d0, projection=...) at /home/apol/devel/frameworks/kwin/src/scene.cpp:247
#37 0x00007fe5ecd6f76e in KWin::SceneOpenGL::paint(KWin::AbstractOutput*, QRegion const&, QList<KWin::Toplevel*> const&, KWin::RenderLoop*) (this=0x563ce44968b0, output=0x563ce4764db0, damage=..., toplevels=..., renderLoop=0x563ce47624d0) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:317
#38 0x00007fe5eca74f7d in KWin::Compositor::composite(KWin::RenderLoop*) (this=0x563ce44faff0, renderLoop=0x563ce47624d0) at /home/apol/devel/frameworks/kwin/src/composite.cpp:631
#39 0x00007fe5eca74151 in KWin::Compositor::handleFrameRequested(KWin::RenderLoop*) (this=0x563ce44faff0, renderLoop=0x563ce47624d0) at /home/apol/devel/frameworks/kwin/src/composite.cpp:585
#40 0x00007fe5eca7cc63 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KWin::RenderLoop*>, void, void (KWin::Compositor::*)(KWin::RenderLoop*)>::call(void (KWin::Compositor::*)(KWin::RenderLoop*), KWin::Compositor*, void**) (f=
(void (KWin::Compositor::*)(KWin::Compositor * const, KWin::RenderLoop *)) 0x7fe5eca74130 <KWin::Compositor::handleFrameRequested(KWin::RenderLoop*)>, o=0x563ce44faff0, arg=0x7ffcb434ed00) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:152
#41 0x00007fe5eca7cbbd in QtPrivate::FunctionPointer<void (KWin::Compositor::*)(KWin::RenderLoop*)>::call<QtPrivate::List<KWin::RenderLoop*>, void>(void (KWin::Compositor::*)(KWin::RenderLoop*), KWin::Compositor*, void**) (f=(void (KWin::Compositor::*)(KWin::Compositor * const, KWin::RenderLoop *)) 0x7fe5eca74130 <KWin::Compositor::handleFrameRequested(KWin::RenderLoop*)>, o=0x563ce44faff0, arg=0x7ffcb434ed00)
at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:185
#42 0x00007fe5eca7cb02 in QtPrivate::QSlotObject<void (KWin::Compositor::*)(KWin::RenderLoop*), QtPrivate::List<KWin::RenderLoop*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x563ce4373010, r=0x563ce44faff0, a=0x7ffcb434ed00, ret=0x0) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:418
#43 0x00007fe5e9db6093 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcb434ed00, r=0x563ce44faff0, this=0x563ce4373010) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#44 doActivate<false>(QObject*, int, void**) (sender=0x563ce47624d0, signal_index=5, argv=0x7ffcb434ed00) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#45 0x00007fe5ec9ffd93 in KWin::RenderLoop::frameRequested(KWin::RenderLoop*) (this=0x563ce47624d0, _t1=0x563ce47624d0) at src/kwin_autogen/EWIEGA46WW/moc_renderloop.cpp:206
#46 0x00007fe5ecbc5293 in KWin::RenderLoopPrivate::dispatch() (this=0x563ce4763a00) at /home/apol/devel/frameworks/kwin/src/renderloop.cpp:150
#47 0x00007fe5ecbc5a08 in KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0::operator()() const (this=0x563ce4762400) at /home/apol/devel/frameworks/kwin/src/renderloop.cpp:31
#48 0x00007fe5ecbc59b6 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0>::call(KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0&, void**) (f=..., arg=0x7ffcb434ef00) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:146
#49 0x00007fe5ecbc5981 in QtPrivate::Functor<KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0, 0>::call<QtPrivate::List<>, void>(KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0&, void*, void**) (f=..., arg=0x7ffcb434ef00) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:256
#50 0x00007fe5ecbc5921 in QtPrivate::QFunctorSlotObject<KWin::RenderLoopPrivate::RenderLoopPrivate(KWin::RenderLoop*)::$_0, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x563ce47623f0, r=0x563ce47624d0, a=0x7ffcb434ef00, ret=0x0) at /home/apol/devel/kde5/include/QtCore/qobjectdefs_impl.h:443
#51 0x00007fe5e9db6093 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcb434ef00, r=0x563ce47624d0, this=0x563ce47623f0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
#52 doActivate<false>(QObject*, int, void**) (sender=0x563ce4763a18, signal_index=3, argv=0x7ffcb434ef00) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
#53 0x00007fe5e9daf55f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fe5ea052280 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffcb434ef00) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3946
#54 0x00007fe5e9dba05a in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#55 0x00007fe5e9dabf6f in QObject::event(QEvent*) (this=0x563ce4763a18, e=0x7ffcb434f080) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:1336
#56 0x00007fe5ea9bd6cf in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x563ce4763a18, e=0x7ffcb434f080) at /home/apol/devel/frameworks/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3632
#57 0x00007fe5e9d7f93a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x563ce4763a18, event=0x7ffcb434f080) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1064
#58 0x00007fe5e9dd62db in QTimerInfoList::activateTimers() (this=this@entry=0x563ce4336c28) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qtimerinfo_unix.cpp:643
#59 0x00007fe5e9dd3a9c in QEventDispatcherUNIXPrivate::activateTimers() (this=this@entry=0x563ce4336ba0) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:249
#60 0x00007fe5e9dd47e7 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:516
#61 0x0000563ce3988d8d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at /home/apol/devel/frameworks/qt5/qtbase/src/platformsupport/eventdispatchers/qunixeventdispatcher.cpp:63
#62 0x00007fe5e9d7e33b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffcb434f220, flags=..., flags@entry=...) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/global/qflags.h:69
#63 0x00007fe5e9d86620 in QCoreApplication::exec() () at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/global/qflags.h:121
#64 0x0000563ce3845eb6 in main(int, char**) (argc=15, argv=0x7ffcb434fd98) at /home/apol/devel/frameworks/kwin/src/main_wayland.cpp:740
(gdb) frame 8
#8 0x00007fe5ecd784f8 in KWin::SceneOpenGLDecorationRenderer::render(QRegion const&)::$_5::operator()(QRect const&, QRect const&, QPoint const&, bool) const (this=0x7ffcb434ceb0, geo=..., partRect=..., position=..., rotated=false) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1723
1723 clamp(image, isIntegerScaling ? viewportScaled : viewportScaled.marginsRemoved({1, 1, 1, 1}));
(gdb) p viewportScaled
$1 = {x1 = 1, y1 = 1, x2 = 1, y2 = 33}
(gdb) down
#7 0x00007fe5ecd78962 in KWin::clamp (image=..., viewport=...) at /home/apol/devel/frameworks/kwin/src/scenes/opengl/scene_opengl.cpp:1651
1651 clamp_row(left, width, right, firstRow + left, dest);
(gdb) p viewport
$2 = (const QRect &) @0x7ffcb434cd10: {x1 = 2, y1 = 2, x2 = 0, y2 = 32}