[arch-commits] Commit in inkscape/trunk (PKGBUILD ime-placement.patch)
Gaetan Bisson
bisson at nymeria.archlinux.org
Tue Apr 22 02:10:12 UTC 2014
Date: Tuesday, April 22, 2014 @ 04:10:12
Author: bisson
Revision: 211634
fix FS#39898
Added:
inkscape/trunk/ime-placement.patch
Modified:
inkscape/trunk/PKGBUILD
---------------------+
PKGBUILD | 9 ++++---
ime-placement.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-04-21 19:51:24 UTC (rev 211633)
+++ PKGBUILD 2014-04-22 02:10:12 UTC (rev 211634)
@@ -5,7 +5,7 @@
pkgname=inkscape
pkgver=0.48.4
-pkgrel=13
+pkgrel=14
pkgdesc='Vector graphics editor using the SVG file format'
url='http://inkscape.sourceforge.net/'
license=('GPL' 'LGPL')
@@ -20,10 +20,12 @@
'uniconvertor: reading/writing to some proprietary formats')
source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2"
'spuriouscomma.patch'
- 'freetype.patch'
- 'gc74.patch')
+ 'ime-placement.patch'
+ 'freetype.patch'
+ 'gc74.patch')
sha1sums=('5f26f6ad191d1e7c2a9fb69a438722beb172224c'
'7d1d5a6d1d2b0926721a994d5889c52890fc57c1'
+ 'b12b948ca5ee7e02703a13aa8b8bccdf67947f12'
'aba4d98bebae088c3401fd9259ea3cf70b96fbbf'
'3e1b5b6852d668388a857bc7a73fb7731fb262b8')
@@ -33,6 +35,7 @@
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ../gc74.patch # FS#39106
patch -p0 -i ../freetype.patch # FS#37956
+ patch -p1 -i ../ime-placement.patch # FS#39898
patch -p0 -i ../spuriouscomma.patch
sed -i 's|/usr/bin/python\>|/usr/bin/python2|g' cxxtest/*.py
sed -i 's|/usr/bin/env python\>|/usr/bin/env python2|g' share/*/{test/,}*.py
Added: ime-placement.patch
===================================================================
--- ime-placement.patch (rev 0)
+++ ime-placement.patch 2014-04-22 02:10:12 UTC (rev 211634)
@@ -0,0 +1,62 @@
+diff -aur old/src/text-context.cpp new/src/text-context.cpp
+--- old/src/text-context.cpp 2011-07-08 08:25:09.468790000 -1000
++++ new/src/text-context.cpp 2014-04-21 14:48:22.668759004 -1000
+@@ -684,6 +684,17 @@
+ // articifically here, for the text object does not exist yet:
+ double cursor_height = sp_desktop_get_font_size_tool(desktop);
+ sp_ctrlline_set_coords(SP_CTRLLINE(tc->cursor), dtp, dtp + Geom::Point(0, cursor_height));
++ if (tc->imc) {
++ GdkRectangle im_cursor;
++ Geom::Point const top_left = SP_EVENT_CONTEXT(tc)->desktop->get_display_area().corner(3);
++ Geom::Point const cursor_size(0, cursor_height);
++ Geom::Point const im_position = SP_EVENT_CONTEXT(tc)->desktop->d2w(dtp + cursor_size - top_left);
++ im_cursor.x = (int) floor(im_position[Geom::X]);
++ im_cursor.y = (int) floor(im_position[Geom::Y]);
++ im_cursor.width = 0;
++ im_cursor.height = (int) -floor(SP_EVENT_CONTEXT(tc)->desktop->d2w(cursor_size)[Geom::Y]);
++ gtk_im_context_set_cursor_location(tc->imc, &im_cursor);
++ }
+ event_context->_message_context->set(Inkscape::NORMAL_MESSAGE, _("Type text; <b>Enter</b> to start new line.")); // FIXME:: this is a copy of a string from _update_cursor below, do not desync
+
+ event_context->within_tolerance = false;
+@@ -1560,8 +1571,6 @@
+ static void
+ sp_text_context_update_cursor(SPTextContext *tc, bool scroll_to_see)
+ {
+- GdkRectangle im_cursor = { 0, 0, 1, 1 };
+-
+ // due to interruptible display, tc may already be destroyed during a display update before
+ // the cursor update (can't do both atomically, alas)
+ if (!tc->desktop) return;
+@@ -1586,10 +1595,17 @@
+ sp_ctrlline_set_coords(SP_CTRLLINE(tc->cursor), d0, d1);
+
+ /* fixme: ... need another transformation to get canvas widget coordinate space? */
+- im_cursor.x = (int) floor(d0[Geom::X]);
+- im_cursor.y = (int) floor(d0[Geom::Y]);
+- im_cursor.width = (int) floor(d1[Geom::X]) - im_cursor.x;
+- im_cursor.height = (int) floor(d1[Geom::Y]) - im_cursor.y;
++ if (tc->imc) {
++ GdkRectangle im_cursor = { 0, 0, 1, 1 };
++ Geom::Point const top_left = SP_EVENT_CONTEXT(tc)->desktop->get_display_area().corner(3);
++ Geom::Point const im_d0 = SP_EVENT_CONTEXT(tc)->desktop->d2w(d0 - top_left);
++ Geom::Point const im_d1 = SP_EVENT_CONTEXT(tc)->desktop->d2w(d1 - top_left);
++ im_cursor.x = (int) floor(im_d0[Geom::X]);
++ im_cursor.y = (int) floor(im_d1[Geom::Y]);
++ im_cursor.width = (int) floor(im_d1[Geom::X]) - im_cursor.x;
++ im_cursor.height = (int) floor(im_d0[Geom::Y]) - im_cursor.y;
++ gtk_im_context_set_cursor_location(tc->imc, &im_cursor);
++ }
+
+ tc->show = TRUE;
+ tc->phase = 1;
+@@ -1631,9 +1647,6 @@
+ }
+ }
+
+- if (tc->imc) {
+- gtk_im_context_set_cursor_location(tc->imc, &im_cursor);
+- }
+ SP_EVENT_CONTEXT(tc)->desktop->emitToolSubselectionChanged((gpointer)tc);
+ }
+
More information about the arch-commits
mailing list