From ea8974fa9315dc43837b3d59a587c7cbfd87b5fd Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 30 Jan 2015 14:33:58 +0100 Subject: [PATCH] try to reposition before showing to minimize dialog repositions, try to put it at the proper position before showing. besides making things a bit snappier, showing at 0,0 for an instant has some interesting sideeffects: MouseArea has a rather strange way to manage hoverevents: at window show, it will check if the item is under the absolute mouse position, if so, will emit an entered() signal. This causes the Kickoff menu to automatically select the last tab on first show, because for an instant (that never gets drawn on the screen) all the tabs will actually be under the mouse cursor Change-Id: Ie9fc45f2a5076c3f49b42e8a7cee109b04db46b9 --- src/plasmaquick/dialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index c01584aaf..0023efd05 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -1210,6 +1210,9 @@ void Dialog::setVisible(bool visible) d->visible = visible; if (d->componentComplete) { + if (d->visualParent) { + setPosition(popupPosition(d->visualParent, size())); + } QQuickWindow::setVisible(visible); //signal will be emitted and proxied from the QQuickWindow code } else {