Merge remote-tracking branch 'origin/5.4' into 5.5

Conflicts:
	src/client/qwaylandshmbackingstore.cpp
	src/client/qwaylandwindow.cpp

Change-Id: I795fd08f0fc5d3cb5ed55bf16e724f66b7567723
This commit is contained in:
Liang Qi 2015-04-15 09:19:39 +02:00
commit cd7c9b50f6
10 changed files with 43 additions and 24 deletions

View File

@ -5,8 +5,6 @@ QT += waylandclient-private
include(../../../../hardwareintegration/client/brcm-egl/brcm-egl.pri)
LIBS += -lEGL
OTHER_FILES += \
brcm-egl.json

View File

@ -8,8 +8,6 @@ QT += waylandclient-private
include(../../../../hardwareintegration/client/drm-egl-server/drm-egl-server.pri)
LIBS += -lEGL
OTHER_FILES += \
drm-egl-server.json

View File

@ -5,8 +5,6 @@ QT += waylandclient-private
include(../../../../hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pri)
LIBS += -lEGL
OTHER_FILES += \
libhybris-egl-server.json

View File

@ -48,7 +48,10 @@ namespace QtWaylandClient {
class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer {
public:
QWaylandBuffer() { }
QWaylandBuffer()
: mBuffer(0)
{
}
virtual ~QWaylandBuffer() { }
wl_buffer *buffer() {return mBuffer;}
virtual QSize size() const = 0;

View File

@ -198,7 +198,6 @@ private:
QSocketNotifier *mReadNotifier;
int mFd;
int mWritableNotificationFd;
bool mScreensInitialized;
QList<RegistryGlobal> mGlobals;
int mCompositorVersion;
uint32_t mLastInputSerial;

View File

@ -35,6 +35,7 @@
#define QWAYLANDSHELLSURFACE_H
#include <QtCore/QSize>
#include <QObject>
#include <wayland-client.h>
@ -51,8 +52,9 @@ namespace QtWaylandClient {
class QWaylandWindow;
class QWaylandInputDevice;
class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface
class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QObject
{
Q_OBJECT
public:
explicit QWaylandShellSurface(QWaylandWindow *window);
virtual ~QWaylandShellSurface() {}

View File

@ -55,7 +55,8 @@ namespace QtWaylandClient {
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
const QSize &size, QImage::Format format, int scale)
: mMarginsImage(0)
: mShmPool(0)
, mMarginsImage(0)
{
int stride = size.width() * 4;
int alloc = stride * size.height();
@ -97,9 +98,12 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
QWaylandShmBuffer::~QWaylandShmBuffer(void)
{
delete mMarginsImage;
munmap((void *) mImage.constBits(), mImage.byteCount());
wl_buffer_destroy(mBuffer);
wl_shm_pool_destroy(mShmPool);
if (mImage.constBits())
munmap((void *) mImage.constBits(), mImage.byteCount());
if (mBuffer)
wl_buffer_destroy(mBuffer);
if (mShmPool)
wl_shm_pool_destroy(mShmPool);
}
QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn)

View File

@ -102,10 +102,24 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
// Set initial surface title
mShellSurface->setTitle(window->title());
// Set surface class to the .desktop file name (obtained from executable name)
QFileInfo exeFileInfo(qApp->applicationFilePath());
QString className = exeFileInfo.baseName() + QLatin1String(".desktop");
mShellSurface->setAppId(className);
// The appId is the desktop entry identifier that should follow the
// reverse DNS convention (see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html),
// use the application domain if available, otherwise the executable base name.
// According to xdg-shell the appId is only the name, without the .desktop suffix.
QFileInfo fi = QCoreApplication::instance()->applicationFilePath();
QStringList domainName =
QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'),
QString::SkipEmptyParts);
if (domainName.isEmpty()) {
mShellSurface->setAppId(fi.baseName());
} else {
QString appId;
for (int i = 0; i < domainName.count(); ++i)
appId.prepend(QLatin1Char('.')).prepend(domainName.at(i));
appId.append(fi.baseName());
mShellSurface->setAppId(appId);
}
}
if (QPlatformWindow::parent() && mSubSurfaceWindow) {
@ -234,7 +248,7 @@ void QWaylandWindow::setVisible(bool visible)
parent = mDisplay->lastInputWindow();
}
if (parent) {
QWaylandWlShellSurface *wlshellSurface = dynamic_cast<QWaylandWlShellSurface*>(mShellSurface);
QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface);
if (wlshellSurface)
wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial());
}
@ -500,7 +514,7 @@ bool QWaylandWindow::createDecoration()
{
// so far only xdg-shell support this "unminimize" trick, may be moved elsewhere
if (mState == Qt::WindowMinimized) {
QWaylandXdgSurface *xdgSurface = dynamic_cast<QWaylandXdgSurface *>(mShellSurface);
QWaylandXdgSurface *xdgSurface = qobject_cast<QWaylandXdgSurface *>(mShellSurface);
if ( xdgSurface ) {
if (xdgSurface->isFullscreen()) {
setWindowStateInternal(Qt::WindowFullScreen);
@ -639,7 +653,8 @@ bool QWaylandWindow::touchDragDecoration(QWaylandInputDevice *inputDevice, const
void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)
{
if (mWindowDecoration->handleMouse(inputDevice, e.local, e.global, e.buttons, e.modifiers)) {
if (mMousePressedInContentArea == Qt::NoButton &&
mWindowDecoration->handleMouse(inputDevice, e.local, e.global, e.buttons, e.modifiers)) {
if (mMouseEventsInContentArea)
QWindowSystemInterface::handleLeaveEvent(window());
return;

View File

@ -52,9 +52,10 @@ class QWaylandWindow;
class QWaylandInputDevice;
class QWaylandExtendedSurface;
class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QtWayland::wl_shell_surface
, public QWaylandShellSurface
class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QWaylandShellSurface
, public QtWayland::wl_shell_surface
{
Q_OBJECT
public:
QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window);
virtual ~QWaylandWlShellSurface();

View File

@ -53,9 +53,10 @@ class QWaylandWindow;
class QWaylandInputDevice;
class QWaylandExtendedSurface;
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgSurface : public QtWayland::xdg_surface
, public QWaylandShellSurface
class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgSurface : public QWaylandShellSurface
, public QtWayland::xdg_surface
{
Q_OBJECT
public:
QWaylandXdgSurface(struct ::xdg_surface *shell_surface, QWaylandWindow *window);
virtual ~QWaylandXdgSurface();