Compare commits
3 Commits
citadel
...
gbsneto/co
Author | SHA1 | Date | |
---|---|---|---|
|
d6345a5c8b | ||
|
628b34e96f | ||
|
5743b52ec8 |
@ -28,14 +28,20 @@ var AppIconMode = {
|
|||||||
function _createWindowClone(window, size) {
|
function _createWindowClone(window, size) {
|
||||||
let [width, height] = window.get_size();
|
let [width, height] = window.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: window,
|
|
||||||
width: width * scale,
|
let cloneWidth = size;
|
||||||
height: height * scale,
|
let cloneHeight = size;
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
if (width > height)
|
||||||
// usual hack for the usual bug in ClutterBinLayout...
|
cloneHeight = size * (height / width);
|
||||||
x_expand: true,
|
else
|
||||||
y_expand: true });
|
cloneWidth = size * (width / height);
|
||||||
|
|
||||||
|
return new Clutter.Actor({
|
||||||
|
content: window.content,
|
||||||
|
width: cloneWidth,
|
||||||
|
height: cloneHeight,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWindows(workspace) {
|
function getWindows(workspace) {
|
||||||
@ -411,7 +417,7 @@ class CyclerHighlight extends St.Widget {
|
|||||||
super._init({ layout_manager: new Clutter.BinLayout() });
|
super._init({ layout_manager: new Clutter.BinLayout() });
|
||||||
this._window = null;
|
this._window = null;
|
||||||
|
|
||||||
this._clone = new Clutter.Clone();
|
this._clone = new Clutter.Actor();
|
||||||
this.add_actor(this._clone);
|
this.add_actor(this._clone);
|
||||||
|
|
||||||
this._highlight = new St.Widget({ style_class: 'cycler-highlight' });
|
this._highlight = new St.Widget({ style_class: 'cycler-highlight' });
|
||||||
@ -433,8 +439,8 @@ class CyclerHighlight extends St.Widget {
|
|||||||
|
|
||||||
this._window = w;
|
this._window = w;
|
||||||
|
|
||||||
if (this._clone.source)
|
if (this._clone.content)
|
||||||
this._clone.source.sync_visibility();
|
this._clone.content.window_actor.sync_visibility();
|
||||||
|
|
||||||
let windowActor = this._window
|
let windowActor = this._window
|
||||||
? this._window.get_compositor_private() : null;
|
? this._window.get_compositor_private() : null;
|
||||||
@ -442,7 +448,7 @@ class CyclerHighlight extends St.Widget {
|
|||||||
if (windowActor)
|
if (windowActor)
|
||||||
windowActor.hide();
|
windowActor.hide();
|
||||||
|
|
||||||
this._clone.source = windowActor;
|
this._clone.content = windowActor.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onAllocationChanged() {
|
_onAllocationChanged() {
|
||||||
|
@ -400,8 +400,12 @@ var Overview = class {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
let window = windows[0];
|
let window = windows[0];
|
||||||
let clone = new Clutter.Clone({ source: window,
|
let clone = new Clutter.Actor({
|
||||||
x: window.x, y: window.y });
|
source: window.content,
|
||||||
|
request_mode: Clutter.RequestMode.CONTENT_SIZE,
|
||||||
|
x: window.x,
|
||||||
|
y: window.y,
|
||||||
|
});
|
||||||
clone.source.connect('destroy', () => {
|
clone.source.connect('destroy', () => {
|
||||||
clone.destroy();
|
clone.destroy();
|
||||||
});
|
});
|
||||||
|
@ -84,7 +84,7 @@ class WindowCloneLayout extends Clutter.LayoutManager {
|
|||||||
if (child == container._windowClone)
|
if (child == container._windowClone)
|
||||||
realWindow = container.realWindow;
|
realWindow = container.realWindow;
|
||||||
else
|
else
|
||||||
realWindow = child.source;
|
realWindow = child.content.window_actor;
|
||||||
|
|
||||||
child.allocate(this._makeBoxForWindow(realWindow.meta_window),
|
child.allocate(this._makeBoxForWindow(realWindow.meta_window),
|
||||||
flags);
|
flags);
|
||||||
@ -110,7 +110,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
this.metaWindow._delegate = this;
|
this.metaWindow._delegate = this;
|
||||||
this._workspace = workspace;
|
this._workspace = workspace;
|
||||||
|
|
||||||
this._windowClone = new Clutter.Clone({ source: realWindow });
|
this._windowClone = new Clutter.Actor({ content: realWindow.content });
|
||||||
// We expect this to be used for all interaction rather than
|
// We expect this 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
|
||||||
@ -197,7 +197,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
// Delete all windows, starting from the bottom-most (most-modal) one
|
// Delete all windows, starting from the bottom-most (most-modal) one
|
||||||
let windows = this.get_children();
|
let windows = this.get_children();
|
||||||
for (let i = windows.length - 1; i >= 1; i--) {
|
for (let i = windows.length - 1; i >= 1; i--) {
|
||||||
let realWindow = windows[i].source;
|
let realWindow = windows[i].content.window_actor;
|
||||||
let metaWindow = realWindow.meta_window;
|
let metaWindow = realWindow.meta_window;
|
||||||
|
|
||||||
metaWindow.delete(global.get_current_time());
|
metaWindow.delete(global.get_current_time());
|
||||||
@ -229,7 +229,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_doAddAttachedDialog(metaWin, realWin) {
|
_doAddAttachedDialog(metaWin, realWin) {
|
||||||
let clone = new Clutter.Clone({ source: realWin });
|
let clone = new Clutter.Actor({ content: realWin.content });
|
||||||
clone._sizeChangedId = metaWin.connect('size-changed',
|
clone._sizeChangedId = metaWin.connect('size-changed',
|
||||||
this._onMetaWindowSizeChanged.bind(this));
|
this._onMetaWindowSizeChanged.bind(this));
|
||||||
clone._posChangedId = metaWin.connect('position-changed',
|
clone._posChangedId = metaWin.connect('position-changed',
|
||||||
@ -282,7 +282,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
if (child == this._windowClone)
|
if (child == this._windowClone)
|
||||||
realWindow = this.realWindow;
|
realWindow = this.realWindow;
|
||||||
else
|
else
|
||||||
realWindow = child.source;
|
realWindow = child.content.window_actor;
|
||||||
|
|
||||||
let metaWindow = realWindow.meta_window;
|
let metaWindow = realWindow.meta_window;
|
||||||
rect = rect.union(metaWindow.get_frame_rect());
|
rect = rect.union(metaWindow.get_frame_rect());
|
||||||
@ -327,7 +327,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
if (child == this._windowClone)
|
if (child == this._windowClone)
|
||||||
realWindow = this.realWindow;
|
realWindow = this.realWindow;
|
||||||
else
|
else
|
||||||
realWindow = child.source;
|
realWindow = child.content.window_actor;
|
||||||
|
|
||||||
realWindow.meta_window.disconnect(child._sizeChangedId);
|
realWindow.meta_window.disconnect(child._sizeChangedId);
|
||||||
realWindow.meta_window.disconnect(child._posChangedId);
|
realWindow.meta_window.disconnect(child._posChangedId);
|
||||||
|
@ -53,7 +53,8 @@ var WindowClone = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}, class WindowClone extends Clutter.Actor {
|
}, class WindowClone extends Clutter.Actor {
|
||||||
_init(realWindow) {
|
_init(realWindow) {
|
||||||
let clone = new Clutter.Clone({ source: realWindow });
|
let clone = new Clutter.Actor({ content: realWindow.content,
|
||||||
|
request_mode: Clutter.RequestMode.CONTENT_SIZE });
|
||||||
super._init({
|
super._init({
|
||||||
layout_manager: new PrimaryActorLayout(clone),
|
layout_manager: new PrimaryActorLayout(clone),
|
||||||
reactive: true
|
reactive: true
|
||||||
@ -137,7 +138,8 @@ var WindowClone = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_doAddAttachedDialog(metaDialog, realDialog) {
|
_doAddAttachedDialog(metaDialog, realDialog) {
|
||||||
let clone = new Clutter.Clone({ source: realDialog });
|
let clone = new Clutter.Actor({ content: realDialog.content,
|
||||||
|
request_mode: Clutter.RequestMode.CONTENT_SIZE });
|
||||||
this._updateDialogPosition(realDialog, clone);
|
this._updateDialogPosition(realDialog, clone);
|
||||||
|
|
||||||
clone._updateId = realDialog.connect('notify::position', dialog => {
|
clone._updateId = realDialog.connect('notify::position', dialog => {
|
||||||
@ -163,7 +165,7 @@ var WindowClone = GObject.registerClass({
|
|||||||
|
|
||||||
_disconnectSignals() {
|
_disconnectSignals() {
|
||||||
this.get_children().forEach(child => {
|
this.get_children().forEach(child => {
|
||||||
let realWindow = child.source;
|
let realWindow = child.content.window_actor;
|
||||||
|
|
||||||
realWindow.disconnect(child._updateId);
|
realWindow.disconnect(child._updateId);
|
||||||
realWindow.disconnect(child._destroyId);
|
realWindow.disconnect(child._destroyId);
|
||||||
|
Loading…
Reference in New Issue
Block a user