[gnome-shell] ScreenShield: hide the cursor while the lock screen is on



commit e5f7390c096d58ab8de7b7d6acb4d316f91cfb76
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Fri Aug 31 17:51:32 2012 +0200

    ScreenShield: hide the cursor while the lock screen is on
    
    While the screen is locked and the cursor is not moved, the mouse
    cursor should be hidden, to indicate the machine is idle.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682535

 js/ui/screenShield.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 86dcf7d..e47f0aa 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -704,6 +704,8 @@ const ScreenShield = new Lang.Class({
             this._lockScreenGroup.hide();
         }
 
+        global.stage.show_cursor();
+
         if (Main.sessionMode.currentMode == 'lock-screen')
             Main.sessionMode.popMode('lock-screen');
     },
@@ -792,6 +794,16 @@ const ScreenShield = new Lang.Class({
         this._arrowAnimationId = Mainloop.timeout_add(6000, Lang.bind(this, this._animateArrows));
         this._animateArrows();
 
+        let motionId = global.stage.connect('captured-event', function(stage, event) {
+            if (event.type() == Clutter.EventType.MOTION) {
+                global.stage.show_cursor();
+                global.stage.disconnect(motionId);
+            }
+
+            return false;
+        });
+        global.stage.hide_cursor();
+
         this._lockScreenState = MessageTray.State.SHOWN;
         this._lockScreenGroup.fixed_position_set = false;
         this._lockScreenScrollCounter = 0;



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