7#include <QtWaylandCompositor/QWaylandShellSurface>
8#include <QGuiApplication>
19 popupItem->setShellSurface(shellSurface);
20 popupItem->setAutoCreatePopupItems(
true);
22 popupItem->deleteLater();
65 if (
d->m_shellIntegration) {
67 delete d->m_shellIntegration;
97 return d->m_shellSurface;
108 if (
d->m_shellIntegration) {
110 delete d->m_shellIntegration;
111 d->m_shellIntegration =
nullptr;
115 d->m_shellIntegration =
shellSurface->createIntegration(
this);
169 return d->m_autoCreatePopupItems;
176 if (
enabled ==
d->m_autoCreatePopupItems)
179 d->m_autoCreatePopupItems =
enabled;
193 if (!self->eventFilterInstalled) {
194 qGuiApp->installEventFilter(self);
195 self->eventFilterInstalled =
true;
196 self->client = client;
197 self->closePopups = closePopups;
205 if (self->eventFilterInstalled && !self->waitForRelease)
209void QWaylandQuickShellEventFilter::stopFilter()
211 if (eventFilterInstalled) {
212 qGuiApp->removeEventFilter(
this);
213 eventFilterInstalled =
false;
218QWaylandQuickShellEventFilter::QWaylandQuickShellEventFilter(
QObject *
parent)
227 if (press && !waitForRelease) {
230 mousePressTimeout.
start(0,
this);
240 bool popupClient = shellSurfaceItem && shellSurfaceItem->
surface() && shellSurfaceItem->
surface()->
client() == client;
242 if (waitForRelease) {
245 waitForRelease =
false;
251 if (finalRelease && mousePressTimeout.
isActive()) {
253 qWarning(
"Badly written autotest detected");
254 mousePressTimeout.
stop();
264 mousePressTimeout.
stop();
266 if (press && !popupClient) {
270 waitForRelease =
true;
282 mousePressTimeout.
stop();
294 if (
auto *surf = qobject_cast<QWaylandQuickShellSurfaceItem *>(moveItem))
312 auto *moveItem =
q->moveItem();
316 auto it =
parent->childItems().crbegin();
328 moveItem->stackAfter(
top);
341 auto *moveItem =
q->moveItem();
345 auto it =
parent->childItems().cbegin();
357 moveItem->stackBefore(
bottom);
368 return d->staysOnTop;
374 if (
d->staysOnTop == onTop)
376 d->staysOnTop = onTop;
377 if (
d->staysOnBottom) {
378 d->staysOnBottom =
false;
385 Q_ASSERT(!(
d->staysOnTop &&
d->staysOnBottom));
396 return d->staysOnBottom;
402 if (
d->staysOnBottom == onBottom)
404 d->staysOnBottom = onBottom;
406 d->staysOnTop =
false;
413 Q_ASSERT(!(
d->staysOnTop &&
d->staysOnBottom));
418#include "moc_qwaylandquickshellsurfaceitem_p.cpp"
420#include "moc_qwaylandquickshellsurfaceitem.cpp"
void start(int msec, QObject *obj)
\obsolete Use chrono overload instead.
int timerId() const noexcept
Returns the timer's ID.
void stop()
Stops the timer.
bool isActive() const noexcept
Returns true if the timer is running and has not been stopped; otherwise returns false.
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void removeEventFilter(QObject *obj)
Removes an event filter object obj from this object.
The QQmlProperty class abstracts accessing properties on objects created from QML.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QList< QQuickItem * > childItems() const
Returns the children of this item.
bool enabled
\qmlproperty bool QtQuick::Item::enabled
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
\qmltype WaylandQuickItem \instantiates QWaylandQuickItem \inqmlmodule QtWayland.Compositor
void surfaceDestroyed()
\qmlsignal void QtWayland.Compositor::WaylandQuickItem::surfaceDestroyed()
QWaylandSurface * surface
\qmlproperty WaylandSurface QtWayland.Compositor::WaylandQuickItem::surface
QWaylandQuickShellEventFilter implements a Wayland popup grab.
bool eventFilter(QObject *, QEvent *) override
Filters events if this object has been installed as an event filter for the watched object.
static void startFilter(QWaylandClient *client, CallbackFunction closePopupCallback)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
std::function< void()> CallbackFunction
static void cancelFilter()
bool m_autoCreatePopupItems
QWaylandQuickShellSurfaceItem * maybeCreateAutoPopup(QWaylandShellSurface *shellSurface)
\qmltype ShellSurfaceItem \instantiates QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inq...
QQuickItem * moveItem
\qmlproperty Item QtWayland.Compositor::ShellSurfaceItem::moveItem
bool staysOnTop
Keep this item above other Wayland surfaces.
QWaylandShellSurface * shellSurface
\qmlproperty ShellSurface QtWayland.Compositor::ShellSurfaceItem::shellSurface
void staysOnBottomChanged()
bool staysOnBottom
Keep this item above other Wayland surfaces.
void autoCreatePopupItemsChanged()
QWaylandQuickShellSurfaceItem(QQuickItem *parent=nullptr)
Constructs a QWaylandQuickWlShellSurfaceItem with the given parent.
bool autoCreatePopupItems
\qmlproperty bool QtWayland.Compositor::ShellSurfaceItem::autoCreatePopupItems
~QWaylandQuickShellSurfaceItem() override
void setStaysOnBottom(bool on)
void setStaysOnTop(bool on)
void setMoveItem(QQuickItem *moveItem)
void shellSurfaceChanged()
void setShellSurface(QWaylandShellSurface *shellSurface)
void setAutoCreatePopupItems(bool enabled)
\qmltype ShellSurface \instantiates QWaylandShellSurface \inqmlmodule QtWayland.Compositor
QWaylandClient * client
\qmlproperty WaylandClient QtWayland.Compositor::WaylandSurface::client
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble GLdouble q
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
#define QStringLiteral(str)
static QWaylandQuickShellSurfaceItem * findSurfaceItemFromMoveItem(QQuickItem *moveItem)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent