[gnome-shell] windowManager: Hold the window on the stage while going between workspaces
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] windowManager: Hold the window on the stage while going between workspaces
- Date: Wed, 27 Jun 2012 18:11:22 +0000 (UTC)
commit e43fe982631782cf8383852a4b383de736b5a97d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 26 20:11:44 2012 +0200
windowManager: Hold the window on the stage while going between workspaces
Right now the "move to workspace" keyboard shortcut transition isn't smooth. It
shows the window disappearing, hopping to the next workspace, and then sliding
into view. "Pin" the window to the stage while the animation is in progress,
then release it afterwards.
https://bugzilla.gnome.org/show_bug.cgi?id=660839
js/ui/windowManager.js | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 269cd47..dc79f32 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -94,6 +94,7 @@ const WindowManager = new Lang.Class({
this._unmaximizing = [];
this._mapping = [];
this._destroying = [];
+ this._movingWindow = null;
this._dimmedWindows = [];
@@ -473,11 +474,13 @@ const WindowManager = new Lang.Class({
this._switchData = switchData;
switchData.inGroup = new Clutter.Group();
switchData.outGroup = new Clutter.Group();
+ switchData.movingWindowBin = new Clutter.Group();
switchData.windows = [];
let wgroup = global.window_group;
wgroup.add_actor(switchData.inGroup);
wgroup.add_actor(switchData.outGroup);
+ wgroup.add_actor(switchData.movingWindowBin);
for (let i = 0; i < windows.length; i++) {
let window = windows[i];
@@ -485,7 +488,12 @@ const WindowManager = new Lang.Class({
if (!window.meta_window.showing_on_its_workspace())
continue;
- if (window.get_workspace() == from) {
+ if (this._movingWindow && window.meta_window == this._movingWindow) {
+ switchData.movingWindow = { window: window,
+ parent: window.get_parent() };
+ switchData.windows.push(switchData.movingWindow);
+ window.reparent(switchData.movingWindowBin);
+ } else if (window.get_workspace() == from) {
switchData.windows.push({ window: window,
parent: window.get_parent() });
window.reparent(switchData.outGroup);
@@ -500,6 +508,8 @@ const WindowManager = new Lang.Class({
switchData.inGroup.set_position(-xDest, -yDest);
switchData.inGroup.raise_top();
+ switchData.movingWindowBin.raise_top();
+
Tweener.addTween(switchData.outGroup,
{ x: xDest,
y: yDest,
@@ -537,6 +547,10 @@ const WindowManager = new Lang.Class({
Tweener.removeTweens(switchData.outGroup);
switchData.inGroup.destroy();
switchData.outGroup.destroy();
+ switchData.movingWindowBin.destroy();
+
+ if (this._movingWindow)
+ this._movingWindow = null;
shellwm.completed_switch_workspace();
},
@@ -586,7 +600,6 @@ const WindowManager = new Lang.Class({
if (activeWorkspace != toActivate)
toActivate.activate(global.get_current_time());
-
if (!Main.overview.visible)
this._workspaceSwitcherPopup.display(direction, toActivate.index());
},
@@ -598,6 +611,8 @@ const WindowManager = new Lang.Class({
if (activeWorkspace != toActivate) {
// This won't have any effect for "always sticky" windows
// (like desktop windows or docks)
+
+ this._movingWindow = window;
window.change_workspace(toActivate);
global.display.clear_mouse_mode();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]