MacOS-style minimize window behavior
Open, WishlistPublic

Description

I would like to see an optional feature that minimizes windows in the style of the MacOS dock.

In the current Latte Dock implementation, open windows (whether visible or minimized) are grouped together in "tasks" with their corresponding program launcher (1). Clicking on these tasks will either open the program, focus on the current instance's window, or "present" the available open windows if there are more than one (2).

The feature I'm describing would keep the same behavior for all windows except those that are minimized. Minimized windows would instead each be given their own tasks in the right side of the dock. A screenshot of this behavior in MacOS is provided below.

  1. I'm not sure if task is the appropriate designation for the entity I'm describing. I mean shortcut or icon
  2. i.e. the Present Windows behavior of Plasma
shanepearlman triaged this task as Wishlist priority.
shanepearlman added a comment.EditedMar 26 2019, 11:53 PM

In the MacOS dock, the minimized windows are displayed in the dock as a miniature screenshot or render of the application window contents. The screenshot is overlaid with a small version of the application icon in the bottom right corner.

zzag added a subscriber: zzag.Mar 28 2019, 11:28 AM

sorry for delaying my response... full Latte matters this week..

So let me describe you the Latte context and why you dont need at all to use the Latte codebase for this :)

Latte has the following structure for folders:

app(c++): application executable to be responsible for everything actually, more importantly for the Latte::Views (docks/panels) placement,loading/unloading,universalsettings, globalshortcuts etc.
plasmoid (qml): it is the Latte Tasks plasmoid which can be added also in plasma desktop and plasma panels
containment (qml): responsible to load/unload applets visuals and inform Latte::Views concerning the mask needed / animations etc. etc.

so, my opinion is that what you want is a plasma applet that uses only qml and shows only previews for minimized windows irrelevant of Latte or plasma panels.

In Latte code, the responsible part is called plasmoid

I will tell you what steps I would try and why I dont know if this has any meaning for the time being:

  1. Create a simple plasma applet that shows ungrouped tasks (with no launchers):

e.g. https://github.com/KDE/plasma-desktop/blob/master/applets/taskmanager/package/contents/ui/main.qml
e.g. https://phabricator.kde.org/source/latte-dock/browse/master/plasmoid/package/contents/ui/main.qml

  1. all [1] applets are using TaskManager.TasksModel in order to have a tasks model in their qml code: https://github.com/KDE/plasma-workspace/blob/master/libtaskmanager/tasksmodel.h
  1. after [2] you can try to draw the previews for shown windows instead of the task icon, e.g. https://github.com/KDE/plasma-desktop/blob/master/applets/taskmanager/package/contents/ui/ToolTipInstance.qml#L187
  1. after [3] you can try to draw previews only for minimized windows, for example by setting TasksModel variable filterNotMinimizedWindows: true

BUT under X11 you should know that this is not possible for minimized windows!!!

Only way you can have previews for all windows including minimized is to enable that option, plasma systemsettings->Display->Compositor->Keep Window Thumbnails:Always but that option under X11 breaks the minimized flag for all windows, meaning that no taskmanager can understand afterwards which windows are minimized or not

for wayland I dont know if previews from taskmanagers are supported yet for Plasma environment.
Last time I checked they were not supported, meaning that the taskmanager could not create previews in its popup tooltips BUT I might be wrong if that feature was added in last versions.