diff --git a/CMakeLists.txt b/CMakeLists.txt
index 869458b1..34846f3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,8 @@ find_package(Qt5Multimedia)
find_package(Qt5Feedback)
find_package(Intl REQUIRED)
+find_package(LayerShellQt REQUIRED)
+
find_package(AnthyUnicode)
find_package(Anthy)
find_package(Pinyin)
@@ -180,6 +182,8 @@ endif()
target_compile_definitions(maliit-keyboard-common PRIVATE ${maliit-keyboard-definitions})
target_compile_features(maliit-keyboard-common PRIVATE cxx_std_17)
+target_link_libraries(maliit-keyboard-common LayerShellQt::Interface)
+
set(MALIIT_KEYBOARD_PLUGIN_SOURCES
src/plugin/plugin.cpp
src/plugin/plugin.h
diff --git a/src/keyboard/keyboard.cpp b/src/keyboard/keyboard.cpp
index ffd1dcb7..e12779d0 100644
--- a/src/keyboard/keyboard.cpp
+++ b/src/keyboard/keyboard.cpp
@@ -30,7 +30,7 @@
int main(int argc, char **argv) {
setenv("QT_IM_MODULE", "none", true);
- setenv("QT_WAYLAND_SHELL_INTEGRATION", "inputpanel-shell", true);
+ setenv("QT_WAYLAND_SHELL_INTEGRATION", "layer-shell;inputpanel-shell", true);
QGuiApplication app(argc, argv);
@@ -38,4 +38,4 @@ int main(int argc, char **argv) {
Maliit::StandaloneInputMethod inputMethod(&plugin);
return app.exec();
-}
\ No newline at end of file
+}
diff --git a/src/plugin/inputmethod_p.h b/src/plugin/inputmethod_p.h
index bee9e979..78374d34 100644
--- a/src/plugin/inputmethod_p.h
+++ b/src/plugin/inputmethod_p.h
@@ -14,6 +14,8 @@
* along with this program. If not, see .
*/
+#pragma once
+
#include "inputmethod.h"
#include "coreutils.h"
@@ -34,6 +36,8 @@
#include
#include
+#include
+
#include
#include
#include
@@ -58,6 +62,12 @@ QQuickView *createWindow(MAbstractInputMethodHost *host)
{
QScopedPointer view(new QQuickView);
+ LayerShellQt::Window *layerShell = LayerShellQt::Window::get(view.get());
+ layerShell->setLayer(LayerShellQt::Window::LayerTop);
+ layerShell->setAnchors(LayerShellQt::Window::AnchorBottom);
+ layerShell->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityOnDemand);
+ layerShell->setScope(QStringLiteral("input-panel"));
+
QSurfaceFormat format;
format.setAlphaBufferSize(8);
view->setFormat(format);