D28719: [Purpose Plugin] Detect cancelling the prompt more reliable

Kai Uwe Broulik noreply at phabricator.kde.org
Fri Apr 10 11:18:47 BST 2020


broulik created this revision.
broulik added reviewers: Plasma, fvogt.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  `aboutToHide` is emitted before an action is triggered and `activeAction()` is the action currently hovered.
  This means we can't properly tell that the prompt got canceled, when hovering an action and then hitting Escape to close the menu.
  This patch sets a property in response to `triggered` and then does a delayed check for that in `aboutToHide`.

TEST PLAN
  Used https://alligator.io/js/web-share-api/ for testing
  
  - Clicked "Share me!" button, got purpose prompt, clicked Email, shared correctly
  - Clicked "Share me!" button, got purpose prompt, clicked outside, canceled correctly
  
  With this patch
  
  - Clicked "Share me!" button, hovered an action, then hit Escape to cancel it. Now cancels properly.
  
  Previously it would effectively break the plugin as it would never reset its pending reply state.

REPOSITORY
  R856 Plasma Browser Integration

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

AFFECTED FILES
  host/purposeplugin.cpp

To: broulik, #plasma, fvogt
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200410/b9e0d19c/attachment.html>


More information about the Plasma-devel mailing list