Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:GA
gnome-disk-utility
0002-Make-dialog-work-with-xid-again.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Make-dialog-work-with-xid-again.patch of Package gnome-disk-utility
From cf87263973a2d6b71bc1feec792453c39e81b008 Mon Sep 17 00:00:00 2001 From: Matthias Clasen <mclasen@redhat.com> Date: Wed, 8 Jan 2014 19:25:03 -0500 Subject: [PATCH 2/3] Make dialog work with --xid again When triggering an async operation from a GApplicationCommandline, we must use g_application_hold/release to ensure the application instance stays around until the operation is done. https://bugzilla.gnome.org/show_bug.cgi?id=721278 --- src/disks/gduapplication.c | 4 +++- src/disks/gduformatvolumedialog.c | 19 +++++++++++++++---- src/disks/gduformatvolumedialog.h | 4 +++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/disks/gduapplication.c b/src/disks/gduapplication.c index 4d0938a..8984c56 100644 --- a/src/disks/gduapplication.c +++ b/src/disks/gduapplication.c @@ -265,7 +265,9 @@ gdu_application_command_line (GApplication *_app, } else if (opt_format) { - gdu_format_volume_dialog_show_for_xid (app->client, opt_xid, object_to_select); + g_application_hold (_app); + gdu_format_volume_dialog_show_for_xid (app->client, opt_xid, object_to_select, + (GCallback)g_application_release, _app); } if (opt_restore_disk_image != NULL) diff --git a/src/disks/gduformatvolumedialog.c b/src/disks/gduformatvolumedialog.c index f741ade..2e0ca79 100644 --- a/src/disks/gduformatvolumedialog.c +++ b/src/disks/gduformatvolumedialog.c @@ -33,11 +33,16 @@ typedef struct GtkWidget *contents_box; GtkWidget *create_filesystem_widget; + + GCallback finished_cb; + gpointer cb_data; } FormatVolumeData; static void format_volume_data_free (FormatVolumeData *data) { + if (data->finished_cb) + ((GDestroyNotify) data->finished_cb) (data->cb_data); g_clear_object (&data->parent_window); g_object_unref (data->object); g_object_unref (data->block); @@ -144,13 +149,17 @@ static void gdu_format_volume_dialog_show_internal (UDisksClient *client, GtkWindow *parent_window, gint parent_xid, - UDisksObject *object) + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data) { GduApplication *app = GDU_APPLICATION (g_application_get_default ()); FormatVolumeData *data; gint response; data = g_new0 (FormatVolumeData, 1); + data->finished_cb = finished_cb; + data->cb_data = cb_data; data->parent_window = (parent_window != NULL) ? g_object_ref (parent_window) : NULL; data->object = g_object_ref (object); data->block = udisks_object_get_block (object); @@ -250,9 +259,11 @@ gdu_format_volume_dialog_show_internal (UDisksClient *client, void gdu_format_volume_dialog_show_for_xid (UDisksClient *client, gint xid, - UDisksObject *object) + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data) { - gdu_format_volume_dialog_show_internal (client, NULL, xid, object); + gdu_format_volume_dialog_show_internal (client, NULL, xid, object, finished_cb, cb_data); } void @@ -260,5 +271,5 @@ gdu_format_volume_dialog_show (GduWindow *window, UDisksObject *object) { gdu_format_volume_dialog_show_internal (gdu_window_get_client (window), GTK_WINDOW (window), - -1, object); + -1, object, NULL, NULL); } diff --git a/src/disks/gduformatvolumedialog.h b/src/disks/gduformatvolumedialog.h index 62a43ef..3721fbb 100644 --- a/src/disks/gduformatvolumedialog.h +++ b/src/disks/gduformatvolumedialog.h @@ -19,7 +19,9 @@ void gdu_format_volume_dialog_show (GduWindow *window, UDisksObject *object); void gdu_format_volume_dialog_show_for_xid (UDisksClient *client, gint xid, - UDisksObject *object); + UDisksObject *object, + GCallback finished_cb, + gpointer cb_data); G_END_DECLS -- 1.8.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor