Fix StPasswordEntry crash

Resolves: #2009637
This commit is contained in:
Ray Strode 2021-10-12 15:21:12 -04:00
parent f89d5e3ea4
commit d516442ca5
2 changed files with 106 additions and 5 deletions

View File

@ -0,0 +1,94 @@
From de6604e4c7ddfcfd5fc089c462ecd29316b44189 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 12 Oct 2021 15:15:50 -0400
Subject: [PATCH] st-password-entry: Fix crash when DConf changes after StEntry
is destroyed
commit 8721c5db37c1409dbb806c915e6c077e1c4b8c6b made StPasswordEntry
honor the 'disable-show-password' setting.
Unfortunately, it introduced a lifecycle bug where the signal handler
for noticing setting changes can out live the entry itself.
This commit fixes the problem by using g_signal_connect_object
---
src/st/st-password-entry.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/st/st-password-entry.c b/src/st/st-password-entry.c
index 3dd8c6c1c..d17eeefa4 100644
--- a/src/st/st-password-entry.c
+++ b/src/st/st-password-entry.c
@@ -202,64 +202,65 @@ on_disable_show_password_changed (GObject *object,
static void
clutter_text_password_char_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
StPasswordEntry *entry = ST_PASSWORD_ENTRY (user_data);
ClutterActor *clutter_text;
clutter_text = st_entry_get_clutter_text (ST_ENTRY (entry));
if (clutter_text_get_password_char (CLUTTER_TEXT (clutter_text)) == 0)
st_password_entry_set_password_visible (entry, TRUE);
else
st_password_entry_set_password_visible (entry, FALSE);
}
static void
st_password_entry_init (StPasswordEntry *entry)
{
StPasswordEntryPrivate *priv = ST_PASSWORD_ENTRY_PRIV (entry);
ClutterActor *clutter_text;
priv->peek_password_icon = g_object_new (ST_TYPE_ICON,
"style-class", "peek-password",
"icon-name", "eye-not-looking-symbolic",
NULL);
st_entry_set_secondary_icon (ST_ENTRY (entry), priv->peek_password_icon);
st_password_entry_set_show_peek_icon (entry, TRUE);
- g_signal_connect (st_settings_get (),
- "notify::disable-show-password",
- G_CALLBACK (on_disable_show_password_changed),
- entry);
+ g_signal_connect_object (st_settings_get (),
+ "notify::disable-show-password",
+ G_CALLBACK (on_disable_show_password_changed),
+ entry,
+ 0);
clutter_text = st_entry_get_clutter_text (ST_ENTRY (entry));
clutter_text_set_password_char (CLUTTER_TEXT (clutter_text), BLACK_CIRCLE);
st_entry_set_input_purpose (ST_ENTRY (entry), CLUTTER_INPUT_CONTENT_PURPOSE_PASSWORD);
g_signal_connect (clutter_text, "notify::password-char",
G_CALLBACK (clutter_text_password_char_cb), entry);
}
/**
* st_password_entry_new:
*
* Create a new #StPasswordEntry.
*
* Returns: a new #StEntry
*/
StEntry*
st_password_entry_new (void)
{
return ST_ENTRY (g_object_new (ST_TYPE_PASSWORD_ENTRY, NULL));
}
/**
* st_password_entry_set_show_peek_icon:
* @entry: a #StPasswordEntry
* @value: %TRUE to show the peek-icon in the entry
*
* Sets whether to show or hide the peek-icon in the password entry. If %TRUE,
* a icon button for temporarily unmasking the password will be shown at the
--
2.31.1

View File

@ -2,7 +2,7 @@
Name: gnome-shell
Version: 41.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Window management and application launching for GNOME
License: GPLv2+
@ -10,20 +10,23 @@ URL: https://wiki.gnome.org/Projects/GnomeShell
Source0: http://download.gnome.org/sources/gnome-shell/41/%{name}-%{tarball_version}.tar.xz
# Replace Epiphany with Firefox in the default favourite apps list
Patch1: gnome-shell-favourite-apps-firefox.patch
Patch10001: gnome-shell-favourite-apps-firefox.patch
# Backported from upstream
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1993
Patch2: 0001-inputMethod-Clear-preeditStr-before-reset.patch
Patch20001: 0001-inputMethod-Clear-preeditStr-before-reset.patch
# Fix wrong OSD icons displaying after the first
# https://bugzilla.redhat.com/show_bug.cgi?id=2011872
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1983
Patch3: 0001-st-icon-Ensure-icons-are-updated-if-theme-node-is-in.patch
Patch30001: 0001-st-icon-Ensure-icons-are-updated-if-theme-node-is-in.patch
# Some users might have a broken PAM config, so we really need this
# downstream patch to stop trying on configuration errors.
Patch10005: 0001-gdm-Work-around-failing-fingerprint-auth.patch
Patch40001: 0001-gdm-Work-around-failing-fingerprint-auth.patch
# Fix crash if settings get updated after an entry is destroyed (#2009637)
Patch50001: 0001-st-password-entry-Fix-crash-when-DConf-changes-after.patch
%define eds_version 3.33.1
@ -239,6 +242,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%{_mandir}/man1/gnome-shell.1*
%changelog
* Tue Oct 12 2021 Ray Strode <rstrode@redhat.com> - 41.0-4
- Fix StPasswordEntry crash
Resolves: #2009637
* Thu Oct 07 2021 Adam Williamson <awilliam@redhat.com> - 41.0-3
- Backport MR #1983 to fix wrong OSD icons (#2011872)