diff options
author | Philippe Coval <philippe.coval@open.eurogiciel.org> | 2014-03-26 10:16:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-09 11:44:30 +0200 |
commit | 768484daaa64bea965bef981a16f59be8db0c190 (patch) | |
tree | 0e65a8d37f340a4dcdd1f3eb10f4245afba9e35a /src/client/qwaylanddisplay.cpp | |
parent | c2a22eea6716e073875474adf624d8463eba836c (diff) |
Add minimize feature to QWindow using wayland's xdg-shell
The feature is disabled by default,
and can be enabled at runtime
by exporting QT_WAYLAND_USE_XDG_SHELL env variable.
This patch relies on presence of protocol file
which has been imported from weston-1.4.0 sources,
until the xdg-shell is merge into wayland itself.
Because xdg-shell is experimental,
code fallback to WaylandShell if no XdgShell
but keep in mind those shells are exclusive.
Since xdg-shell and wayland-shell share most of the API,
some factorization is done by an (empty) abstraction class
to keep the code more readable.
Despite xdg-shell introduces new popups concept,
they're not used on this change for maitainance purpose.
Notes:
* This change depends on presence of xdg-shell protocol file.
* You can check a demo video
(qt-tizen-cinematic-experience-20140430-rzr)
of the test case at :
https://www.youtube.com/watch?v=pY_XXvKc_0E#
* Use Super+Tab to show window again if hidden
Task-number: QTBUG-38633/part/2of2
Change-Id: I2d7ed85bea1847d82439fdfc893a3dbb2581c14a
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 3576c0bd2..88b4e3889 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -61,6 +61,7 @@ #include "qwaylandqtkey_p.h" #include <QtWaylandClient/private/qwayland-text.h> +#include <QtWaylandClient/private/qwayland-xdg-shell.h> #include <QtCore/QAbstractEventDispatcher> #include <QtGui/private/qguiapplication_p.h> @@ -206,6 +207,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin mCompositor.init(registry, id); } else if (interface == QStringLiteral("wl_shm")) { mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1)); + } else if (interface == QStringLiteral("xdg_shell") + && qEnvironmentVariableIsSet("QT_WAYLAND_USE_XDG_SHELL")) { + mShellXdg.reset(new QtWayland::xdg_shell(registry, id)); + mShellXdg->use_unstable_version(QtWayland::xdg_shell::version_current); } else if (interface == QStringLiteral("wl_shell")){ mShell.reset(new QtWayland::wl_shell(registry, id)); } else if (interface == QStringLiteral("wl_seat")) { |