diff options
author | Johan Klokkhammer Helsing <johan.helsing@theqtcompany.com> | 2016-02-17 12:51:54 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@theqtcompany.com> | 2016-03-24 11:30:33 +0000 |
commit | d87d8b8afdd377e17a98b4d0f51c4bb0aaec25c2 (patch) | |
tree | 675df7cb09e6da37db7b6eb654371f1412f10fa5 /src/compositor/compositor_api/qwaylandkeyboard.cpp | |
parent | bfa0951619e56e856cc1443f78fbdb66e3bde009 (diff) |
Initial compositor support for xdg-shell wayland extension
xdg-shell is an extension to the wayland protocol providing
functionality suited towards traditional desktop environments.
Most of the examples from Weston now require xdg-shell, ivi-shell or
some other custom extension. In order for our compositor-api to support
those examples and many real-world applications, we needed a compositor
implementation of xdg-shell.
This commit adds a class QWaylandXdgShell, along with
QWaylandXdgSurface and QWaylandXdgPopup. These clases are used almost
exactly like the corresponding QWaylandShell* variants.
qwindow-compositor has been updated to use the new functionality.
qwindow-compositor now only sets focus on surfaces that have a role.
weston-terminal was crashing because we set keyboard focus on the cursor
surface.
Keyboard focus handling has been slightly changed. Most of the
functionality has been moved from QWaylandKeyboard::setFocus to
QWaylandInputDevice::setKeyboardFocus. This is done in order to track
where the keyboard focus should have been, in case the input device
(seat) does not currently have a keyboard capability.
If a keyboard capability is later set on the input device, its focus
will automatically be set to the value stored in QWaylandInputDevice.
The reason for the change in keyboard focus handling is that we need to
know if an xdgSurface has keyboard focus in order to know whether to
send the Activated state in configure events. The Activated state tells
the client to draw itself as having focus (i.e. title bar not grayed out).
Change-Id: I1b1ca9a4223e87f5ade1e0f4c975979a400c38cb
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandkeyboard.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandkeyboard.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index a707d6470..caf2c9255 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -41,8 +41,6 @@ #include <QtWaylandCompositor/QWaylandInputDevice> #include <QtWaylandCompositor/QWaylandClient> -#include <QtWaylandCompositor/QWaylandShellSurface> - #include <QtCore/QFile> #include <QtCore/QStandardPaths> @@ -532,14 +530,10 @@ QWaylandSurface *QWaylandKeyboard::focus() const /*! * Sets the current focus to \a surface. */ -bool QWaylandKeyboard::setFocus(QWaylandSurface *surface) +void QWaylandKeyboard::setFocus(QWaylandSurface *surface) { Q_D(QWaylandKeyboard); - QWaylandShellSurface *shellsurface = QWaylandShellSurface::findIn(surface); - if (shellsurface && shellsurface->focusPolicy() == QWaylandShellSurface::NoKeyboardFocus) - return false; d->focused(surface); - return true; } /*! |