Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ if(enable-wayland)
find_package(Wayland REQUIRED)
find_package(Qt5WaylandClient 5.14 REQUIRED PRIVATE)
find_package(Qt5XkbCommonSupport REQUIRED PRIVATE)
find_package(LayerShellQt REQUIRED PRIVATE)
pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon)
find_package(Gtk3)
endif()
Expand Down Expand Up @@ -108,7 +109,7 @@ qt5_add_dbus_interface(CONNECTION_SOURCES dbus_interfaces/minputmethodserver1int
add_library(maliit-connection STATIC ${CONNECTION_SOURCES})
target_link_libraries(maliit-connection Qt5::Core Qt5::DBus Qt5::Gui maliit-common)
if(enable-wayland)
target_link_libraries(maliit-connection Wayland::Client PkgConfig::XKBCOMMON)
target_link_libraries(maliit-connection Wayland::Client PkgConfig::XKBCOMMON LayerShellQt::Interface)
target_include_directories(maliit-connection PRIVATE ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS})
endif()
target_include_directories(maliit-connection PUBLIC connection)
Expand Down Expand Up @@ -201,7 +202,6 @@ if(enable-wayland)
list(APPEND PLUGINS_SOURCES
src/waylandplatform.cpp
src/waylandplatform.h)

endif()

if(enable-hwkeyboard)
Expand Down
27 changes: 25 additions & 2 deletions src/waylandplatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@

#include <wayland-client.h>

#include <QDebug>
#include <QGuiApplication>
#include <QRegion>
#include <QWindow>
#include <LayerShellQt/Window>

#include "waylandplatform.h"
#include "windowdata.h"

using namespace LayerShellQt;

namespace Maliit
{

Expand All @@ -35,8 +40,26 @@ WaylandPlatform::WaylandPlatform()
void WaylandPlatform::setupInputPanel(QWindow* window,
Maliit::Position position)
{
Q_UNUSED(window)
Q_UNUSED(position)
if (qgetenv("QT_WAYLAND_SHELL_INTEGRATION") == QByteArray("layer-shell")) {
auto ls_window = Window::get(window);
ls_window->setDesiredOutput(QGuiApplication::primaryScreen());
ls_window->setLayer(Window::Layer::LayerOverlay);
Window::Anchors anchors = Window::Anchor::AnchorBottom;
switch (position) {
case PositionLeftBottom: {
anchors |= Window::Anchor::AnchorLeft;
break;
}
case PositionRightBottom: {
anchors |= Window::Anchor::AnchorRight;
break;
}
default: {
break;
}
}
ls_window->setAnchors(anchors);
}
}

void WaylandPlatform::setInputRegion(QWindow* window,
Expand Down