Skip to content

Commit

Permalink
Merge branch 'jb17545' into 'master'
Browse files Browse the repository at this point in the history
[alien] Add API to identify Alien surfaces. Contributes to JB#17545

See merge request !75
  • Loading branch information
jpetrell committed Nov 17, 2017
2 parents 3aa789d + 97341dc commit 771f9b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/compositor/alienmanager/aliensurface.cpp
Expand Up @@ -36,6 +36,7 @@ AlienSurface::AlienSurface(AlienClient *client, QWaylandSurface *surface, uint32
connect(surface, &QWaylandSurface::configure, this, &AlienSurface::configure);
setSurfaceType(QWaylandSurface::Toplevel);
setSurfaceClassName(package);
surface->setProperty("alienSurface", true);
}

AlienSurface::~AlienSurface()
Expand Down
12 changes: 10 additions & 2 deletions src/compositor/lipstickcompositorwindow.cpp
Expand Up @@ -22,7 +22,6 @@
#include "lipstickcompositor.h"
#include "lipstickcompositorwindow.h"


#include "hwcimage.h"
#include "hwcrenderstage.h"
#include <EGL/egl.h>
Expand All @@ -31,7 +30,7 @@

LipstickCompositorWindow::LipstickCompositorWindow(int windowId, const QString &category,
QWaylandQuickSurface *surface, QQuickItem *parent)
: QWaylandSurfaceItem(surface, parent), m_windowId(windowId), m_category(category),
: QWaylandSurfaceItem(surface, parent), m_windowId(windowId), m_isAlien(false), m_category(category),
m_delayRemove(false), m_windowClosed(false), m_removePosted(false), m_mouseRegionValid(false),
m_interceptingTouch(false), m_mapped(false), m_noHardwareComposition(false),
m_focusOnTouch(false), m_hasVisibleReferences(false)
Expand All @@ -45,6 +44,10 @@ LipstickCompositorWindow::LipstickCompositorWindow(int windowId, const QString &
connect(this, SIGNAL(touchEventsEnabledChanged()), SLOT(handleTouchCancel()));
connect(this, &QWaylandSurfaceItem::surfaceDestroyed, this, &QObject::deleteLater);

if (surface) {
m_isAlien = surface->property("alienSurface").toBool();
}

connectSurfaceSignals();
}

Expand Down Expand Up @@ -74,6 +77,11 @@ int LipstickCompositorWindow::windowId() const
return m_windowId;
}

bool LipstickCompositorWindow::isAlien() const
{
return m_isAlien;
}

qint64 LipstickCompositorWindow::processId() const
{
if (surface())
Expand Down
4 changes: 4 additions & 0 deletions src/compositor/lipstickcompositorwindow.h
Expand Up @@ -29,6 +29,7 @@ class LIPSTICK_EXPORT LipstickCompositorWindow : public QWaylandSurfaceItem

Q_PROPERTY(int windowId READ windowId CONSTANT)
Q_PROPERTY(bool isInProcess READ isInProcess CONSTANT)
Q_PROPERTY(bool isAlien READ isAlien CONSTANT)

Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
Q_PROPERTY(QVariant userData READ userData WRITE setUserData NOTIFY userDataChanged)
Expand Down Expand Up @@ -57,6 +58,8 @@ class LIPSTICK_EXPORT LipstickCompositorWindow : public QWaylandSurfaceItem
virtual QString title() const;
virtual bool isInProcess() const;

bool isAlien() const;

QRect mouseRegionBounds() const;

bool eventFilter(QObject *object, QEvent *event);
Expand Down Expand Up @@ -106,6 +109,7 @@ private slots:
void handleTouchEvent(QTouchEvent *e);

int m_windowId;
bool m_isAlien;
QString m_category;
bool m_delayRemove:1;
bool m_windowClosed:1;
Expand Down

0 comments on commit 771f9b6

Please sign in to comment.