[Overview] Don't dim window previews
Undim windows when going to the overview and restore their state when leaving. https://bugzilla.gnome.org/show_bug.cgi?id=629371
This commit is contained in:
parent
907dd4381b
commit
45dcfa9a70
@ -91,6 +91,8 @@ WindowManager.prototype = {
|
|||||||
this._mapping = [];
|
this._mapping = [];
|
||||||
this._destroying = [];
|
this._destroying = [];
|
||||||
|
|
||||||
|
this._dimmedWindows = [];
|
||||||
|
|
||||||
this._switchData = null;
|
this._switchData = null;
|
||||||
this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
|
this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
|
||||||
this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
|
this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
|
||||||
@ -114,6 +116,15 @@ WindowManager.prototype = {
|
|||||||
this.setKeybindingHandler('switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher));
|
this.setKeybindingHandler('switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||||
this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
|
this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||||
this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher));
|
this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher));
|
||||||
|
|
||||||
|
Main.overview.connect('showing', Lang.bind(this, function() {
|
||||||
|
for (let i = 0; i < this._dimmedWindows.length; i++)
|
||||||
|
this._undimParentWindow(this._dimmedWindows[i], true);
|
||||||
|
}));
|
||||||
|
Main.overview.connect('hiding', Lang.bind(this, function() {
|
||||||
|
for (let i = 0; i < this._dimmedWindows.length; i++)
|
||||||
|
this._dimParentWindow(this._dimmedWindows[i], true);
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
setKeybindingHandler: function(keybinding, handler){
|
setKeybindingHandler: function(keybinding, handler){
|
||||||
@ -221,47 +232,50 @@ WindowManager.prototype = {
|
|||||||
return count != 0;
|
return count != 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
_dimParentWindow: function(actor) {
|
_dimParentWindow: function(actor, animate) {
|
||||||
let meta = actor.get_meta_window();
|
let meta = actor.get_meta_window();
|
||||||
let parent = meta.get_transient_for();
|
let parent = meta.get_transient_for();
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
let parentActor = parent.get_compositor_private();
|
let parentActor = parent.get_compositor_private();
|
||||||
if (!parentActor)
|
if (!parentActor || this._parentHasOtherAttachedDialog(parent, meta))
|
||||||
return;
|
return;
|
||||||
if (!this._parentHasOtherAttachedDialog(parent, meta)) {
|
|
||||||
let texture = parentActor.get_texture();
|
let texture = parentActor.get_texture();
|
||||||
|
if (animate)
|
||||||
Tweener.addTween(getWindowDimmer(texture),
|
Tweener.addTween(getWindowDimmer(texture),
|
||||||
{ dimFraction: 1.0,
|
{ dimFraction: 1.0,
|
||||||
time: DIM_TIME,
|
time: DIM_TIME,
|
||||||
transition: 'linear'
|
transition: 'linear'
|
||||||
});
|
});
|
||||||
}
|
else
|
||||||
|
getWindowDimmer(texture).dimFraction = 1.0;
|
||||||
},
|
},
|
||||||
|
|
||||||
_undimParentWindow: function(actor) {
|
_undimParentWindow: function(actor, animate) {
|
||||||
let meta = actor.get_meta_window();
|
let meta = actor.get_meta_window();
|
||||||
let parent = meta.get_transient_for();
|
let parent = meta.get_transient_for();
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
let parentActor = parent.get_compositor_private();
|
let parentActor = parent.get_compositor_private();
|
||||||
if (!parentActor)
|
if (!parentActor || this._parentHasOtherAttachedDialog(parent, meta))
|
||||||
return;
|
return;
|
||||||
if (!this._parentHasOtherAttachedDialog(parent, meta)) {
|
|
||||||
let texture = parentActor.get_texture();
|
let texture = parentActor.get_texture();
|
||||||
|
if (animate)
|
||||||
Tweener.addTween(getWindowDimmer(texture),
|
Tweener.addTween(getWindowDimmer(texture),
|
||||||
{ dimFraction: 0.0,
|
{ dimFraction: 0.0,
|
||||||
time: UNDIM_TIME,
|
time: UNDIM_TIME,
|
||||||
transition: 'linear'
|
transition: 'linear'
|
||||||
});
|
});
|
||||||
}
|
else
|
||||||
|
getWindowDimmer(texture).dimFraction = 0.0;
|
||||||
},
|
},
|
||||||
|
|
||||||
_mapWindow : function(shellwm, actor) {
|
_mapWindow : function(shellwm, actor) {
|
||||||
if (this._shouldAnimate() && actor
|
if (actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG
|
||||||
&& actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG
|
|
||||||
&& Meta.prefs_get_attach_modal_dialogs()
|
&& Meta.prefs_get_attach_modal_dialogs()
|
||||||
&& actor.get_meta_window().get_transient_for()) {
|
&& actor.get_meta_window().get_transient_for()) {
|
||||||
|
this._dimmedWindows.push(actor);
|
||||||
|
if (this._shouldAnimate()) {
|
||||||
actor.set_scale(1.0, 0.0);
|
actor.set_scale(1.0, 0.0);
|
||||||
actor.show();
|
actor.show();
|
||||||
this._mapping.push(actor);
|
this._mapping.push(actor);
|
||||||
@ -277,7 +291,10 @@ WindowManager.prototype = {
|
|||||||
onOverwriteScope: this,
|
onOverwriteScope: this,
|
||||||
onOverwriteParams: [shellwm, actor]
|
onOverwriteParams: [shellwm, actor]
|
||||||
});
|
});
|
||||||
this._dimParentWindow(actor);
|
this._dimParentWindow(actor, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
shellwm.completed_map(actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this._shouldAnimate(actor)) {
|
if (!this._shouldAnimate(actor)) {
|
||||||
@ -324,11 +341,15 @@ WindowManager.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_destroyWindow : function(shellwm, actor) {
|
_destroyWindow : function(shellwm, actor) {
|
||||||
while (actor && this._shouldAnimate()
|
while (actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG
|
||||||
&& actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG
|
|
||||||
&& actor.get_meta_window().get_transient_for()) {
|
&& actor.get_meta_window().get_transient_for()) {
|
||||||
this._undimParentWindow(actor);
|
if (!Main.overview.visible)
|
||||||
if (!Meta.prefs_get_attach_modal_dialogs())
|
this._undimParentWindow(actor, true);
|
||||||
|
this._dimmedWindows = this._dimmedWindows.filter(function(win) {
|
||||||
|
return win != actor;
|
||||||
|
});
|
||||||
|
if (!Meta.prefs_get_attach_modal_dialogs()
|
||||||
|
|| !this._shouldAnimate())
|
||||||
break;
|
break;
|
||||||
actor.set_scale(1.0, 1.0);
|
actor.set_scale(1.0, 1.0);
|
||||||
actor.show();
|
actor.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user