public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Samuli Suominen (ssuominen)" <ssuominen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in www-client/midori/files: midori-0.4.0-webkit151.patch
Date: Sun,  2 Oct 2011 21:31:10 +0000 (UTC)	[thread overview]
Message-ID: <20111002213110.0AC462004C@flycatcher.gentoo.org> (raw)

ssuominen    11/10/02 21:31:10

  Added:                midori-0.4.0-webkit151.patch
  Log:
  Fix building with webkit-gtk >= 1.5.1 wrt #385371 by Hanno Meyer-Thurow
  
  (Portage version: 2.2.0_alpha60/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  www-client/midori/files/midori-0.4.0-webkit151.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/midori/files/midori-0.4.0-webkit151.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/midori/files/midori-0.4.0-webkit151.patch?rev=1.1&content-type=text/plain

Index: midori-0.4.0-webkit151.patch
===================================================================
From 648d869e4ff69f121da97484a0fd553b005ca751 Mon Sep 17 00:00:00 2001
From: Christian Dywan <christian@twotoasts.de>
Date: Wed, 21 Sep 2011 21:50:51 +0000
Subject: Use DOM API to get selected text in WebKitGTK+ 1.5.1

Fixes: https://bugs.launchpad.net/midori/+bug/799603
---
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 0d7a96e..e426e7f 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -39,9 +39,11 @@
     #include <sys/utsname.h>
 #endif
 
+#if !WEBKIT_CHECK_VERSION (1, 5, 1)
 /* This is unstable API, so we need to declare it */
 gchar*
 webkit_web_view_get_selected_text (WebKitWebView* web_view);
+#endif
 
 static void
 midori_view_construct_web_view (MidoriView* view);
@@ -4167,10 +4169,33 @@ midori_view_get_link_uri (MidoriView* view)
 gboolean
 midori_view_has_selection (MidoriView* view)
 {
+#if WEBKIT_CHECK_VERSION (1, 5, 1)
+    WebKitDOMDocument* doc;
+    WebKitDOMDOMWindow* window;
+    WebKitDOMDOMSelection* selection;
+    WebKitDOMRange* range;
+#endif
+
     g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE);
 
+
+#if WEBKIT_CHECK_VERSION (1, 5, 1)
+    doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
+    window = webkit_dom_document_get_default_view (doc);
+    selection = webkit_dom_dom_window_get_selection (window);
+    if (selection == NULL)
+        return FALSE;
+
+    range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
+    if (range == NULL)
+        return FALSE;
+
+    katze_assign (view->selected_text, webkit_dom_range_get_text (range));
+#else
     katze_assign (view->selected_text, webkit_web_view_get_selected_text (
         WEBKIT_WEB_VIEW (view->web_view)));
+#endif
+
     if (view->selected_text && *view->selected_text)
         return TRUE;
     else
--
cgit 






             reply	other threads:[~2011-10-02 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-02 21:31 Samuli Suominen (ssuominen) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-11  7:20 [gentoo-commits] gentoo-x86 commit in www-client/midori/files: midori-0.4.0-webkit151.patch Samuli Suominen (ssuominen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111002213110.0AC462004C@flycatcher.gentoo.org \
    --to=ssuominen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox