Bug 354821

Summary: ComboBox popup wrong position
Product: [Frameworks and Libraries] libplasma Reporter: Leslie Zhai <zhaixiang>
Component: componentsAssignee: Marco Martin <notmart>
Status: RESOLVED UPSTREAM    
Severity: normal CC: cjacker
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: combo popup wrong position REVERT patch

Description Leslie Zhai 2015-11-04 08:28:33 UTC
kcm_pulseaudio use QML to do UI, but ComboBox popup wrong position, shown as https://pbs.twimg.com/media/CS9Br1MUwAE-D-z.png

kcmshell5 kcm_pulseaudio
konsole output:
Trying to use rootObject before initialization is completed, whilst using setInitializationDelayed. Forcing completion
void QWindow::setTransientParent(QWindow*) QQuickWindow(0x10c3560) must be a top level window.

KF5: v5.15.0
Qt5: v5.5.1

Reproducible: Always

Steps to Reproduce:
1. kcmshell5 kcm_pulseaudio
2. click 'Output Devices' tab
3. click Port ComboBox

Actual Results:  
popup wrong position

Expected Results:  
popup correct position
Comment 1 Christoph Feck 2015-11-04 21:07:27 UTC
Can you confirm the issue is also with the "wrench popup" when running this command:

    kcmshell5 kwineffects

If yes, I guess the issue is with Plasma QML components, not with Plasma-pa.
Comment 2 Leslie Zhai 2015-11-05 02:21:36 UTC
(In reply to Christoph Feck from comment #1)
> Can you confirm the issue is also with the "wrench popup" when running this
> command:
> 
>     kcmshell5 kwineffects
> 
> If yes, I guess the issue is with Plasma QML components, not with Plasma-pa.

yes, the same issue https://pbs.twimg.com/media/CTA5Ui7UkAAjf27.png
Comment 3 Cjacker 2015-11-12 15:42:19 UTC
This issue was caused by:
https://github.com/qtproject/qtquickcontrols/commit/d70e5ebe11a8eb22fe5e71945982d81991dc9f09

It intend to fix QTBUG-40883: 
https://bugreports.qt.io/browse/QTBUG-40883

but actually the bug was not fixed, try 'kcmshell5 kwineffects' and right click on the "Search" lineedit, the position of popup menu is still wrong.
Comment 4 Cjacker 2015-11-12 16:45:58 UTC
More information:
1, A qt bug report(for windows): https://bugreports.qt.io/browse/QTBUG-40195
a commit happened to fix it:
https://codereview.qt-project.org/#/c/89777/

and also leave the weird qwarning  there:
 qWarning() << Q_FUNC_INFO << parent << "must be a top level window.";

2, Because of 1, another two bug report:
https://bugreports.qt.io/browse/QTCREATORBUG-12972
https://bugreports.qt.io/browse/QTBUG-40883

commits to fix it:
https://codereview.qt-project.org/#/c/94265/
https://codereview.qt-project.org/#/c/94347/

And this issue occurred.

Revert all these commits make 'kcmshell5 kwineffects' happy, the drop down menu works and the popup menu of 'search lineedit' works.

I double checked these QTBUGs and nothing looks broken after revert.
Comment 5 Cjacker 2015-11-13 01:20:33 UTC
the call trace:

Breakpoint 1, 0x00007fffd2283940 in QWindow::setTransientParent(QWindow*)@plt () from /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
(gdb) bt
#0  0x00007fffd2283940 in QWindow::setTransientParent(QWindow*)@plt () at /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
#1  0x00007fffd22963e5 in QQuickMenuPopupWindow::setParentItem(QQuickItem*) () at /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
#2  0x00007fffd2291fa5 in QQuickMenu::__popup(QRectF const&, int, QQuickMenu::MenuType) ()
    at /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
#3  0x00007fffd22b0f49 in QQuickMenu::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
    at /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
#4  0x00007fffd22b1508 in QQuickMenu::qt_metacall(QMetaObject::Call, int, void**) ()
    at /usr/lib/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so
#5  0x00007ffff3935570 in QQmlVMEMetaObject::metaCall(QMetaObject::Call, int, void**) () at /lib/libQt5Qml.so.5
#6  0x00007ffff398b599 in QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const () at /lib/libQt5Qml.so.5
#7  0x00007ffff390e25c in CallMethod(QQmlObjectOrGadget const&, int, int, int, int*, QV4::ExecutionEngine*, QV4::CallData*) [clone .constprop.153] () at /lib/libQt5Qml.so.5
#8  0x00007ffff390fa44 in CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*) [clone .constprop.151] () at /lib/libQt5Qml.so.5
#9  0x00007ffff39104bb in QV4::QObjectMethod::callInternal(QV4::CallData*) () at /lib/libQt5Qml.so.5
#10 0x00007ffff3926733 in QV4::Runtime::callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) () at /lib/libQt5Qml.so.5
#11 0x00007fffd22345c9 in  ()
#12 0x000bab0001180001 in  ()
#13 0x000cabff01190001 in  ()
#14 0x0003000000000000 in  ()
#15 0x0001000000000000 in  ()
#16 0x0000000000000002 in  ()
#17 0x0000003200000008 in  ()
#18 0x00007fffd2417058 in  ()
#19 0x00007fffd2417060 in  ()
#20 0x00000000008f2e40 in  ()
#21 0x00007ffff38ca54a in QV4::SimpleScriptFunction::call(QV4::Managed*, QV4::CallData*) () at /lib/libQt5Qml.so.5
#22 0x00007ffff39b115e in QQmlJavaScriptExpression::evaluate(QQmlContextData*, QV4::Value const&, QV4::CallData*, bool*) () at /lib/libQt5Qml.so.5
#23 0x00007ffff395ad56 in QQmlBoundSignalExpression::evaluate(void**) () at /lib/libQt5Qml.so.5
#24 0x00007ffff395b5eb in QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) () at /lib/libQt5Qml.so.5
#25 0x00007ffff39959ae in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () at /lib/libQt5Qml.so.5
#26 0x00007ffff393c414 in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () at /lib/libQt5Qml.so.5
#27 0x00007ffff53212e1 in QMetaObject::activate(QObject*, int, int, void**) () at /lib/libQt5Core.so.5
#28 0x00007ffff3a22faa in QQmlTimer::event(QEvent*) () at /lib/libQt5Qml.so.5
#29 0x00007ffff5c3a28c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/libQt5Widgets.so.5
Comment 6 Leslie Zhai 2015-11-13 02:04:44 UTC
Hi Cjacker, so here comes a REVERT patch to fix it ;-)
Comment 7 Cjacker 2015-11-13 03:27:08 UTC
(In reply to Leslie Zhai from comment #6)
> Hi Cjacker, so here comes a REVERT patch to fix it ;-)

This issue only occurred after QT 5.3.x.

I already reverted these three commits in our repos, and verified with the test of related QTBUGs, no big issue found, at least for kf5/plasma.
Comment 8 Leslie Zhai 2016-04-14 02:50:03 UTC
Created attachment 98389 [details]
combo popup wrong position REVERT patch

rebased for Qt5.6.x