[gnome-shell] When fading in window icons, use the final position not current position
- From: Owen Taylor <otaylor src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] When fading in window icons, use the final position not current position
- Date: Mon, 10 Aug 2009 14:02:24 +0000 (UTC)
commit 4830808d2fb34f7927e086faf570f4fbdf3a717e
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Sat Aug 8 00:41:46 2009 -0400
When fading in window icons, use the final position not current position
The onComplete when positioning windows may come before the
final stage of the workspace positioning animation. So we can't
use actor.get_transformed_position() to figure out where to put
the icons. Compute the final position manually ourselves instead.
http://bugzilla.gnome.org/show_bug.cgi?id=591123
js/ui/workspaces.js | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/workspaces.js b/js/ui/workspaces.js
index 72dbbfd..c3c3441 100644
--- a/js/ui/workspaces.js
+++ b/js/ui/workspaces.js
@@ -472,9 +472,19 @@ Workspace.prototype = {
_fadeInWindowIcon: function (clone, icon) {
icon.opacity = 0;
icon.show();
- let [parentX, parentY] = icon.get_parent().get_transformed_position();
- let [cloneX, cloneY] = clone.actor.get_transformed_position();
- let [cloneWidth, cloneHeight] = clone.actor.get_transformed_size();
+ // This is a little messy and complicated because when we
+ // start the fade-in we may not have done the final positioning
+ // of the workspaces. (Tweener doesn't necessarily finish
+ // all animations before calling onComplete callbacks.)
+ // So we need to manually compute where the window will
+ // be after the workspace animation finishes.
+ let [parentX, parentY] = icon.get_parent().get_position();
+ let [cloneX, cloneY] = clone.actor.get_position();
+ let [cloneWidth, cloneHeight] = clone.actor.get_size();
+ cloneX = this.gridX + this.scale * cloneX;
+ cloneY = this.gridY + this.scale * cloneY;
+ cloneWidth = this.scale * clone.actor.scale_x * cloneWidth;
+ cloneHeight = this.scale * clone.actor.scale_y * cloneHeight;
// Note we only round the first part, because we're still going to be
// positioned relative to the parent. By subtracting a possibly
// non-integral parent X/Y we cancel it out.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]