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
qwaylandwlshellintegration_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDWLSHELLINTEGRATION_H
6#define QWAYLANDWLSHELLINTEGRATION_H
7
8#include <QtWaylandCompositor/private/qwaylandquickshellsurfaceitem_p.h>
9
10#include <QtWaylandCompositor/QWaylandWlShellSurface>
11
12#include <QtCore/qpointer.h>
13
14QT_BEGIN_NAMESPACE
15
16//
17// W A R N I N G
18// -------------
19//
20// This file is not part of the Qt API. It exists purely as an
21// implementation detail. This header file may change from version to
22// version without notice, or even be removed.
23//
24// We mean it.
25//
26
27namespace QtWayland {
28
30{
32public:
35
36protected:
37 bool eventFilter(QObject *object, QEvent *event) override;
38
39private Q_SLOTS:
41 void handleStartResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges);
42 void handleSetDefaultTopLevel();
43 void handleSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, bool inactive);
44 void handleSetMaximized(QWaylandOutput *output);
45 void handleSetFullScreen(QWaylandWlShellSurface::FullScreenMethod method, uint framerate, QWaylandOutput *output);
46 void handleSetPopup(QWaylandSeat *seat, QWaylandSurface *parent, const QPoint &relativeToParent);
47 void handleShellSurfaceDestroyed();
48 void handleSurfaceHasContentChanged();
49 void handleRedraw();
50 void adjustOffsetForNextFrame(const QPointF &offset);
51 void handleFullScreenSizeChanged();
52 void handleMaximizedSizeChanged();
53
54private:
55 enum class GrabberState {
56 Default,
57 Resize,
58 Move
59 };
60
61 void handlePopupClosed();
62 void handlePopupRemoved();
63 qreal devicePixelRatio() const;
64
65 QWaylandQuickShellSurfaceItem *m_item = nullptr;
66 QPointer<QWaylandWlShellSurface> m_shellSurface;
67 GrabberState grabberState = GrabberState::Default;
68 struct {
69 QWaylandSeat *seat = nullptr;
71 bool initialized = false;
72 } moveState;
73 struct {
74 QWaylandSeat *seat = nullptr;
78 bool initialized = false;
79 } resizeState;
80
81 bool isPopup = false;
82
83 enum class State {
84 Windowed,
85 Maximized,
86 FullScreen
87 };
88
89 State currentState = State::Windowed;
90 State nextState = State::Windowed;
91
92 struct {
94 QMetaObject::Connection sizeChangedConnection; // Depending on whether maximized or fullscreen,
95 // will be hooked to geometry-changed or available-
96 // geometry-changed.
97 } nonwindowedState;
98
99 QPointF normalPosition;
100 QPointF finalPosition;
101
102 bool filterMouseMoveEvent(QMouseEvent *event);
103 bool filterMouseReleaseEvent(QMouseEvent *event);
104};
105
106}
107
108QT_END_NAMESPACE
109
110#endif // QWAYLANDWLSHELLINTEGRATION_H
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QWaylandWlShellSurface::ResizeEdge resizeEdges
Combined button and popup list for selecting options.