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



commit aed1af6fa7ad6ccc17c826a8e9df6dfb7bea29fe
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 | 2 --
 1 file changed, 2 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 31d7caef..802ca493 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3276,8 +3276,6 @@ 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);
                }
        }
 }


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