Client: Add fullscreen shell integration
[ChangeLog][QPA plugin] Added support for fullscreen-shell unstable v1. The fullscreen_shell_unstable_v1 interface displays a single surface per output and it is used for nested compositors, where each output is rendered in a surface that is then displayed by the main compositor. For example weston could be the main compositor and a QML compositor could be launched as a client using this shell integration to display it inside weston. Change-Id: I037679a283ff03cb4bdf4b3fed59945090ec9250 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
parent
e82a4695d2
commit
237f8b94e5
245
src/3rdparty/wayland/protocols/fullscreen-shell-unstable-v1.xml
vendored
Normal file
245
src/3rdparty/wayland/protocols/fullscreen-shell-unstable-v1.xml
vendored
Normal file
@ -0,0 +1,245 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<protocol name="fullscreen_shell_unstable_v1">
|
||||||
|
|
||||||
|
<copyright>
|
||||||
|
Copyright © 2016 Yong Bakos
|
||||||
|
Copyright © 2015 Jason Ekstrand
|
||||||
|
Copyright © 2015 Jonas Ådahl
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice (including the next
|
||||||
|
paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<interface name="zwp_fullscreen_shell_v1" version="1">
|
||||||
|
<description summary="displays a single surface per output">
|
||||||
|
Displays a single surface per output.
|
||||||
|
|
||||||
|
This interface provides a mechanism for a single client to display
|
||||||
|
simple full-screen surfaces. While there technically may be multiple
|
||||||
|
clients bound to this interface, only one of those clients should be
|
||||||
|
shown at a time.
|
||||||
|
|
||||||
|
To present a surface, the client uses either the present_surface or
|
||||||
|
present_surface_for_mode requests. Presenting a surface takes effect
|
||||||
|
on the next wl_surface.commit. See the individual requests for
|
||||||
|
details about scaling and mode switches.
|
||||||
|
|
||||||
|
The client can have at most one surface per output at any time.
|
||||||
|
Requesting a surface to be presented on an output that already has a
|
||||||
|
surface replaces the previously presented surface. Presenting a null
|
||||||
|
surface removes its content and effectively disables the output.
|
||||||
|
Exactly what happens when an output is "disabled" is
|
||||||
|
compositor-specific. The same surface may be presented on multiple
|
||||||
|
outputs simultaneously.
|
||||||
|
|
||||||
|
Once a surface is presented on an output, it stays on that output
|
||||||
|
until either the client removes it or the compositor destroys the
|
||||||
|
output. This way, the client can update the output's contents by
|
||||||
|
simply attaching a new buffer.
|
||||||
|
|
||||||
|
Warning! The protocol described in this file is experimental and
|
||||||
|
backward incompatible changes may be made. Backward compatible changes
|
||||||
|
may be added together with the corresponding interface version bump.
|
||||||
|
Backward incompatible changes are done by bumping the version number in
|
||||||
|
the protocol and interface names and resetting the interface version.
|
||||||
|
Once the protocol is to be declared stable, the 'z' prefix and the
|
||||||
|
version number in the protocol and interface names are removed and the
|
||||||
|
interface version number is reset.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<request name="release" type="destructor">
|
||||||
|
<description summary="release the wl_fullscreen_shell interface">
|
||||||
|
Release the binding from the wl_fullscreen_shell interface.
|
||||||
|
|
||||||
|
This destroys the server-side object and frees this binding. If
|
||||||
|
the client binds to wl_fullscreen_shell multiple times, it may wish
|
||||||
|
to free some of those bindings.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<enum name="capability">
|
||||||
|
<description summary="capabilities advertised by the compositor">
|
||||||
|
Various capabilities that can be advertised by the compositor. They
|
||||||
|
are advertised one-at-a-time when the wl_fullscreen_shell interface is
|
||||||
|
bound. See the wl_fullscreen_shell.capability event for more details.
|
||||||
|
|
||||||
|
ARBITRARY_MODES:
|
||||||
|
This is a hint to the client that indicates that the compositor is
|
||||||
|
capable of setting practically any mode on its outputs. If this
|
||||||
|
capability is provided, wl_fullscreen_shell.present_surface_for_mode
|
||||||
|
will almost never fail and clients should feel free to set whatever
|
||||||
|
mode they like. If the compositor does not advertise this, it may
|
||||||
|
still support some modes that are not advertised through wl_global.mode
|
||||||
|
but it is less likely.
|
||||||
|
|
||||||
|
CURSOR_PLANE:
|
||||||
|
This is a hint to the client that indicates that the compositor can
|
||||||
|
handle a cursor surface from the client without actually compositing.
|
||||||
|
This may be because of a hardware cursor plane or some other mechanism.
|
||||||
|
If the compositor does not advertise this capability then setting
|
||||||
|
wl_pointer.cursor may degrade performance or be ignored entirely. If
|
||||||
|
CURSOR_PLANE is not advertised, it is recommended that the client draw
|
||||||
|
its own cursor and set wl_pointer.cursor(NULL).
|
||||||
|
</description>
|
||||||
|
<entry name="arbitrary_modes" value="1" summary="compositor is capable of almost any output mode"/>
|
||||||
|
<entry name="cursor_plane" value="2" summary="compositor has a separate cursor plane"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<event name="capability">
|
||||||
|
<description summary="advertises a capability of the compositor">
|
||||||
|
Advertises a single capability of the compositor.
|
||||||
|
|
||||||
|
When the wl_fullscreen_shell interface is bound, this event is emitted
|
||||||
|
once for each capability advertised. Valid capabilities are given by
|
||||||
|
the wl_fullscreen_shell.capability enum. If clients want to take
|
||||||
|
advantage of any of these capabilities, they should use a
|
||||||
|
wl_display.sync request immediately after binding to ensure that they
|
||||||
|
receive all the capability events.
|
||||||
|
</description>
|
||||||
|
<arg name="capability" type="uint"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<enum name="present_method">
|
||||||
|
<description summary="different method to set the surface fullscreen">
|
||||||
|
Hints to indicate to the compositor how to deal with a conflict
|
||||||
|
between the dimensions of the surface and the dimensions of the
|
||||||
|
output. The compositor is free to ignore this parameter.
|
||||||
|
</description>
|
||||||
|
<entry name="default" value="0" summary="no preference, apply default policy"/>
|
||||||
|
<entry name="center" value="1" summary="center the surface on the output"/>
|
||||||
|
<entry name="zoom" value="2" summary="scale the surface, preserving aspect ratio, to the largest size that will fit on the output" />
|
||||||
|
<entry name="zoom_crop" value="3" summary="scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" />
|
||||||
|
<entry name="stretch" value="4" summary="scale the surface to the size of the output ignoring aspect ratio" />
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<request name="present_surface">
|
||||||
|
<description summary="present surface for display">
|
||||||
|
Present a surface on the given output.
|
||||||
|
|
||||||
|
If the output is null, the compositor will present the surface on
|
||||||
|
whatever display (or displays) it thinks best. In particular, this
|
||||||
|
may replace any or all surfaces currently presented so it should
|
||||||
|
not be used in combination with placing surfaces on specific
|
||||||
|
outputs.
|
||||||
|
|
||||||
|
The method parameter is a hint to the compositor for how the surface
|
||||||
|
is to be presented. In particular, it tells the compositor how to
|
||||||
|
handle a size mismatch between the presented surface and the
|
||||||
|
output. The compositor is free to ignore this parameter.
|
||||||
|
|
||||||
|
The "zoom", "zoom_crop", and "stretch" methods imply a scaling
|
||||||
|
operation on the surface. This will override any kind of output
|
||||||
|
scaling, so the buffer_scale property of the surface is effectively
|
||||||
|
ignored.
|
||||||
|
</description>
|
||||||
|
<arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
|
||||||
|
<arg name="method" type="uint"/>
|
||||||
|
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="present_surface_for_mode">
|
||||||
|
<description summary="present surface for display at a particular mode">
|
||||||
|
Presents a surface on the given output for a particular mode.
|
||||||
|
|
||||||
|
If the current size of the output differs from that of the surface,
|
||||||
|
the compositor will attempt to change the size of the output to
|
||||||
|
match the surface. The result of the mode-switch operation will be
|
||||||
|
returned via the provided wl_fullscreen_shell_mode_feedback object.
|
||||||
|
|
||||||
|
If the current output mode matches the one requested or if the
|
||||||
|
compositor successfully switches the mode to match the surface,
|
||||||
|
then the mode_successful event will be sent and the output will
|
||||||
|
contain the contents of the given surface. If the compositor
|
||||||
|
cannot match the output size to the surface size, the mode_failed
|
||||||
|
will be sent and the output will contain the contents of the
|
||||||
|
previously presented surface (if any). If another surface is
|
||||||
|
presented on the given output before either of these has a chance
|
||||||
|
to happen, the present_cancelled event will be sent.
|
||||||
|
|
||||||
|
Due to race conditions and other issues unknown to the client, no
|
||||||
|
mode-switch operation is guaranteed to succeed. However, if the
|
||||||
|
mode is one advertised by wl_output.mode or if the compositor
|
||||||
|
advertises the ARBITRARY_MODES capability, then the client should
|
||||||
|
expect that the mode-switch operation will usually succeed.
|
||||||
|
|
||||||
|
If the size of the presented surface changes, the resulting output
|
||||||
|
is undefined. The compositor may attempt to change the output mode
|
||||||
|
to compensate. However, there is no guarantee that a suitable mode
|
||||||
|
will be found and the client has no way to be notified of success
|
||||||
|
or failure.
|
||||||
|
|
||||||
|
The framerate parameter specifies the desired framerate for the
|
||||||
|
output in mHz. The compositor is free to ignore this parameter. A
|
||||||
|
value of 0 indicates that the client has no preference.
|
||||||
|
|
||||||
|
If the value of wl_output.scale differs from wl_surface.buffer_scale,
|
||||||
|
then the compositor may choose a mode that matches either the buffer
|
||||||
|
size or the surface size. In either case, the surface will fill the
|
||||||
|
output.
|
||||||
|
</description>
|
||||||
|
<arg name="surface" type="object" interface="wl_surface"/>
|
||||||
|
<arg name="output" type="object" interface="wl_output"/>
|
||||||
|
<arg name="framerate" type="int"/>
|
||||||
|
<arg name="feedback" type="new_id" interface="zwp_fullscreen_shell_mode_feedback_v1"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<enum name="error">
|
||||||
|
<description summary="wl_fullscreen_shell error values">
|
||||||
|
These errors can be emitted in response to wl_fullscreen_shell requests.
|
||||||
|
</description>
|
||||||
|
<entry name="invalid_method" value="0" summary="present_method is not known"/>
|
||||||
|
</enum>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<interface name="zwp_fullscreen_shell_mode_feedback_v1" version="1">
|
||||||
|
<event name="mode_successful">
|
||||||
|
<description summary="mode switch succeeded">
|
||||||
|
This event indicates that the attempted mode switch operation was
|
||||||
|
successful. A surface of the size requested in the mode switch
|
||||||
|
will fill the output without scaling.
|
||||||
|
|
||||||
|
Upon receiving this event, the client should destroy the
|
||||||
|
wl_fullscreen_shell_mode_feedback object.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="mode_failed">
|
||||||
|
<description summary="mode switch failed">
|
||||||
|
This event indicates that the attempted mode switch operation
|
||||||
|
failed. This may be because the requested output mode is not
|
||||||
|
possible or it may mean that the compositor does not want to allow it.
|
||||||
|
|
||||||
|
Upon receiving this event, the client should destroy the
|
||||||
|
wl_fullscreen_shell_mode_feedback object.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="present_cancelled">
|
||||||
|
<description summary="mode switch cancelled">
|
||||||
|
This event indicates that the attempted mode switch operation was
|
||||||
|
cancelled. Most likely this is because the client requested a
|
||||||
|
second mode switch before the first one completed.
|
||||||
|
|
||||||
|
Upon receiving this event, the client should destroy the
|
||||||
|
wl_fullscreen_shell_mode_feedback object.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
</protocol>
|
@ -1,4 +1,23 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"Id": "wayland-fullscreen-protocol",
|
||||||
|
"Name": "Wayland Fullscreen Shell Protocol",
|
||||||
|
"QDocModule": "qtwaylandcompositor",
|
||||||
|
"QtUsage": "Used in the Qt Wayland platform plugin.",
|
||||||
|
"Files": "fullscreen-shell-unstable-v1.xml",
|
||||||
|
|
||||||
|
"Description": "A Wayland shell for displaying a single surface per output",
|
||||||
|
"Homepage": "https://wayland.freedesktop.org",
|
||||||
|
"Version": "unstable v1",
|
||||||
|
"DownloadLocation": "https://cgit.freedesktop.org/wayland/wayland-protocols",
|
||||||
|
"LicenseId": "MIT",
|
||||||
|
"License": "MIT License",
|
||||||
|
"LicenseFile": "MIT_LICENSE.txt",
|
||||||
|
"Copyright": "Copyright © 2016 Yong Bakos
|
||||||
|
Copyright © 2015 Jason Ekstrand
|
||||||
|
Copyright © 2015 Jonas Ådahl"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"Id": "wayland-protocol",
|
"Id": "wayland-protocol",
|
||||||
"Name": "Wayland Protocol",
|
"Name": "Wayland Protocol",
|
||||||
|
@ -87,6 +87,11 @@
|
|||||||
"condition": "features.draganddrop || features.clipboard",
|
"condition": "features.draganddrop || features.clipboard",
|
||||||
"output": [ "privateFeature" ]
|
"output": [ "privateFeature" ]
|
||||||
},
|
},
|
||||||
|
"wayland-client-fullscreen-shell-v1": {
|
||||||
|
"label": "fullscreen-shell-v1",
|
||||||
|
"condition": "features.wayland-client",
|
||||||
|
"output": [ "privateFeature" ]
|
||||||
|
},
|
||||||
"wayland-client-ivi-shell": {
|
"wayland-client-ivi-shell": {
|
||||||
"label": "ivi-shell",
|
"label": "ivi-shell",
|
||||||
"condition": "features.wayland-client",
|
"condition": "features.wayland-client",
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Keys": [ "fullscreen-shell-v1" ]
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
QT += gui-private waylandclient-private
|
||||||
|
CONFIG += wayland-scanner
|
||||||
|
|
||||||
|
QMAKE_USE += wayland-client
|
||||||
|
|
||||||
|
WAYLANDCLIENTSOURCES += \
|
||||||
|
../../../3rdparty/protocol/fullscreen-shell-unstable-v1.xml
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
qwaylandfullscreenshellv1integration.h \
|
||||||
|
qwaylandfullscreenshellv1surface.h
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
main.cpp \
|
||||||
|
qwaylandfullscreenshellv1integration.cpp \
|
||||||
|
qwaylandfullscreenshellv1surface.cpp
|
||||||
|
|
||||||
|
OTHER_FILES += \
|
||||||
|
fullscreen-shell-v1.json
|
||||||
|
|
||||||
|
PLUGIN_TYPE = wayland-shell-integration
|
||||||
|
PLUGIN_CLASS_NAME = QWaylandFullScreenShellV1IntegrationPlugin
|
||||||
|
load(qt_plugin)
|
@ -0,0 +1,69 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the plugins 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
|
||||||
|
|
||||||
|
#include "qwaylandfullscreenshellv1integration.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
class QWaylandFullScreenShellV1IntegrationPlugin : public QWaylandShellIntegrationPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "fullscreen-shell-v1.json")
|
||||||
|
public:
|
||||||
|
QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
QWaylandShellIntegration *QWaylandFullScreenShellV1IntegrationPlugin::create(const QString &key, const QStringList ¶mList)
|
||||||
|
{
|
||||||
|
Q_UNUSED(paramList);
|
||||||
|
|
||||||
|
if (key == QLatin1String("fullscreen-shell-v1"))
|
||||||
|
return new QWaylandFullScreenShellV1Integration();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#include "main.moc"
|
@ -0,0 +1,71 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the plugins 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "qwaylandfullscreenshellv1integration.h"
|
||||||
|
#include "qwaylandfullscreenshellv1surface.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
bool QWaylandFullScreenShellV1Integration::initialize(QWaylandDisplay *display)
|
||||||
|
{
|
||||||
|
for (const QWaylandDisplay::RegistryGlobal &global : display->globals()) {
|
||||||
|
if (global.interface == QLatin1String("zwp_fullscreen_shell_v1") && !m_shell) {
|
||||||
|
m_shell.reset(new QtWayland::zwp_fullscreen_shell_v1(display->wl_registry(), global.id, global.version));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_shell) {
|
||||||
|
qCDebug(lcQpaWayland) << "Couldn't find global zwp_fullscreen_shell_v1 for fullscreen-shell";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QWaylandShellIntegration::initialize(display);
|
||||||
|
}
|
||||||
|
|
||||||
|
QWaylandShellSurface *QWaylandFullScreenShellV1Integration::createShellSurface(QWaylandWindow *window)
|
||||||
|
{
|
||||||
|
return new QWaylandFullScreenShellV1Surface(m_shell.data(), window);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the plugins 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
|
||||||
|
#define QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
|
||||||
|
|
||||||
|
#include <wayland-client.h>
|
||||||
|
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||||
|
|
||||||
|
#include "qwayland-fullscreen-shell-unstable-v1.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandFullScreenShellV1Integration : public QWaylandShellIntegration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool initialize(QWaylandDisplay *display) override;
|
||||||
|
QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QScopedPointer<QtWayland::zwp_fullscreen_shell_v1> m_shell;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
|
@ -0,0 +1,61 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the plugins 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||||
|
|
||||||
|
#include "qwaylandfullscreenshellv1surface.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
QWaylandFullScreenShellV1Surface::QWaylandFullScreenShellV1Surface(QtWayland::zwp_fullscreen_shell_v1 *shell, QWaylandWindow *window)
|
||||||
|
: QWaylandShellSurface(window)
|
||||||
|
, m_shell(shell)
|
||||||
|
, m_window(window)
|
||||||
|
{
|
||||||
|
auto screen = static_cast<QWaylandScreen *>(m_window->screen());
|
||||||
|
m_shell->present_surface(m_window->object(),
|
||||||
|
QtWayland::zwp_fullscreen_shell_v1::present_method_default,
|
||||||
|
screen->output());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the plugins 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QWAYLANDFULLSCREENSHELLV1SURFACE_H
|
||||||
|
#define QWAYLANDFULLSCREENSHELLV1SURFACE_H
|
||||||
|
|
||||||
|
#include <QtWaylandClient/qtwaylandclientglobal.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
|
|
||||||
|
#include "qwayland-fullscreen-shell-unstable-v1.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandFullScreenShellV1Surface : public QWaylandShellSurface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QWaylandFullScreenShellV1Surface(QtWayland::zwp_fullscreen_shell_v1 *shell, QWaylandWindow *window);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QtWayland::zwp_fullscreen_shell_v1 *m_shell = nullptr;
|
||||||
|
QWaylandWindow *m_window = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // QWAYLANDFULLSCREENSHELLV1SURFACE_H
|
@ -1,6 +1,7 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
QT_FOR_CONFIG += waylandclient-private
|
QT_FOR_CONFIG += waylandclient-private
|
||||||
|
|
||||||
|
qtConfig(wayland-client-fullscreen-shell-v1): SUBDIRS += fullscreen-shell-v1
|
||||||
qtConfig(wayland-client-ivi-shell): SUBDIRS += ivi-shell
|
qtConfig(wayland-client-ivi-shell): SUBDIRS += ivi-shell
|
||||||
qtConfig(wayland-client-wl-shell): SUBDIRS += wl-shell
|
qtConfig(wayland-client-wl-shell): SUBDIRS += wl-shell
|
||||||
qtConfig(wayland-client-xdg-shell): SUBDIRS += xdg-shell
|
qtConfig(wayland-client-xdg-shell): SUBDIRS += xdg-shell
|
||||||
|
@ -2,6 +2,7 @@ TEMPLATE=subdirs
|
|||||||
|
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
client \
|
client \
|
||||||
|
fullscreenshellv1 \
|
||||||
iviapplication \
|
iviapplication \
|
||||||
xdgshellv6 \
|
xdgshellv6 \
|
||||||
wl_connect
|
wl_connect
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
include (../shared/shared.pri)
|
||||||
|
|
||||||
|
TARGET = tst_client_fullscreenshell1
|
||||||
|
SOURCES += tst_fullscreenshellv1.cpp
|
111
tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp
Normal file
111
tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
** 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "mockcompositor.h"
|
||||||
|
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
static const QSize screenSize(1600, 1200);
|
||||||
|
|
||||||
|
class TestWindow : public QWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TestWindow()
|
||||||
|
{
|
||||||
|
setSurfaceType(QSurface::RasterSurface);
|
||||||
|
setGeometry(0, 0, 800, 600);
|
||||||
|
create();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class tst_WaylandClientFullScreenShellV1 : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
tst_WaylandClientFullScreenShellV1(MockCompositor *c)
|
||||||
|
: m_compositor(c)
|
||||||
|
{
|
||||||
|
QSocketNotifier *notifier = new QSocketNotifier(m_compositor->waylandFileDescriptor(), QSocketNotifier::Read, this);
|
||||||
|
connect(notifier, &QSocketNotifier::activated, this, &tst_WaylandClientFullScreenShellV1::processWaylandEvents);
|
||||||
|
// connect to the event dispatcher to make sure to flush out the outgoing message queue
|
||||||
|
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClientFullScreenShellV1::processWaylandEvents);
|
||||||
|
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClientFullScreenShellV1::processWaylandEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void processWaylandEvents()
|
||||||
|
{
|
||||||
|
m_compositor->processWaylandEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanup()
|
||||||
|
{
|
||||||
|
// make sure the surfaces from the last test are properly cleaned up
|
||||||
|
// and don't show up as false positives in the next test
|
||||||
|
QTRY_VERIFY(!m_compositor->fullScreenShellV1Surface());
|
||||||
|
}
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void createDestroyWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MockCompositor *m_compositor = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tst_WaylandClientFullScreenShellV1::createDestroyWindow()
|
||||||
|
{
|
||||||
|
TestWindow window;
|
||||||
|
window.show();
|
||||||
|
|
||||||
|
QTRY_VERIFY(m_compositor->fullScreenShellV1Surface());
|
||||||
|
|
||||||
|
window.destroy();
|
||||||
|
QTRY_VERIFY(!m_compositor->fullScreenShellV1Surface());
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
setenv("XDG_RUNTIME_DIR", ".", 1);
|
||||||
|
setenv("QT_QPA_PLATFORM", "wayland", 1); // force QGuiApplication to use wayland plugin
|
||||||
|
setenv("QT_WAYLAND_SHELL_INTEGRATION", "fullscreen-shell-v1", 1);
|
||||||
|
setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1); // window decorations don't make much sense here
|
||||||
|
|
||||||
|
MockCompositor compositor;
|
||||||
|
compositor.setOutputMode(screenSize);
|
||||||
|
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
compositor.applicationInitialized();
|
||||||
|
|
||||||
|
tst_WaylandClientFullScreenShellV1 tc(&compositor);
|
||||||
|
return QTest::qExec(&tc, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <tst_fullscreenshellv1.moc>
|
@ -299,6 +299,16 @@ QSharedPointer<MockXdgToplevelV6> MockCompositor::xdgToplevelV6(int index)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<MockSurface> MockCompositor::fullScreenShellV1Surface(int index)
|
||||||
|
{
|
||||||
|
QSharedPointer<MockSurface> result;
|
||||||
|
lock();
|
||||||
|
if (Impl::Surface *surface = m_compositor->fullScreenShellV1()->surfaces().value(index, nullptr))
|
||||||
|
result = surface->mockSurface();
|
||||||
|
unlock();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
MockCompositor::Command MockCompositor::makeCommand(Command::Callback callback, void *target)
|
MockCompositor::Command MockCompositor::makeCommand(Command::Callback callback, void *target)
|
||||||
{
|
{
|
||||||
Command command;
|
Command command;
|
||||||
@ -382,6 +392,7 @@ Compositor::Compositor()
|
|||||||
m_iviApplication.reset(new IviApplication(m_display));
|
m_iviApplication.reset(new IviApplication(m_display));
|
||||||
m_wlShell.reset(new WlShell(m_display));
|
m_wlShell.reset(new WlShell(m_display));
|
||||||
m_xdgShellV6.reset(new XdgShellV6(m_display));
|
m_xdgShellV6.reset(new XdgShellV6(m_display));
|
||||||
|
m_fullScreenShellV1.reset(new FullScreenShellV1(m_display));
|
||||||
|
|
||||||
m_loop = wl_display_get_event_loop(m_display);
|
m_loop = wl_display_get_event_loop(m_display);
|
||||||
m_fd = wl_event_loop_get_fd(m_loop);
|
m_fd = wl_event_loop_get_fd(m_loop);
|
||||||
@ -459,6 +470,11 @@ XdgShellV6 *Compositor::xdgShellV6() const
|
|||||||
return m_xdgShellV6.data();
|
return m_xdgShellV6.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FullScreenShellV1 *Compositor::fullScreenShellV1() const
|
||||||
|
{
|
||||||
|
return m_fullScreenShellV1.data();
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t Compositor::nextSerial()
|
uint32_t Compositor::nextSerial()
|
||||||
{
|
{
|
||||||
return wl_display_next_serial(m_display);
|
return wl_display_next_serial(m_display);
|
||||||
@ -474,6 +490,7 @@ void Compositor::removeSurface(Surface *surface)
|
|||||||
m_surfaces.removeOne(surface);
|
m_surfaces.removeOne(surface);
|
||||||
m_keyboard->handleSurfaceDestroyed(surface);
|
m_keyboard->handleSurfaceDestroyed(surface);
|
||||||
m_pointer->handleSurfaceDestroyed(surface);
|
m_pointer->handleSurfaceDestroyed(surface);
|
||||||
|
m_fullScreenShellV1->removeSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
Surface *Compositor::resolveSurface(const QVariant &v)
|
Surface *Compositor::resolveSurface(const QVariant &v)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "mockxdgshellv6.h"
|
#include "mockxdgshellv6.h"
|
||||||
#include "mockiviapplication.h"
|
#include "mockiviapplication.h"
|
||||||
|
#include "mockfullscreenshellv1.h"
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
@ -76,6 +77,7 @@ public:
|
|||||||
|
|
||||||
IviApplication *iviApplication() const;
|
IviApplication *iviApplication() const;
|
||||||
XdgShellV6 *xdgShellV6() const;
|
XdgShellV6 *xdgShellV6() const;
|
||||||
|
FullScreenShellV1 *fullScreenShellV1() const;
|
||||||
|
|
||||||
void addSurface(Surface *surface);
|
void addSurface(Surface *surface);
|
||||||
void removeSurface(Surface *surface);
|
void removeSurface(Surface *surface);
|
||||||
@ -135,6 +137,7 @@ private:
|
|||||||
QScopedPointer<IviApplication> m_iviApplication;
|
QScopedPointer<IviApplication> m_iviApplication;
|
||||||
QScopedPointer<WlShell> m_wlShell;
|
QScopedPointer<WlShell> m_wlShell;
|
||||||
QScopedPointer<XdgShellV6> m_xdgShellV6;
|
QScopedPointer<XdgShellV6> m_xdgShellV6;
|
||||||
|
QScopedPointer<FullScreenShellV1> m_fullScreenShellV1;
|
||||||
};
|
};
|
||||||
|
|
||||||
void registerResource(wl_list *list, wl_resource *resource);
|
void registerResource(wl_list *list, wl_resource *resource);
|
||||||
@ -251,6 +254,7 @@ public:
|
|||||||
QSharedPointer<MockOutput> output(int index = 0);
|
QSharedPointer<MockOutput> output(int index = 0);
|
||||||
QSharedPointer<MockIviSurface> iviSurface(int index = 0);
|
QSharedPointer<MockIviSurface> iviSurface(int index = 0);
|
||||||
QSharedPointer<MockXdgToplevelV6> xdgToplevelV6(int index = 0);
|
QSharedPointer<MockXdgToplevelV6> xdgToplevelV6(int index = 0);
|
||||||
|
QSharedPointer<MockSurface> fullScreenShellV1Surface(int index = 0);
|
||||||
|
|
||||||
void lock();
|
void lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
|
43
tests/auto/wayland/shared/mockfullscreenshellv1.cpp
Normal file
43
tests/auto/wayland/shared/mockfullscreenshellv1.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
** 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "mockfullscreenshellv1.h"
|
||||||
|
#include "mocksurface.h"
|
||||||
|
|
||||||
|
namespace Impl {
|
||||||
|
|
||||||
|
void FullScreenShellV1::zwp_fullscreen_shell_v1_present_surface(Resource *resource, struct ::wl_resource *surface, uint32_t method, struct ::wl_resource *output)
|
||||||
|
{
|
||||||
|
Q_UNUSED(resource)
|
||||||
|
Q_UNUSED(method)
|
||||||
|
Q_UNUSED(output)
|
||||||
|
|
||||||
|
m_surfaces.append(Surface::fromResource(surface));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Impl
|
58
tests/auto/wayland/shared/mockfullscreenshellv1.h
Normal file
58
tests/auto/wayland/shared/mockfullscreenshellv1.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
** 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 The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef MOCKFULLSCREENSHELLV1_H
|
||||||
|
#define MOCKFULLSCREENSHELLV1_H
|
||||||
|
|
||||||
|
#include <qwayland-server-fullscreen-shell-unstable-v1.h>
|
||||||
|
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
|
namespace Impl {
|
||||||
|
|
||||||
|
class Surface;
|
||||||
|
class FullScreenShellV1;
|
||||||
|
|
||||||
|
class FullScreenShellV1 : public QtWaylandServer::zwp_fullscreen_shell_v1
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit FullScreenShellV1(::wl_display *display) : zwp_fullscreen_shell_v1(display, 1) {}
|
||||||
|
|
||||||
|
QVector<Surface *> surfaces() const { return m_surfaces; }
|
||||||
|
void removeSurface(Surface *surface) { m_surfaces.removeOne(surface); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void zwp_fullscreen_shell_v1_present_surface(Resource *resource, struct ::wl_resource *surface, uint32_t method, struct ::wl_resource *output) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QVector<Surface *> m_surfaces;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Impl
|
||||||
|
|
||||||
|
#endif // MOCKFULLSCREENSHELLV1_H
|
@ -8,12 +8,14 @@ CONFIG += wayland-scanner
|
|||||||
WAYLANDSERVERSOURCES += \
|
WAYLANDSERVERSOURCES += \
|
||||||
../../../../src/3rdparty/protocol/ivi-application.xml \
|
../../../../src/3rdparty/protocol/ivi-application.xml \
|
||||||
../../../../src/3rdparty/protocol/wayland.xml \
|
../../../../src/3rdparty/protocol/wayland.xml \
|
||||||
../../../../src/3rdparty/protocol/xdg-shell-unstable-v6.xml
|
../../../../src/3rdparty/protocol/xdg-shell-unstable-v6.xml \
|
||||||
|
../../../../src/3rdparty/protocol/fullscreen-shell-unstable-v1.xml
|
||||||
|
|
||||||
INCLUDEPATH += ../shared
|
INCLUDEPATH += ../shared
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
../shared/mockcompositor.cpp \
|
../shared/mockcompositor.cpp \
|
||||||
|
../shared/mockfullscreenshellv1.cpp \
|
||||||
../shared/mockinput.cpp \
|
../shared/mockinput.cpp \
|
||||||
../shared/mockiviapplication.cpp \
|
../shared/mockiviapplication.cpp \
|
||||||
../shared/mockwlshell.cpp \
|
../shared/mockwlshell.cpp \
|
||||||
@ -23,6 +25,7 @@ SOURCES += \
|
|||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
../shared/mockcompositor.h \
|
../shared/mockcompositor.h \
|
||||||
|
../shared/mockfullscreenshellv1.h \
|
||||||
../shared/mockinput.h \
|
../shared/mockinput.h \
|
||||||
../shared/mockiviapplication.h \
|
../shared/mockiviapplication.h \
|
||||||
../shared/mockwlshell.h \
|
../shared/mockwlshell.h \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user