Show the plasmoid context menu on long tap
AbandonedPublic

Authored by apol on Mar 25 2019, 3:16 PM.

Details

Reviewers
mart
Group Reviewers
Plasma
Frameworks
Summary

Also expose a method to show the context menu so plasmoids that implement a MouseArea that will eat the event can display it too.

Test Plan

Invoked several context menus with my fingertip

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10178
Build 10196: arc lint + arc unit
apol created this revision.Mar 25 2019, 3:16 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 25 2019, 3:16 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
apol requested review of this revision.Mar 25 2019, 3:16 PM
apol updated this revision to Diff 54777.Mar 25 2019, 3:34 PM

polish

[testing with D20043] The context menu that is shown on press-and-hold seems to differ from the one shown when right-clicked:

Right-clicked:

Pressed-and-held:

And the press-and-hold version opens the Alternatives panel in the wrong place, with the wrong assortment of items:

apol updated this revision to Diff 54901.Mar 26 2019, 11:17 PM

Convert to the containment coordinate system, otherwise we show the context menu of the applet at 0,0

Much better now, thanks! I'll let a real Plasma person do the final code review. :)

mart added a subscriber: mart.EditedMar 27 2019, 2:27 PM

what happens on long tap on the desktop?
this introduces different behavior between long tap on panel and desktop
should it go in a sort of config mode instead?

mart requested changes to this revision.Mar 27 2019, 3:10 PM

for now we could go with this...
can you make it work *only* when the applet's formfactor is horizontal or vertical?
so this codepath wouldn't touch the desktop case at all

This revision now requires changes to proceed.Mar 27 2019, 3:10 PM

Don't we want long-press-for-context-menu when using a touchscreen on the desktop?

mart added a comment.EditedMar 27 2019, 4:27 PM

Don't we want long-press-for-context-menu when using a touchscreen on the desktop?

this patch is not "on desktop specific"
also, in the desktop area, long press always was select/move for plasmoids. if now it would open the context menu, there would be no way at all to move them around anymore
and in general i think on touchscreen there are very few places (tough some definitely are) where is acceptable to open a context menu, it's just not what the pattern ended up being

apol abandoned this revision.Apr 9 2019, 1:08 AM

We discussed it and decided long tap is not the way to go, will have to find alternative ways to access the options on the context menu on a case-by-case basis.

That seems... quite sub-optimal to me.

Is all of this to preserve press-and-hold for moving widgets? Is there a centralized place for this discussion? If not I can create a Phab task for it.

apol added a comment.Apr 9 2019, 8:41 PM

That seems... quite sub-optimal to me.

Is all of this to preserve press-and-hold for moving widgets? Is there a centralized place for this discussion? If not I can create a Phab task for it.

no, there isn't. If you can coordinate it through a phabricator task, I would really appreciate it.

In D20042#446976, @apol wrote:

That seems... quite sub-optimal to me.

Is all of this to preserve press-and-hold for moving widgets? Is there a centralized place for this discussion? If not I can create a Phab task for it.

no, there isn't. If you can coordinate it through a phabricator task, I would really appreciate it.

Done, see T10783: Right-click on touch.