Double-check that view->selected_text is set

Sometimes view->selected_text isn't set even if
context has WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION
This commit is contained in:
André Stösel 2012-03-20 18:25:56 +01:00 committed by Christian Dywan
parent 532335702a
commit 90eaea3dca

View file

@ -2357,7 +2357,8 @@ midori_view_populate_popup (MidoriView* view,
context = katze_object_get_int (view->hit_test, "context"); context = katze_object_get_int (view->hit_test, "context");
has_selection = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION; has_selection = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;
/* Ensure view->selected_text */ /* Ensure view->selected_text */
midori_view_has_selection (view); if (!midori_view_has_selection (view))
has_selection = false;
is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE; is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
is_image = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE; is_image = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
is_media = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA; is_media = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;