Skip to content

Commit

Permalink
x11/gnome-shell: Fix crashes on start
Browse files Browse the repository at this point in the history
  • Loading branch information
neelchauhan committed Oct 2, 2021
1 parent 55e6acd commit 20fe95f
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 0 deletions.
1 change: 1 addition & 0 deletions x11/gnome-shell/Makefile
Expand Up @@ -2,6 +2,7 @@

PORTNAME= gnome-shell
PORTVERSION= 41.0
PORTREVISION= 1
CATEGORIES= x11 gnome
MASTER_SITES= GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+)\..*/\1/}
DIST_SUBDIR= gnome
Expand Down
156 changes: 156 additions & 0 deletions x11/gnome-shell/files/patch-js_gdm_loginDialog_js
@@ -0,0 +1,156 @@
$OpenBSD: patch-js_gdm_loginDialog_js,v 1.3 2021/06/14 18:54:25 jasper Exp $

Index: js/gdm/loginDialog.js
--- js/gdm/loginDialog.js.orig
+++ js/gdm/loginDialog.js
@@ -42,6 +42,7 @@ var UserListItem = GObject.registerClass({
_init(user) {
let layout = new St.BoxLayout({
vertical: true,
+ x_align: Clutter.ActorAlign.START,
});
super._init({
style_class: 'login-dialog-user-list-item',
@@ -762,9 +763,6 @@ var LoginDialog = GObject.registerClass({

if (this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
-
- if (this._disableUserList && this._timedLoginUserListHold)
- this._timedLoginUserListHold.release();
}
}

@@ -858,7 +856,6 @@ var LoginDialog = GObject.registerClass({
this._resetGreeterProxy();
this._sessionMenuButton.updateSensitivity(true);

- const previousUser = this._user;
this._user = null;

if (this._nextSignalId) {
@@ -866,11 +863,7 @@ var LoginDialog = GObject.registerClass({
this._nextSignalId = 0;
}

- if (previousUser && beginRequest === AuthPrompt.BeginRequestType.REUSE_USERNAME) {
- this._user = previousUser;
- this._authPrompt.setUser(this._user);
- this._authPrompt.begin({ userName: previousUser.get_user_name() });
- } else if (beginRequest === AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
+ if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
if (!this._disableUserList)
this._showUserList();
else
@@ -1051,72 +1044,54 @@ var LoginDialog = GObject.registerClass({
let loginItem = null;
let animationTime;

- let tasks = [
- () => {
- if (this._disableUserList)
- return;
+ let tasks = [() => this._waitForItemForUser(userName),

- this._timedLoginUserListHold = this._waitForItemForUser(userName);
- },
+ () => {
+ loginItem = this._userList.getItemFromUserName(userName);

- () => {
- this._timedLoginUserListHold = null;
+ // If there is an animation running on the item, reset it.
+ loginItem.hideTimedLoginIndicator();
+ },

- if (this._disableUserList)
- loginItem = this._authPrompt;
- else
- loginItem = this._userList.getItemFromUserName(userName);
+ () => {
+ // If we're just starting out, start on the right item.
+ if (!this._userManager.is_loaded)
+ this._userList.jumpToItem(loginItem);
+ },

- // If there is an animation running on the item, reset it.
- loginItem.hideTimedLoginIndicator();
- },
+ () => {
+ // This blocks the timed login animation until a few
+ // seconds after the user stops interacting with the
+ // login screen.

- () => {
- if (this._disableUserList)
- return;
+ // We skip this step if the timed login delay is very short.
+ if (delay > _TIMED_LOGIN_IDLE_THRESHOLD) {
+ animationTime = delay - _TIMED_LOGIN_IDLE_THRESHOLD;
+ return this._blockTimedLoginUntilIdle();
+ } else {
+ animationTime = delay;
+ return null;
+ }
+ },

- // If we're just starting out, start on the right item.
- if (!this._userManager.is_loaded)
- this._userList.jumpToItem(loginItem);
- },
+ () => {
+ // If idle timeout is done, make sure the timed login indicator is shown
+ if (delay > _TIMED_LOGIN_IDLE_THRESHOLD &&
+ this._authPrompt.visible)
+ this._authPrompt.cancel();

- () => {
- // This blocks the timed login animation until a few
- // seconds after the user stops interacting with the
- // login screen.
+ if (delay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) {
+ this._userList.scrollToItem(loginItem);
+ loginItem.grab_key_focus();
+ }
+ },

- // We skip this step if the timed login delay is very short.
- if (delay > _TIMED_LOGIN_IDLE_THRESHOLD) {
- animationTime = delay - _TIMED_LOGIN_IDLE_THRESHOLD;
- return this._blockTimedLoginUntilIdle();
- } else {
- animationTime = delay;
- return null;
- }
- },
+ () => loginItem.showTimedLoginIndicator(animationTime),

- () => {
- if (this._disableUserList)
- return;
-
- // If idle timeout is done, make sure the timed login indicator is shown
- if (delay > _TIMED_LOGIN_IDLE_THRESHOLD &&
- this._authPrompt.visible)
- this._authPrompt.cancel();
-
- if (delay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) {
- this._userList.scrollToItem(loginItem);
- loginItem.grab_key_focus();
- }
- },
-
- () => loginItem.showTimedLoginIndicator(animationTime),
-
- () => {
- this._timedLoginBatch = null;
- this._greeter.call_begin_auto_login_sync(userName, null);
- },
- ];
+ () => {
+ this._timedLoginBatch = null;
+ this._greeter.call_begin_auto_login_sync(userName, null);
+ }];

this._timedLoginBatch = new Batch.ConsecutiveBatch(this, tasks);

41 changes: 41 additions & 0 deletions x11/gnome-shell/files/patch-js_ui_endSessionDialog_js
@@ -0,0 +1,41 @@
$OpenBSD: patch-js_ui_endSessionDialog_js,v 1.1 2020/11/08 09:38:19 ajacoutot Exp $

Index: js/ui/endSessionDialog.js
--- js/ui/endSessionDialog.js.orig
+++ js/ui/endSessionDialog.js
@@ -230,11 +230,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog
destroyOnClose: false });

this._loginManager = LoginManager.getLoginManager();
- this._loginManager.canRebootToBootLoaderMenu(
- (canRebootToBootLoaderMenu, unusedNeedsAuth) => {
- this._canRebootToBootLoaderMenu = canRebootToBootLoaderMenu;
- });
-
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._updatesPermission = null;
@@ -453,23 +448,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog
label,
});

- // Add Alt "Boot Options" option to the Reboot button
- if (this._canRebootToBootLoaderMenu && signal === 'ConfirmedReboot') {
- this._rebootButton = button;
- this._rebootButtonAlt = this.addButton({
- action: () => {
- this.close(true);
- let signalId = this.connect('closed', () => {
- this.disconnect(signalId);
- this._confirmRebootToBootLoaderMenu();
- });
- },
- label: C_('button', 'Boot Options'),
- });
- this._rebootButtonAlt.visible = false;
- this._capturedEventId = global.stage.connect('captured-event',
- this._onCapturedEvent.bind(this));
- }
}
}

0 comments on commit 20fe95f

Please sign in to comment.