Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandxdgshell.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// Copyright (C) 2017 Eurogiciel, author: <philippe.coval@eurogiciel.fr>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
6
8
9#include <QtWaylandClient/private/qwaylanddisplay_p.h>
10#include <QtWaylandClient/private/qwaylandwindow_p.h>
11#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
12#include <QtWaylandClient/private/qwaylandscreen_p.h>
13#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
14
15#include <QtGui/QGuiApplication>
16#include <QtGui/private/qwindow_p.h>
17
19
20namespace QtWaylandClient {
21
22QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface)
23 : QtWayland::xdg_toplevel(xdgSurface->get_toplevel())
24 , m_xdgSurface(xdgSurface)
25{
26 QWindow *window = xdgSurface->window()->window();
27 if (auto *decorationManager = m_xdgSurface->m_shell->decorationManager()) {
28 if (!(window->flags() & Qt::FramelessWindowHint))
29 m_decoration = decorationManager->createToplevelDecoration(object());
30 }
31 requestWindowStates(window->windowStates());
32 requestWindowFlags(window->flags());
33}
34
35QWaylandXdgSurface::Toplevel::~Toplevel()
36{
37 // The protocol spec requires that the decoration object is deleted before xdg_toplevel.
38 delete m_decoration;
39 m_decoration = nullptr;
40
41 if (isInitialized())
42 destroy();
43}
44
45void QWaylandXdgSurface::Toplevel::applyConfigure()
46{
47 if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen)))
48 m_normalSize = m_xdgSurface->m_window->windowContentGeometry().size();
49
50 if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive)
51 && !m_xdgSurface->m_window->display()->isKeyboardAvailable())
52 m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window);
53
54 if (!(m_pending.states & Qt::WindowActive) && (m_applied.states & Qt::WindowActive)
55 && !m_xdgSurface->m_window->display()->isKeyboardAvailable())
56 m_xdgSurface->m_window->display()->handleWindowDeactivated(m_xdgSurface->m_window);
57
58 m_xdgSurface->m_window->handleToplevelWindowTilingStatesChanged(m_toplevelStates);
59 m_xdgSurface->m_window->handleWindowStatesChanged(m_pending.states);
60
61 // If the width or height is zero, the client should decide the size on its own.
62 QSize surfaceSize;
63
64 if (m_pending.size.width() > 0) {
65 surfaceSize.setWidth(m_pending.size.width());
66 } else {
67 if (Q_UNLIKELY(m_pending.states & (Qt::WindowMaximized | Qt::WindowFullScreen))) {
68 qCWarning(lcQpaWayland) << "Configure event with maximized or fullscreen state contains invalid width:" << m_pending.size.width();
69 } else {
70 int width = m_normalSize.width();
71 if (!m_pending.bounds.isEmpty())
72 width = std::min(width, m_pending.bounds.width());
73 surfaceSize.setWidth(width);
74 }
75 }
76
77 if (m_pending.size.height() > 0) {
78 surfaceSize.setHeight(m_pending.size.height());
79 } else {
80 if (Q_UNLIKELY(m_pending.states & (Qt::WindowMaximized | Qt::WindowFullScreen))) {
81 qCWarning(lcQpaWayland) << "Configure event with maximized or fullscreen state contains invalid height:" << m_pending.size.height();
82 } else {
83 int height = m_normalSize.height();
84 if (!m_pending.bounds.isEmpty())
85 height = std::min(height, m_pending.bounds.height());
86 surfaceSize.setHeight(height);
87 }
88 }
89
90 if (!surfaceSize.isEmpty())
91 m_xdgSurface->m_window->resizeFromApplyConfigure(surfaceSize.grownBy(m_xdgSurface->m_window->windowContentMargins()));
92
93 m_applied = m_pending;
94 qCDebug(lcQpaWayland) << "Applied pending xdg_toplevel configure event:" << m_applied.size << m_applied.states;
95}
96
97bool QWaylandXdgSurface::Toplevel::wantsDecorations()
98{
99 if (m_decoration && (m_decoration->pending() == QWaylandXdgToplevelDecorationV1::mode_server_side
100 || !m_decoration->isConfigured()))
101 return false;
102
103 return !(m_pending.states & Qt::WindowFullScreen);
104}
105
106void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure_bounds(int32_t width, int32_t height)
107{
108 m_pending.bounds = QSize(width, height);
109}
110
111void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure(int32_t width, int32_t height, wl_array *states)
112{
113 m_pending.size = QSize(width, height);
114
115 auto *xdgStates = static_cast<uint32_t *>(states->data);
116 size_t numStates = states->size / sizeof(uint32_t);
117
118 m_pending.states = Qt::WindowNoState;
119 m_toplevelStates = QWaylandWindow::WindowNoState;
120
121 for (size_t i = 0; i < numStates; i++) {
122 switch (xdgStates[i]) {
123 case XDG_TOPLEVEL_STATE_ACTIVATED:
124 m_pending.states |= Qt::WindowActive;
125 break;
126 case XDG_TOPLEVEL_STATE_MAXIMIZED:
127 m_pending.states |= Qt::WindowMaximized;
128 break;
129 case XDG_TOPLEVEL_STATE_FULLSCREEN:
130 m_pending.states |= Qt::WindowFullScreen;
131 break;
132 case XDG_TOPLEVEL_STATE_TILED_LEFT:
133 m_toplevelStates |= QWaylandWindow::WindowTiledLeft;
134 break;
135 case XDG_TOPLEVEL_STATE_TILED_RIGHT:
136 m_toplevelStates |= QWaylandWindow::WindowTiledRight;
137 break;
138 case XDG_TOPLEVEL_STATE_TILED_TOP:
139 m_toplevelStates |= QWaylandWindow::WindowTiledTop;
140 break;
141 case XDG_TOPLEVEL_STATE_TILED_BOTTOM:
142 m_toplevelStates |= QWaylandWindow::WindowTiledBottom;
143 break;
144 default:
145 break;
146 }
147 }
148 qCDebug(lcQpaWayland) << "Received xdg_toplevel.configure with" << m_pending.size
149 << "and" << m_pending.states;
150}
151
152void QWaylandXdgSurface::Toplevel::xdg_toplevel_close()
153{
154 m_xdgSurface->m_window->window()->close();
155}
156
157void QWaylandXdgSurface::Toplevel::requestWindowFlags(Qt::WindowFlags flags)
158{
159 if (m_decoration) {
161 delete m_decoration;
162 m_decoration = nullptr;
163 } else {
164 m_decoration->unsetMode();
165 }
166 }
167}
168
169void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states)
170{
171 // Re-send what's different from the applied state
172 Qt::WindowStates changedStates = m_applied.states ^ states;
173
174 if (changedStates & Qt::WindowMaximized) {
176 set_maximized();
177 else
178 unset_maximized();
179 }
180
181 if (changedStates & Qt::WindowFullScreen) {
183 auto screen = m_xdgSurface->window()->waylandScreen();
184 if (screen) {
185 set_fullscreen(screen->output());
186 }
187 } else
188 unset_fullscreen();
189 }
190
191 // Minimized state is not reported by the protocol, so always send it
193 set_minimized();
194 m_xdgSurface->window()->handleWindowStatesChanged(states & ~Qt::WindowMinimized);
195 }
196}
197
198QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResizeEdges(Qt::Edges edges)
199{
200 return static_cast<enum resize_edge>(
201 ((edges & Qt::TopEdge) ? resize_edge_top : 0)
202 | ((edges & Qt::BottomEdge) ? resize_edge_bottom : 0)
203 | ((edges & Qt::LeftEdge) ? resize_edge_left : 0)
204 | ((edges & Qt::RightEdge) ? resize_edge_right : 0));
205}
206
207QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent,
208 QtWayland::xdg_positioner *positioner)
209 : m_xdgSurface(xdgSurface)
210 , m_parentXdgSurface(qobject_cast<QWaylandXdgSurface *>(parent->shellSurface()))
211 , m_parent(parent)
212{
213
214 init(xdgSurface->get_popup(m_parentXdgSurface ? m_parentXdgSurface->object() : nullptr,
215 positioner->object()));
216}
217
218QWaylandXdgSurface::Popup::~Popup()
219{
220 if (isInitialized())
221 destroy();
222
223 if (m_grabbing) {
224 auto *shell = m_xdgSurface->m_shell;
225 Q_ASSERT(shell->m_topmostGrabbingPopup == this);
226 shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr;
227 m_grabbing = false;
228
229 // Synthesize Qt enter/leave events for popup
230 QWindow *leave = nullptr;
231 if (m_xdgSurface && m_xdgSurface->window())
232 leave = m_xdgSurface->window()->window();
234
236 QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
237 }
238}
239
240void QWaylandXdgSurface::Popup::applyConfigure()
241{
242 if (m_pendingGeometry.isValid()) {
243 QRect geometryWithMargins = m_pendingGeometry.marginsAdded(m_xdgSurface->m_window->windowContentMargins());
244 QMargins parentMargins = m_parent->windowContentMargins() - m_parent->clientSideMargins();
245 QRect globalGeometry = geometryWithMargins.translated(m_parent->geometry().topLeft() + QPoint(parentMargins.left(), parentMargins.top()));
246 m_xdgSurface->setGeometryFromApplyConfigure(globalGeometry.topLeft(), globalGeometry.size());
247 }
248 resetConfiguration();
249}
250
251void QWaylandXdgSurface::Popup::resetConfiguration()
252{
253 m_pendingGeometry = QRect();
254}
255
256void QWaylandXdgSurface::Popup::grab(QWaylandInputDevice *seat, uint serial)
257{
258 m_xdgSurface->m_shell->m_topmostGrabbingPopup = this;
259 xdg_popup::grab(seat->wl_seat(), serial);
260 m_grabbing = true;
261}
262
263void QWaylandXdgSurface::Popup::xdg_popup_configure(int32_t x, int32_t y, int32_t width, int32_t height)
264{
265 m_pendingGeometry = QRect(x, y, width, height);
266}
267
268void QWaylandXdgSurface::Popup::xdg_popup_popup_done()
269{
270 m_xdgSurface->m_window->window()->close();
271}
272
275 , xdg_surface(surface)
276 , m_shell(shell)
277 , m_window(window)
278{
280 Qt::WindowType type = window->window()->type();
281 auto *transientParent = window->transientParent();
282
283 if (type == Qt::ToolTip && transientParent) {
284 setPopup(transientParent);
285 } else if (type == Qt::Popup && transientParent && display->lastInputDevice()) {
286 setGrabPopup(transientParent, display->lastInputDevice(), display->lastInputSerial());
287 } else {
288 setToplevel();
289 if (transientParent) {
290 auto parentXdgSurface = qobject_cast<QWaylandXdgSurface *>(transientParent->shellSurface());
291 if (parentXdgSurface)
292 m_toplevel->set_parent(parentXdgSurface->m_toplevel->object());
293 }
294 }
295 setSizeHints();
296}
297
299{
300 if (m_toplevel) {
301 delete m_toplevel;
302 m_toplevel = nullptr;
303 }
304 if (m_popup) {
305 delete m_popup;
306 m_popup = nullptr;
307 }
308 destroy();
309}
310
311bool QWaylandXdgSurface::resize(QWaylandInputDevice *inputDevice, Qt::Edges edges)
312{
313 if (!m_toplevel || !m_toplevel->isInitialized())
314 return false;
315
316 auto resizeEdges = Toplevel::convertToResizeEdges(edges);
317 m_toplevel->resize(inputDevice->wl_seat(), inputDevice->serial(), resizeEdges);
318 return true;
319}
320
322{
323 if (m_toplevel && m_toplevel->isInitialized()) {
324 m_toplevel->move(inputDevice->wl_seat(), inputDevice->serial());
325 return true;
326 }
327 return false;
328}
329
331{
332 if (m_toplevel && m_toplevel->isInitialized()) {
334 m_toplevel->show_window_menu(seat->wl_seat(), seat->serial(), position.x(), position.y());
335 return true;
336 }
337 return false;
338}
339
341{
342 if (m_toplevel)
343 m_toplevel->set_title(title);
344}
345
347{
348 if (m_toplevel)
349 m_toplevel->set_app_id(appId);
350
351 m_appId = appId;
352}
353
355{
356 if (m_toplevel)
357 m_toplevel->requestWindowFlags(flags);
358}
359
361{
362 return m_configured || m_pendingConfigureSerial;
363}
364
366{
367 if (!isExposed() && !region.isEmpty()) {
368 m_exposeRegion = region;
369 return true;
370 }
371 return false;
372}
373
375{
376 // It is a redundant ack_configure, so skipped.
377 if (m_pendingConfigureSerial == m_appliedConfigureSerial)
378 return;
379
380 if (m_toplevel)
381 m_toplevel->applyConfigure();
382 if (m_popup)
383 m_popup->applyConfigure();
384 m_appliedConfigureSerial = m_pendingConfigureSerial;
385
386 m_configured = true;
387 ack_configure(m_appliedConfigureSerial);
388}
389
391{
392 return m_toplevel && m_toplevel->wantsDecorations();
393}
394
396{
397 setSizeHints();
398
399 if (m_toplevel && m_window)
400 m_window->commit();
401}
402
404{
405 set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height());
406}
407
409{
410 if (m_toplevel && m_window) {
411 const int minWidth = qMax(0, m_window->windowMinimumSize().width());
412 const int minHeight = qMax(0, m_window->windowMinimumSize().height());
413 int maxWidth = qMax(0, m_window->windowMaximumSize().width());
414 int maxHeight = qMax(0, m_window->windowMaximumSize().height());
415 if (maxWidth == QWINDOWSIZE_MAX)
416 maxWidth = 0;
417 if (maxHeight == QWINDOWSIZE_MAX)
418 maxHeight = 0;
419
420 // It will not change min/max sizes if invalid.
421 if (minWidth > maxWidth || minHeight > maxHeight)
422 return;
423
424 m_toplevel->set_min_size(minWidth, minHeight);
425 m_toplevel->set_max_size(maxWidth, maxHeight);
426 }
427}
428
430{
431 QByteArray lowerCaseResource = resource.toLower();
432 if (lowerCaseResource == "xdg_surface")
433 return object();
434 else if (lowerCaseResource == "xdg_toplevel" && m_toplevel)
435 return m_toplevel->object();
436 else if (lowerCaseResource == "xdg_popup" && m_popup)
437 return m_popup->object();
438 return nullptr;
439}
440
442{
443 if (m_toplevel)
444 return m_toplevel->object();
445 if (m_popup)
446 return m_popup->object();
447 return {};
448}
449
451{
452 if (m_toplevel)
453 m_toplevel->requestWindowStates(states);
454 else
455 qCDebug(lcQpaWayland) << "Ignoring window states requested by non-toplevel zxdg_surface_v6.";
456}
457
458void QWaylandXdgSurface::setToplevel()
459{
460 Q_ASSERT(!m_toplevel && !m_popup);
461 m_toplevel = new Toplevel(this);
462}
463
464void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
465{
466 Q_ASSERT(!m_toplevel && !m_popup);
467
468 auto positioner = new QtWayland::xdg_positioner(m_shell->m_xdgWmBase->create_positioner());
469 // set_popup expects a position relative to the parent
470 QRect windowGeometry = m_window->windowContentGeometry();
471 QMargins windowMargins = m_window->windowContentMargins() - m_window->clientSideMargins();
472 QMargins parentMargins = parent->windowContentMargins() - parent->clientSideMargins();
473 QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
474 transientPos += QPoint(windowMargins.left(), windowMargins.top());
475 transientPos -= parent->geometry().topLeft();
476 transientPos -= QPoint(parentMargins.left(), parentMargins.top());
477 positioner->set_anchor_rect(transientPos.x(), transientPos.y(), 1, 1);
478 positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left);
479 positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
480 positioner->set_size(windowGeometry.width(), windowGeometry.height());
481 positioner->set_constraint_adjustment(QtWayland::xdg_positioner::constraint_adjustment_slide_x
482 | QtWayland::xdg_positioner::constraint_adjustment_slide_y);
483 m_popup = new Popup(this, parent, positioner);
484 positioner->destroy();
485
486 delete positioner;
487}
488
489void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial)
490{
491 auto parentXdgSurface = qobject_cast<QWaylandXdgSurface *>(parent->shellSurface());
492 auto *top = m_shell->m_topmostGrabbingPopup;
493
494 if (top && top->m_xdgSurface != parentXdgSurface) {
495 qCWarning(lcQpaWayland) << "setGrabPopup called with a parent," << parentXdgSurface
496 << "which does not match the current topmost grabbing popup,"
497 << top->m_xdgSurface << "According to the xdg-shell protocol, this"
498 << "is not allowed. The wayland QPA plugin is currently handling"
499 << "it by setting the parent to the topmost grabbing popup."
500 << "Note, however, that this may cause positioning errors and"
501 << "popups closing unxpectedly because xdg-shell mandate that child"
502 << "popups close before parents";
503 parent = top->m_xdgSurface->m_window;
504 }
505 setPopup(parent);
506 m_popup->grab(device, serial);
507
508 // Synthesize Qt enter/leave events for popup
509 if (!parent)
510 return;
512 QWindow *leave = parent->window();
513 if (current != leave)
514 return;
515
517
518 QWindow *enter = nullptr;
519 if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window())
520 enter = m_popup->m_xdgSurface->window()->window();
521
522 if (enter)
523 QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
524}
525
527{
528 m_pendingConfigureSerial = serial;
529 if (!m_configured) {
530 // We have to do the initial applyConfigure() immediately, since that is the expose.
532 m_exposeRegion = QRegion(QRect(QPoint(), m_window->geometry().size()));
533 } else {
534 // Later configures are probably resizes, so we have to queue them up for a time when we
535 // are not painting to the window.
536 m_window->applyConfigureWhenPossible();
537 }
538
539 if (!m_exposeRegion.isEmpty()) {
540 m_window->handleExpose(m_exposeRegion);
541 m_exposeRegion = QRegion();
542 }
543}
544
546{
547 if (auto *activation = m_shell->activation()) {
548 if (!m_activationToken.isEmpty()) {
549 activation->activate(m_activationToken, window()->wlSurface());
550 m_activationToken = {};
551 return true;
552 } else if (const auto token = qEnvironmentVariable("XDG_ACTIVATION_TOKEN"); !token.isEmpty()) {
553 activation->activate(token, window()->wlSurface());
554 qunsetenv("XDG_ACTIVATION_TOKEN");
555 return true;
556 } else {
557 const auto focusWindow = QGuiApplication::focusWindow();
558 // At least GNOME requires to request the token in order to get the
559 // focus stealing prevention indication, so requestXdgActivationToken call
560 // is still necessary in that case.
561 const auto wlWindow = focusWindow ? static_cast<QWaylandWindow*>(focusWindow->handle()) : m_window;
562 if (const auto xdgSurface = qobject_cast<QWaylandXdgSurface *>(wlWindow->shellSurface())) {
563 if (const auto seat = wlWindow->display()->lastInputDevice()) {
564 const auto tokenProvider = activation->requestXdgActivationToken(
565 wlWindow->display(), wlWindow->wlSurface(), seat->serial(), xdgSurface->m_appId);
566 connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this,
567 [this, tokenProvider](const QString &token) {
568 m_shell->activation()->activate(token, window()->wlSurface());
569 tokenProvider->deleteLater();
570 });
571 return true;
572 }
573 }
574 }
575 }
576 return false;
577}
578
580{
581 if (auto *activation = m_shell->activation()) {
582 auto tokenProvider = activation->requestXdgActivationToken(
583 m_shell->m_display, m_window->wlSurface(), serial, m_appId);
584 connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this,
585 [this, tokenProvider](const QString &token) {
586 Q_EMIT m_window->xdgActivationTokenCreated(token);
587 tokenProvider->deleteLater();
588 });
589 } else {
591 }
592}
593
595{
596 if (m_shell->activation()) {
597 m_activationToken = token;
598 } else {
599 qCWarning(lcQpaWayland) << "zxdg_activation_v1 not available";
600 }
601}
602
604{
605 if (m_alertState == enabled)
606 return;
607
608 m_alertState = enabled;
609
610 if (!m_alertState)
611 return;
612
613 auto *activation = m_shell->activation();
614 if (!activation)
615 return;
616
617 const auto tokenProvider = activation->requestXdgActivationToken(
618 m_shell->m_display, m_window->wlSurface(), std::nullopt, m_appId);
619 connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this,
620 [this, tokenProvider](const QString &token) {
621 m_shell->activation()->activate(token, m_window->wlSurface());
622 tokenProvider->deleteLater();
623 });
624}
625
627{
628 if (!m_toplevel || !m_shell->exporter()) {
629 return QString();
630 }
631 if (!m_toplevel->m_exported) {
632 m_toplevel->m_exported.reset(m_shell->exporter()->exportToplevel(m_window->wlSurface()));
633 // handle events is sent immediately
634 m_shell->display()->forceRoundTrip();
635 }
636 return m_toplevel->m_exported->handle();
637}
638
640 : m_display(display), m_xdgWmBase(xdgWmBase)
641{
642 display->addRegistryListener(&QWaylandXdgShell::handleRegistryGlobal, this);
643}
644
646{
647 m_display->removeListener(&QWaylandXdgShell::handleRegistryGlobal, this);
648}
649
650void QWaylandXdgShell::handleRegistryGlobal(void *data, wl_registry *registry, uint id,
651 const QString &interface, uint version)
652{
653 QWaylandXdgShell *xdgShell = static_cast<QWaylandXdgShell *>(data);
655 xdgShell->m_xdgDecorationManager.reset(new QWaylandXdgDecorationManagerV1(registry, id, version));
656
657 if (interface == QLatin1String(QWaylandXdgActivationV1::interface()->name)) {
658 xdgShell->m_xdgActivation.reset(new QWaylandXdgActivationV1(registry, id, version));
659 }
660
661 if (interface == QLatin1String(QWaylandXdgExporterV2::interface()->name)) {
662 xdgShell->m_xdgExporter.reset(new QWaylandXdgExporterV2(registry, id, version));
663 }
664}
665
666}
667
669
670#include "moc_qwaylandxdgshell_p.cpp"
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
QByteArray toLower() const &
Definition qbytearray.h:190
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
Definition qcursor.cpp:188
static QWindow * topLevelAt(const QPoint &pos)
Returns the top level window at the given position pos, if any.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
\inmodule QtCore
Definition qmargins.h:23
constexpr int left() const noexcept
Returns the left margin.
Definition qmargins.h:110
constexpr int top() const noexcept
Returns the top margin.
Definition qmargins.h:113
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
QSize windowMinimumSize() const
Returns the QWindow minimum size.
virtual QRect geometry() const
Returns the current geometry of a window.
QSize windowMaximumSize() const
Returns the QWindow maximum size.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition qpoint.h:394
\inmodule QtCore\reentrant
Definition qpoint.h:23
constexpr int x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:127
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:132
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr QRect marginsAdded(const QMargins &margins) const noexcept
Returns a rectangle grown by the margins.
Definition qrect.h:447
constexpr int height() const noexcept
Returns the height of the rectangle.
Definition qrect.h:238
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:220
constexpr QSize size() const noexcept
Returns the size of the rectangle.
Definition qrect.h:241
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:235
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
Definition qrect.h:260
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
\inmodule QtCore
Definition qsize.h:25
constexpr int height() const noexcept
Returns the height.
Definition qsize.h:132
constexpr QSize grownBy(QMargins m) const noexcept
Definition qsize.h:49
constexpr int width() const noexcept
Returns the width.
Definition qsize.h:129
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
Definition qsize.h:135
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
Definition qsize.h:123
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
Definition qsize.h:138
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandXdgDecorationManagerV1.
QWaylandXdgShell()
Constructs a QWaylandXdgShell object.
\qmltype XdgSurface \instantiates QWaylandXdgSurface \inqmlmodule QtWayland.Compositor....
QWaylandXdgSurface()
Constructs a QWaylandXdgSurface.
static void handleLeaveEvent(QWindow *window)
static void handleEnterEvent(QWindow *window, const QPointF &local=QPointF(), const QPointF &global=QPointF())
\inmodule QtGui
Definition qwindow.h:63
void removeListener(RegistryListener listener, void *data)
virtual void requestXdgActivationToken(quint32 serial)
void commit(QWaylandBuffer *buffer, const QRegion &damage)
QWaylandWindow * transientParent() const
QWaylandDisplay * display() const
void requestXdgActivationToken(uint serial) override
QRect windowContentGeometry() const
Window geometry as defined by the xdg-shell spec (in wl_surface coordinates) topLeft is where the sha...
void handleExpose(const QRegion &region)
QWaylandXdgActivationTokenV1 * requestXdgActivationToken(QWaylandDisplay *display, struct ::wl_surface *surface, std::optional< uint32_t > serial, const QString &app_id)
QWaylandXdgExportedV2 * exportToplevel(wl_surface *surface)
QWaylandDisplay * display() const
QWaylandXdgActivationV1 * activation() const
QWaylandXdgExporterV2 * exporter() const
std::any surfaceRole() const override
void setWindowGeometry(const QRect &rect) override
void * nativeResource(const QByteArray &resource)
void setTitle(const QString &title) override
void setXdgActivationToken(const QString &token) override
bool handleExpose(const QRegion &) override
void setAlertState(bool enabled) override
bool resize(QWaylandInputDevice *inputDevice, Qt::Edges edges) override
void requestWindowStates(Qt::WindowStates states) override
bool move(QWaylandInputDevice *inputDevice) override
void xdg_surface_configure(uint32_t serial) override
void setWindowFlags(Qt::WindowFlags flags) override
void setAppId(const QString &appId) override
void requestXdgActivationToken(quint32 serial) override
bool showWindowMenu(QWaylandInputDevice *seat) override
rect
[4]
Token token
Definition keywords.cpp:444
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
@ WindowFullScreen
Definition qnamespace.h:254
@ WindowNoState
Definition qnamespace.h:251
@ WindowMinimized
Definition qnamespace.h:252
@ WindowMaximized
Definition qnamespace.h:253
@ WindowActive
Definition qnamespace.h:255
@ RightEdge
@ TopEdge
@ BottomEdge
@ LeftEdge
WindowType
Definition qnamespace.h:204
@ FramelessWindowHint
Definition qnamespace.h:224
@ ToolTip
Definition qnamespace.h:212
@ Popup
Definition qnamespace.h:210
#define Q_UNLIKELY(x)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
T qobject_cast(QObject *object)
\variable QObject::staticMetaObject
Definition qobject.h:385
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble top
GLuint object
[3]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLenum type
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLint y
GLuint * states
#define QWINDOWSIZE_MAX
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
QScreen * screen
[1]
Definition main.cpp:29
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
Q_CORE_EXPORT bool qunsetenv(const char *varName)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_EMIT
unsigned int quint32
Definition qtypes.h:45
unsigned int uint
Definition qtypes.h:29
#define leave(x)
#define enabled
QObject::connect nullptr
QString title
[35]
aWidget window() -> setWindowTitle("New Window Title")
[2]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent