Fix updating of workspace frame actor

Both the position and size of the frame actor depend on the scale
of the workspace, so update them both when the scale changes.

On the other hand, the the frame actor doesn't need to be
repositioned when the workspace moves (since it is relative to the
workspace). We do base the frame  position of the desktop actor, but
that will presumably stay fixed (at 0,0) in most all cases.

http://bugzilla.gnome.org/show_bug.cgi?id=591122
This commit is contained in:
Owen W. Taylor 2009-08-08 00:31:47 -04:00
parent 5d0808e1c0
commit 02ee6f69b3

View File

@ -411,13 +411,11 @@ Workspace.prototype = {
this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y); this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y);
this._frame.lower_bottom(); this._frame.lower_bottom();
this._framePosHandler = this.actor.connect('notify::x', Lang.bind(this, this._updateFramePosition)); this._framePosHandler = this.actor.connect('notify::scale-x', Lang.bind(this, this._updateFramePosition));
this._frameSizeHandler = this.actor.connect('notify::scale-x', Lang.bind(this, this._updateFrameSize));
} else { } else {
if (!this._frame) if (!this._frame)
return; return;
this.actor.disconnect(this._framePosHandler); this.actor.disconnect(this._framePosHandler);
this.actor.disconnect(this._frameSizeHandler);
this._frame.destroy(); this._frame.destroy();
this._frame = null; this._frame = null;
} }
@ -426,9 +424,6 @@ Workspace.prototype = {
_updateFramePosition : function() { _updateFramePosition : function() {
this._frame.set_position(this._desktop.actor.x - FRAME_SIZE / this.actor.scale_x, this._frame.set_position(this._desktop.actor.x - FRAME_SIZE / this.actor.scale_x,
this._desktop.actor.y - FRAME_SIZE / this.actor.scale_y); this._desktop.actor.y - FRAME_SIZE / this.actor.scale_y);
},
_updateFrameSize : function() {
this._frame.set_size(this._desktop.actor.width + 2 * FRAME_SIZE / this.actor.scale_x, this._frame.set_size(this._desktop.actor.width + 2 * FRAME_SIZE / this.actor.scale_x,
this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y); this._desktop.actor.height + 2 * FRAME_SIZE / this.actor.scale_y);
}, },