From 22f01e4be74d03c94ab854296e18206409d21bea Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 27 Sep 2018 09:26:30 +0200 Subject: [PATCH] Add downstream patches implementing the "Boot Options" menu from: https://wiki.gnome.org/Design/OS/BootOptions --- ...-Immediately-add-buttons-to-the-dial.patch | 56 +++++++++ ...-Support-rebooting-into-the-bootload.patch | 115 ++++++++++++++++++ gnome-shell.spec | 11 +- 3 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch create mode 100644 0002-endSessionDialog-Support-rebooting-into-the-bootload.patch diff --git a/0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch b/0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch new file mode 100644 index 0000000..3d00b40 --- /dev/null +++ b/0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch @@ -0,0 +1,56 @@ +From 68b038ba1ee10cb957eec56fec435e3cfeffd20d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 15 Aug 2018 14:26:19 +0200 +Subject: [PATCH 1/2] endSessionDialog: Immediately add buttons to the dialog + +Immediately add buttons to the dialog instead of first building an +array of button-info structs. + +This is a preparation patch for adding support changing the "Reboot" +button into a "Boot Options" button when Alt is pressed. +--- + js/ui/endSessionDialog.js | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js +index 4804333d4..5657cbffd 100644 +--- a/js/ui/endSessionDialog.js ++++ b/js/ui/endSessionDialog.js +@@ -437,25 +437,26 @@ var EndSessionDialog = new Lang.Class({ + }, + + _updateButtons() { +- let dialogContent = DialogContent[this._type]; +- let buttons = [{ action: this.cancel.bind(this), ++ this.clearButtons(); ++ ++ this.addButton({ action: this.cancel.bind(this), + label: _("Cancel"), +- key: Clutter.Escape }]; ++ key: Clutter.Escape }); + ++ let dialogContent = DialogContent[this._type]; + for (let i = 0; i < dialogContent.confirmButtons.length; i++) { + let signal = dialogContent.confirmButtons[i].signal; + let label = dialogContent.confirmButtons[i].label; +- buttons.push({ action: () => { ++ let button = this.addButton( ++ { action: () => { + this.close(true); + let signalId = this.connect('closed', () => { + this.disconnect(signalId); + this._confirm(signal); + }); +- }, +- label: label }); ++ }, ++ label: label }); + } +- +- this.setButtons(buttons); + }, + + close(skipSignal) { +-- +2.19.0 + diff --git a/0002-endSessionDialog-Support-rebooting-into-the-bootload.patch b/0002-endSessionDialog-Support-rebooting-into-the-bootload.patch new file mode 100644 index 0000000..4634ea9 --- /dev/null +++ b/0002-endSessionDialog-Support-rebooting-into-the-bootload.patch @@ -0,0 +1,115 @@ +From 345278af9b7139d12e393d6b18abfe055172dedd Mon Sep 17 00:00:00 2001 +From: Hans de Goede +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 + diff --git a/gnome-shell.spec b/gnome-shell.spec index 1b6fa21..bf4dab0 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -1,6 +1,6 @@ Name: gnome-shell Version: 3.30.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Window management and application launching for GNOME Group: User Interface/Desktops @@ -55,6 +55,11 @@ Patch11: 0001-theme-define-proper-hover-and-active-states.patch Patch12: 0001-inputMethod-Add-a-null-check-for-text-in-vfunc_set_s.patch Patch13: 228.patch +# Implement https://wiki.gnome.org/Design/OS/BootOptions +# This should go upstream once systemd has a generic interface for this +Patch14: 0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch +Patch15: 0002-endSessionDialog-Support-rebooting-into-the-bootload.patch + %define libcroco_version 0.6.8 %define eds_version 3.17.2 %define gnome_desktop_version 3.7.90 @@ -250,6 +255,10 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas &> /dev/null %{_mandir}/man1/%{name}.1.gz %changelog +* Thu Sep 27 2018 Hans de Goede - 3.30.0-9 +- Add downstream patches implementing the "Boot Options" menu from: + https://wiki.gnome.org/Design/OS/BootOptions + * Sat Sep 22 2018 Adam Williamson - 3.30.0-8 - Backport fix for IBus type issue (GGO MR #228)