22#include <QtCore/QFileInfo>
23#include <QtCore/QPointer>
24#include <QtCore/QRegularExpression>
25#include <QtGui/QWindow>
27#include <QGuiApplication>
28#include <qpa/qwindowsysteminterface.h>
29#include <QtGui/private/qguiapplication_p.h>
30#include <QtGui/private/qwindow_p.h>
32#include <QtCore/QDebug>
33#include <QtCore/QThread>
34#include <QtCore/private/qthread_p.h>
36#include <QtWaylandClient/private/qwayland-fractional-scale-v1.h>
46QWaylandWindow *QWaylandWindow::mMouseGrab =
nullptr;
47QWaylandWindow *QWaylandWindow::mTopPopup =
nullptr;
53 , mShellIntegration(
display->shellIntegration())
60 mFrameCallbackTimeout = frameCallbackTimeout;
63 mScale = waylandScreen() ? waylandScreen()->scale() : 1;
67 initializeWlSurface();
70 &QNativeInterface::Private::QWaylandWindow::surfaceCreated);
72 &QNativeInterface::Private::QWaylandWindow::surfaceDestroyed);
85 if (
w->transientParent() ==
parent)
89 if (mMouseGrab ==
this) {
102void QWaylandWindow::initWindow()
108 initializeWlSurface();
115 this, &QWaylandWindow::updateScale);
118 if (shouldCreateSubSurface()) {
123 parent->initializeWlSurface();
124 if (
parent->wlSurface()) {
128 }
else if (shouldCreateShellSurface()) {
136 <<
"which does not match the current topmost grabbing popup,"
137 << mTopPopup->window() <<
"With some shell surface protocols, this"
138 <<
"is not allowed. The wayland QPA plugin is currently handling"
139 <<
"it by setting the parent to the topmost grabbing popup."
140 <<
"Note, however, that this may cause positioning errors and"
141 <<
"popups closing unxpectedly. Please fix the transient parent of the popup.";
174 if (domainName.isEmpty()) {
178 for (
int i = 0;
i < domainName.size(); ++
i)
180 appId.
append(fi.baseName());
188 emit surfaceRoleCreated();
190 qWarning(
"Could not create a shell surface object.");
196 if (
display()->viewporter() &&
display()->fractionalScaleManager()) {
211 if (geometry.
width() <= 0)
226void QWaylandWindow::initializeWlSurface()
233 this, &QWaylandWindow::handleScreensChanged);
235 this, &QWaylandWindow::updateScale);
247 qCWarning(lcQpaWayland) <<
"Cannot set shell integration while there's already a shell surface created";
253bool QWaylandWindow::shouldCreateShellSurface()
const
258 if (shouldCreateSubSurface())
270bool QWaylandWindow::shouldCreateSubSurface()
const
289 if (mTopPopup ==
this)
300 emit surfaceRoleDestroyed();
387 const int libwaylandMaxBufferSize = 4096;
391 const int maxLength = libwaylandMaxBufferSize / 3 - 100;
394 if (truncated.size() < formatted.size()) {
395 qCWarning(lcQpaWayland) <<
"Window titles longer than" <<
maxLength <<
"characters are not supported."
396 <<
"Truncating window title (from" << formatted.size() <<
"chars)";
421void QWaylandWindow::setGeometry_helper(
const QRect &
rect)
432 if (parentWindow && parentWindow->
isExposed()) {
446 setGeometry_helper(
rect);
461 if (
isExposed() && !mInResizeFromApplyConfigure && exposeGeometry != mLastExposeGeometry)
474void QWaylandWindow::updateInputRegion()
482 if (!transparentInputRegion)
492 mSurface->set_input_region(
nullptr);
496 wl_region_destroy(region);
500void QWaylandWindow::updateViewport()
511 int widthWithoutMargins =
qMax(sizeWithMargins.width() - (margins.
left() + margins.
right()), 1);
512 int heightWithoutMargins =
qMax(sizeWithMargins.height() - (margins.
top() + margins.
bottom()), 1);
514 QRect geometry(positionWithoutMargins,
QSize(widthWithoutMargins, heightWithoutMargins));
516 mInResizeFromApplyConfigure =
true;
518 mInResizeFromApplyConfigure =
false;
527 mInResizeFromApplyConfigure =
true;
529 mInResizeFromApplyConfigure =
false;
535 int widthWithoutMargins =
qMax(sizeWithMargins.width() - (margins.
left() + margins.
right()), 1);
536 int heightWithoutMargins =
qMax(sizeWithMargins.height() - (margins.
top() + margins.
bottom()), 1);
540 mInResizeFromApplyConfigure =
true;
542 mInResizeFromApplyConfigure =
false;
550 qCDebug(lcQpaWayland) <<
"sendExposeEvent: intercepted by shell extension, not sending";
551 mLastExposeGeometry =
rect;
554QPlatformScreen *QWaylandWindow::calculateScreenFromSurfaceEvents()
const
568 if (lastVisible == visible)
570 lastVisible = visible;
619 setOpaqueArea(
mMask);
652 "QWaylandWindow::doApplyConfigure",
"not called from main thread");
660void QWaylandWindow::doApplyConfigureFromOtherThread()
713 auto subWindow = subSurface->window();
714 subWindow->sendRecursiveExposeEvent();
728 if (
mSurface->version() >= WL_SURFACE_OFFSET_SINCE_VERSION) {
753 const QRect bufferRect =
756 mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
757 bufferRect.height());
780 if (
buffer->committed()) {
781 qCDebug(lcWaylandBackingstore) <<
"Buffer already committed, ignoring.";
793 const QRect bufferRect =
796 mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
797 bufferRect.height());
815const wl_callback_listener QWaylandWindow::callbackListener = {
816 [](
void *
data, wl_callback *callback, uint32_t
time) {
819 window->handleFrameCallback(callback);
823void QWaylandWindow::handleFrameCallback(wl_callback* callback)
832 wl_callback_destroy(callback);
867 qCDebug(lcWaylandBackingstore) <<
"Didn't receive frame callback in time, window should now be inexposed";
915 return shadowMargins;
938 return QPointF(surfacePosition.
x() - margins.
left(), surfacePosition.
y() - margins.
top());
970 if (platformScreen->isPlaceholder())
991 const auto transform =
mSurface->preferredBufferTransform().value_or(WL_OUTPUT_TRANSFORM_NORMAL);
996 screenOrientation =
screen->primaryOrientation();
1006 transform = isPortrait ? WL_OUTPUT_TRANSFORM_270 : WL_OUTPUT_TRANSFORM_NORMAL;
1009 transform = isPortrait ? WL_OUTPUT_TRANSFORM_NORMAL : WL_OUTPUT_TRANSFORM_90;
1012 transform = isPortrait ? WL_OUTPUT_TRANSFORM_90 : WL_OUTPUT_TRANSFORM_180;
1015 transform = isPortrait ? WL_OUTPUT_TRANSFORM_180 : WL_OUTPUT_TRANSFORM_270;
1044 updateInputRegion();
1050 "QWaylandWindow::createDecoration",
"not called from main thread");
1057 static bool decorationPluginFailed =
false;
1088 if (decorations.empty()) {
1089 qWarning() <<
"No decoration plugins available. Running with no decorations.";
1090 decorationPluginFailed =
true;
1096 if (!decorationPluginName.isEmpty()) {
1098 if (!decorations.contains(targetKey)) {
1099 qWarning() <<
"Requested decoration " << targetKey <<
" not found, falling back to default";
1104 if (targetKey.isEmpty()) {
1107 const QByteArray currentDesktop = unixServices->desktopEnvironment();
1108 if (currentDesktop ==
"GNOME") {
1109 if (decorations.contains(
"adwaita"_L1))
1110 targetKey =
"adwaita"_L1;
1111 else if (decorations.contains(
"gnome"_L1))
1112 targetKey =
"gnome"_L1;
1115 decorations.removeAll(
"adwaita"_L1);
1116 decorations.removeAll(
"gnome"_L1);
1120 if (targetKey.isEmpty())
1121 targetKey = decorations.first();
1126 qWarning() <<
"Could not create decoration from factory! Running with no decorations.";
1127 decorationPluginFailed =
true;
1139 QPoint pos = subsurf->window()->geometry().topLeft();
1141 subsurf->set_position(
pos.x() +
m.left(),
pos.y() +
m.top());
1153 window()->requestUpdate();
1168 if (
w &&
w->shellSurface())
1203#if QT_CONFIG(cursor)
1204 restoreMouseCursor(inputDevice);
1210 handleMouseEventWithDecoration(inputDevice, e);
1231#if QT_CONFIG(cursor)
1235 restoreMouseCursor(inputDevice);
1240#ifndef QT_NO_GESTURES
1247 qCWarning(lcQpaWaylandInput) <<
"Unexpected GestureStarted while already active";
1257 inputDevice->mTouchPadDevice,
1287 inputDevice->mTouchPadDevice,
1302 qCWarning(lcQpaWaylandInput) <<
"Unexpected GestureStarted while already active";
1312 inputDevice->mTouchPadDevice,
1328 inputDevice->mTouchPadDevice,
1335 inputDevice->mTouchPadDevice,
1356 inputDevice->mTouchPadDevice,
1386 QRect windowRect(0 + marg.left(),
1393 globalTranslated.
setX(globalTranslated.x() - marg.left());
1394 globalTranslated.setY(globalTranslated.y() - marg.top());
1396#if QT_CONFIG(cursor)
1397 restoreMouseCursor(inputDevice);
1413 localTranslated, globalTranslated,
1432void QWaylandWindow::handleScreensChanged()
1439 if (!newScreen->isPlaceholder() && !newScreen->QPlatformScreen::screen())
1446 &&
geometry().topLeft() != newScreen->geometry().topLeft()) {
1448 geometry.
moveTo(newScreen->geometry().topLeft());
1456void QWaylandWindow::updateScale()
1460 preferredScale = std::max(1.0, preferredScale);
1462 setScale(preferredScale);
1467 auto preferredScale =
mSurface->preferredBufferScale().value_or(1);
1468 preferredScale = std::max(1, preferredScale);
1469 setScale(preferredScale);
1477void QWaylandWindow::setScale(
qreal newScale)
1494 window()->requestUpdate();
1499#if QT_CONFIG(cursor)
1506void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *
device)
1509 setMouseCursor(
device, *overrideCursor);
1535 return !(shouldCreateShellSurface() || shouldCreateSubSurface());
1556 qWarning(
"This plugin supports grabbing the mouse only for popup windows");
1560 mMouseGrab = grab ?
this :
nullptr;
1582 Qt::WindowStates statesWithoutActive =
states &
~Qt::WindowActive;
1585 lastStatesWithoutActive);
1622#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE
1648 qCDebug(lcWaylandBackingstore) <<
"Didn't receive frame callback in time, window should now be inexposed";
1656 qCDebug(lcWaylandBackingstore) <<
"requestUpdate";
1671 qCDebug(lcWaylandBackingstore) <<
"requestUpdate called twice without committing anything";
1703 struct ::wl_surface *wrappedSurface =
reinterpret_cast<struct ::wl_surface *
>(wl_proxy_create_wrapper(
mSurface->object()));
1706 wl_proxy_wrapper_destroy(wrappedSurface);
1707 wl_callback_add_listener(
mFrameCallback, &QWaylandWindow::callbackListener,
this);
1727 qCDebug(lcWaylandBackingstore) <<
"deliverUpdateRequest";
1745 if (
auto *seat =
display()->lastInputDevice()) {
1747 seat->handleEndDrag();
1755 if (
auto seat =
display()->lastInputDevice()) {
1756 bool rc = mShellSurface && mShellSurface->move(seat);
1757 seat->handleEndDrag();
1763bool QWaylandWindow::isOpaque()
const
1768void QWaylandWindow::setOpaqueArea(
const QRegion &opaqueArea)
1778 mSurface->set_opaque_region(region);
1779 wl_region_destroy(region);
1799void QWaylandWindow::removeChildPopup(QWaylandWindow *
child)
1837#include "moc_qwaylandwindow_p.cpp"
IOBluetoothDevice * device
bool testAndSetAcquire(T expectedValue, T newValue) noexcept
void storeRelease(T newValue) noexcept
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
The QCursor class provides a mouse cursor with an arbitrary shape.
void invalidate() noexcept
Marks this QElapsedTimer object as invalid.
bool hasExpired(qint64 timeout) const noexcept
Returns true if elapsed() exceeds the given timeout, otherwise false.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
State
Specifies the state of this event point.
@ ApplicationPaletteChange
static QPlatformIntegration * platformIntegration()
static QPlatformNativeInterface * platformNativeInterface()
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
static QCursor * overrideCursor()
Returns the active application override cursor.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
QString desktopFileName
the base name of the desktop entry for this application
The QIcon class provides scalable icons in different modes and states.
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
const_iterator cend() const
const_iterator cbegin() const
constexpr int bottom() const noexcept
Returns the bottom margin.
constexpr bool isNull() const noexcept
Returns true if all margins are is 0; otherwise returns false.
constexpr int left() const noexcept
Returns the left margin.
constexpr int right() const noexcept
Returns the right margin.
constexpr int top() const noexcept
Returns the top margin.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
constexpr void setX(qreal x) noexcept
Sets the x coordinate of this point to the given finite x coordinate.
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
QRect toAlignedRect() const noexcept
\inmodule QtCore\reentrant
constexpr QRect marginsRemoved(const QMargins &margins) const noexcept
Removes the margins from the rectangle, shrinking it.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
The QRegion class specifies a clip region for a painter.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
QRegion translated(int dx, int dy) const
constexpr QStringView left(qsizetype n) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QString & prepend(QChar c)
static QThreadData * get2(QThread *thread)
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
static QThread * currentThread()
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static bool handleGestureEventWithValueAndDelta(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, qreal value, const QPointF &delta, const QPointF &local, const QPointF &global, int fingerCount=2)
static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen)
static void handleLeaveEvent(QWindow *window)
static bool handleGestureEventWithRealValue(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, qreal value, const QPointF &local, const QPointF &global, int fingerCount=2)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static bool handleCloseEvent(QWindow *window)
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static void handleWindowDevicePixelRatioChanged(QWindow *window)
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
static bool handleGestureEvent(QWindow *window, ulong timestamp, const QPointingDevice *device, Qt::NativeGestureType type, const QPointF &local, const QPointF &global, int fingerCount=0)
static void handleEnterEvent(QWindow *window, const QPointF &local=QPointF(), const QPointF &global=QPointF())
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState=-1)
Qt::WindowFlags flags
the window flags of the window
virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, QEventPoint::State state, Qt::KeyboardModifiers mods)=0
void setWaylandWindow(QWaylandWindow *window)
virtual QMargins margins(MarginsType marginsType=Full) const =0
virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods)=0
static QWaylandAbstractDecoration * create(const QString &name, const QStringList &args)
static QStringList keys()
struct::wl_region * createRegion(const QRegion &qregion)
struct::wl_subsurface * createSubSurface(QWaylandWindow *window, QWaylandWindow *parent)
void handleWindowDestroyed(QWaylandWindow *window)
bool isWindowActivated(const QWaylandWindow *window)
QtWayland::wp_fractional_scale_manager_v1 * fractionalScaleManager() const
bool supportsWindowDecoration() const
wl_event_queue * frameEventQueue()
void preferredScaleChanged()
void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name)
Qt::MouseEventSource source
Qt::KeyboardModifiers modifiers
virtual QWaylandShellSurface * createShellSurface(QWaylandWindow *window)=0
virtual void setWindowFlags(Qt::WindowFlags flags)
virtual void setAppId(const QString &)
virtual bool isAlertState() const
virtual bool requestActivate()
virtual void requestWindowStates(Qt::WindowStates states)
virtual void requestXdgActivationToken(quint32 serial)
virtual bool wantsDecorations() const
virtual void setTitle(const QString &)
virtual void sendProperty(const QString &name, const QVariant &value)
virtual void applyConfigure()
virtual void detachPopup(QWaylandShellSurface *popup)
virtual bool resize(QWaylandInputDevice *, Qt::Edges)
virtual void attachPopup(QWaylandShellSurface *popup)
virtual void setAlertState(bool enabled)
virtual void propagateSizeHints()
virtual void setContentOrientationMask(Qt::ScreenOrientations orientation)
virtual void setXdgActivationToken(const QString &token)
virtual bool handleExpose(const QRegion &)
virtual QMargins serverSideFrameMargins() const
virtual void setWindowPosition(const QPoint &position)
virtual bool isExposed() const
virtual bool requestActivateOnShow()
virtual std::any surfaceRole() const
virtual void setWindowGeometry(const QRect &rect)
bool recreateBackBufferIfNeeded()
QWaylandWindow * parent() const
void preferredBufferScaleChanged()
void preferredBufferTransformChanged()
static QWaylandSurface * fromWlSurface(::wl_surface *surface)
std::any _surfaceRole() const override
void setProperty(const QString &name, const QVariant &value)
void setBackingStore(QWaylandShmBackingStore *backingStore)
virtual void ensureSize()
QRegion mQueuedBufferDamage
void wlSurfaceDestroyed()
friend class QWaylandSubSurface
QMargins windowContentMargins() const
QWaylandShellIntegration * mShellIntegration
QWaylandAbstractDecoration * mWindowDecoration
QMargins clientSideMargins() const
Qt::WindowStates mLastReportedWindowStates
void handleWindowStatesChanged(Qt::WindowStates states)
QPointF mapFromWlSurface(const QPointF &surfacePosition) const
Converts from wl_surface coordinates to Qt window coordinates.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QReadWriteLock mSurfaceLock
QScopedPointer< QWaylandViewport > mViewport
void updateBufferTransform()
QWaylandAbstractDecoration * decoration() const
@ GestureActiveInContentArea
@ GestureActiveInDecoration
QWaylandWindow(QWindow *window, QWaylandDisplay *display)
void attach(QWaylandBuffer *buffer, int x, int y)
QString windowTitle() const
bool mMouseEventsInContentArea
QWaylandDisplay * mDisplay
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QWaitCondition mFrameSyncWait
Qt::WindowStates windowStates() const
bool isAlertState() const override
Reimplement this method return whether the window is in an alert state.
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the window.
QWaylandShellSurface * shellSurface() const
QElapsedTimer mFrameCallbackElapsedTimer
bool setMouseGrabEnabled(bool grab) override
~QWaylandWindow() override
bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, QEventPoint::State state, Qt::KeyboardModifiers mods)
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
virtual void doHandleFrameCallback()
void setShellIntegration(QWaylandShellIntegration *shellIntegration)
void sendProperty(const QString &name, const QVariant &value)
QWaylandSubSurface * mSubSurfaceWindow
bool mTransparentInputRegion
virtual QRect defaultGeometry() const
QWaylandWindow * transientParent() const
int mFrameCallbackCheckIntervalTimerId
QWaylandShmBackingStore * mBackingStore
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
void setXdgActivationToken(const QString &token)
QList< QPointer< QWaylandWindow > > mChildPopups
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
QVariant property(const QString &name)
void applyConfigureWhenPossible()
QScopedPointer< QWaylandSurface > mSurface
QWaylandBuffer * mQueuedBuffer
QWaylandScreen * waylandScreen() const
void handleContentOrientationChange(Qt::ScreenOrientation orientation) override
Handle changes to the orientation of the platform window's contents.
QWaylandDisplay * display() const
struct::wl_callback * mFrameCallback
void safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
void setOrientationMask(Qt::ScreenOrientations mask)
void handleSwipeGesture(QWaylandInputDevice *inputDevice, const QWaylandPointerGestureSwipeEvent &e)
Qt::ScreenOrientation mLastReportedContentOrientation
QPlatformScreen * mLastReportedScreen
QAtomicInt mWaitingForUpdateDelivery
QSize surfaceSize() const
Size, with decorations (including including eventual shadows) in wl_surface coordinates.
void setWindowState(Qt::WindowStates states) override
Requests setting the window state of this surface to type.
QWaylandSubSurface * subSurfaceWindow() const
void handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states)
bool mFrameCallbackTimedOut
void handlePinchGesture(QWaylandInputDevice *inputDevice, const QWaylandPointerGesturePinchEvent &e)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
void requestXdgActivationToken(uint serial) override
bool waitForFrameSync(int timeout)
QPointer< QWaylandWindow > mTransientParent
QScopedPointer< QWaylandFractionalScale > mFractionalScale
void addAttachOffset(const QPoint point)
virtual WindowType windowType() const =0
bool isExposed() const override
Returns if this window is exposed in the windowing system.
static QWaylandWindow * fromWlSurface(::wl_surface *surface)
void repositionFromApplyConfigure(const QPoint &position)
QRecursiveMutex mResizeLock
int mFrameCallbackTimeout
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void deliverUpdateRequest() override
Delivers an QEvent::UpdateRequest event to the window.
QPoint attachOffset() const
bool isActive() const override
Returns true if the window should appear active from a style perspective.
bool startSystemResize(Qt::Edges edges) override
Reimplement this method to start a system resize operation if the system supports it and return true ...
QList< QWaylandSubSurface * > mChildren
void setMask(const QRegion ®ion) override
Reimplement to be able to let Qt set the mask of a window.
ToplevelWindowTilingStates toplevelWindowTilingStates() const
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
::wl_surface * wlSurface() const
void handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)
Qt::MouseButtons mMousePressedInContentArea
GestureState mGestureState
bool mWaitingForFrameCallback
void sendRecursiveExposeEvent()
void setParent(const QPlatformWindow *parent) override
This function is called to enable native child window in QPA.
QRect windowContentGeometry() const
Window geometry as defined by the xdg-shell spec (in wl_surface coordinates) topLeft is where the sha...
void damage(const QRect &rect)
QVariantMap properties() const
QWaylandShellIntegration * shellIntegration() const
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
bool mWindowDecorationEnabled
void timerEvent(QTimerEvent *event) override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates
::wl_surface * surface() const override
void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset={0, 0})
void setGeometryFromApplyConfigure(const QPoint &globalPosition, const QSize &sizeWithMargins)
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
bool mWaitingToApplyConfigure
QMargins frameMargins() const override
void sendExposeEvent(const QRect &rect)
QWaylandShellSurface * mShellSurface
void setCustomMargins(const QMargins &margins) override
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
void setCanResize(bool canResize)
static bool fixedToplevelPositions
QSet< QString >::iterator it
struct wl_display * display
Combined button and popup list for selecting options.
static QWaylandWindow * closestShellSurfaceWindow(QWindow *window)
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
@ BypassWindowManagerHint
@ WindowTransparentForInput
QList< QString > QStringList
Constructs a string list that contains the given string, str.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
#define Q_ASSERT_X(cond, x, msg)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QDeadlineTimer deadline(30s)
\inmodule QtCore \reentrant