forked from AuroraMiddleware/gtk
printing: Be more careful when deserializing
The GVariant we are getting here might not be coming from GTK+, but rather from some other source. Best to be forgiving and deal with missing data without crashing. This was causing the GTK+ portal backends to crash on print requests from Qt.
This commit is contained in:
parent
ecc612b1a2
commit
21fddc3994
@ -902,8 +902,11 @@ gtk_page_setup_new_from_gvariant (GVariant *variant)
|
||||
setup = gtk_page_setup_new ();
|
||||
|
||||
paper_size = gtk_paper_size_new_from_gvariant (variant);
|
||||
gtk_page_setup_set_paper_size (setup, paper_size);
|
||||
gtk_paper_size_free (paper_size);
|
||||
if (paper_size)
|
||||
{
|
||||
gtk_page_setup_set_paper_size (setup, paper_size);
|
||||
gtk_paper_size_free (paper_size);
|
||||
}
|
||||
|
||||
if (g_variant_lookup (variant, "MarginTop", "d", &margin))
|
||||
gtk_page_setup_set_top_margin (setup, margin, GTK_UNIT_MM);
|
||||
|
Loading…
Reference in New Issue
Block a user