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

            Bug ID: 473416
           Summary: Resizing sidebar is laggy
    Classification: Applications
           Product: ghostwriter
           Version: 23.04.3
          Platform: Archlinux
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: megan.con...@kdemail.net
          Reporter: merlijn.verstra...@gmail.com
  Target Milestone: ---

Created attachment 160983
  --> https://bugs.kde.org/attachment.cgi?id=160983&action=edit
Demonstration of the issue

SUMMARY
When dragging the sidebar in any of the modes (outline, sessions stats, doc
stats, cheat sheet) it moves very delayed relative to the mouse cursor, and the
delay seems to stack the longer you drag around.

When doing this for prolonged time ghostwriter also seems to crash (SEGV).
```
merlijn@arch ~ % ghostwriter
Command "pandoc" is not available.
Command "multimarkdown" is not available.
Command "cmark" is not available.
kf.sonnet.core: No language dictionaries for the language: "en_US"
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[1]    22509 segmentation fault (core dumped)  ghostwriter
```
I think it got stuck in some recursive function and reached call stack limit ?
```
(gdb) bt
#0  0x00007fcd7921eac4 in QTextEngine::itemize() const
(this=this@entry=0x5623c530b7b0) at text/qtextengine.cpp:2103
#1  0x00007fcd79221c05 in QTextEngine::findItem(int, int) const
(this=0x5623c530b7b0, strPos=0, firstItem=0) at text/qtextengine.cpp:2273
#2  0x00007fcd7922532b in QTextEngine::setBoundary(int) const
(this=this@entry=0x5623c530b7b0, strPos=0) at text/qtextengine.cpp:3385
#3  0x00007fcd79225495 in QTextEngine::addRequiredBoundaries() const
(this=<optimized out>) at text/qtextengine.cpp:3041
#4  QTextEngine::addRequiredBoundaries() const (this=0x5623c530b7b0) at
text/qtextengine.cpp:3036
#5  0x00007fcd7921f60b in QTextEngine::itemize() const (this=<optimized out>)
at text/qtextengine.cpp:2248
#6  0x00007fcd7922d883 in QTextLayout::beginLayout()
(this=this@entry=0x5623c530b6d0) at text/qtextlayout.cpp:659
#7  0x00007fcd79b2cc71 in QPlainTextDocumentLayout::layoutBlock(QTextBlock
const&) (this=this@entry=0x5623c48568e0, block=...) at
widgets/qplaintextedit.cpp:379
#8  0x00007fcd79b2d154 in
QPlainTextDocumentLayout::blockBoundingRect(QTextBlock const&) const
(block=..., this=0x5623c48568e0) at widgets/qplaintextedit.cpp:200
#9  QPlainTextDocumentLayout::blockBoundingRect(QTextBlock const&) const
(this=0x5623c48568e0, block=...) at widgets/qplaintextedit.cpp:195
#10 0x00007fcd79b35cc4 in QPlainTextEdit::blockBoundingRect(QTextBlock const&)
const (this=this@entry=0x5623c48bad20, block=...) at
widgets/qplaintextedit.cpp:3212
#11 0x00005623c2707bb0 in ghostwriter::MarkdownEditor::paintEvent(QPaintEvent*)
(this=0x5623c48bad20, event=0x7fff191ee4c0) at
/usr/src/debug/ghostwriter/ghostwriter-23.04.3/src/markdowneditor.cpp:457
#12 0x00007fcd799af080 in QWidget::event(QEvent*) (this=0x5623c48bad20,
event=0x7fff191ee4c0) at kernel/qwidget.cpp:8826
#13 0x00007fcd79a5d703 in QFrame::event(QEvent*) (this=0x5623c48bad20,
e=0x7fff191ee4c0) at widgets/qframe.cpp:550
#14 0x00007fcd78c99702 in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
(receiver=receiver@entry=0x5623c48bab40, event=event@entry=0x7fff191ee4c0) at
kernel/qcoreapplication.cpp:1190
#15 0x00007fcd7997892f in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x5623c48bab40, e=0x7fff191ee4c0) at
kernel/qapplication.cpp:3634
#16 0x00007fcd78c9c6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x5623c48bab40, event=0x7fff191ee4c0) at
kernel/qcoreapplication.cpp:1064
#17 0x00007fcd78c9c783 in QCoreApplication::sendSpontaneousEvent(QObject*,
QEvent*) (receiver=<optimized out>, event=<optimized out>) at
kernel/qcoreapplication.cpp:1474
#18 0x00007fcd799a2fbb in QWidgetPrivate::sendPaintEvent(QRegion const&)
(this=this@entry=0x5623c47afcc0, toBePainted=...) at kernel/qwidget.cpp:5479
#19 0x00007fcd799a43bd in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*,
QWidgetRepaintManager*)
    (this=this@entry=0x5623c47afcc0, pdev=pdev@entry=0x5623c4d69f98, rgn=...,
offset=..., flags=flags@entry=..., sharedPainter=sharedPainter@entry=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5429
#20 0x00007fcd799a4dce in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=0x5623c45d8050, pdev=0x5623c4d69f98, siblings=..., index=<optimized out>,
rgn=<optimized out>, offset=..., flags=..., sharedPainter=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5610
#21 0x00007fcd799a4c2c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=this@entry=0x5623c45d8050, pdev=pdev@entry=0x5623c4d69f98, siblings=...,
index=30, rgn=..., offset=..., flags=..., sharedPainter=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5596
#22 0x00007fcd799a385e in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*,
QWidgetRepaintManager*)
    (this=this@entry=0x5623c45d8050, pdev=pdev@entry=0x5623c4d69f98, rgn=...,
offset=..., flags=..., flags@entry=..., sharedPainter=sharedPainter@entry=0x0,
repaintManager=<optimized out>)
    at kernel/qwidget.cpp:5470
#23 0x00007fcd799a4dce in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=0x5623c4af8600, pdev=0x5623c4d69f98, siblings=..., index=<optimized out>,
rgn=<optimized out>, offset=..., flags=..., sharedPainter=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5610
#24 0x00007fcd799a4c2c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=0x5623c4af8600, pdev=0x5623c4d69f98, siblings=..., index=1, rgn=...,
offset=..., flags=..., sharedPainter=0x0, repaintManager=0x5623c48625d0) at
kernel/qwidget.cpp:5596
#25 0x00007fcd799a4c2c in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=this@entry=0x5623c4af8600, pdev=pdev@entry=0x5623c4d69f98, siblings=...,
index=3, rgn=..., offset=..., flags=..., sharedPainter=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5596
#26 0x00007fcd799a385e in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*,
QWidgetRepaintManager*)
    (this=this@entry=0x5623c4af8600, pdev=pdev@entry=0x5623c4d69f98, rgn=...,
offset=..., flags=..., flags@entry=..., sharedPainter=sharedPainter@entry=0x0,
repaintManager=<optimized out>)
    at kernel/qwidget.cpp:5470
#27 0x00007fcd799a4dce in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*,
QList<QObject*> const&, int, QRegion const&, QPoint const&,
QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
(this=this@entry=0x5623c45d1550, pdev=pdev@entry=0x5623c4d69f98, siblings=...,
index=<optimized out>, rgn=..., offset=..., flags=..., sharedPainter=0x0,
repaintManager=0x5623c48625d0) at kernel/qwidget.cpp:5610
#28 0x00007fcd799a385e in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*,
QWidgetRepaintManager*)
    (this=0x5623c45d1550, pdev=0x5623c4d69f98, rgn=..., offset=<optimized out>,
flags=..., sharedPainter=<optimized out>, repaintManager=<optimized out>) at
kernel/qwidget.cpp:5470
#29 0x00007fcd79984719 in QWidgetRepaintManager::paintAndFlush()
(this=0x5623c48625d0) at kernel/qwidgetrepaintmanager.cpp:1023
#30 0x00007fcd799af111 in QWidget::event(QEvent*) (this=0x7fff199e2a40,
event=0x5623c54e8ee0) at kernel/qwidget.cpp:8990
#31 0x00007fcd7997893f in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x7fff199e2a40, e=0x5623c54e8ee0) at
kernel/qapplication.cpp:3640
#32 0x00007fcd78c9c6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x7fff199e2a40, event=0x5623c54e8ee0) at
kernel/qcoreapplication.cpp:1064
#33 0x00007fcd78ca165b in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) (receiver=0x0, event_type=0, data=0x5623c441e4f0) at
kernel/qcoreapplication.cpp:1821
#34 0x00007fcd78ce76d8 in postEventSourceDispatch(GSource*, GSourceFunc,
gpointer) (s=0x5623c4451d60) at kernel/qeventdispatcher_glib.cpp:277
#35 0x00007fcd6f30fa31 in g_main_dispatch (context=0x7fcd54000ee0) at
../glib/glib/gmain.c:3460
#36 g_main_context_dispatch (context=0x7fcd54000ee0) at
../glib/glib/gmain.c:4200
...
#54402 0x00007fcd7913bef2 in QGuiApplication::exec() () at
kernel/qguiapplication.cpp:1870
#54403 0x00007fcd79976cda in QApplication::exec() () at
kernel/qapplication.cpp:2832
#54404 0x00005623c26d7ef0 in main(int, char**) (argc=<optimized out>,
argv=<optimized out>) at
/usr/src/debug/ghostwriter/ghostwriter-23.04.3/src/appmain.cpp:175
```
coredump itself is 10MB so I can't attach it.

STEPS TO REPRODUCE
1. Hover over the sidebar separation line
2. Hold down left mouse button
3. Move mouse quickly
4. Let go of left mouse button

5. To cause a crash, don't let go of mouse button and keep resizing.

OBSERVED RESULT
See attachment

EXPECTED RESULT
Resizing should happen in less than 100ms of me letting go of the left mouse
button.

SOFTWARE/OS VERSIONS
WM: Sway
Linux/KDE Plasma: Arch Linux | Kernel 6.4.10-zen / /
KDE Plasma Version: /
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10

System info: Ran on AMD Ryzen 5 5600X, 1% cpu idle, 32GB ram 11% used idle

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

Reply via email to