From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D281E138ACE for ; Fri, 19 Dec 2014 14:42:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 33FB2E0DE6; Fri, 19 Dec 2014 14:42:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A8E8E0DE6 for ; Fri, 19 Dec 2014 14:42:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 850ED3405E2 for ; Fri, 19 Dec 2014 14:42:21 +0000 (UTC) Received: by oystercatcher.gentoo.org (Postfix, from userid 2262) id 2E7C7CD90; Fri, 19 Dec 2014 14:42:20 +0000 (UTC) From: "Pacho Ramos (pacho)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, pacho@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-text/evince/files: evince-3.12.2-memory-leak.patch evince-3.12.2-scroll-search-2.patch evince-3.12.2-print-center.patch evince-3.12.2-scroll-search-1.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: evince-3.12.2-memory-leak.patch evince-3.12.2-scroll-search-2.patch evince-3.12.2-print-center.patch evince-3.12.2-scroll-search-1.patch X-VCS-Directories: app-text/evince/files X-VCS-Committer: pacho X-VCS-Committer-Name: Pacho Ramos Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20141219144220.2E7C7CD90@oystercatcher.gentoo.org> Date: Fri, 19 Dec 2014 14:42:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d06a1522-f6b1-43ab-923e-c6c396537abb X-Archives-Hash: 965830544f28cca2f4fe83cc1e58c720 pacho 14/12/19 14:42:20 Added: evince-3.12.2-memory-leak.patch evince-3.12.2-scroll-search-2.patch evince-3.12.2-print-center.patch evince-3.12.2-scroll-search-1.patch Log: Fix scrolling when search is used (#532878 by Johan Hovold), apply some more fixes from 3.12 branch. Drop old. (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key A188FBD4) Revision Changes Path 1.1 app-text/evince/files/evince-3.12.2-memory-leak.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-memory-leak.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-memory-leak.patch?rev=1.1&content-type=text/plain Index: evince-3.12.2-memory-leak.patch =================================================================== >From 86cfddae23cacfbb24469f1926cb965522bec6ca Mon Sep 17 00:00:00 2001 From: Giselle Reis Date: Sat, 30 Aug 2014 00:23:04 +0200 Subject: libview: fixing memory leak The memory leak was caused by a g_signal_connect which was never disconnected. This patch makes sure the signal is disconnected and the job is cancelled before creating another rendering job. It additionally introduces a helper function to cleanly finalize the job. diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c index 897d3de..22170f9 100644 --- a/libview/ev-pixbuf-cache.c +++ b/libview/ev-pixbuf-cache.c @@ -161,20 +161,27 @@ ev_pixbuf_cache_finalize (GObject *object) } static void +end_job (CacheJobInfo *job_info, + gpointer data) +{ + g_signal_handlers_disconnect_by_func (job_info->job, + G_CALLBACK (job_finished_cb), + data); + ev_job_cancel (job_info->job); + g_object_unref (job_info->job); + job_info->job = NULL; +} + +static void dispose_cache_job_info (CacheJobInfo *job_info, gpointer data) { if (job_info == NULL) return; - if (job_info->job) { - g_signal_handlers_disconnect_by_func (job_info->job, - G_CALLBACK (job_finished_cb), - data); - ev_job_cancel (job_info->job); - g_object_unref (job_info->job); - job_info->job = NULL; - } + if (job_info->job) + end_job (job_info, data); + if (job_info->surface) { cairo_surface_destroy (job_info->surface); job_info->surface = NULL; @@ -281,14 +288,8 @@ copy_job_to_job_info (EvJobRender *job_render, job_info->points_set = TRUE; } - if (job_info->job) { - g_signal_handlers_disconnect_by_func (job_info->job, - G_CALLBACK (job_finished_cb), - pixbuf_cache); - ev_job_cancel (job_info->job); - g_object_unref (job_info->job); - job_info->job = NULL; - } + if (job_info->job) + end_job (job_info, pixbuf_cache); job_info->page_ready = TRUE; } @@ -337,12 +338,7 @@ check_job_size_and_unref (EvPixbufCache *pixbuf_cache, height == EV_JOB_RENDER (job_info->job)->target_height) return; - g_signal_handlers_disconnect_by_func (job_info->job, - G_CALLBACK (job_finished_cb), - pixbuf_cache); - ev_job_cancel (job_info->job); - g_object_unref (job_info->job); - job_info->job = NULL; + end_job (job_info, pixbuf_cache); } /* Do all function that copies a job from an older cache to it's position in the @@ -651,6 +647,9 @@ add_job (EvPixbufCache *pixbuf_cache, cairo_region_destroy (job_info->region); job_info->region = region ? cairo_region_reference (region) : NULL; + if (job_info->job) + end_job (job_info, pixbuf_cache); + job_info->job = ev_job_render_new (pixbuf_cache->document, page, rotation, scale, width, height); -- cgit v0.10.1 1.1 app-text/evince/files/evince-3.12.2-scroll-search-2.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-scroll-search-2.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-scroll-search-2.patch?rev=1.1&content-type=text/plain Index: evince-3.12.2-scroll-search-2.patch =================================================================== >From dd3df79ea999850c737b049081d81afa59af22d3 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Tue, 18 Nov 2014 12:53:40 +0100 Subject: [PATCH] [libview] Show correct page when next search result requested If there are more than 1 results on a page then requesting next search result from the same page will not return you to the page with the search results if you moved from the page in the meantime (when you are not in continuous mode). This applies also to previous results. https://bugzilla.gnome.org/show_bug.cgi?id=730252 --- libview/ev-view.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libview/ev-view.c b/libview/ev-view.c index f3aa033..a9159cd 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -8250,6 +8250,8 @@ ev_view_find_next (EvView *view) if (view->find_result >= n_results) { view->find_result = 0; jump_to_find_page (view, EV_VIEW_FIND_NEXT, 1); + } else if (view->find_page != view->current_page) { + jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0); } jump_to_find_result (view); @@ -8264,6 +8266,8 @@ ev_view_find_previous (EvView *view) if (view->find_result < 0) { jump_to_find_page (view, EV_VIEW_FIND_PREV, -1); view->find_result = MAX (0, ev_view_find_get_n_results (view, view->find_page) - 1); + } else if (view->find_page != view->current_page) { + jump_to_find_page (view, EV_VIEW_FIND_PREV, 0); } jump_to_find_result (view); -- 2.1.0 1.1 app-text/evince/files/evince-3.12.2-print-center.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-print-center.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-print-center.patch?rev=1.1&content-type=text/plain Index: evince-3.12.2-print-center.patch =================================================================== >From 1057dc0dd6dee5dc1992fc88b76e4c928d2ff0e7 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Thu, 14 Aug 2014 14:07:05 +0200 Subject: print-operation: Fix centering of documents when printing with a manual scale When a manual scale is used for printing, the document is not correctly centered because the cairo context has a scale already applied. We need to consider the current scale when centering the page and also convert the coordinates before the cairo_translate(). https://bugzilla.gnome.org/show_bug.cgi?id=734788 diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c index b348038..df41c60 100644 --- a/libview/ev-print-operation.c +++ b/libview/ev-print-operation.c @@ -1825,6 +1825,27 @@ _print_context_get_hard_margins (GtkPrintContext *context, } static void +ev_print_operation_print_get_scaled_page_size (EvPrintOperationPrint *print, + gint page, + gdouble *width, + gdouble *height) +{ + GtkPrintSettings *settings; + gdouble manual_scale; + + ev_document_get_page_size (EV_PRINT_OPERATION (print)->document, + page, width, height); + + settings = gtk_print_operation_get_print_settings (print->op); + manual_scale = gtk_print_settings_get_scale (settings) / 100.0; + if (manual_scale == 1.0) + return; + + *width *= manual_scale; + *height *= manual_scale; +} + +static void ev_print_operation_print_draw_page (EvPrintOperationPrint *print, GtkPrintContext *context, gint page) @@ -1834,6 +1855,7 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, gdouble cr_width, cr_height; gdouble width, height, scale; gdouble x_scale, y_scale; + gdouble x_offset, y_offset; gdouble top, bottom, left, right; gtk_print_operation_set_defer_drawing (print->op); @@ -1857,12 +1879,16 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, cr = gtk_print_context_get_cairo_context (context); cr_width = gtk_print_context_get_width (context); cr_height = gtk_print_context_get_height (context); - ev_document_get_page_size (op->document, page, &width, &height); + ev_print_operation_print_get_scaled_page_size (print, page, &width, &height); if (print->page_scale == EV_SCALE_NONE) { /* Center document page on the printed page */ - if (print->autorotate) - cairo_translate (cr, (cr_width - width) / 2, (cr_height - height) / 2); + if (print->autorotate) { + x_offset = (cr_width - width) / 2; + y_offset = (cr_height - height) / 2; + cairo_device_to_user (cr, &x_offset, &y_offset); + cairo_translate (cr, x_offset, y_offset); + } } else { _print_context_get_hard_margins (context, &top, &bottom, &left, &right); @@ -1875,29 +1901,27 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, scale = 1.0; if (print->autorotate) { - double left_right_sides, top_bottom_sides; - - cairo_translate (cr, (cr_width - scale * width) / 2, - (cr_height - scale * height) / 2); + x_offset = (cr_width - scale * width) / 2; + y_offset = (cr_height - scale * height) / 2; + cairo_device_to_user (cr, &x_offset, &y_offset); + cairo_translate (cr, x_offset, y_offset); /* Ensure document page is within the margins. The * scale guarantees the document will fit in the * margins so we just need to check each side and * if it overhangs the margin, translate it to the - * margin. */ - left_right_sides = (cr_width - width*scale)/2; - top_bottom_sides = (cr_height - height*scale)/2; - if (left_right_sides < left) - cairo_translate (cr, left - left_right_sides, 0); + * margin. */ + if (x_offset < left) + cairo_translate (cr, left - x_offset, 0); - if (left_right_sides < right) - cairo_translate (cr, -(right - left_right_sides), 0); + if (x_offset < right) + cairo_translate (cr, -(right - x_offset), 0); - if (top_bottom_sides < top) - cairo_translate (cr, 0, top - top_bottom_sides); + if (y_offset < top) + cairo_translate (cr, 0, top - y_offset); - if (top_bottom_sides < bottom) - cairo_translate (cr, 0, -(bottom - top_bottom_sides)); + if (y_offset < bottom) + cairo_translate (cr, 0, -(bottom - y_offset)); } else { cairo_translate (cr, left, top); } -- cgit v0.10.1 1.1 app-text/evince/files/evince-3.12.2-scroll-search-1.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-scroll-search-1.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/evince/files/evince-3.12.2-scroll-search-1.patch?rev=1.1&content-type=text/plain Index: evince-3.12.2-scroll-search-1.patch =================================================================== >From 2cb9d88d7b396b6ac4bb01c035a40b48da419b65 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Mon, 19 May 2014 14:32:19 +0200 Subject: [PATCH 1/2] [libview] Scroll to the search result selected by user Scroll to page on which is the search result selected by user when not in continuous mode. https://bugzilla.gnome.org/show_bug.cgi?id=730252 --- libview/ev-view.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libview/ev-view.c b/libview/ev-view.c index 7618bbd..393bf77 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -7684,6 +7684,9 @@ jump_to_find_page (EvView *view, EvViewFindDirection direction, gint shift) break; } } + + if (!view->continuous) + ev_document_model_set_page (view->model, view->find_page); } static void @@ -7808,6 +7811,7 @@ ev_view_find_set_result (EvView *view, gint page, gint result) { view->find_page = page; view->find_result = result; + jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0); jump_to_find_result (view); gtk_widget_queue_draw (GTK_WIDGET (view)); } -- 1.9.0