我正在使用 oneiric 和 gnome shell 以及 Docky。窗口最小化到面板上的“活动”概览。我怎样才能获得 docky 的最小化效果而不是“活动”?
答案1
我想做同样的事情,但用花哨的底部面板代替底座。但概念是一样的。我认为你可以编辑这个文件:
/usr/share/gnome-shell/js/ui/windowManager.js
我试图找出其影响,但我唯一发现的是:
/* scale window down to 0x0.
* maybe TODO: get icon geometry passed through and move the window towards it?
*/
this._minimizing.push(actor);
let primary = Main.layoutManager.primaryMonitor;
let xDest = primary.x;
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
xDest += primary.width;
Tweener.addTween(actor,
{ scale_x: 0.0,
scale_y: 0.0,
x: xDest,
y: 0,
time: WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._minimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
},
如果有其他过渡,也许可以替代它。我甚至可以使用淡出过渡。我只是不知道这些变量在哪里指定。我认为重要的行是x:x目标,,y: 0,和过渡:'easeOutQuad',
如果有人愿意补充或者纠正这一点,请帮忙。
答案2
抱歉重新提起这么老的话题,但我正在寻找为 Gnome Shell 编写一些自定义动画,而这几乎是我能找到的唯一有点帮助的话题。
为了帮助其他人,以下是我迄今为止所做的事情:
// push the current actor onto the
// minimising stack / queue / list /
// whatever it is
this._minimizing.push(actor);
// get the main monitor
let primary = Main.layoutManager.primaryMonitor;
// calculate the destination for the x
// coordinate (0,0 is top left so this
// is presumably 0 for single monitor set ups)
let xDest = primary.x;
// if Clutter is configured to use
// right-to-left text, then the
// activities button is on the
// right hand side, so add the
// monitor width to xDest
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
xDest += primary.width;
// add the animation to the window
Tweener.addTween(actor,
{
// shrink the height and width down to 0
scale_x: 0.0,
scale_y: 0.0,
// move to the calculated destination
// (most likely top-left i.e. 0,0)
x: xDest,
y: 0,
// take the correct amount of time
time: WINDOW_ANIMATION_TIME,
// set the type of curve to use
// during the animation
transition: 'easeOutQuad',
// set up some events to trigger
// when were done
onComplete: this._minimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._minimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
长话短说,如果你的 Dock 位于底部,你可以通过执行以下操作轻松让动画移动到其中间:
x:主.x + (主.宽度 / 2)
y:主要高度
虽然不完美,但这是一个开始......
答案3
目前,在不改变源代码的情况下改变这种情况的唯一方法是编写一个扩展,改变最小化动画的属性,使其以 dock 为目标。
答案4
尝试使用 GNOME 扩展禁用窗口动画: