After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756753 - wayland: show subsurfaces in window thumbnails
wayland: show subsurfaces in window thumbnails
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: overview
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 757080 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-17 16:27 UTC by Carlos Garnacho
Modified: 2021-07-05 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
compositor: Add meta_window_actor_get_shape_bounds() (5.28 KB, patch)
2015-10-17 16:28 UTC, Carlos Garnacho
needs-work Details | Review
workspace: Show subsurfaces in workspace overview (2.97 KB, patch)
2015-10-17 16:28 UTC, Carlos Garnacho
reviewed Details | Review

Description Carlos Garnacho 2015-10-17 16:27:08 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).
Comment 1 Carlos Garnacho 2015-10-17 16:28:29 UTC
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.
Comment 2 Carlos Garnacho 2015-10-17 16:28:52 UTC
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.
Comment 3 Giovanni Campagna 2015-10-19 18:25:53 UTC
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.
Comment 4 Giovanni Campagna 2015-10-26 18:00:13 UTC
*** Bug 757080 has been marked as a duplicate of this bug. ***
Comment 5 Rui Matos 2017-02-02 13:16:15 UTC
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.
Comment 6 Rui Matos 2017-02-02 13:18:03 UTC
Review of attachment 313543 [details] [review]:

This looks fine but it should fix altTab.js too. Either here or in a separate patch.
Comment 7 Carlos Garnacho 2017-02-02 13:42:47 UTC
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.
Comment 8 GNOME Infrastructure Team 2021-07-05 14:44:02 UTC
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.