Merge lp:~michael-sheldon/ubuntu/utopic/maliit-framework/fix-input-method-size-updates into lp:ubuntu/utopic/maliit-framework

Proposed by Michael Sheldon
Status: Merged
Merge reported by: Ricardo Salveti
Merged at revision: not available
Proposed branch: lp:~michael-sheldon/ubuntu/utopic/maliit-framework/fix-input-method-size-updates
Merge into: lp:ubuntu/utopic/maliit-framework
Diff against target: 483 lines (+416/-3)
8 files modified
.pc/0009-update-input-region-when-hiding.patch/src/windowgroup.cpp (+176/-0)
.pc/0010-fix-building-with-g++-4.9.patch/src/src.pro (+193/-0)
.pc/applied-patches (+2/-0)
debian/changelog (+10/-0)
debian/patches/0009-update-input-region-when-hiding.patch (+25/-0)
debian/patches/series (+2/-0)
src/src.pro (+4/-0)
src/windowgroup.cpp (+4/-3)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu/utopic/maliit-framework/fix-input-method-size-updates
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+228860@code.launchpad.net

Commit message

Ensure that input method area sizes are always updated when sent from the keyboard plugin regardless of whether the keyboard is currently active. This allows for hiding animations to correctly set the input method area whilst the keyboard is otherwise inactive.

Description of the change

Ensures that input method area sizes are always updated when sent from the keyboard plugin regardless of whether the keyboard is currently active. This allows for hiding animations to correctly set the input method area whilst the keyboard is otherwise inactive.

To post a comment you must log in.
18. By Michael Sheldon

Fix building against g++ 4.9

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.pc/0009-update-input-region-when-hiding.patch'
=== added directory '.pc/0009-update-input-region-when-hiding.patch/src'
=== added file '.pc/0009-update-input-region-when-hiding.patch/src/windowgroup.cpp'
--- .pc/0009-update-input-region-when-hiding.patch/src/windowgroup.cpp 1970-01-01 00:00:00 +0000
+++ .pc/0009-update-input-region-when-hiding.patch/src/windowgroup.cpp 2014-08-04 15:52:39 +0000
@@ -0,0 +1,176 @@
1/* * This file is part of Maliit framework *
2 *
3 * Copyright (C) 2013 Openismus GmbH
4 *
5 * Contact: maliit-discuss@lists.maliit.org
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License version 2.1 as published by the Free Software Foundation
10 * and appearing in the file LICENSE.LGPL included in the packaging
11 * of this file.
12 */
13
14#include <QDebug>
15
16#include "abstractplatform.h"
17#include "windowgroup.h"
18
19namespace Maliit
20{
21
22WindowGroup::WindowGroup(const QSharedPointer<AbstractPlatform> &platform)
23 : m_platform(platform),
24 m_active(false)
25{
26 m_hideTimer.setSingleShot(true);
27 m_hideTimer.setInterval(2000);
28 connect(&m_hideTimer, SIGNAL(timeout()), this, SLOT(hideWindows()));
29}
30
31WindowGroup::~WindowGroup()
32{}
33
34void WindowGroup::activate()
35{
36 m_active = true;
37 m_hideTimer.stop();
38}
39
40void WindowGroup::deactivate(HideMode mode)
41{
42 if (m_active) {
43 m_active = false;
44
45 if (mode == HideImmediate) {
46 hideWindows();
47 } else {
48 m_hideTimer.start();
49 }
50 }
51}
52
53void WindowGroup::setupWindow(QWindow *window, Maliit::Position position)
54{
55 if (window) {
56 if (not containsWindow(window)) {
57 QWindow *parent = window->parent ();
58
59 if (parent and not containsWindow(parent)) {
60 qWarning () << "Plugin is misbehaving - tried to register a window with yet-unregistered parent!";
61 return;
62 }
63 m_window_list.append (WindowData(window, position));
64
65 window->setFlags (Qt::FramelessWindowHint |
66 Qt::WindowStaysOnTopHint |
67 Qt::WindowDoesNotAcceptFocus);
68
69 connect (window, SIGNAL (visibleChanged(bool)),
70 this, SLOT (onVisibleChanged(bool)));
71 connect (window, SIGNAL (heightChanged(int)),
72 this, SLOT (updateInputMethodArea()));
73 connect (window, SIGNAL (widthChanged(int)),
74 this, SLOT (updateInputMethodArea()));
75 connect (window, SIGNAL (xChanged(int)),
76 this, SLOT (updateInputMethodArea()));
77 connect (window, SIGNAL (yChanged(int)),
78 this, SLOT (updateInputMethodArea()));
79 m_platform->setupInputPanel(window, position);
80 updateInputMethodArea();
81 }
82 }
83}
84
85void WindowGroup::setScreenRegion(const QRegion &region, QWindow *window)
86{
87 if (window == 0 && m_window_list.size() > 0) {
88 window = m_window_list.at(0).m_window.data();
89 }
90 m_platform->setInputRegion(window, region);
91}
92
93void WindowGroup::setInputMethodArea(const QRegion &region, QWindow *window)
94{
95 if (window == 0 && m_window_list.size() > 0) {
96 window = m_window_list.at(0).m_window.data();
97 }
98
99 for (int i = 0; i < m_window_list.size(); ++i) {
100 WindowData &data = m_window_list[i];
101 if (data.m_window == window) {
102 data.m_inputMethodArea = region;
103 break;
104 }
105 }
106
107 if (m_active) {
108 updateInputMethodArea();
109 }
110}
111
112void WindowGroup::setApplicationWindow(WId id)
113{
114 Q_FOREACH (const WindowData &data, m_window_list) {
115 if (data.m_window and not data.m_window->parent()) {
116 m_platform->setApplicationWindow(data.m_window, id);
117 }
118 }
119}
120
121void WindowGroup::onVisibleChanged(bool visible)
122{
123 if (m_active) {
124 updateInputMethodArea();
125 } else if (visible) {
126 QWindow *window = qobject_cast<QWindow*>(sender());
127
128 if (window) {
129 qWarning () << "An inactive plugin is misbehaving - tried to show a window!";
130 window->setVisible (false);
131 }
132 }
133}
134
135void WindowGroup::updateInputMethodArea()
136{
137 QRegion new_area;
138
139 Q_FOREACH (const WindowData &data, m_window_list) {
140 if (data.m_window and not data.m_window->parent() and
141 data.m_window->isVisible() and
142 not data.m_inputMethodArea.isEmpty()) {
143 new_area |= data.m_inputMethodArea.translated(data.m_window->position());
144 }
145 }
146
147 if (new_area != m_last_im_area) {
148 m_last_im_area = new_area;
149 Q_EMIT inputMethodAreaChanged(m_last_im_area);
150 }
151}
152
153bool WindowGroup::containsWindow(QWindow *window)
154{
155 Q_FOREACH (const WindowData &data, m_window_list) {
156 if (data.m_window == window) {
157 return true;
158 }
159 }
160
161 return false;
162}
163
164void WindowGroup::hideWindows()
165{
166 m_hideTimer.stop();
167
168 Q_FOREACH (const WindowData &data, m_window_list) {
169 if (data.m_window) {
170 data.m_window->setVisible (false);
171 }
172 }
173 updateInputMethodArea();
174}
175
176} // namespace Maliit
0177
=== added directory '.pc/0010-fix-building-with-g++-4.9.patch'
=== added directory '.pc/0010-fix-building-with-g++-4.9.patch/src'
=== added file '.pc/0010-fix-building-with-g++-4.9.patch/src/src.pro'
--- .pc/0010-fix-building-with-g++-4.9.patch/src/src.pro 1970-01-01 00:00:00 +0000
+++ .pc/0010-fix-building-with-g++-4.9.patch/src/src.pro 2014-08-04 15:52:39 +0000
@@ -0,0 +1,193 @@
1include(../config.pri)
2
3TOP_DIR = ..
4
5VERSION = $$MALIIT_ABI_VERSION
6TEMPLATE = lib
7TARGET = $$TOP_DIR/lib/$$MALIIT_PLUGINS_LIB
8
9# Input
10PLUGIN_HEADERS_PUBLIC = \
11 maliit/plugins/inputmethodplugin.h \
12 maliit/plugins/abstractinputmethod.h \
13 maliit/plugins/abstractinputmethodhost.h \
14 maliit/plugins/keyoverride.h \
15 maliit/plugins/keyoverridedata.h \
16 maliit/plugins/attributeextension.h \
17 maliit/plugins/extensionevent.h \
18 maliit/plugins/updateevent.h \
19 maliit/plugins/updatereceiver.h \
20 maliit/plugins/plugindescription.h \
21 maliit/plugins/subviewdescription.h \
22 maliit/plugins/abstractpluginsetting.h \
23
24PLUGIN_SOURCES += \
25 maliit/plugins/abstractinputmethod.cpp \
26 maliit/plugins/abstractinputmethodhost.cpp \
27 maliit/plugins/keyoverride.cpp \
28 maliit/plugins/keyoverridedata.cpp \
29 maliit/plugins/attributeextension.cpp \
30 maliit/plugins/extensionevent.cpp \
31 maliit/plugins/updateevent.cpp \
32 maliit/plugins/updatereceiver.cpp \
33 maliit/plugins/plugindescription.cpp \
34 maliit/plugins/subviewdescription.cpp \
35
36PLUGIN_HEADERS_PRIVATE += \
37 maliit/plugins/keyoverride_p.h \
38 maliit/plugins/attributeextension_p.h \
39 maliit/plugins/extensionevent_p.h \
40 maliit/plugins/updateevent_p.h \
41
42SERVER_HEADERS_PUBLIC += \
43 mimserver.h \
44
45SERVER_SOURCES += \
46 mimserver.cpp \
47
48SERVER_HEADERS_PRIVATE += \
49 mimpluginmanager.h \
50 mimpluginmanager_p.h \
51 minputmethodhost.h \
52 mattributeextensionid.h \
53 mattributeextensionmanager.h \
54 msharedattributeextensionmanager.h \
55 mimhwkeyboardtracker.h \
56 mimonscreenplugins.h \
57 mimsubviewoverride.h \
58 mimserveroptions.h \
59 windowgroup.h \
60 windowdata.h \
61 abstractplatform.h \
62 unknownplatform.h \
63
64SERVER_SOURCES += \
65 mimpluginmanager.cpp \
66 minputmethodhost.cpp \
67 mattributeextensionid.cpp \
68 mattributeextensionmanager.cpp \
69 msharedattributeextensionmanager.cpp \
70 mimonscreenplugins.cpp \
71 mimsubviewoverride.cpp \
72 mimserveroptions.cpp \
73 windowgroup.cpp \
74 windowdata.cpp \
75 abstractplatform.cpp \
76 unknownplatform.cpp \
77
78!noxcb {
79 SERVER_HEADERS_PRIVATE += xcbplatform.h
80 SERVER_SOURCES += xcbplatform.cpp
81 PKGCONFIG += xcb xcb-xfixes
82}
83
84wayland {
85 SERVER_HEADERS_PRIVATE += waylandplatform.h
86 SERVER_SOURCES += waylandplatform.cpp
87}
88
89SETTINGS_HEADERS_PRIVATE += \
90 mimsettingsqsettings.h \
91 mimsettings.h \
92
93SETTINGS_SOURCES += \
94 mimsettings.cpp \
95 mimsettingsqsettings.cpp \
96
97QUICK_HEADERS_PRIVATE += \
98 quick/maliitquick.h \
99 quick/inputmethodquick.h \
100 quick/inputmethodquickplugin.h \
101 quick/keyoverridequick.h \
102 quick/keyoverridequick_p.h \
103
104QUICK_SOURCES += \
105 quick/inputmethodquick.cpp \
106 quick/inputmethodquickplugin.cpp \
107 quick/keyoverridequick.cpp \
108
109!nohwkeyboard {
110 SERVER_HEADERS_PRIVATE += mimhwkeyboardtracker_p.h
111 SERVER_SOURCES += mimhwkeyboardtracker.cpp
112
113 enable-contextkit {
114 PKGCONFIG += contextsubscriber-1.0
115 DEFINES += HAVE_CONTEXTSUBSCRIBER
116 } else {
117 # libudev needed by non-contextkit MImHwKeyboardTracker
118 PKGCONFIG += libudev
119 }
120} else {
121 SERVER_SOURCES += mimhwkeyboardtracker_stub.cpp
122}
123
124HEADERS += \
125 $$PLUGIN_HEADERS_PUBLIC \
126 $$PLUGIN_HEADERS_PRIVATE \
127 $$SERVER_HEADERS_PUBLIC \
128 $$SERVER_HEADERS_PRIVATE \
129 $$SETTINGS_HEADERS_PRIVATE \
130 $$QUICK_HEADERS_PRIVATE
131
132SOURCES += \
133 $$PLUGIN_SOURCES \
134 $$SERVER_SOURCES \
135 $$SETTINGS_SOURCES \
136 $$QUICK_SOURCES
137
138CONFIG += link_pkgconfig
139QT = core gui gui-private dbus qml quick
140
141
142# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
143for(OPTION,$$list($$lower($$COV_OPTION))){
144 isEqual(OPTION, on){
145 QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs -fno-elide-constructors
146 LIBS += -lgcov
147 }
148}
149
150OBJECTS_DIR = .obj
151MOC_DIR = .moc
152
153QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda
154
155target.path += $$LIBDIR
156
157plugins_headers.path += $$INCLUDEDIR/$$MALIIT_PLUGINS_HEADER/maliit/plugins
158plugins_headers.files += $$PLUGIN_HEADERS_PUBLIC
159
160server_headers.path += $$INCLUDEDIR/$$MALIIT_SERVER_HEADER
161server_headers.files += $$SERVER_HEADERS_PUBLIC
162
163OTHER_FILES += \
164 maliit-server.pc.in \
165 maliit-plugins.pc.in \
166 libmaliit-plugins.pri
167
168OTHER_FILES += \
169 config.h.in \
170 maliit-plugins.prf.in \
171 maliit-defines.prf.in \
172
173outputFiles(config.h maliit-defines.prf maliit-plugins.prf maliit-plugins.pc maliit-server.pc)
174
175install_pkgconfig.path = $${LIBDIR}/pkgconfig
176install_pkgconfig.files = \
177 $$OUT_PWD/MeegoImFramework.pc \
178 $$OUT_PWD/maliit-plugins.pc \
179 $$OUT_PWD/maliit-server.pc \
180
181install_prf.path = $$MALIIT_INSTALL_PRF
182install_prf.files = $$OUT_PWD/maliit-plugins.prf $$OUT_PWD/maliit-defines.prf
183
184INSTALLS += \
185 target \
186 plugins_headers \
187 server_headers \
188 install_prf \
189 install_pkgconfig \
190
191include($$TOP_DIR/weston-protocols/libmaliit-weston-protocols.pri)
192include($$TOP_DIR/connection/libmaliit-connection.pri)
193include($$TOP_DIR/common/libmaliit-common.pri)
0194
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2014-06-02 15:26:38 +0000
+++ .pc/applied-patches 2014-08-04 15:52:39 +0000
@@ -6,3 +6,5 @@
60006-fix_orientation_to_angle_mapping.patch60006-fix_orientation_to_angle_mapping.patch
70007-use_host_prefix_for_mkspecs.patch70007-use_host_prefix_for_mkspecs.patch
80008-qt5.3-fix.patch80008-qt5.3-fix.patch
90009-update-input-region-when-hiding.patch
100010-fix-building-with-g++-4.9.patch
911
=== modified file 'debian/changelog'
--- debian/changelog 2014-06-02 15:26:38 +0000
+++ debian/changelog 2014-08-04 15:52:39 +0000
@@ -1,3 +1,13 @@
1maliit-framework (0.99.0+git20130615+97e8335-0ubuntu10) utopic; urgency=medium
2
3 * Ensure that input method area sizes are always updated when sent from the
4 keyboard plugin regardless of whether the keyboard is currently active.
5 This allows for hiding animations to correctly set the input method area
6 whilst the keyboard is otherwise inactive.
7 * Fix building with g++ 4.9
8
9 -- Michael Sheldon <michael.sheldon@canonical.com> Mon, 04 Aug 2014 16:34:14 +0100
10
1maliit-framework (0.99.0+git20130615+97e8335-0ubuntu9) utopic; urgency=medium11maliit-framework (0.99.0+git20130615+97e8335-0ubuntu9) utopic; urgency=medium
2 12
3 [ Timo Jyrinki ]13 [ Timo Jyrinki ]
414
=== added file 'debian/patches/0009-update-input-region-when-hiding.patch'
--- debian/patches/0009-update-input-region-when-hiding.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0009-update-input-region-when-hiding.patch 2014-08-04 15:52:39 +0000
@@ -0,0 +1,25 @@
1Author: Michael Sheldon <michael.sheldon@canonical.com>
2Forwarded: no
3Description: Update input method area when hiding the keyboard
4 This patch ensures that maliit continues to update the input method area after the
5 keyboard has been dismissed. This allows keyboard hiding animations to provide a
6 smooth transition between the showing and hiding states.
7
8Index: maliit-framework-0.99+git20130702+97e8335/src/windowgroup.cpp
9===================================================================
10--- maliit-framework-0.99.0+git20130615+97e8335.orig/src/windowgroup.cpp
11+++ maliit-framework-0.99.0+git20130615+97e8335/src/windowgroup.cpp
12@@ -104,9 +104,10 @@ void WindowGroup::setInputMethodArea(con
13 }
14 }
15
16- if (m_active) {
17- updateInputMethodArea();
18- }
19+ // We should update the input method area regardless of whether we're still
20+ // active or not, as keyboard hiding animations could be changing this
21+ // region after we've deactivated
22+ updateInputMethodArea();
23 }
24
25 void WindowGroup::setApplicationWindow(WId id)
026
=== modified file 'debian/patches/series'
--- debian/patches/series 2014-06-02 15:26:38 +0000
+++ debian/patches/series 2014-08-04 15:52:39 +0000
@@ -6,3 +6,5 @@
60006-fix_orientation_to_angle_mapping.patch60006-fix_orientation_to_angle_mapping.patch
70007-use_host_prefix_for_mkspecs.patch70007-use_host_prefix_for_mkspecs.patch
80008-qt5.3-fix.patch80008-qt5.3-fix.patch
90009-update-input-region-when-hiding.patch
100010-fix-building-with-g++-4.9.patch
911
=== modified file 'src/src.pro'
--- src/src.pro 2013-07-23 19:47:04 +0000
+++ src/src.pro 2014-08-04 15:52:39 +0000
@@ -147,6 +147,10 @@
147 }147 }
148}148}
149149
150# g++ 4.9 introduces a new check for unused functions that we wish to ignore
151# to avoid removing upstream code
152QMAKE_CXXFLAGS += -Wno-unused-function
153
150OBJECTS_DIR = .obj154OBJECTS_DIR = .obj
151MOC_DIR = .moc155MOC_DIR = .moc
152156
153157
=== modified file 'src/windowgroup.cpp'
--- src/windowgroup.cpp 2013-07-23 19:47:04 +0000
+++ src/windowgroup.cpp 2014-08-04 15:52:39 +0000
@@ -104,9 +104,10 @@
104 }104 }
105 }105 }
106106
107 if (m_active) {107 // We should update the input method area regardless of whether we're still
108 updateInputMethodArea();108 // active or not, as keyboard hiding animations could be changing this
109 }109 // region after we've deactivated
110 updateInputMethodArea();
110}111}
111112
112void WindowGroup::setApplicationWindow(WId id)113void WindowGroup::setApplicationWindow(WId id)

Subscribers

People subscribed via source and target branches