8#if QT_CONFIG(wayland_compositor_quick)
9#include "qwaylandwlshellintegration_p.h"
11#include <QtWaylandCompositor/private/qwaylandutils_p.h>
13#include <QtWaylandCompositor/QWaylandCompositor>
14#include <QtWaylandCompositor/QWaylandView>
15#include <QtWaylandCompositor/QWaylandOutput>
16#include <QtWaylandCompositor/QWaylandClient>
18#include <QtCore/QObject>
19#include <QtCore/QDebug>
34 QWaylandResource shellSurfaceResource(wl_resource_create(resource->client(), &wl_shell_surface_interface,
35 wl_resource_get_version(resource->handle),
id));
44 wl_resource *displayRes = wl_client_get_object(resource->client(), 1);
48 emit q->wlShellSurfaceRequested(surface, shellSurfaceResource);
58 emit q->wlShellSurfaceCreated(shellSurface);
64 qWarning(
"Unexpected state. Can't find registered shell surface.");
83 if (m_windowType == windowType)
85 m_windowType = windowType;
88 emit q->windowTypeChanged();
99 struct wl_resource *input_device_super,
107 emit q->startMove(input_device);
111 struct wl_resource *input_device_super,
128 emit q->setDefaultToplevel();
132 struct wl_resource *parent_surface_resource,
142 emit q->setTransient(parent_surface,
QPoint(
x,
y),
flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE);
148 struct wl_resource *output_resource)
175 struct wl_resource *output_resource)
191 if (m_pings.
remove(serial))
194 qWarning(
"Received an unexpected pong!");
201 if (
title == m_title)
205 emit q->titleChanged();
216 emit q->classNameChanged();
284 qWarning() <<
"Failed to find QWaylandCompositor when initializing QWaylandWlShell";
293 return d->m_shellSurfaces;
301 if (shellSurface->surface() && shellSurface->surface()->client() == client)
302 surfsForClient.
append(shellSurface);
304 return surfsForClient;
313 && shellSurface->surface() && shellSurface->surface()->hasContent()) {
314 popupSurfaces.
append(shellSurface);
317 return popupSurfaces;
325 && shellSurface->surface() && shellSurface->surface()->hasContent()) {
326 return shellSurface->surface()->client();
336 shellSurface->sendPopupDone();
344 return QWaylandWlShellPrivate::interface();
386 return QWaylandWlShellPrivate::interfaceName();
471 return QWaylandWlShellSurfacePrivate::interface();
479 return QWaylandWlShellSurfacePrivate::interfaceName();
533 if (!
size.isValid()) {
534 qWarning() <<
"Can't configure wl_shell_surface with an invalid size" <<
size;
537 d->send_configure(edges,
size.width(),
size.height());
554 d->send_popup_done();
557#if QT_CONFIG(wayland_compositor_quick)
607 return d->m_windowType;
641 return d->m_className;
646 return &QWaylandWlShellSurfacePrivate::s_role;
663 uint32_t serial =
d->m_surface->compositor()->nextSerial();
672 if (
auto p = QtWayland::fromResource<QWaylandWlShellSurfacePrivate *>(resource))
679#include "moc_qwaylandwlshell.cpp"
bool removeOne(const AT &t)
void append(parameter_type t)
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
bool remove(const T &value)
iterator insert(const T &value)
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
void setExtensionContainer(QWaylandObject *container)
Sets the extension container for this QWaylandCompositorExtension to container.
virtual void initialize()
Initializes the QWaylandCompositorExtension.
QWaylandObject * extensionContainer() const
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
static QWaylandOutput * fromResource(wl_resource *resource)
Returns the QWaylandOutput corresponding to resource.
\inmodule QtWaylandCompositor
\qmltype ShellSurfaceItem \instantiates QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inq...
\inmodule QtWaylandCompositor
wl_resource * resource() const
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
static QWaylandSeat * fromSeatResource(struct ::wl_resource *resource)
Returns the QWaylandSeat corresponding to the resource.
\inmodule QtWaylandCompositor
\inmodule QtWaylandCompositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
Sets a role on the surface.
QList< QWaylandWlShellSurface * > m_shellSurfaces
static QWaylandWlShellPrivate * get(QWaylandWlShell *shell)
void unregisterShellSurface(QWaylandWlShellSurface *shellSurface)
void shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) override
void shell_surface_set_maximized(Resource *resource, struct wl_resource *output_resource) override
void ping(uint32_t serial)
void shell_surface_destroy_resource(Resource *resource) override
QWaylandWlShellSurfacePrivate()
void shell_surface_set_toplevel(Resource *resource) override
void shell_surface_move(Resource *resource, struct wl_resource *input_device_super, uint32_t time) override
void shell_surface_pong(Resource *resource, uint32_t serial) override
~QWaylandWlShellSurfacePrivate() override
void shell_surface_set_fullscreen(Resource *resource, uint32_t method, uint32_t framerate, struct wl_resource *output_resource) override
void shell_surface_set_transient(Resource *resource, struct wl_resource *parent_surface_resource, int x, int y, uint32_t flags) override
void shell_surface_set_class(Resource *resource, const QString &class_) override
void shell_surface_set_title(Resource *resource, const QString &title) override
void shell_surface_resize(Resource *resource, struct wl_resource *input_device, uint32_t time, uint32_t edges) override
void shell_surface_set_popup(Resource *resource, struct wl_resource *input_device, uint32_t time, struct wl_resource *parent, int32_t x, int32_t y, uint32_t flags) override
void setWindowType(Qt::WindowType windowType)
\qmltype WlShellSurface \instantiates QWaylandWlShellSurface \inqmlmodule QtWayland....
static QWaylandWlShellSurface * fromResource(wl_resource *res)
Returns the QWaylandWlShellSurface object associated with the given resource, or null if no such obje...
static QByteArray interfaceName()
QWaylandWlShell * shell
\qmlproperty WlShell WlShellSurface::shell
static const struct wl_interface * interface()
Q_INVOKABLE void sendPopupDone()
\qmlmethod void WlShellSurface::sendPopupDone()
QString title
\qmlproperty string WlShellSurface::title
QString className
\qmlproperty string WlShellSurface::className
Q_INVOKABLE void sendConfigure(const QSize &size, ResizeEdge edges)
\qmlmethod void WlShellSurface::sendConfigure(size s, enum edges)
static QWaylandSurfaceRole * role()
ResizeEdge
This enum type provides a way to specify an edge or corner of the surface.
Qt::WindowType windowType() const override
\qmlproperty enum WlShellSurface::windowType
QWaylandSurface * surface
\qmlproperty WaylandSurface WlShellSurface::surface
void ping()
\qmlmethod void WlShellSurface::ping()
void initialize() override
Q_INVOKABLE QSize sizeForResize(const QSizeF &size, const QPointF &delta, ResizeEdge edges)
~QWaylandWlShellSurface() override
QWaylandWlShellSurface()
Constructs a QWaylandWlShellSurface.
\qmltype WlShell \instantiates QWaylandWlShell \inqmlmodule QtWayland.Compositor.WlShell
QWaylandWlShell()
Constructs a QWaylandWlShell object.
QList< QWaylandWlShellSurface * > shellSurfacesForClient(QWaylandClient *client) const
QWaylandClient * popupClient() const
static QByteArray interfaceName()
void initialize() override
Initializes the WlShell extension.
QList< QWaylandWlShellSurface * > shellSurfaces() const
QList< QWaylandWlShellSurface * > mappedPopups() const
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandWlShell.
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
constexpr const T & qMax(const T &a, const T &b)
static QOpenGLCompositor * compositor
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLenum input
QT_BEGIN_NAMESPACE typedef uchar * output
const char className[16]
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent