Make all our window clones use the MetaWindowActor as source

Using a MetaWindowActor's shaped texture as the source for window
clones means that if there are further MetaSurfaceActor children
(e.g. a wayland client using sub-surfaces) they don't get cloned.

This obviously wasn't an issue until wayland clients introduced the
possibility of having multiple MetaSurfaceActors under a
MetaWindowActor but there's no fundamental reason we can't clone the
toplevel actor.

WorkspaceThumbnail.WindowClone is the one class that was already using
the MetaWindowActor instead of the texture although it seems to have
been an unintended change in commit
8b99617513.

https://bugzilla.gnome.org/show_bug.cgi?id=756715
This commit is contained in:
Rui Matos 2017-02-01 19:01:47 +01:00
parent 722bef3d0c
commit c8cb84b533
3 changed files with 4 additions and 5 deletions

View File

@ -33,10 +33,9 @@ const AppIconMode = {
}; };
function _createWindowClone(window, size) { function _createWindowClone(window, size) {
let windowTexture = window.get_texture(); let [width, height] = window.get_size();
let [width, height] = windowTexture.get_size();
let scale = Math.min(1.0, size / width, size / height); let scale = Math.min(1.0, size / width, size / height);
return new Clutter.Clone({ source: windowTexture, return new Clutter.Clone({ source: window,
width: width * scale, width: width * scale,
height: height * scale, height: height * scale,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,

View File

@ -378,7 +378,7 @@ const Overview = new Lang.Class({
return null; return null;
let window = windows[0]; let window = windows[0];
let clone = new Clutter.Clone({ source: window.get_texture(), let clone = new Clutter.Clone({ source: window,
x: window.x, y: window.y }); x: window.x, y: window.y });
clone.source.connect('destroy', Lang.bind(this, function() { clone.source.connect('destroy', Lang.bind(this, function() {
clone.destroy(); clone.destroy();

View File

@ -111,7 +111,7 @@ const WindowClone = new Lang.Class({
this.metaWindow._delegate = this; this.metaWindow._delegate = this;
this._workspace = workspace; this._workspace = workspace;
this._windowClone = new Clutter.Clone({ source: realWindow.get_texture() }); this._windowClone = new Clutter.Clone({ source: realWindow });
// We expect this.actor to be used for all interaction rather than // We expect this.actor to be used for all interaction rather than
// this._windowClone; as the former is reactive and the latter // this._windowClone; as the former is reactive and the latter
// is not, this just works for most cases. However, for DND all // is not, this just works for most cases. However, for DND all