[arch-commits] Commit in midori/trunk (PKGBUILD webkit_search.diff)

andyrtr at archlinux.org andyrtr at archlinux.org
Mon Oct 3 10:21:45 EDT 2011


    Date: Monday, October 3, 2011 @ 10:21:45
  Author: andyrtr
Revision: 139575

upgpkg: midori 0.4.0-2

fix text search, FS26207

Added:
  midori/trunk/webkit_search.diff
Modified:
  midori/trunk/PKGBUILD

--------------------+
 PKGBUILD           |   14 +++++++++---
 webkit_search.diff |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-10-03 14:01:31 UTC (rev 139574)
+++ PKGBUILD	2011-10-03 14:21:45 UTC (rev 139575)
@@ -5,7 +5,7 @@
 
 pkgname=midori
 pkgver=0.4.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A lightweight web browser based on Gtk WebKit"
 arch=('i686' 'x86_64')
 url="http://www.twotoasts.de/index.php?/pages/midori_summary.html"
@@ -14,11 +14,19 @@
 depends=('libwebkit>=1.3.13' 'libunique' 'hicolor-icon-theme' 'desktop-file-utils' 'libnotify>=0.7.1' 'libxss' 'sqlite3' 'glib2')
 makedepends=('libxml2' 'intltool' 'gtk-doc' 'librsvg' 'python2>=2.7.1' 'vala') # 'git'
 optdepends=('vala: for use in extensions')
-source=(http://archive.xfce.org/src/apps/$pkgname/0.4/$pkgname-$pkgver.tar.bz2)
-md5sums=('14aa14ccabf3d003903f1584dab15d7a')
+source=(http://archive.xfce.org/src/apps/$pkgname/0.4/$pkgname-$pkgver.tar.bz2
+	webkit_search.diff)
+md5sums=('14aa14ccabf3d003903f1584dab15d7a'
+         '293c026e1875145e0df9584e1ff2a70e')
+sha1sums=('c6d1d41f4e3c97bd2839235bd9d7b2a8a408c585'
+          '82bba447bc1aaeabf0ec95f3ddaf5c24dd27474c')
 
 build() {
   cd ${srcdir}/${pkgname}-${pkgver}
+  
+  # FS#26207
+  patch -Np1 -i ${srcdir}/webkit_search.diff
+  
   # python2 
   export PYTHON=/usr/bin/python2
   sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" wscript waf

Added: webkit_search.diff
===================================================================
--- webkit_search.diff	                        (rev 0)
+++ webkit_search.diff	2011-10-03 14:21:45 UTC (rev 139575)
@@ -0,0 +1,59 @@
+From 648d869e4ff69f121da97484a0fd553b005ca751 Mon Sep 17 00:00:00 2001
+From: Christian Dywan <christian at 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 



More information about the arch-commits mailing list