GNOME Bugzilla – Bug 756753
wayland: show subsurfaces in window thumbnails
Last modified: 2021-07-05 14:44:02 UTC
This is little more than an RFC at the moment, although I'm attaching some patches. Currently on wayland, subsurfaces are not shown on window thumbnails (neither alt-tab, nor overview windows), most noticeable is that this makes totem and gnome-maps empty (as clutter-gtk uses subsurfaces on wayland). Even though, just showing these is not that easy, subsurfaces may overflow at either side of the parent window, and there may actually be a hierarchy of those. The first obvious obstacles are: 1) The shapes may not be rectangular anymore, the overview code accounts for this for the border drawing. The border actor lies in different parts of stacking/hierachy, on top of the window clone. Jimmac suggested on IRC to set a semitransparent background, but given the current actor layout, I find it hard to not make the window clone glowing blue, or put border+close button beneath. 2) Likewise, we can't guarantee anymore that the ClutterClone won't be painting outside of its allocation, the ClutterClone allocation will be proportional to the toplevel, so besides the shape region we need to know the rectangle that the toplevel window is occupying there in order to render and allocate correctly the clones. This also plays odd with the close button, as the corner of the toplevel might not be a corner in the global shape. Maybe we should just render subsurfaces if those fit within the main window area? that'd at least help fix the ugliest cases (eg. totem, gnome-maps).
Created attachment 313542 [details] [review] compositor: Add meta_window_actor_get_shape_bounds() This function returns the bounding box of the union of the window and all its children. It will be useful for the cases we need to know the shape and dimensions of an entire window+subsurfaces hierarchy.
Created attachment 313543 [details] [review] workspace: Show subsurfaces in workspace overview This makes popovers and contents from apps like gnome-maps or totem visible on the overview. The usecase of popovers bring in interesting issues, as the popover subsurface may overflow the parent window on either direction. In order to look somewhat better, a semitransparent background has been set on the hover indication actor.
I should add that the same problems with overview window thumbnails happen with modal dialogs, which are also shown attached on top of the thumbnail. So I would say, just reuse the same code, and the same solution.
*** Bug 757080 has been marked as a duplicate of this bug. ***
Review of attachment 313542 [details] [review]: ::: src/compositor/meta-window-actor.c @@ +646,3 @@ + + /* In the child tree of a MetaWindowActor we've got 3 different kinds + * of children: MetaWindowActors, MetaSurfaceActors and MetaShapedTextures. I think this should be done in a new MetaSurfaceActor vfunc. The X implementation would be trivial since we always have one single MetaSurfaceActorX11 without children (other than the texture). The wayland implementation would do the multiple children bounds union recursively. We wouldn't need to handle MetaWindowActor and MetaShapedTexture at all. @@ +722,3 @@ + bounds->y *= scale; + bounds->width *= scale; + bounds->height *= scale; I don't think this is right since IIUC, at the clutter level coordinates are already in physical pixels. In case I'm wrong about that, then this would need to be done for all MetaSurfaceActorWayland children, not just for the MetaWindowActor's direct child.
Review of attachment 313543 [details] [review]: This looks fine but it should fix altTab.js too. Either here or in a separate patch.
Good timing :). I picked this up again earlier this week too, taking Giovanni's suggestion to put to reuse code I put a common implementation separately in a js/ui/windowClone.js file so it could be used on altTab/workspace/workspaceThumbnail.js. I left some positioning/scaling glitches to sort out though... will attach here ASAP when I fix these.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.