From 53326bfa3fabb0f90109093a0f127f2422fdc888 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 11 Jan 2016 15:13:07 +0100 Subject: [PATCH 1/3] Fix the control key Let Ctrl+A cause a key event with text Ctrl+A (0x01), like we do on the other platforms. Previously we would use 'A', which would confuse some applications. Task-number: QTBUG-50398 Change-Id: Ie3def4bd9c96e538b2572b88fae029d347e08814 Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 9ac678c93b5..567620ba50d 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -645,6 +645,13 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, qtkey = QWaylandXkb::keysymToQtKey(sym, modifiers, text); + + // Map control + letter to proper text + if (utf32 >= 'A' && utf32 <= '~' && (modifiers & Qt::ControlModifier)) { + utf32 &= ~0x60; + text = QString::fromUcs4(&utf32, 1); + } + QWindowSystemInterface::handleExtendedKeyEvent(window->window(), time, type, qtkey, modifiers, From 4c0a1bc3b0bb64f131cdeda265c1d038cd5b9ecf Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 11 Jan 2016 14:28:24 +0100 Subject: [PATCH 2/3] Don't create wl_surface for desktop widgets Change-Id: I3ebcb49a4acf230b9515c0317aab2307dcb9270b Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index ed7b656d903..fe0d6bb9516 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -88,8 +88,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window) { static WId id = 1; mWindowId = id++; - - initWindow(); + if (window->type() != Qt::Desktop) + initWindow(); } QWaylandWindow::~QWaylandWindow() From c70987cd65ba3ba0927593e2c87a2ea631a25d24 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 10 Feb 2016 12:51:26 +0100 Subject: [PATCH 3/3] Fix freeze when using BypassWindowManagerHint Shell surfaces are now created for windows with BypassWindowManager set, unless the environment variable QT_WAYLAND_USE_BYPASSWINDOWMANAGERHINT is also set. This means that in case you need a window to not create a wayland shell_surface (perhaps because you do not want to use wl_shell or xdg_shell), you can set the environment variable and get the same behavior as before. Meaning the surfaces of windows with the flag set will not be assigned a role. Task-number: QTBUG-49272 Change-Id: Idf969540497d6b4e54395b97472d99d2e068be93 Reviewed-by: Giulio Camuffo Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index fe0d6bb9516..fa4e20f948b 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -122,7 +122,8 @@ void QWaylandWindow::initWindow() if (::wl_subsurface *ss = mDisplay->createSubSurface(this, p)) { mSubSurfaceWindow = new QWaylandSubSurface(this, p, ss); } - } else if (!(window()->flags() & Qt::BypassWindowManagerHint)) { + } else if (!(qEnvironmentVariableIsSet("QT_WAYLAND_USE_BYPASSWINDOWMANAGERHINT") && + window()->flags() & Qt::BypassWindowManagerHint)) { mShellSurface = mDisplay->createShellSurface(this); }