From 1548bcb4629a6a41641a0188003215b3098aa5fc Mon Sep 17 00:00:00 2001 From: rootavish Date: Sun, 10 Aug 2014 01:05:45 +0530 Subject: Page Label handling, other fixes Added the function to handle links from the toolbar, also added functions to disconnect all ev-view handlers once it has been replaced by ev-web-view, and vice-versa(to drop all handler associated to ev-web-view). Also the unref call to job_thumb was causing thumbnail jobs to crash with GTK2, so had to revert that, now we're back to the document folder not getting deleted from disk. --- shell/ev-window.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'shell/ev-window.c') diff --git a/shell/ev-window.c b/shell/ev-window.c index bb870976..fda6f68b 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1502,7 +1502,7 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) /*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); ev_window->priv->view = NULL; gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window), @@ -1511,6 +1511,7 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) } else { /*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); g_object_unref(ev_window->priv->webview); } @@ -5887,8 +5888,14 @@ sidebar_links_link_activated_cb (EvSidebarLinks *sidebar_links, EvLink *link, Ev static void activate_link_cb (EvPageAction *page_action, EvLink *link, EvWindow *window) { - ev_view_handle_link (EV_VIEW (window->priv->view), link); - gtk_widget_grab_focus (window->priv->view); + if (window->priv->view) { + ev_view_handle_link (EV_VIEW (window->priv->view), link); + gtk_widget_grab_focus (window->priv->view); + } + else { + ev_web_view_handle_link (EV_WEB_VIEW (window->priv->webview), link); + gtk_widget_grab_focus (window->priv->webview); + } } static void -- cgit v1.2.1