Don't use gtk_dialog_run to show the NautilusOpenWithDialog. That won't

2009-01-29  Cosimo Cecchi  <cosimoc@gnome.org>

	* libnautilus-private/nautilus-autorun.c: (handle_dialog_closure),
	(dialog_response_cb), (dialog_destroy_cb), (combo_box_changed):
	Don't use gtk_dialog_run to show the NautilusOpenWithDialog.
	That won't work, as we will spawn a GtkFileChooser later,
	eating all the mouse events on it if we do (#569651).

svn path=/trunk/; revision=14900
This commit is contained in:
Cosimo Cecchi 2009-01-29 15:47:17 +00:00 committed by Cosimo Cecchi
parent 202fde6348
commit 23f3fe2986
2 changed files with 39 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2009-01-29 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-autorun.c: (handle_dialog_closure),
(dialog_response_cb), (dialog_destroy_cb), (combo_box_changed):
Don't use gtk_dialog_run to show the NautilusOpenWithDialog.
That won't work, as we will spawn a GtkFileChooser later,
eating all the mouse events on it if we do (#569651).
2009-01-29 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-file-operations.c:

View file

@ -240,6 +240,30 @@ other_application_selected (NautilusOpenWithDialog *dialog,
nautilus_autorun_rebuild_combo_box (data->combo_box);
}
static void
handle_dialog_closure (NautilusAutorunComboBoxData *data)
{
if (!data->other_application_selected) {
/* reset combo box so we don't linger on "Open with other Application..." */
nautilus_autorun_rebuild_combo_box (data->combo_box);
}
}
static void
dialog_response_cb (GtkDialog *dialog,
gint response,
NautilusAutorunComboBoxData *data)
{
handle_dialog_closure (data);
}
static void
dialog_destroy_cb (GtkObject *object,
NautilusAutorunComboBoxData *data)
{
handle_dialog_closure (data);
}
static void
combo_box_changed (GtkComboBox *combo_box,
NautilusAutorunComboBoxData *data)
@ -311,21 +335,21 @@ combo_box_changed (GtkComboBox *combo_box,
case AUTORUN_OTHER_APP:
{
GtkWidget *dialog;
int response;
data->other_application_selected = FALSE;
dialog = nautilus_add_application_dialog_new (NULL, x_content_type);
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (combo_box))));
g_signal_connect (dialog, "application_selected",
G_CALLBACK (other_application_selected),
data);
response = gtk_dialog_run (GTK_DIALOG (dialog));
g_signal_connect (dialog, "response",
G_CALLBACK (dialog_response_cb), data);
g_signal_connect (dialog, "destroy",
G_CALLBACK (dialog_destroy_cb), data);
gtk_widget_show (GTK_WIDGET (dialog));
if (!data->other_application_selected) {
/* reset combo box so we don't linger on "Open with other Application..." */
nautilus_autorun_rebuild_combo_box (data->combo_box);
}
/* TODO: destroy dialog? */
break;
}