4#include <QtWaylandCompositor/QWaylandCompositor>
5#include <QtWaylandCompositor/private/qwaylandsurface_p.h>
86 qCWarning(qLcWaylandCompositor) <<
"Failed to find QWaylandCompositor when initializing QWaylandIdleInhibitManagerV1";
97 return QWaylandIdleInhibitManagerV1Private::interface();
105 qCWarning(qLcWaylandCompositor) <<
"Couldn't find surface requested for creating an inhibitor";
106 wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT,
107 "invalid wl_surface@%d", wl_resource_get_id(surfaceResource));
112 if (!surfacePrivate) {
113 wl_resource_post_no_memory(resource->handle);
117 auto *inhibitor =
new Inhibitor(surface, resource->client(),
id, resource->version());
119 wl_resource_post_no_memory(resource->handle);
122 surfacePrivate->idleInhibitors.append(inhibitor);
124 if (surfacePrivate->idleInhibitors.size() == 1)
125 Q_EMIT surface->inhibitsIdleChanged();
132 : QtWaylandServer::zwp_idle_inhibitor_v1(client,
id,
qMin<
quint32>(version, interfaceVersion()))
148 Q_ASSERT(surfacePrivate->idleInhibitors.contains(
this));
149 surfacePrivate->idleInhibitors.removeOne(
this);
151 if (surfacePrivate->idleInhibitors.isEmpty())
152 Q_EMIT m_surface.data()->inhibitsIdleChanged();
155 wl_resource_destroy(resource->handle);
160#include "moc_qwaylandidleinhibitv1.cpp"
\inmodule QtWaylandCompositor
virtual void initialize()
Initializes the QWaylandCompositorExtension.
QWaylandObject * extensionContainer() const
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
void zwp_idle_inhibitor_v1_destroy(Resource *resource) override
Inhibitor(QWaylandSurface *surface, wl_client *client, quint32 id, quint32 version)
void zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) override
void zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surfaceResource) override
\inmodule QtWaylandCompositor
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandIdleInhibitManagerV1.
~QWaylandIdleInhibitManagerV1()
Destructs a QWaylandIdleInhibitManagerV1 object.
QWaylandIdleInhibitManagerV1()
Constructs a QWaylandIdleInhibitManagerV1 object.
void initialize() override
Initializes the extension.
static QWaylandSurfacePrivate * get(QWaylandSurface *surface)
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
Combined button and popup list for selecting options.
#define qCWarning(category,...)
constexpr const T & qMin(const T &a, const T &b)
static QOpenGLCompositor * compositor