UI to manage non-active containments
Closed, ResolvedPublic

Description

Currently it is impossible to manage containments that are not on an active screen. They can't be recovered to an active screen or deleted.

Our multi screen handling also isn't very robust. It tries to be clever and map connectors, but it is not a problem with a strict single defined answer.

We also lack a good import/export of containments. It's tied into look and feel, we would be better off splitting that out.

Proposal

Management:

For a given selected containment one can:

  • remove a dead containment
  • export/import a containment
  • change the screen/activity assignments

Better screen handling:

Containments are as follows:.

Screen becomes string based with one of following options:

Primary, Secondary, Tertiary, "E-DP1", "HDMI-0"
i.e either an integer index, or a QScreen::name

Activity is string based with one of the following options:
Any", "My Activity1", "My activity 2"
(stored as regular activity UUIDs using the null activity ID for all activities, maybe you can choose 0-N activities?)

This gets presented in the UI. We can put some marker next to the current activity/screen used (two screens will match, by index or by ID)

UI

This would be accessible through the burger menu in edit mode

Implementation in PlasmaShell

On every screen or activity change the mapping is re-evaluated and changes are applied.

The algorithm is as follows:

foreach possible containment we check *in the used-specified order* if it matches any situation of corresponding screen + activity
For desktops we apply the first containment that matches per screen, for panels we apply all matching containments

if any desktops remain unpopulated a new desktop containment is created with the following corresponding characteristics:

  • screen = ScreenN (index based)
  • activity = currentActivity

No new panels are ever created from this situation

It is appended (i.e at the bottom) of the list of possible containments.

Rationale

By allowing the user to choose the order we get the maximum flexibiliity for covering all possible cases. It also very explicit meaning we don't need to worry too much about error cases - if someone creates two desktops that are both on screen 2 and activity 2, then it is determined which one will load.

The default case is also kept relatively simple, if one doesn't open this screen they will get something sensible as all their containments will be screen-index based and "just-work" for some definition of that

Specific changes

ScreenPool takes on the job of QGuiApplication for the puposes of having an ordered list of screens and signifying changes.
It also performs detection of overlapping desktops internally and removes all inside ScreenPool (current logic is in ShellCorona)
ScreenPool drops the mapping

int Containment::screen() gets deprecated, it was a mess anyway

It gains a QString Containment::screenId this is the configured screen string in the format above
To get the current screen, use the relevant ContainmentView

The main "normal" edit mode view remains untouched and is the default behaviour.

davidedmundson updated the task description. (Show Details)
ngraham added a subscriber: ngraham.Apr 7 2021, 2:09 PM

Overall I like the idea. In terms of the UI, could we maybe have a grid view instead of a table view? That way each one could display a graphical representation of what that containment actually... contains!

Would this be implemented as a new System Settings KCM? Or something in the KScreen KCM? Or something else?

ndavis added a subscriber: ndavis.Apr 7 2021, 5:08 PM

could we maybe have a grid view instead of a table view? That way each one could display a graphical representation of what that containment actually... contains!

Doing full previews is *considerably* harder, one possible halfway option we might have is just showing the correct wallpaper assuming it's an image. We have code for that already.
As for a grid, I think it would be important to show a concept of order; as then we can be explicit to a user what happens in the case of multiple containment matches; that's less intuitive with a list.

Would this be implemented as a new System Settings KCM?

What I had in mind was inside plasmashell process, accessible via some button in edit mode.

Correct wallpaper is probably good enough.

Showing an ordered list implies one of the following to the user:

  1. "This is the actual spatial order that these things are in"
  2. "This is a priority queue showing which thing will be picked first"

As long as we're clear on which one we're doing, we avoid mixing metaphors, and we clearly communicate this to the user, I think we're good.

Personally I think System Settings is the place where people are going to look, since the scope of this feature feels like it's "all of Plasma" which is a close overlap with the scope of System Settings. But I won't die on that hill. :)

mart added a subscriber: mart.Apr 8 2021, 5:43 PM

If the screen() is the connector name, what happens wrt the "primary" screen? if i attach an external screen to laptop, and the external screen is set as primary, i expect desktop and panels to migrate to the new primary screen, therefore swapping their associated connector

Do we even have a concept of "primary" at all on Wayland?

mart added a comment.Apr 8 2021, 6:02 PM

The concern i have abut the whole thing is how the configuration is disconnected from the actual desktop and panels (also having panel1/panel2 and what not that can't give you any idea what it is). the only reason this is necessary at all, is that some may be invisible due to a disconnected screen.

Taking a step back, the most intuitive way would be for that case having a view that shows a screenshot of desktop and panels of what was in that screen the last time it was turned off and simple ways to maybe delete them, send panels to an existing screen, swap desktop with one in a screen and what not.

this doesn't need a listview or gridview of text, but pretty much a single view of the disconnected screens (and imo, only the disconnected ones)

mart added a comment.EditedApr 8 2021, 6:02 PM

Do we even have a concept of "primary" at all on Wayland?

wayland doesn't know, kscreen fakes it

mart added a comment.Apr 8 2021, 6:05 PM

could we maybe have a grid view instead of a table view? That way each one could display a graphical representation of what that containment actually... contains!

Doing full previews is *considerably* harder, one possible halfway option we might have is just showing the correct wallpaper assuming it's an image. We have code for that already.

if you do only the orphan ones, you can do a render to image of the containments just before the view gets killed, and that will be a faitful-ish representation as since the containment is not "working" it won't have changed since the last screenshot

mart added a comment.Apr 8 2021, 6:32 PM

This is a rough idea:

Doesn't consider activities yet, but i'll do something tomorrow

In T14346#253422, @mart wrote:

The concern i have abut the whole thing is how the configuration is disconnected from the actual desktop and panels (also having panel1/panel2 and what not that can't give you any idea what it is). the only reason this is necessary at all, is that some may be invisible due to a disconnected screen.

Taking a step back, the most intuitive way would be for that case having a view that shows a screenshot of desktop and panels of what was in that screen the last time it was turned off and simple ways to maybe delete them, send panels to an existing screen, swap desktop with one in a screen and what not.

this doesn't need a listview or gridview of text, but pretty much a single view of the disconnected screens (and imo, only the disconnected ones)

One of the use cases I thought we wanted to handle was being able to easily clone a containment onto another one. Would your idea support that?

mart added a comment.Apr 9 2021, 8:29 AM

One of the use cases I thought we wanted to handle was being able to easily clone a containment onto another one. Would your idea support that?

adding a "copy to/from current" buttons as well i guess

mart added a comment.Apr 9 2021, 1:02 PM

Attempt with activities

crossi added a subscriber: crossi.Sep 22 2021, 9:35 AM
ngraham closed this task as Resolved.Jan 28 2022, 3:07 AM
ngraham moved this task from Work in Progress to Done on the Plasma board.
ngraham claimed this task.

Oh hey, we ended up with pretty much just that in Plasma 5.25. :)