mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Restore opacity peeking window different workspace
This commit is contained in:
2
panel.js
2
panel.js
@@ -1325,7 +1325,7 @@ var Panel = GObject.registerClass({
|
||||
transition: 'easeOutQuad'
|
||||
};
|
||||
|
||||
Utils.animateWindowOpacity(w.get_compositor_private(), tweenOpts);
|
||||
Utils.animateWindowOpacity(w.get_compositor_private(), tweenOpts, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
4
utils.js
4
utils.js
@@ -420,7 +420,7 @@ var activateSiblingWindow = function(windows, direction, startWindow) {
|
||||
}
|
||||
};
|
||||
|
||||
var animateWindowOpacity = function(window, tweenOpts) {
|
||||
var animateWindowOpacity = function(window, tweenOpts, adjustVisibility) {
|
||||
//there currently is a mutter bug with the windowactor opacity, starting with 3.34
|
||||
//https://gitlab.gnome.org/GNOME/mutter/issues/836
|
||||
|
||||
@@ -433,7 +433,7 @@ var animateWindowOpacity = function(window, tweenOpts) {
|
||||
|
||||
window = windowActor.get_first_child() || windowActor;
|
||||
|
||||
if (!windowActor.visible && visible) {
|
||||
if (!windowActor.visible && visible && adjustVisibility) {
|
||||
window.opacity = 0;
|
||||
windowActor.visible = visible;
|
||||
}
|
||||
|
||||
@@ -590,6 +590,11 @@ var PreviewMenu = GObject.registerClass({
|
||||
let focusWindow = () => this._focusMetaWindow(Me.settings.get_int('peek-mode-opacity'), window);
|
||||
|
||||
this._restorePeekedWindowStack();
|
||||
|
||||
if (this._peekedWindow && windowWorkspace != currentWorkspace) {
|
||||
currentWorkspace.list_windows().forEach(mw => this.animateWindowOpacity(mw, null, 255))
|
||||
}
|
||||
|
||||
this._peekedWindow = window;
|
||||
|
||||
if (currentWorkspace != windowWorkspace) {
|
||||
@@ -650,20 +655,26 @@ var PreviewMenu = GObject.registerClass({
|
||||
if (isFocused && mw.minimized) {
|
||||
wa.show();
|
||||
}
|
||||
|
||||
if (!mw.minimized) {
|
||||
let tweenOpts = getTweenOpts({ opacity: isFocused ? 255 : dimOpacity });
|
||||
|
||||
if (immediate && !mw.is_on_all_workspaces()) {
|
||||
tweenOpts.time = 0;
|
||||
}
|
||||
|
||||
Utils.animateWindowOpacity(wa, tweenOpts);
|
||||
}
|
||||
|
||||
this.animateWindowOpacity(mw, wa, isFocused ? 255 : dimOpacity, immediate)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
animateWindowOpacity(metaWindow, windowActor, opacity, immediate) {
|
||||
windowActor = windowActor || metaWindow.get_compositor_private();
|
||||
|
||||
if (windowActor && !metaWindow.minimized) {
|
||||
let tweenOpts = getTweenOpts({ opacity });
|
||||
|
||||
if (immediate && !metaWindow.is_on_all_workspaces()) {
|
||||
tweenOpts.time = 0;
|
||||
}
|
||||
|
||||
Utils.animateWindowOpacity(windowActor, tweenOpts);
|
||||
}
|
||||
}
|
||||
|
||||
_restorePeekedWindowStack() {
|
||||
let windowActor = this._peekedWindow ? this._peekedWindow.get_compositor_private() : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user