[gnome-disk-utility] Be more careful with XIDs



commit 62253c54e8c7136e6f2dc9de70c68b7af7c3cd64
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 8 18:51:53 2014 -0500

    Be more careful with XIDs
    
    When an invalid XID is specified, we end up calling
    gdk_window_set_transient_for with a NULL window. This leads
    to a crash, so don't do it, and instead silently ignore
    the invalid XID.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721278

 src/disks/gduformatvolumedialog.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/disks/gduformatvolumedialog.c b/src/disks/gduformatvolumedialog.c
index c737cb0..f741ade 100644
--- a/src/disks/gduformatvolumedialog.c
+++ b/src/disks/gduformatvolumedialog.c
@@ -181,7 +181,8 @@ gdu_format_volume_dialog_show_internal (UDisksClient *client,
       GdkWindow *foreign_window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), 
parent_xid);
       if (!gtk_widget_get_realized (data->dialog))
           gtk_widget_realize (data->dialog);
-      gdk_window_set_transient_for (gtk_widget_get_window (data->dialog), foreign_window);
+      if (foreign_window != NULL)
+        gdk_window_set_transient_for (gtk_widget_get_window (data->dialog), foreign_window);
     }
 
   gtk_dialog_set_default_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK);


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