[gnome-shell] Add a debug keybinding to pause/resume all tweens



commit 9bb4d17e315058d5f582a514c5d48021c1d4cc06
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jan 14 08:49:32 2014 -0500

    Add a debug keybinding to pause/resume all tweens
    
    So we can inspect a mid-tween scene easier.

 data/org.gnome.shell.gschema.xml.in.in |    5 +++++
 js/ui/windowManager.js                 |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in
index 617bc38..91cec04 100644
--- a/data/org.gnome.shell.gschema.xml.in.in
+++ b/data/org.gnome.shell.gschema.xml.in.in
@@ -116,6 +116,11 @@
         Keybinding to focus the active notification.
       </_description>
     </key>
+    <key name="pause-resume-tweens" type="as">
+      <default>[]</default>
+      <summary>Keybinding that pauses and resumes all running tweens, for debugging purposes</summary>
+      <description></description>
+    </key>
   </schema>
 
   <schema id="org.gnome.shell.keyboard" path="/org/gnome/shell/keyboard/"
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index a0531a8..a408014 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -556,6 +556,12 @@ const WindowManager = new Lang.Class({
                                         Shell.KeyBindingMode.LOGIN_SCREEN,
                                         Lang.bind(this, this._startA11ySwitcher));
 
+        this.addKeybinding('toggle-tweens',
+                           new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
+                           Meta.KeyBindingFlags.NONE,
+                           Shell.KeyBindingMode.ALL,
+                           Lang.bind(this, this._toggleTweens));
+
         this.addKeybinding('open-application-menu',
                            new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
                            Meta.KeyBindingFlags.NONE,
@@ -1088,6 +1094,15 @@ const WindowManager = new Lang.Class({
         Main.panel.toggleAppMenu();
     },
 
+    _toggleTweens: function() {
+        this._tweensPaused = !this._tweensPaused;
+        const OrigTweener = imports.tweener.tweener;
+        if (this._tweensPaused)
+            OrigTweener.pauseAllTweens();
+        else
+            OrigTweener.resumeAllTweens();
+    },
+
     _showWorkspaceSwitcher : function(display, screen, window, binding) {
         if (!Main.sessionMode.hasWorkspaces)
             return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]