Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.14.2
-
None
-
Ubuntu 20.10
Description
If I have a Qt app open either under Wayland or XWayland, and select a QTextDocument then:
- Hit modifier keys, e.g. ctrl.
- Select another window.
In either order, I see QTextDocument::contentsChanged emitted even though contents have not changed. See backtrace:
#0 EditWidget::setModified(bool) (this=0x55624408b530, state=true) at /home/abilinski/builds/keepassxc/src/gui/EditWidget.cpp:148 #1 0x00007fd8f7aa8320 in doActivate<false>(QObject*, int, void**) (sender=0x5562440df9d0, signal_index=7, argv=0x7ffdf16ea8b0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395 #2 0x00007fd8f7aa8320 in doActivate<false>(QObject*, int, void**) (sender=0x5562440e3b10, signal_index=3, argv=0x7ffdf16ea990) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395 #3 0x00007fd8f88250a3 in QWidgetTextControl::qt_metacall(QMetaObject::Call, int, void**) (this=0x5562440e3b10, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7ffdf16eaaa0) at .moc/moc_qwidgettextcontrol_p.cpp:489 #4 0x00007fd8f7aa8030 in doActivate<false>(QObject*, int, void**) (sender=0x5562440e60c0, signal_index=4, argv=0x7ffdf16eaaa0, argv@entry=0x0) at /usr/include/c++/10/bits/atomic_base.h:741 #5 0x00007fd8f7aa2068 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fd8f84b7820 <QTextDocument::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x0) at kernel/qobject.cpp:3930 #6 0x00007fd8f83abc07 in QTextDocument::contentsChanged() (this=<optimized out>) at .moc/moc_qtextdocument.cpp:427 #7 0x00007fd8f807c724 in QTextDocumentPrivate::finishEdit() (this=0x5562440e69b0) at text/qtextdocument_p.cpp:1247 #8 0x00007fd8f807cb1c in QTextDocumentPrivate::endEditBlock() (this=<optimized out>) at text/qtextdocument_p.cpp:1203 #9 QTextDocumentPrivate::endEditBlock() (this=<optimized out>) at text/qtextdocument_p.cpp:1186
This causes apps to misbehave, and prompt for saving changes, which causes confusion as a user, making me unsure if I either made accidental changes that should be discarded or intentional changes that must be saved.
Issue originally noticed using KeepassXC here: https://github.com/keepassxreboot/keepassxc/issues/4338#issuecomment-774945616