Rework PhoshActivity and PhoshOverview
Currently PhoshOverview
manually manages the relationship between PhoshToplevel
(a representation of xdg-foreign-toplevel) and PhoshActivity
(a display-only widget with an activity card), by tracking them with g_object_{set/get}_data}
, requesting and passing window thumbnails etc.
This is far from ideal - PhoshOverview
is already quite a messy thing having multiple responsibilities. However, the most obvious way of fixing that - letting PhoshActivity
consume and handle PhoshToplevel
by itself - isn't good either, since 1:1 relationship between PhoshActivity
and PhoshToplevel
is very temporary (see #324; and potentially other things in the future like splash screens or suspended activites).
We need a new entity responsible for representing and managing a single activity. I'd propose renaming current PhoshActivity
into PhoshActivityCard
, and creating a new PhoshActivity
class that would then handle any actual logic by itself, allowing PhoshOverview
to not care about activity implementation details.
This way, PhoshActivityCard
could just represent the state of any PhoshActivity
given to it, regardless of its internal implementation, freeing PhoshOverview
from unwanted responsibilities. This also opens a path for compositing multiple thumbnails onto a single activity, as needed for window stacks (#324), without cluttering classes that shouldn't need to care about it, since this whole logic could be then properly contained in implementation of PhoshActivity
.
This may also touch PhoshThumbnail
, since currently it sits in a rather awkward place between Overview, Toplevel and Activity.