代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gnome-shell 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 345278af9b7139d12e393d6b18abfe055172dedd Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 15 Aug 2018 15:03:56 +0200
Subject: [PATCH 2/2] endSessionDialog: Support rebooting into the bootloader
menu aka ("Boot Options")
This implements the "Alt" behavior for the "Reboot" button as outlined in
the design here: https://wiki.gnome.org/Design/OS/BootOptions
This causes the endSessionDialog to send a ConfirmedRebootToBootOptions signal
to gnome-session instead of the normal ConfirmedReboot signal, actually
telling the boot-loader that it should show its menu the next boot is left
up to gnome-session.
Note I've tried implementing this with the AltSwitcher class from
js/ui/status/system.js first, but that puts the button in a St.Bin()
which causes the button to think it is the only button on the dialog
and makes it have rounded corners on both of its bottom corners.
---
js/ui/endSessionDialog.js | 50 +++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 5657cbffd..bfc64a7d6 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -271,6 +271,9 @@ var EndSessionDialog = new Lang.Class({
this._totalSecondsToStayOpen = 0;
this._applications = [];
this._sessions = [];
+ this._capturedEventId = 0;
+ this._rebootButton = null;
+ this._rebootButtonAlt = null;
this.connect('destroy',
this._onDestroy.bind(this));
@@ -436,6 +439,26 @@ var EndSessionDialog = new Lang.Class({
this._sessionHeader.visible = hasSessions;
},
+ _onCapturedEvent(actor, event) {
+ let altEnabled = false;
+
+ let type = event.type();
+ if (type != Clutter.EventType.KEY_PRESS && type != Clutter.EventType.KEY_RELEASE)
+ return Clutter.EVENT_PROPAGATE;
+
+ let key = event.get_key_symbol();
+ if (key != Clutter.KEY_Alt_L && key != Clutter.KEY_Alt_R)
+ return Clutter.EVENT_PROPAGATE;
+
+ if (type == Clutter.EventType.KEY_PRESS)
+ altEnabled = true;
+
+ this._rebootButton.visible = !altEnabled;
+ this._rebootButtonAlt.visible = altEnabled;
+
+ return Clutter.EVENT_PROPAGATE;
+ },
+
_updateButtons() {
this.clearButtons();
@@ -456,7 +479,32 @@ var EndSessionDialog = new Lang.Class({
});
},
label: label });
+
+ // Add Alt "Boot Options" option to the Reboot button
+ if (signal == 'ConfirmedReboot') {
+ this._rebootButton = button;
+ this._rebootButtonAlt = this.addButton(
+ { action: () => {
+ this.close(true);
+ let signalId = this.connect('closed', () => {
+ this.disconnect(signalId);
+ this._confirm('ConfirmedRebootToBootOptions');
+ });
+ },
+ label: C_("button", "Boot Options") });
+ this._rebootButtonAlt.visible = false;
+ this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
+ }
+ }
+ },
+
+ _stopAltCapture() {
+ if (this._capturedEventId > 0) {
+ global.stage.disconnect(this._capturedEventId);
+ this._capturedEventId = 0;
}
+ this._rebootButton = null;
+ this._rebootButtonAlt = null;
},
close(skipSignal) {
@@ -468,6 +516,7 @@ var EndSessionDialog = new Lang.Class({
cancel() {
this._stopTimer();
+ this._stopAltCapture();
this._dbusImpl.emit_signal('Canceled', null);
this.close();
},
@@ -476,6 +525,7 @@ var EndSessionDialog = new Lang.Class({
let callback = () => {
this._fadeOutDialog();
this._stopTimer();
+ this._stopAltCapture();
this._dbusImpl.emit_signal(signal, null);
};
--
2.19.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。