]> spindle.queued.net Git - midori/commitdiff
Double-check that view->selected_text is set
authorAndré Stösel <andre@stoesel.de>
Tue, 20 Mar 2012 17:25:56 +0000 (18:25 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 22 Mar 2012 20:29:52 +0000 (21:29 +0100)
Sometimes view->selected_text isn't set even if
context has WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION

midori/midori-view.c

index 2e149783cba79f8b4f1a9eaeaf0e1922e77cac0e..752261b6a93379dc430709043b530a2b477615ea 100644 (file)
@@ -2357,7 +2357,8 @@ midori_view_populate_popup (MidoriView* view,
     context = katze_object_get_int (view->hit_test, "context");
     has_selection = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;
     /* 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_image = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
     is_media = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;