]> git.pld-linux.org Git - packages/ibus-qt.git/blob - ibus-qt-HEAD.patch
- release 3 (by relup.sh)
[packages/ibus-qt.git] / ibus-qt-HEAD.patch
1 From 282bf68d2064972fd24de109e0280fd48c299c9c Mon Sep 17 00:00:00 2001
2 From: Peng Huang <shawn.p.huang@gmail.com>
3 Date: Thu, 25 Nov 2010 14:22:12 +0900
4 Subject: [PATCH] Fix selected text be deleted problem.
5
6 ---
7  qtim/ibus-input-context.cpp |   13 ++++++++++++-
8  1 files changed, 12 insertions(+), 1 deletions(-)
9
10 diff --git a/qtim/ibus-input-context.cpp b/qtim/ibus-input-context.cpp
11 index c47fce6..fdfd34a 100644
12 --- a/qtim/ibus-input-context.cpp
13 +++ b/qtim/ibus-input-context.cpp
14 @@ -722,11 +722,22 @@ IBusInputContext::displayPreeditText (const TextPointer &text, uint cursor_pos,
15  void
16  IBusInputContext::slotUpdatePreeditText (const TextPointer &text, uint cursor_pos, bool visible)
17  {
18 +    // set visible to false, if text is empty
19 +    visible = visible && !text->text ().isEmpty ();
20 +
21 +    // set cursor at end, if pos is greater than the text length
22 +    if (cursor_pos > (uint)text->text ().length ())
23 +        cursor_pos = text->text ().length ();
24 +
25 +    bool update = (m_preedit_visible != visible) || visible;
26 +
27      m_preedit = text;
28      m_preedit_visible = visible;
29      m_preedit_cursor_pos = cursor_pos;
30  
31 -    displayPreeditText (m_preedit, m_preedit_cursor_pos, visible);
32 +    if (update) {
33 +        displayPreeditText (m_preedit, m_preedit_cursor_pos, visible);
34 +    }
35  }
36  
37  void
38 -- 
39 1.7.2.1
40
This page took 0.12804 seconds and 3 git commands to generate.