X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libview%2Fev-view.c;h=9c125d3135102f8a5c6669fcde7b9b9e1344dfa9;hb=9aa54d8bf6ca229d5dc473b73336d799c8bf448f;hp=7ef1dd862b462db4b29f3e79f76ff6e34232421e;hpb=571c029b39457f4971a58f73819f67bd5dcd5145;p=evince.git diff --git a/libview/ev-view.c b/libview/ev-view.c index 7ef1dd86..9c125d31 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -3096,29 +3096,26 @@ ev_view_do_popup_menu (EvView *view, gdouble x, gdouble y) { + GList *items = NULL; 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); - 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); - 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; } @@ -3923,7 +3920,7 @@ draw_loading_text (EvView *view, 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; @@ -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_cclosure_marshal_VOID__OBJECT, + g_cclosure_marshal_VOID__POINTER, 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, @@ -5367,7 +5364,7 @@ merge_selection_region (EvView *view, view->scale, &tmp_region); - if (tmp_region) { + if (tmp_region && !gdk_region_empty (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) { - 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); - g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL); } void