After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700856 - sound: "Test Speakers" dialogue still shown when panel changed
sound: "Test Speakers" dialogue still shown when panel changed
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Sound
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control center sound maintainer(s)
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-22 18:53 UTC by Joshua Lock
Modified: 2013-06-04 11:01 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
Patch to ensure dialogue is closed when panel changed from Sound (2.19 KB, patch)
2013-05-22 18:54 UTC, Joshua Lock
needs-work Details | Review
Patch attempt 2 (2.76 KB, patch)
2013-05-24 01:59 UTC, Joshua Lock
none Details | Review
Cleaner version of the patch (2.00 KB, patch)
2013-06-03 23:52 UTC, Joshua Lock
committed Details | Review

Description Joshua Lock 2013-05-22 18:53:15 UTC
When the g-c-c panel is changed from Sound to another panel whilst the Test Speakers dialog is still open (i.e. user activates a panel via one of the Shell indicators) the dialog remains shown and modal for the g-c-c window.
Comment 1 Joshua Lock 2013-05-22 18:54:11 UTC
Created attachment 245081 [details] [review]
Patch to ensure dialogue is closed when panel changed from Sound
Comment 2 Thomas Wood 2013-05-23 11:13:08 UTC
Review of attachment 245081 [details] [review]:

::: panels/sound/gvc-mixer-dialog.c
@@ +1536,3 @@
 static void
+on_dialog_closed (GObject  *source,
+                  gpointer user_data)

The "destroy" signal prototype has GtkWidget as the first parameter.

@@ +1540,3 @@
+        GtkWidget *d;
+
+        if (user_data == NULL || !GTK_IS_WIDGET (user_data))

This check should be necessary because the signal must be disconnected if the speaker test dialog has been destroyed (see below).

@@ +1552,3 @@
+                    gpointer  user_data)
+{
+        if (dialog != NULL && GTK_IS_DIALOG (dialog))

dialog is the object that emits the signal, so this check will always evaluate to true.

@@ +1631,1 @@
         gtk_dialog_run (GTK_DIALOG (d));

The "destroy" signal handler needs disconnecting after the test speakers dialog has been destroyed, otherwise a dangling pointer will be passed to on_dialog_closed.

I don't think the "response" signal needs to be connected here. Emitting the response signal using gtk_dialog_response rather than destroying dialog in on_dialog_closed should be sufficient.
Comment 3 Joshua Lock 2013-05-24 01:59:27 UTC
Created attachment 245208 [details] [review]
Patch attempt 2

Thanks for the review Thomas. I've attached a cleaned up version here which I believe follows the spirit of your review.
Comment 4 Joshua Lock 2013-06-03 23:52:10 UTC
Created attachment 245975 [details] [review]
Cleaner version of the patch

Thomas rightly pointed out that other panels do something similar in a much cleaner way, by ensuring the dialog is handled appropriately in the panels dispose method. This patch follows that pattern.