D17543: [Dialog] Don't alter mainItem's visibility

Kai Uwe Broulik noreply at phabricator.kde.org
Wed Dec 12 14:44:30 GMT 2018


broulik created this revision.
broulik added reviewers: Plasma, mart.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
broulik requested review of this revision.

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

TEST PLAN
  Needs D17542 <https://phabricator.kde.org/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.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D17543

AFFECTED FILES
  src/plasmaquick/dialog.cpp

To: broulik, #plasma, mart
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181212/16f5570b/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list