Commit 9aba61f6 authored by carlosgc@webkit.org's avatar carlosgc@webkit.org

[GTK] [WebKit2] Crash when printing to a file via javascript

https://bugs.webkit.org/show_bug.cgi?id=122801

Reviewed by Martin Robinson.

This crash is caused by a GTK+ bug, but we can work around it by
ensuring the print dialog is always shown with a valid
GtkPrintSettings object.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationRunDialog):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4eb08fdc
2013-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] [WebKit2] Crash when printing to a file via javascript
https://bugs.webkit.org/show_bug.cgi?id=122801
Reviewed by Martin Robinson.
This crash is caused by a GTK+ bug, but we can work around it by
ensuring the print dialog is always shown with a valid
GtkPrintSettings object.
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationRunDialog):
2013-11-09 Dan Bernstein <mitz@apple.com>
Use createCFURLFromBuffer when converting a String to a CFURL
......
......@@ -228,8 +228,12 @@ static WebKitPrintOperationResponse webkitPrintOperationRunDialog(WebKitPrintOpe
| GTK_PRINT_CAPABILITY_SCALE));
WebKitPrintOperationPrivate* priv = printOperation->priv;
if (priv->printSettings)
gtk_print_unix_dialog_set_settings(printDialog, priv->printSettings.get());
// Make sure the initial settings of the GtkPrintUnixDialog is a valid
// GtkPrintSettings object to work around a crash happening in the GTK+
// file print backend. https://bugzilla.gnome.org/show_bug.cgi?id=703784.
if (!priv->printSettings)
priv->printSettings = adoptGRef(gtk_print_settings_new());
gtk_print_unix_dialog_set_settings(printDialog, priv->printSettings.get());
if (priv->pageSetup)
gtk_print_unix_dialog_set_page_setup(printDialog, priv->pageSetup.get());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment