[gnome-bluetooth] Set a parent on the remove confirmation dialog



commit 126b526a3f501029aa0fca9dd4c98e50f5306805
Author: Joshua Lock <josh linux intel com>
Date:   Fri Oct 16 14:21:38 2009 +0100

    Set a parent on the remove confirmation dialog
    
    With a NULL parent on Moblin the dialog ends up stacked below other windows
    and can't accept any user input.
    Modify the internal method show_confirm_dialog to take a BluetoothChooser
    as an argument and set the toplevel window of the chooser as a parent for
    the dialog.
    
    This makes things work *much* nicer in Moblin and doesn't seem to have any
    adverse affect in Gnome.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598685

 lib/bluetooth-chooser.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lib/bluetooth-chooser.c b/lib/bluetooth-chooser.c
index 4b07497..e952946 100644
--- a/lib/bluetooth-chooser.c
+++ b/lib/bluetooth-chooser.c
@@ -341,12 +341,13 @@ bluetooth_chooser_get_selected_device_info (BluetoothChooser *self,
 }
 
 static gboolean
-show_confirm_dialog(const char *name)
+show_confirm_dialog (BluetoothChooser *chooser, const char *name)
 {
-	GtkWidget *dialog;
+	GtkWidget *dialog, *parent;
 	gint response;
 
-	dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
+	parent = gtk_widget_get_toplevel (GTK_WIDGET (chooser));
+	dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_MODAL,
 					 GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
 					 _("Remove '%s' from the list of devices?"), name);
 	g_object_set (G_OBJECT (dialog), "secondary-text",
@@ -391,7 +392,7 @@ bluetooth_chooser_remove_selected_device (BluetoothChooser *self)
 
 	adapter = bluetooth_client_get_default_adapter(priv->client);
 
-	if (show_confirm_dialog (name) != FALSE) {
+	if (show_confirm_dialog (self, name) != FALSE) {
 		const gchar *device_path;
 
 		device_path = dbus_g_proxy_get_path (device);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]