From f9b37020767638898f0cd0d036f864fe40b2ec92 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 14 May 2016 12:19:24 -0700 Subject: Remove the check for a parent, more intuitive conditions --- shell/ev-window.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'shell/ev-window.c') diff --git a/shell/ev-window.c b/shell/ev-window.c index 3053c03e..8a4553e4 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1579,22 +1579,22 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) ev_window_warning_message (ev_window, "%s", _("The document contains only empty pages")); } + #if ENABLE_EPUB - GtkWidget *parent= gtk_widget_get_parent(ev_window->priv->webview); if (document->iswebdocument == TRUE && - parent == NULL ) + ev_window->priv->view != NULL) { /*We have encountered a web document, replace the atril view with a web view, if the web view is not already loaded.*/ gtk_container_remove (GTK_CONTAINER(ev_window->priv->scrolled_window), ev_window->priv->view); ev_view_disconnect_handlers(EV_VIEW(ev_window->priv->view)); - g_object_unref(ev_window->priv->view); + g_object_unref(ev_window->priv->view); ev_window->priv->view = NULL; gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window), ev_window->priv->webview); gtk_widget_show(ev_window->priv->webview); } - else { + else if(ev_window->priv->webview != NULL && document->iswebdocument == FALSE) { /*Since the document is not a webdocument might as well get rid of the webview now*/ ev_web_view_disconnect_handlers(EV_WEB_VIEW(ev_window->priv->webview)); g_object_ref_sink(ev_window->priv->webview); -- cgit v1.2.1