KWin
Loading...
Searching...
No Matches
lockscreen_overlay_v1.cpp
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
8#include "display.h"
9#include "seat.h"
10#include "surface.h"
11
12#include "qwayland-server-kde-lockscreen-overlay-v1.h"
13
14namespace KWin
15{
16static constexpr int s_version = 1;
17
18class LockscreenOverlayV1InterfacePrivate : public QtWaylandServer::kde_lockscreen_overlay_v1
19{
20public:
22 : QtWaylandServer::kde_lockscreen_overlay_v1(*display, s_version)
23 , q(q)
24 {
25 }
26
27protected:
28 void kde_lockscreen_overlay_v1_allow(Resource *resource, struct ::wl_resource *surface) override
29 {
30 auto surfaceIface = SurfaceInterface::get(surface);
31 if (surfaceIface->isMapped()) {
32 wl_resource_post_error(resource->handle, error_invalid_surface_state, "surface is already mapped");
33 return;
34 }
35 Q_EMIT q->allowRequested(surfaceIface);
36 }
37 void kde_lockscreen_overlay_v1_destroy(Resource *resource) override
38 {
39 wl_resource_destroy(resource->handle);
40 }
41
42private:
44};
45
47
49 : QObject(parent)
50 , d(std::make_unique<LockscreenOverlayV1InterfacePrivate>(display, this))
51{
52}
53
54}
55
56#include "moc_lockscreen_overlay_v1.cpp"
Class holding the Wayland server display loop.
Definition display.h:34
void allowRequested(SurfaceInterface *surface)
Notifies about the surface being activated.
LockscreenOverlayV1Interface(Display *display, QObject *parent=nullptr)
LockscreenOverlayV1InterfacePrivate(Display *display, LockscreenOverlayV1Interface *q)
void kde_lockscreen_overlay_v1_allow(Resource *resource, struct ::wl_resource *surface) override
void kde_lockscreen_overlay_v1_destroy(Resource *resource) override
static SurfaceInterface * get(wl_resource *native)
Definition surface.cpp:819