Compare commits
2 Commits
citadel
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
|
c8ea06be26 | ||
|
d734b117e0 |
@ -110,6 +110,7 @@ var WindowClone = new Lang.Class({
|
|||||||
this.metaWindow = realWindow.meta_window;
|
this.metaWindow = realWindow.meta_window;
|
||||||
this.metaWindow._delegate = this;
|
this.metaWindow._delegate = this;
|
||||||
this._workspace = workspace;
|
this._workspace = workspace;
|
||||||
|
this._attachedDialogs = [];
|
||||||
|
|
||||||
this._windowClone = new Clutter.Clone({ source: realWindow });
|
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
|
||||||
@ -208,6 +209,12 @@ var WindowClone = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
addDialog(win) {
|
addDialog(win) {
|
||||||
|
let realWin = win.get_compositor_private();
|
||||||
|
if (this._attachedDialogs.includes(realWin))
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._attachedDialogs.push(realWin);
|
||||||
|
|
||||||
let parent = win.get_transient_for();
|
let parent = win.get_transient_for();
|
||||||
while (parent.is_attached_dialog())
|
while (parent.is_attached_dialog())
|
||||||
parent = parent.get_transient_for();
|
parent = parent.get_transient_for();
|
||||||
@ -225,7 +232,7 @@ var WindowClone = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
hasAttachedDialogs() {
|
hasAttachedDialogs() {
|
||||||
return this.actor.get_n_children() > 1;
|
return this._attachedDialogs.length > 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
_doAddAttachedDialog(metaWin, realWin) {
|
_doAddAttachedDialog(metaWin, realWin) {
|
||||||
@ -235,6 +242,9 @@ var WindowClone = new Lang.Class({
|
|||||||
clone._posChangedId = metaWin.connect('position-changed',
|
clone._posChangedId = metaWin.connect('position-changed',
|
||||||
this._onMetaWindowSizeChanged.bind(this));
|
this._onMetaWindowSizeChanged.bind(this));
|
||||||
clone._destroyId = realWin.connect('destroy', () => {
|
clone._destroyId = realWin.connect('destroy', () => {
|
||||||
|
let idx = this._attachedDialogs.indexOf(realWin);
|
||||||
|
this._attachedDialogs.splice(idx, 1);
|
||||||
|
|
||||||
clone.destroy();
|
clone.destroy();
|
||||||
|
|
||||||
this._onMetaWindowSizeChanged();
|
this._onMetaWindowSizeChanged();
|
||||||
|
@ -151,7 +151,7 @@ var WindowClone = new Lang.Class({
|
|||||||
|
|
||||||
_doAddAttachedDialog(metaDialog, realDialog) {
|
_doAddAttachedDialog(metaDialog, realDialog) {
|
||||||
let clone = new Clutter.Clone({ source: realDialog });
|
let clone = new Clutter.Clone({ source: realDialog });
|
||||||
this._updateDialogPosition(realDialog, clone);
|
this._updateDialogPosition(metaDialog, clone);
|
||||||
|
|
||||||
clone._updateId = realDialog.connect('notify::position', dialog => {
|
clone._updateId = realDialog.connect('notify::position', dialog => {
|
||||||
this._updateDialogPosition(dialog, clone);
|
this._updateDialogPosition(dialog, clone);
|
||||||
@ -162,8 +162,7 @@ var WindowClone = new Lang.Class({
|
|||||||
this.actor.add_child(clone);
|
this.actor.add_child(clone);
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateDialogPosition(realDialog, cloneDialog) {
|
_updateDialogPosition(metaDialog, cloneDialog) {
|
||||||
let metaDialog = realDialog.meta_window;
|
|
||||||
let dialogRect = metaDialog.get_frame_rect();
|
let dialogRect = metaDialog.get_frame_rect();
|
||||||
let rect = this.metaWindow.get_frame_rect();
|
let rect = this.metaWindow.get_frame_rect();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user