on xenial help sign in
Resize input method surfaces to match the Shell size
0f863baDaniel d'Andrada
qml/Components/InputMethod.qml−7
@@ -74,15 +74,8 @@ Item {
74 }
74 }
75 }
75 }
76
76
77− function removeSurface() {
78− surface.parent = null;
79− surface.release();
80− }
81−
82 onSurfaceChanged: {
77 onSurfaceChanged: {
83 if (surface) {
78 if (surface) {
84− root.width = surface.implicitWidth;
85− root.height = surface.implicitHeight;
86 surface.parent = root;
79 surface.parent = root;
87 surface.anchors.fill = root;
80 surface.anchors.fill = root;
88 }
81 }
qml/Shell.qml+4−3
@@ -245,6 +245,7 @@ FocusScope {
245
245
246 InputMethod {
246 InputMethod {
247 id: inputMethod
247 id: inputMethod
248+ anchors.fill: parent
248 }
249 }
249
250
250 Connections {
251 Connections {
@@ -258,11 +259,11 @@ FocusScope {
258 }
259 }
259
260
260 onSurfaceDestroyed: {
261 onSurfaceDestroyed: {
261− var orphan = !surface.parent;
262 if (inputMethod.surface == surface) {
262 if (inputMethod.surface == surface) {
263− inputMethod.removeSurface(surface);
263+ inputMethod.surface = null;
264+ surface.parent = null;
264 }
265 }
265− if (orphan) {
266+ if (!surface.parent) {
266 // there's no one displaying it. delete it right away
267 // there's no one displaying it. delete it right away
267 surface.release();
268 surface.release();
268 }
269 }