Merge lp:~michael-sheldon/ubuntu-keyboard/disable-height-switch into lp:ubuntu-keyboard

Proposed by Michael Zanetti
Status: Merged
Approved by: Bill Filler
Approved revision: 328
Merged at revision: 371
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/disable-height-switch
Merge into: lp:ubuntu-keyboard
Diff against target: 113 lines (+29/-6)
4 files modified
data/schemas/com.canonical.keyboard.maliit.gschema.xml (+5/-0)
src/plugin/inputmethod.cpp (+12/-6)
src/plugin/keyboardsettings.cpp (+10/-0)
src/plugin/keyboardsettings.h (+2/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/disable-height-switch
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+250800@code.launchpad.net

Commit message

Allow the keyboard's height reporting to be disabled when the system is in windowed mode.

Description of the change

Allow the keyboard's height reporting to be disabled when the system is in windowed mode.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/schemas/com.canonical.keyboard.maliit.gschema.xml'
2--- data/schemas/com.canonical.keyboard.maliit.gschema.xml 2015-04-13 10:54:12 +0000
3+++ data/schemas/com.canonical.keyboard.maliit.gschema.xml 2015-04-24 15:44:18 +0000
4@@ -66,6 +66,11 @@
5 <description>Never show the keyboard (e.g. because a hardware keyboard has been connected.)</description>
6 <default>false</default>
7 </key>
8+ <key name="disable-height" type="b">
9+ <summary>Disable height reporting</summary>
10+ <description>Always report a height of 0</description>
11+ <default>false</default>
12+ </key>
13 <key name="plugin-paths" type="as">
14 <summary>Plugin paths</summary>
15 <description>A list of locations to search for keyboard layout plugins in addition to the keyboard data directory.</description>
16
17=== modified file 'src/plugin/inputmethod.cpp'
18--- src/plugin/inputmethod.cpp 2015-04-15 14:03:42 +0000
19+++ src/plugin/inputmethod.cpp 2015-04-24 15:44:18 +0000
20@@ -109,6 +109,7 @@
21 connect(d->editor.wordEngine(), SIGNAL(pluginChanged()), this, SLOT(onWordEnginePluginChanged()));
22 connect(this, SIGNAL(keyboardStateChanged(QString)), &d->editor, SLOT(onKeyboardStateChanged(QString)));
23 connect(d->m_geometry, SIGNAL(visibleRectChanged()), this, SLOT(onVisibleRectChanged()));
24+ connect(&d->m_settings, SIGNAL(disableHeightChanged(bool)), this, SLOT(onVisibleRectChanged()));
25 d->registerAudioFeedbackSoundSetting();
26 d->registerAudioFeedbackSetting();
27 d->registerHapticFeedbackSetting();
28@@ -616,6 +617,17 @@
29 qGuiApp->primaryScreen()->primaryOrientation(),
30 d->m_geometry->visibleRect().toRect());
31
32+ d->applicationApiWrapper->reportOSKVisible(
33+ visibleRect.x(),
34+ visibleRect.y(),
35+ visibleRect.width(),
36+ visibleRect.height()
37+ );
38+
39+ if (d->m_settings.disableHeight()) {
40+ visibleRect.setHeight(0);
41+ }
42+
43 inputMethodHost()->setScreenRegion(QRegion(visibleRect));
44 inputMethodHost()->setInputMethodArea(visibleRect, d->view);
45
46@@ -626,12 +638,6 @@
47 << visibleRect.height()
48 << "> to the app manager.";
49
50- d->applicationApiWrapper->reportOSKVisible(
51- visibleRect.x(),
52- visibleRect.y(),
53- visibleRect.width(),
54- visibleRect.height()
55- );
56 }
57
58 const QString InputMethod::currentPluginPath() const
59
60=== modified file 'src/plugin/keyboardsettings.cpp'
61--- src/plugin/keyboardsettings.cpp 2015-04-15 14:03:42 +0000
62+++ src/plugin/keyboardsettings.cpp 2015-04-24 15:44:18 +0000
63@@ -46,6 +46,7 @@
64 const QLatin1String KEY_PRESS_HAPTIC_FEEDBACK_KEY = QLatin1String("keyPressHapticFeedback");
65 const QLatin1String DOUBLE_SPACE_FULL_STOP_KEY = QLatin1String("doubleSpaceFullStop");
66 const QLatin1String STAY_HIDDEN_KEY = QLatin1String("stayHidden");
67+const QLatin1String DISABLE_HEIGHT_KEY = QLatin1String("disableHeight");
68 const QLatin1String PLUGIN_PATHS_KEY = QLatin1String("pluginPaths");
69
70 /*!
71@@ -199,6 +200,11 @@
72 return m_settings->get(PLUGIN_PATHS_KEY).toStringList();
73 }
74
75+bool KeyboardSettings::disableHeight() const
76+{
77+ return m_settings->get(DISABLE_HEIGHT_KEY).toBool();
78+}
79+
80 /*!
81 * \brief KeyboardSettings::settingUpdated slot to handle changes in the settings backend
82 * A specialized signal is emitted for the affected setting
83@@ -241,6 +247,10 @@
84 return;
85 } else if (key == STAY_HIDDEN_KEY) {
86 Q_EMIT stayHiddenChanged(stayHidden());
87+ return;
88+ } else if (key == DISABLE_HEIGHT_KEY) {
89+ Q_EMIT disableHeightChanged(disableHeight());
90+ return;
91 } else if (key == PLUGIN_PATHS_KEY) {
92 Q_EMIT pluginPathsChanged(pluginPaths());
93 }
94
95=== modified file 'src/plugin/keyboardsettings.h'
96--- src/plugin/keyboardsettings.h 2015-04-13 10:54:12 +0000
97+++ src/plugin/keyboardsettings.h 2015-04-24 15:44:18 +0000
98@@ -57,6 +57,7 @@
99 bool keyPressHapticFeedback() const;
100 bool doubleSpaceFullStop() const;
101 bool stayHidden() const;
102+ bool disableHeight() const;
103 QStringList pluginPaths() const;
104
105 Q_SIGNALS:
106@@ -72,6 +73,7 @@
107 void keyPressHapticFeedbackChanged(bool);
108 void doubleSpaceFullStopChanged(bool);
109 void stayHiddenChanged(bool);
110+ void disableHeightChanged(bool);
111 void pluginPathsChanged(QStringList);
112
113 private:

Subscribers

People subscribed via source and target branches