KWindowSystem

surfacehelper.h
1/*
2 SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QWindow>
10
11#include <QGuiApplication>
12#include <qpa/qplatformnativeinterface.h>
13
14struct wl_surface;
15
16inline wl_surface *surfaceForWindow(QWindow *window)
17{
18 if (!window) {
19 return nullptr;
20 }
21
22 QPlatformNativeInterface *native = qGuiApp->platformNativeInterface();
23 if (!native) {
24 return nullptr;
25 }
26 window->create();
27 return reinterpret_cast<wl_surface *>(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window));
28}
QWidget * window(QObject *job)
void create(WId window, bool initializeWindow, bool destroyOldWindow)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:51:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.