]> www.fi.muni.cz Git - evince.git/blobdiff - libview/ev-view.c
Save current page when closing window in presentation mode
[evince.git] / libview / ev-view.c
index 7ef1dd862b462db4b29f3e79f76ff6e34232421e..9c125d3135102f8a5c6669fcde7b9b9e1344dfa9 100644 (file)
@@ -3096,29 +3096,26 @@ ev_view_do_popup_menu (EvView *view,
                       gdouble x,
                       gdouble y)
 {
                       gdouble x,
                       gdouble y)
 {
+       GList        *items = NULL;
        EvLink       *link;
        EvImage      *image;
        EvAnnotation *annot;
 
        image = ev_view_get_image_at_location (view, x, y);
        EvLink       *link;
        EvImage      *image;
        EvAnnotation *annot;
 
        image = ev_view_get_image_at_location (view, x, y);
-       if (image) {
-               g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, image);
-               return TRUE;
-       }
+       if (image)
+               items = g_list_prepend (items, image);
 
        link = ev_view_get_link_at_location (view, x, y);
 
        link = ev_view_get_link_at_location (view, x, y);
-       if (link) {
-               g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, link);
-               return TRUE;
-       }
+       if (link)
+               items = g_list_prepend (items, link);
 
        annot = ev_view_get_annotation_at_location (view, x, y);
 
        annot = ev_view_get_annotation_at_location (view, x, y);
-       if (annot) {
-               g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, annot);
-               return TRUE;
-       }
+       if (annot)
+               items = g_list_prepend (items, annot);
 
 
-       g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, NULL);
+       g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, items);
+
+       g_list_free (items);
 
        return TRUE;
 }
 
        return TRUE;
 }
@@ -3923,7 +3920,7 @@ draw_loading_text (EvView       *view,
        gint     width, height;
 
        if (!view->loading_text) {
        gint     width, height;
 
        if (!view->loading_text) {
-               const gchar *loading_text = _("Loading...");
+               const gchar *loading_text = _("Loading");
                PangoLayout *layout;
                PangoFontDescription *font_desc;
                PangoRectangle logical_rect;
                PangoLayout *layout;
                PangoFontDescription *font_desc;
                PangoRectangle logical_rect;
@@ -4265,9 +4262,9 @@ ev_view_class_init (EvViewClass *class)
                         G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                         G_STRUCT_OFFSET (EvViewClass, popup_menu),
                         NULL, NULL,
                         G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                         G_STRUCT_OFFSET (EvViewClass, popup_menu),
                         NULL, NULL,
-                        g_cclosure_marshal_VOID__OBJECT,
+                        g_cclosure_marshal_VOID__POINTER,
                         G_TYPE_NONE, 1,
                         G_TYPE_NONE, 1,
-                        G_TYPE_OBJECT);
+                        G_TYPE_POINTER);
        signals[SIGNAL_SELECTION_CHANGED] = g_signal_new ("selection-changed",
                          G_TYPE_FROM_CLASS (object_class),
                          G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
        signals[SIGNAL_SELECTION_CHANGED] = g_signal_new ("selection-changed",
                          G_TYPE_FROM_CLASS (object_class),
                          G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -5367,7 +5364,7 @@ merge_selection_region (EvView *view,
                                                               view->scale,
                                                               &tmp_region);
 
                                                               view->scale,
                                                               &tmp_region);
 
-                       if (tmp_region) {
+                       if (tmp_region && !gdk_region_empty (tmp_region)) {
                                new_sel->covered_region = gdk_region_copy (tmp_region);
                        }
                }
                                new_sel->covered_region = gdk_region_copy (tmp_region);
                        }
                }
@@ -5454,13 +5451,16 @@ selection_free (EvViewSelection *selection)
 static void
 clear_selection (EvView *view)
 {
 static void
 clear_selection (EvView *view)
 {
-       g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL);
-       g_list_free (view->selection_info.selections);
-       view->selection_info.selections = NULL;
+       if (view->selection_info.selections) {
+               g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL);
+               g_list_free (view->selection_info.selections);
+               view->selection_info.selections = NULL;
+
+               g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL);
+       }
        view->selection_info.in_selection = FALSE;
        if (view->pixbuf_cache)
                ev_pixbuf_cache_set_selection_list (view->pixbuf_cache, NULL);
        view->selection_info.in_selection = FALSE;
        if (view->pixbuf_cache)
                ev_pixbuf_cache_set_selection_list (view->pixbuf_cache, NULL);
-       g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL);
 }
 
 void
 }
 
 void