|
|
13bb5b |
From f936c6e5e2566e6a665b61b1610c249e7ec5479b Mon Sep 17 00:00:00 2001
|
|
|
13bb5b |
From: Ray Strode <rstrode@redhat.com>
|
|
|
13bb5b |
Date: Mon, 6 Oct 2014 16:38:03 -0400
|
|
|
13bb5b |
Subject: [PATCH 1/2] screenShield: focus login screen after lifting shield
|
|
|
13bb5b |
|
|
|
13bb5b |
This commit ensures the login screen gets focused after
|
|
|
13bb5b |
the screen shield is raised.
|
|
|
13bb5b |
|
|
|
13bb5b |
The code affects the unlock screen as well, but it's
|
|
|
13bb5b |
less important since the unlock screen gets destroyed
|
|
|
13bb5b |
and recreated each time the curtain moves, so it
|
|
|
13bb5b |
has an opportunity to take focus on its own.
|
|
|
13bb5b |
---
|
|
|
13bb5b |
js/ui/screenShield.js | 4 ++++
|
|
|
13bb5b |
1 file changed, 4 insertions(+)
|
|
|
13bb5b |
|
|
|
13bb5b |
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
|
|
|
13bb5b |
index 089333b..4473b72 100644
|
|
|
13bb5b |
--- a/js/ui/screenShield.js
|
|
|
13bb5b |
+++ b/js/ui/screenShield.js
|
|
|
13bb5b |
@@ -1,37 +1,38 @@
|
|
|
13bb5b |
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
|
13bb5b |
|
|
|
13bb5b |
const Cairo = imports.cairo;
|
|
|
13bb5b |
const Clutter = imports.gi.Clutter;
|
|
|
13bb5b |
const Gio = imports.gi.Gio;
|
|
|
13bb5b |
const GLib = imports.gi.GLib;
|
|
|
13bb5b |
const GnomeDesktop = imports.gi.GnomeDesktop;
|
|
|
13bb5b |
+const Gtk = imports.gi.Gtk;
|
|
|
13bb5b |
const Lang = imports.lang;
|
|
|
13bb5b |
const Mainloop = imports.mainloop;
|
|
|
13bb5b |
const Meta = imports.gi.Meta;
|
|
|
13bb5b |
const Shell = imports.gi.Shell;
|
|
|
13bb5b |
const Signals = imports.signals;
|
|
|
13bb5b |
const St = imports.gi.St;
|
|
|
13bb5b |
const TweenerEquations = imports.tweener.equations;
|
|
|
13bb5b |
|
|
|
13bb5b |
const Background = imports.ui.background;
|
|
|
13bb5b |
const GnomeSession = imports.misc.gnomeSession;
|
|
|
13bb5b |
const Hash = imports.misc.hash;
|
|
|
13bb5b |
const Layout = imports.ui.layout;
|
|
|
13bb5b |
const OVirt = imports.gdm.oVirt;
|
|
|
13bb5b |
const LoginManager = imports.misc.loginManager;
|
|
|
13bb5b |
const Lightbox = imports.ui.lightbox;
|
|
|
13bb5b |
const Main = imports.ui.main;
|
|
|
13bb5b |
const Overview = imports.ui.overview;
|
|
|
13bb5b |
const MessageTray = imports.ui.messageTray;
|
|
|
13bb5b |
const ShellDBus = imports.ui.shellDBus;
|
|
|
13bb5b |
const SmartcardManager = imports.misc.smartcardManager;
|
|
|
13bb5b |
const Tweener = imports.ui.tweener;
|
|
|
13bb5b |
const Util = imports.misc.util;
|
|
|
13bb5b |
|
|
|
13bb5b |
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
|
|
|
13bb5b |
const LOCK_ENABLED_KEY = 'lock-enabled';
|
|
|
13bb5b |
const LOCK_DELAY_KEY = 'lock-delay';
|
|
|
13bb5b |
|
|
|
13bb5b |
// fraction of screen height the arrow must reach before completing
|
|
|
13bb5b |
// the slide up automatically
|
|
|
13bb5b |
const ARROW_DRAG_THRESHOLD = 0.1;
|
|
|
13bb5b |
@@ -851,60 +852,63 @@ const ScreenShield = new Lang.Class({
|
|
|
13bb5b |
_onLightboxShown: function() {
|
|
|
13bb5b |
this.activate(false);
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
showDialog: function() {
|
|
|
13bb5b |
// Ensure that the stage window is mapped, before taking a grab
|
|
|
13bb5b |
// otherwise X errors out
|
|
|
13bb5b |
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
|
|
|
13bb5b |
if (!this._becomeModal()) {
|
|
|
13bb5b |
// In the login screen, this is a hard error. Fail-whale
|
|
|
13bb5b |
log('Could not acquire modal grab for the login screen. Aborting login process.');
|
|
|
13bb5b |
Meta.quit(Meta.ExitCode.ERROR);
|
|
|
13bb5b |
}
|
|
|
13bb5b |
|
|
|
13bb5b |
return false;
|
|
|
13bb5b |
}));
|
|
|
13bb5b |
|
|
|
13bb5b |
this.actor.show();
|
|
|
13bb5b |
this._isGreeter = Main.sessionMode.isGreeter;
|
|
|
13bb5b |
this._isLocked = true;
|
|
|
13bb5b |
this._ensureUnlockDialog(true, true);
|
|
|
13bb5b |
this._hideLockScreen(false, 0);
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
_hideLockScreenComplete: function() {
|
|
|
13bb5b |
if (Main.sessionMode.currentMode == 'lock-screen')
|
|
|
13bb5b |
Main.sessionMode.popMode('lock-screen');
|
|
|
13bb5b |
|
|
|
13bb5b |
this._lockScreenState = MessageTray.State.HIDDEN;
|
|
|
13bb5b |
this._lockScreenGroup.hide();
|
|
|
13bb5b |
+
|
|
|
13bb5b |
+ this._dialog.actor.grab_key_focus();
|
|
|
13bb5b |
+ this._dialog.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
_hideLockScreen: function(animate, velocity) {
|
|
|
13bb5b |
if (this._lockScreenState == MessageTray.State.HIDDEN)
|
|
|
13bb5b |
return;
|
|
|
13bb5b |
|
|
|
13bb5b |
this._lockScreenState = MessageTray.State.HIDING;
|
|
|
13bb5b |
|
|
|
13bb5b |
Tweener.removeTweens(this._lockScreenGroup);
|
|
|
13bb5b |
|
|
|
13bb5b |
if (animate) {
|
|
|
13bb5b |
// Tween the lock screen out of screen
|
|
|
13bb5b |
// if velocity is not specified (i.e. we come here from pressing ESC),
|
|
|
13bb5b |
// use the same speed regardless of original position
|
|
|
13bb5b |
// if velocity is specified, it's in pixels per milliseconds
|
|
|
13bb5b |
let h = global.stage.height;
|
|
|
13bb5b |
let delta = (h + this._lockScreenGroup.y);
|
|
|
13bb5b |
let min_velocity = global.stage.height / (CURTAIN_SLIDE_TIME * 1000);
|
|
|
13bb5b |
|
|
|
13bb5b |
velocity = Math.max(min_velocity, velocity);
|
|
|
13bb5b |
let time = (delta / velocity) / 1000;
|
|
|
13bb5b |
|
|
|
13bb5b |
Tweener.addTween(this._lockScreenGroup,
|
|
|
13bb5b |
{ y: -h,
|
|
|
13bb5b |
time: time,
|
|
|
13bb5b |
transition: 'easeInQuad',
|
|
|
13bb5b |
onComplete: Lang.bind(this, this._hideLockScreenComplete),
|
|
|
13bb5b |
});
|
|
|
13bb5b |
} else {
|
|
|
13bb5b |
this._hideLockScreenComplete();
|
|
|
13bb5b |
--
|
|
|
13bb5b |
2.1.0
|
|
|
13bb5b |
|
|
|
13bb5b |
|
|
|
13bb5b |
From e5c2ad5e29ae1dd691f1762ff1a5e94f0dff8eb5 Mon Sep 17 00:00:00 2001
|
|
|
13bb5b |
From: Ray Strode <rstrode@redhat.com>
|
|
|
13bb5b |
Date: Wed, 8 Oct 2014 09:39:44 -0400
|
|
|
13bb5b |
Subject: [PATCH 2/2] screenShield: fix trace back when unlocking session from
|
|
|
13bb5b |
another vt
|
|
|
13bb5b |
|
|
|
13bb5b |
commit 1d374ac8bd496f6fa6f4c55ffd207bd30bd50075 introduced a bug that
|
|
|
13bb5b |
prevents unlock from working when initiated from another VT
|
|
|
13bb5b |
(user switching).
|
|
|
13bb5b |
|
|
|
13bb5b |
This commit fixes the exception raised.
|
|
|
13bb5b |
|
|
|
13bb5b |
https://bugzilla.gnome.org/show_bug.cgi?id=708105
|
|
|
13bb5b |
---
|
|
|
13bb5b |
js/ui/screenShield.js | 6 ++++--
|
|
|
13bb5b |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
13bb5b |
|
|
|
13bb5b |
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
|
|
|
13bb5b |
index 4473b72..033ed2c 100644
|
|
|
13bb5b |
--- a/js/ui/screenShield.js
|
|
|
13bb5b |
+++ b/js/ui/screenShield.js
|
|
|
13bb5b |
@@ -853,62 +853,64 @@ const ScreenShield = new Lang.Class({
|
|
|
13bb5b |
this.activate(false);
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
showDialog: function() {
|
|
|
13bb5b |
// Ensure that the stage window is mapped, before taking a grab
|
|
|
13bb5b |
// otherwise X errors out
|
|
|
13bb5b |
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
|
|
|
13bb5b |
if (!this._becomeModal()) {
|
|
|
13bb5b |
// In the login screen, this is a hard error. Fail-whale
|
|
|
13bb5b |
log('Could not acquire modal grab for the login screen. Aborting login process.');
|
|
|
13bb5b |
Meta.quit(Meta.ExitCode.ERROR);
|
|
|
13bb5b |
}
|
|
|
13bb5b |
|
|
|
13bb5b |
return false;
|
|
|
13bb5b |
}));
|
|
|
13bb5b |
|
|
|
13bb5b |
this.actor.show();
|
|
|
13bb5b |
this._isGreeter = Main.sessionMode.isGreeter;
|
|
|
13bb5b |
this._isLocked = true;
|
|
|
13bb5b |
this._ensureUnlockDialog(true, true);
|
|
|
13bb5b |
this._hideLockScreen(false, 0);
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
_hideLockScreenComplete: function() {
|
|
|
13bb5b |
if (Main.sessionMode.currentMode == 'lock-screen')
|
|
|
13bb5b |
Main.sessionMode.popMode('lock-screen');
|
|
|
13bb5b |
|
|
|
13bb5b |
this._lockScreenState = MessageTray.State.HIDDEN;
|
|
|
13bb5b |
this._lockScreenGroup.hide();
|
|
|
13bb5b |
|
|
|
13bb5b |
- this._dialog.actor.grab_key_focus();
|
|
|
13bb5b |
- this._dialog.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
|
|
13bb5b |
+ if (this._dialog) {
|
|
|
13bb5b |
+ this._dialog.actor.grab_key_focus();
|
|
|
13bb5b |
+ this._dialog.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
|
|
13bb5b |
+ }
|
|
|
13bb5b |
},
|
|
|
13bb5b |
|
|
|
13bb5b |
_hideLockScreen: function(animate, velocity) {
|
|
|
13bb5b |
if (this._lockScreenState == MessageTray.State.HIDDEN)
|
|
|
13bb5b |
return;
|
|
|
13bb5b |
|
|
|
13bb5b |
this._lockScreenState = MessageTray.State.HIDING;
|
|
|
13bb5b |
|
|
|
13bb5b |
Tweener.removeTweens(this._lockScreenGroup);
|
|
|
13bb5b |
|
|
|
13bb5b |
if (animate) {
|
|
|
13bb5b |
// Tween the lock screen out of screen
|
|
|
13bb5b |
// if velocity is not specified (i.e. we come here from pressing ESC),
|
|
|
13bb5b |
// use the same speed regardless of original position
|
|
|
13bb5b |
// if velocity is specified, it's in pixels per milliseconds
|
|
|
13bb5b |
let h = global.stage.height;
|
|
|
13bb5b |
let delta = (h + this._lockScreenGroup.y);
|
|
|
13bb5b |
let min_velocity = global.stage.height / (CURTAIN_SLIDE_TIME * 1000);
|
|
|
13bb5b |
|
|
|
13bb5b |
velocity = Math.max(min_velocity, velocity);
|
|
|
13bb5b |
let time = (delta / velocity) / 1000;
|
|
|
13bb5b |
|
|
|
13bb5b |
Tweener.addTween(this._lockScreenGroup,
|
|
|
13bb5b |
{ y: -h,
|
|
|
13bb5b |
time: time,
|
|
|
13bb5b |
transition: 'easeInQuad',
|
|
|
13bb5b |
onComplete: Lang.bind(this, this._hideLockScreenComplete),
|
|
|
13bb5b |
});
|
|
|
13bb5b |
} else {
|
|
|
13bb5b |
this._hideLockScreenComplete();
|
|
|
13bb5b |
--
|
|
|
13bb5b |
2.1.0
|
|
|
13bb5b |
|