[gtk/matthiasc/for-master: 1/2] print dialog: Prevent cascading paper dialogs




commit 15c6760a96379ba8c6e6ed21bcc3683437a7bfeb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 29 16:00:01 2020 -0400

    print dialog: Prevent cascading paper dialogs
    
    We trigger the paper dialog when the "manage" item
    in the dropdown is selected. But the selection also
    changes due to internal changes, such as reloading
    the custom paper list when the paper dialog is
    closed. We need to be extra careful to avoid triggering
    another paper dialog when that happens.

 gtk/gtkprintunixdialog.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 5375926db4..b7e486fb30 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -1614,7 +1614,7 @@ set_paper_size (GtkPrintUnixDialog *dialog,
   if (page_setup == NULL)
     return FALSE;
 
-  model = G_LIST_MODEL (dialog->page_setup_list);
+  model = gtk_drop_down_get_model (GTK_DROP_DOWN (dialog->paper_size_combo));
   for (i = 0; i < g_list_model_get_n_items (model); i++)
     {
       list_page_setup = g_list_model_get_item (model, i);
@@ -2901,9 +2901,8 @@ custom_paper_dialog_response_cb (GtkDialog *custom_paper_dialog,
 {
   GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (user_data);
 
-  gtk_print_load_custom_papers (dialog->custom_paper_list);
-
   dialog->internal_page_setup_change = TRUE;
+  gtk_print_load_custom_papers (dialog->custom_paper_list);
   update_paper_sizes (dialog);
   dialog->internal_page_setup_change = FALSE;
 


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