[Dialog] Don't alter mainItem's visibility
ClosedPublic

Authored by broulik on Dec 12 2018, 2:44 PM.

Details

Summary

The item's visible property is independent of the window visibility, which can be checked using Window.visible.

Test Plan

Needs D17542 to fix tooltips
Other than that, kickoff, systray, panelcontroller, notification popups, task manager group dialogs, visibility of pager depending on panelcontroller opening, still works.
dialogqmltest and dialogstatetest still pass, dialognativetest is broken before and after

Notifications no longer get bogus containsMouse and properly times out:
When you closed notification popup by clicking the X button inside the popup, and the popup shows again later, because we manually set visible to true, QQuickMouseArea enters the following code

case ItemVisibleHasChanged:
       if (acceptHoverEvents() && d->hovered != (isVisible() && isUnderMouse())) {
           if (!d->hovered) {
               QPointF cursorPos = QGuiApplicationPrivate::lastCursorPosition;
               d->lastScenePos = d->window->mapFromGlobal(cursorPos.toPoint());
               d->lastPos = mapFromScene(d->lastScenePos);
           }
           setHovered(!d->hovered);
       }

QGuiApplicationPrivate::lastCursorPosition is only updated when a plasmashell window is hovered, which is usually not the case when you just dismissed a notification popup ontop of another application. Hence, the position is incorrect and opening the dialog again causes it to think it's hovered.
isUnderMouse() basically checks contains(QGuiApplicationPrivate::lastCursorPosition).
If we don't mess with visibility, none of this happens.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Dec 12 2018, 2:44 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 12 2018, 2:44 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Dec 12 2018, 2:44 PM
mart accepted this revision.Jan 10 2019, 10:58 AM
This revision is now accepted and ready to land.Jan 10 2019, 10:58 AM
This revision was automatically updated to reflect the committed changes.