[gnome-shell] Toggle mutter's unredirect features on/off depending on the situation



commit 1dee10c5757d9da1df1c61b041537a01ce93e1d0
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Mon Aug 29 23:55:42 2011 +0200

    Toggle mutter's unredirect features on/off depending on the situation
    
    We disable it when in the overview or when recording a video and otherwise
    leave it enabled.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=618497

 js/ui/main.js     |    2 ++
 js/ui/overview.js |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 2b50de4..17a0488 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -108,6 +108,7 @@ function _initRecorder() {
 
         if (recorder.is_recording()) {
             recorder.pause();
+            Meta.enable_unredirect_for_screen(global.screen);
         } else {
             // read the parameters from GSettings always in case they have changed
             recorder.set_framerate(recorderSettings.get_int('framerate'));
@@ -119,6 +120,7 @@ function _initRecorder() {
             else
                 recorder.set_pipeline(null);
 
+            Meta.disable_unredirect_for_screen(global.screen);
             recorder.record();
         }
     });
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 9555a71..bb050e3 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -574,6 +574,9 @@ Overview.prototype = {
         //
         // If we switched to displaying the actors in the Overview rather than
         // clones of them, this would obviously no longer be necessary.
+        //
+        // Disable unredirection while in the overview
+        Meta.disable_unredirect_for_screen(global.screen);
         global.window_group.hide();
         this._group.show();
         this._background.show();
@@ -767,6 +770,9 @@ Overview.prototype = {
     },
 
     _hideDone: function() {
+        // Re-enable unredirection
+        Meta.enable_unredirect_for_screen(global.screen);
+
         global.window_group.show();
 
         this.workspaces.destroy();



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