diff options
author | rootavish <[email protected]> | 2014-07-20 23:57:08 +0530 |
---|---|---|
committer | rootavish <[email protected]> | 2014-07-20 23:57:08 +0530 |
commit | c8b63e55987f0ee6d4067a7309ef2fac8119b0cc (patch) | |
tree | 8bbcdf23fb7d87d2f16ed70475fa613ba8d7af00 /shell/ev-window.c | |
parent | 4a3ac19d1365cb87a31eecea4759484673fad667 (diff) | |
download | atril-c8b63e55987f0ee6d4067a7309ef2fac8119b0cc.tar.bz2 atril-c8b63e55987f0ee6d4067a7309ef2fac8119b0cc.tar.xz |
Moving everything related to webkit to main thread jobs
Including creation of windows, webviews etc., still get a crash. The one page epub works fine with the thumbnails though.
Also fixing some calls which cause gtk-critical errors when I try to close the window.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r-- | shell/ev-window.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c index 3fcf3786..d73cfba6 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -453,8 +453,9 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages && !(document->iswebdocument)); /* View menu */ - /*If it has pages it is a document, so our check for a webdocument lead to a crash. We need to switch these off since more than one - *webview is hard to manage */ + /*If it has pages it is a document, so our check for a webdocument won't lead to a crash. We need to switch these off since more than one + *webview is hard to manage, and would lead to unexpected behaviour in case the number of webviews gets too large. + */ ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages && !(document->iswebdocument)); ev_window_set_action_sensitive (ev_window, "ViewDual", has_pages && !(document->iswebdocument)); ev_window_set_action_sensitive (ev_window, "ViewBestFit", has_pages && !(document->iswebdocument)); @@ -1469,6 +1470,10 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) ev_window->priv->webview); gtk_widget_show(ev_window->priv->webview); } + else { + /*Since the document is not a webdocument might as well get rid of the webview now*/ + g_object_unref(ev_window->priv->webview); + } #endif if (EV_WINDOW_IS_PRESENTATION (ev_window) && document->iswebdocument == FALSE) { gtk_widget_destroy (ev_window->priv->presentation_view); @@ -5380,26 +5385,13 @@ ev_window_dispose (GObject *object) } if (priv->view) { - if ( gtk_widget_get_parent (priv->view) == NULL ) - { - g_object_ref_sink (priv->view); - g_object_unref(priv->view); - } - else - { - g_object_unref (priv->view); - } + g_object_unref (priv->view); priv->view = NULL; } #ifdef ENABLE_EPUB if ( priv->webview ) { - if (gtk_widget_get_parent(priv->webview) == NULL ) { - g_object_ref_sink (priv->webview); - g_object_unref (priv->webview); - }else { - g_object_unref (priv->webview); - } + g_object_unref (priv->webview); priv->webview = NULL ; } #endif |