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
qwaylandwlshellsurface.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
6
7#include <QtWaylandClient/private/qwaylanddisplay_p.h>
8#include <QtWaylandClient/private/qwaylandwindow_p.h>
9#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
10#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
11#include <QtWaylandClient/private/qwaylandscreen_p.h>
12
13#include <QtCore/QDebug>
14
16
17namespace QtWaylandClient {
18
33
38
45
52
57
62
88
93
95{
96 // On wl-shell the client is in charge of states, so diff from the pending state
99
101 qCWarning(lcQpaWayland) << "Minimizing is not supported on wl-shell. Consider using xdg-shell instead.";
102
104 set_maximized(nullptr);
106 }
107
111 }
112
115 setTopLevel(); // set normal window
116 // There's usually no configure event after this, so just clear the rest of the pending
117 // configure here and queue the applyConfigure call
118 m_pending.size = {0, 0};
121 }
122
124}
125
126enum QWaylandWlShellSurface::resize QWaylandWlShellSurface::convertToResizeEdges(Qt::Edges edges)
127{
128 return static_cast<enum resize>(
129 ((edges & Qt::TopEdge) ? resize_top : 0)
130 | ((edges & Qt::BottomEdge) ? resize_bottom : 0)
131 | ((edges & Qt::LeftEdge) ? resize_left : 0)
132 | ((edges & Qt::RightEdge) ? resize_right : 0));
133}
134
136{
137 set_toplevel();
138}
139
140static inline bool testShowWithoutActivating(const QWindow *window)
141{
142 // QWidget-attribute Qt::WA_ShowWithoutActivating.
143 const QVariant showWithoutActivating = window->property("_q_showWithoutActivating");
144 return showWithoutActivating.isValid() && showWithoutActivating.toBool();
145}
146
148{
151 return;
152
153 // set_transient expects a position relative to the parent
154 QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
159 }
160
161 uint32_t flags = 0;
163 if (wf.testFlag(Qt::ToolTip)
167
171}
172
174{
177 qCWarning(lcQpaWayland) << "setPopup called without a parent window";
178 return;
179 }
180 if (!device) {
181 qCWarning(lcQpaWayland) << "setPopup called without an input device";
182 return;
183 }
184
185 // set_popup expects a position relative to the parent
186 QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
191 }
192
195 uint flags = 0;
197}
198
203
212
217
218}
219
220QT_END_NAMESPACE
221
222#include "moc_qwaylandwlshellsurface_p.cpp"
Combined button and popup list for selecting options.
static bool testShowWithoutActivating(const QWindow *window)