Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandxdgshellintegration.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
include
"qwaylandxdgshell_p.h"
5
#
include
"qwaylandxdgshellintegration_p.h"
6
#
include
"qwaylandxdgdecorationv1_p.h"
7
8
#
include
<
QtWaylandClient
/
private
/
qwaylandwindow_p
.
h
>
9
#
include
<
QtWaylandClient
/
private
/
qwaylanddisplay_p
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
namespace
QtWaylandClient
{
14
15
QWaylandXdgShellIntegration
::
QWaylandXdgShellIntegration
() :
QWaylandShellIntegrationTemplate
(6)
16
{
17
connect
(
this
, &
QWaylandShellIntegrationTemplate
::
activeChanged
,
this
, [
this
] {
18
if
(
isActive
()) {
19
mXdgShell
.
reset
(
new
QWaylandXdgShell
(
mDisplay
,
this
));
20
}
else
{
21
mXdgShell
.
reset
(
nullptr
);
22
destroy
();
23
}
24
});
25
}
26
27
QWaylandXdgShellIntegration
::~
QWaylandXdgShellIntegration
()
28
{
29
if
(
isActive
())
30
destroy
();
31
}
32
33
bool
QWaylandXdgShellIntegration
::
initialize
(
QWaylandDisplay
*
display
)
34
{
35
mDisplay
=
display
;
36
return
QWaylandShellIntegrationTemplate
::
initialize
(
display
);
37
}
38
39
void
QWaylandXdgShellIntegration
::
xdg_wm_base_ping
(
uint32_t
serial
)
40
{
41
pong
(
serial
);
42
}
43
44
QWaylandShellSurface
*
QWaylandXdgShellIntegration
::
createShellSurface
(
QWaylandWindow
*
window
)
45
{
46
return
new
QWaylandXdgSurface
(
mXdgShell
.
get
(),
get_xdg_surface
(
window
->
wlSurface
()),
window
);
47
}
48
49
void
*
QWaylandXdgShellIntegration
::
nativeResourceForWindow
(
const
QByteArray
&
resource
,
QWindow
*
window
)
50
{
51
if
(
auto
waylandWindow
=
static_cast
<
QWaylandWindow
*>(
window
->
handle
())) {
52
if
(
auto
xdgSurface
=
qobject_cast
<
QWaylandXdgSurface
*>(
waylandWindow
->
shellSurface
())) {
53
return
xdgSurface
->
nativeResource
(
resource
);
54
}
55
}
56
return
nullptr
;
57
}
58
59
}
60
61
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QtWaylandClient
Definition
qwaylandclientextension.h:15
qtwayland
src
plugins
shellintegration
xdg-shell
qwaylandxdgshellintegration.cpp
Generated on Mon Mar 10 2025 00:55:08 for Qt by
1.13.2