[gnome-software/wip/rancell/ubuntu-3-20-rebase: 33/33] shell: Avoid destroying modal windows in the "response" signal handler
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/ubuntu-3-20-rebase: 33/33] shell: Avoid destroying modal windows in the "response" signal handler
- Date: Sat, 17 Jun 2017 09:51:07 +0000 (UTC)
commit 07ed64312d1b03654bc9bc07521a0b4337e8070b
Author: Kalev Lember <klember redhat com>
Date: Tue Jun 7 15:25:40 2016 +0200
shell: Avoid destroying modal windows in the "response" signal handler
Other code may legitimately connect to the "response" signal handler as
well and if we destroy it in the handler, their callbacks are never
invoked. Instead, do our window tracking in the "unmap" signal handler.
https://bugzilla.gnome.org/show_bug.cgi?id=764437
src/gs-shell.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e226c0e..110d846 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -90,17 +90,12 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
-/**
- * gs_shell_modal_dialog_present:
- **/
static void
-gs_shell_modal_dialog_response_cb (GtkDialog *dialog,
- gint response_id,
- GsShell *shell)
+modal_dialog_unmapped_cb (GtkWidget *dialog,
+ GsShell *shell)
{
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
- g_debug ("handling modal dialog response %i for %p",
- response_id, dialog);
+ g_debug ("modal dialog %p unmapped", dialog);
g_ptr_array_remove (priv->modal_dialogs, dialog);
}
@@ -126,10 +121,10 @@ gs_shell_modal_dialog_present (GsShell *shell, GtkDialog *dialog)
/* add to stack, transfer ownership to here */
g_ptr_array_add (priv->modal_dialogs, dialog);
+ g_signal_connect (GTK_WIDGET (dialog), "unmap",
+ G_CALLBACK (modal_dialog_unmapped_cb), shell);
/* present the new one */
- g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_modal_dialog_response_cb), shell);
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_present (GTK_WINDOW (dialog));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]