Fix popup dialogs/tooltips for Plasma panels vs. Latte docks
Open, Needs TriagePublic

Description

Plasma panels & Latte docks currently have different expectations or wishes about placement of & frames around popups.

R242:6aedda94b27a3ac60176dce960484af3f7787c07 added a heuristic valid at that time to detect a Plasma panel (no mask set), but this heuristic no longer applies due to R120:65367689ea5e6443eeea36398dda0bd48503e1bc (which now sets a mask matching the current Plasma theme). Already before there was an alternative patch proposed (as the original patch/heuristic already has not worked for non-compositing mode): D15821

Citing @mvourlakos :
"
That creates two questions:

  1. How Plasma popups should be placed correctly when the window sets a mask?
  2. Will there be any way for Plasma popups to be placed independently of Window geometry OR Window:mask() ? For example based on the item that triggered the popup event

"

Another issue are frames around popups, where Latte dock (edit: )always in case of macOS dock style would prefer full-framed popup windows, while Plasma currently tries to remove borders on sides touching screen edge or panel edges. Some unapplied patch based on above mentioned heuristics is D15814.

Personally, I wonder if there is a conceptual difference between "Plasma panels" and "Latte docks" from a user POV. To me both are principally the same, only allowing different kind of visual gimmicks for user interaction and item layout. In a perfect world Latte would be merged into Plasma for some panel v2.0 option :)

@kossebau just to add some info, about your comment:

"where Latte dock would prefer always full-framed windows,"...

this is not accurate, Latte since v0.7.x provides Latte panels that can behave and look exactly like plasma panels so they expect from their popups similar behavior like in plasma panels.
So Latte now offers both a dock and a panel option in order to choose....

In the video you can see a top Latte panel and a bottom Latte dock... under Latte codebase these are called just Latte::View(s)

kossebau updated the task description. (Show Details)May 4 2019, 3:53 PM
kossebau updated the task description. (Show Details)May 4 2019, 4:04 PM

@kossebau just to add some info, about your comment:

"where Latte dock would prefer always full-framed windows,"...

this is not accurate, Latte since v0.7.x provides Latte panels that can behave and look exactly like plasma panels so they expect from their popups similar behavior like in plasma panels.
So Latte now offers both a dock and a panel option in order to choose....

Updated text (also added reference to D15821).

So, if your aunt or uncle asks you what the difference between a dock and a panel is, the answer is?
A "panel" is a boxed collection of items, while a "docker" is a open, box-less, something? :) Can you give a list of differences both visually and interaction pattern wise?
Still trying to tell myself if this is more a visual difference or also something functional different, and how this might be mapped onto supporting technology. (sorry, never got around to try Latte, as I am used to and okay enough with my plasma-panel-based workflow and no time/energy left to try something new :) )).

@mvourlakos I wonder if a fix would be to not have the Dialog class itself try to guess how it should be positioned based on hard-coded conditions, but rather have the code creating the popups define the behaviour. Or have the Dialog (sub-)classes query the environment for some policy, e.g. by searching for the cointainment and have it tell what to do.

In Latte you can embed Plasma widgets, correct? So how should their tooltips or popup dialogs behave differently in "dock" and "panel" mode, or compared to Plasma?

mvourlakos added a comment.EditedMay 4 2019, 5:16 PM

@kossebau

So, if your aunt or uncle asks you what the difference between a dock and a panel is, the answer is?

Difficult question... :)
Everyone has a different opinion in the subject. By implementing both (meaning dock and panel) I have
ended in the following simple rule from USER point of view:

Dock: All applets and tasks are in SQUARE form
Panel: Applets and tasks can be in any form SQUARE or RECTANGULAR

The thing is that any other discussion concerning parabolic effects/transparency etc... are just visual differences without
any importance. In Latte both Docks and Panels are just using the same codebase and it is only a matter of different
visual OR behavior settings that identify what is which

In Latte you can embed Plasma widgets, correct?

of course, you can add any plasma widget you want but the parabolic effect will work only if the applet is SQUARE or SMALLER,

but rather have the code creating the popups define the behaviour

it dont think it would work nice

query the environment for some policy, e.g. by searching for the cointainment that describes the optimal behavior.

This is the best solution in my opinion AND it should not be just a setting at the containment configuration but it should
give the freedom to be changed dynamically.
I think that having Behaviors in the containment is the best approach:

e.g. PopUpPlacement = Window | Mask | ParentItem
___ PopUpBorders = All | Panel (current)

In Dock Mode most commonly, the PopUps should have all borders and they should be placed according to the ParentItem that trigerred the show event,

In Panel Mode most commonly, the PopUps should NOT have the border that is touching the panel and they should be positioned based on the Window OR based on
the mask() (this is because of your commit)

Even with current implementation Plasma fails in some cases:
In case the panel background is competely transparent or has an exotic layout such as https://store.kde.org/p/1295310/
then the PopUps should behave like in Dock mode and not with the current behavior

Concerning tooltips I can not think of any difference but I might be missing something.

What do you mean exactly by "RECTANGULATED" and "ORTHOGONAL"? Can you give some examples?

What do you mean exactly by "RECTANGULATED" and "ORTHOGONAL"? Can you give some examples?

My mistake!!! my english :)

I mean
RECTANGULATED -> SQUARE (https://en.wiktionary.org/wiki/square)
ORTHOGONAL -> RECTANGULAR (https://en.wikipedia.org/wiki/Rectangle)