summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwlshellsurface_p.h
diff options
context:
space:
mode:
authorPhilippe Coval <philippe.coval@open.eurogiciel.org>2014-03-26 10:16:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-09 11:44:30 +0200
commit768484daaa64bea965bef981a16f59be8db0c190 (patch)
tree0e65a8d37f340a4dcdd1f3eb10f4245afba9e35a /src/client/qwaylandwlshellsurface_p.h
parentc2a22eea6716e073875474adf624d8463eba836c (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/qwaylandwlshellsurface_p.h')
-rw-r--r--src/client/qwaylandwlshellsurface_p.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h
new file mode 100644
index 000000000..d02bb7bfe
--- /dev/null
+++ b/src/client/qwaylandwlshellsurface_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDWLSHELLSURFACE_H
+#define QWAYLANDWLSHELLSURFACE_H
+
+#include <QtCore/QSize>
+
+#include <wayland-client.h>
+
+#include <QtWaylandClient/private/qwayland-wayland.h>
+#include <QtWaylandClient/private/qwaylandclientexport_p.h>
+#include "qwaylandshellsurface_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWaylandWindow;
+class QWaylandInputDevice;
+class QWindow;
+
+class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QtWayland::wl_shell_surface
+ , public QWaylandShellSurface
+{
+public:
+ QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window);
+ virtual ~QWaylandWlShellSurface();
+
+ using QtWayland::wl_shell_surface::resize;
+ void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) Q_DECL_OVERRIDE;
+
+ using QtWayland::wl_shell_surface::move;
+ void move(QWaylandInputDevice *inputDevice) Q_DECL_OVERRIDE;
+
+ void setTitle(const QString & title) Q_DECL_OVERRIDE;
+ void setAppId(const QString &appId) Q_DECL_OVERRIDE;
+
+private:
+ void setMaximized() Q_DECL_OVERRIDE;
+ void setFullscreen() Q_DECL_OVERRIDE;
+ void setNormal() Q_DECL_OVERRIDE;
+ void setMinimized() Q_DECL_OVERRIDE;
+
+ void setTopLevel() Q_DECL_OVERRIDE;
+ void updateTransientParent(QWindow *parent) Q_DECL_OVERRIDE;
+ void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial);
+
+ QWaylandWindow *m_window;
+ bool m_maximized;
+ bool m_fullscreen;
+ QSize m_size;
+
+ void shell_surface_ping(uint32_t serial) Q_DECL_OVERRIDE;
+ void shell_surface_configure(uint32_t edges,
+ int32_t width,
+ int32_t height) Q_DECL_OVERRIDE;
+ void shell_surface_popup_done() Q_DECL_OVERRIDE;
+
+ friend class QWaylandWindow;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDSHELLSURFACE_H