~darkxst/ubuntu/saucy/gnome-shell/upstart_log

« back to all changes in this revision

Viewing changes to js/ui/pointerWatcher.js

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-31 12:01:12 UTC
  • mfrom: (1.1.49) (19.1.36 experimental)
  • Revision ID: package-import@ubuntu.com-20130531120112-ew91khxf051x9i2r
Tags: 3.8.2-1ubuntu1
* Merge with Debian (LP: #1185869, #1185721). Remaining changes:
  - debian/control.in:
    + Build-depend on libsystemd-login-dev & libsystemd-daemon-dev
    + Depend on gdm instead of gdm3
    + Don't recommend gnome-session-fallback
  - debian/patches/40_change-pam-name-to-match-gdm.patch:
  - debian/patches/revert-suspend-break.patch:
    + Disabled, not needed on Ubuntu
  - debian/patches/ubuntu-lightdm-user-switching.patch:
    + Allow user switching when using LightDM. Thanks Gerhard Stein
      for rebasing against gnome-shell 3.8!
  - debian/patches/ubuntu_lock_on_suspend.patch
    + Respect Ubuntu's lock-on-suspend setting.
      Disabled until it can be rewritten.
  - debian/patches/git_relock_screen_after_crash.patch:
    + Add Upstream fix for unlocked session after crash (LP: #1064584)
* Note that the new GNOME Classic mode (which requires installing
  gnome-shell-extensions) won't work until gnome-session 3.8 is
  available in Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
const Lang = imports.lang;
4
4
const Mainloop = imports.mainloop;
 
5
const GnomeDesktop = imports.gi.GnomeDesktop;
5
6
const Shell = imports.gi.Shell;
6
7
 
7
8
// We stop polling if the user is idle for more than this amount of time
40
41
    Name: 'PointerWatcher',
41
42
 
42
43
    _init: function() {
43
 
        let idleMonitor = Shell.IdleMonitor.get();
44
 
        idleMonitor.add_watch(IDLE_TIME,
45
 
                              Lang.bind(this, this._onIdleMonitorWatch));
46
 
        this._idle = idleMonitor.get_idletime() > IDLE_TIME;
 
44
        this._idleMonitor = new GnomeDesktop.IdleMonitor();
 
45
        this._idleMonitor.add_idle_watch(IDLE_TIME, Lang.bind(this, this._onIdleMonitorBecameIdle));
 
46
        this._idle = this._idleMonitor.get_idletime() > IDLE_TIME;
47
47
        this._watches = [];
48
48
        this.pointerX = null;
49
49
        this.pointerY = null;
78
78
        }
79
79
    },
80
80
 
81
 
    _onIdleMonitorWatch: function(monitor, id, userBecameIdle) {
82
 
        this._idle = userBecameIdle;
83
 
        if (!userBecameIdle)
84
 
            this._updatePointer();
 
81
    _onIdleMonitorBecameActive: function(monitor) {
 
82
        this._idle = false;
 
83
        this._updatePointer();
 
84
        this._updateTimeout();
 
85
    },
85
86
 
 
87
    _onIdleMonitorBecameIdle: function(monitor) {
 
88
        this._idle = true;
 
89
        this._idleMonitor.add_user_active_watch(Lang.bind(this, this._onIdleMonitorBecameActive));
86
90
        this._updateTimeout();
87
91
    },
88
92