[evince/wip/nielsdg/lazy-load-annotations] ev-view: Lazily create annotation windows



commit fcced6cde9c89a9f5b553c5371c88abe16634525
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Jan 3 11:19:16 2020 +0100

    ev-view: Lazily create annotation windows
    
    `EvView` creates a window for each annotation when the page loads, which
    isn't really necessary as the window will be created when the annotation
    gets clicked. As such, we can remove this creation on page load so
    evince only creates annotation windows when necessary.
    
    This (parially) fixes large memory usage of Evince when loading a
    document with a lot of annotations. The problem seemed to be that
    `EvAnnotationWindow` loads a `GSpellTextView` with its own
    `HunspellChecker` instance, creating a lot of unnecessary overhead.
    
    Partially fixes https://gitlab.gnome.org/GNOME/evince/issues/1010

 libview/ev-view.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 31d7caef..b0644545 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3276,8 +3276,8 @@ show_annotation_windows (EvView *view,
                window = get_window_for_annot (view, annot);
                if (window) {
                        ev_view_window_child_move_with_parent (view, window);
-               } else {
-                       ev_view_create_annotation_window (view, annot, parent);
+               /* } else { */
+               /*      ev_view_create_annotation_window (view, annot, parent); */
                }
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]