summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-08 12:41:30 +0300
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-09 09:12:45 +0200
commit9d7ef928ce0febdcee3cb4327b7f4fc559d3aba1 (patch)
tree4c25918fca8fc4a2259c89708eabd328e264d5aa
parent675b41de61ff9e58f16725eba8ef04861039acf1 (diff)
Update to wayland head
Change-Id: Ie012861bc40e3bc448d85c9d8c27f798434020ed Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r--src/compositor/compositor_api/waylandsurface.cpp6
-rw-r--r--src/compositor/compositor_api/waylandsurface.h4
-rw-r--r--src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp1
-rw-r--r--src/compositor/wayland_wrapper/wlshellsurface.cpp36
-rw-r--r--src/compositor/wayland_wrapper/wlshellsurface.h13
-rw-r--r--src/compositor/wayland_wrapper/wlsurface.cpp8
-rw-r--r--src/compositor/wayland_wrapper/wlsurface.h4
-rw-r--r--src/plugins/platforms/wayland/qwaylandshellsurface.cpp14
-rw-r--r--src/plugins/platforms/wayland/qwaylandshellsurface.h5
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp5
-rw-r--r--tests/auto/client/mockshell.cpp32
-rw-r--r--wayland_sha1.txt2
12 files changed, 122 insertions, 8 deletions
diff --git a/src/compositor/compositor_api/waylandsurface.cpp b/src/compositor/compositor_api/waylandsurface.cpp
index 62914e230..1b56566e2 100644
--- a/src/compositor/compositor_api/waylandsurface.cpp
+++ b/src/compositor/compositor_api/waylandsurface.cpp
@@ -324,3 +324,9 @@ void WaylandSurface::sendOnScreenVisibilityChange(bool visible)
if (d->surface->extendedSurface())
d->surface->extendedSurface()->sendOnScreenVisibility(visible);
}
+
+QString WaylandSurface::title() const
+{
+ Q_D(const WaylandSurface);
+ return d->surface->title();
+}
diff --git a/src/compositor/compositor_api/waylandsurface.h b/src/compositor/compositor_api/waylandsurface.h
index 53589ddbb..5cbc6d08b 100644
--- a/src/compositor/compositor_api/waylandsurface.h
+++ b/src/compositor/compositor_api/waylandsurface.h
@@ -76,6 +76,7 @@ class Q_COMPOSITOR_EXPORT WaylandSurface : public QObject
Q_PROPERTY(Qt::ScreenOrientation windowOrientation READ windowOrientation NOTIFY windowOrientationChanged)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged)
Q_PROPERTY(int windowRotation READ windowRotation NOTIFY windowRotationChanged)
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_ENUMS(WindowFlag)
Q_FLAGS(WindowFlag WindowFlags)
@@ -146,6 +147,8 @@ public:
WaylandCompositor *compositor() const;
+ QString title() const;
+
signals:
void mapped();
void unmapped();
@@ -159,6 +162,7 @@ signals:
void contentOrientationChanged();
void windowRotationChanged();
void extendedSurfaceReady();
+ void titleChanged();
};
diff --git a/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp b/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp
index 29f6ceb13..55bf9b053 100644
--- a/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp
+++ b/src/compositor/hardware_integration/xcomposite_share/xcompositebuffer.cpp
@@ -44,6 +44,7 @@ XCompositeBuffer::XCompositeBuffer(Wayland::Compositor *compositor, Window windo
: mWindow(window)
, mInvertedY(false)
{
+ Q_UNUSED(compositor);
base()->height = size.height();
base()->width = size.width();
}
diff --git a/src/compositor/wayland_wrapper/wlshellsurface.cpp b/src/compositor/wayland_wrapper/wlshellsurface.cpp
index a89cd0a6b..333934e19 100644
--- a/src/compositor/wayland_wrapper/wlshellsurface.cpp
+++ b/src/compositor/wayland_wrapper/wlshellsurface.cpp
@@ -258,14 +258,44 @@ void ShellSurface::set_maximized(struct wl_client *client,
Q_UNUSED(output);
}
+void ShellSurface::pong(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(resource);
+ Q_UNUSED(serial);
+}
+
+void ShellSurface::set_title(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title)
+{
+ Q_UNUSED(client);
+ ShellSurface *self = static_cast<ShellSurface *>(resource->data);
+ self->surface()->setTitle(QString::fromUtf8(title));
+}
+
+void ShellSurface::set_class(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *class_)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(resource);
+ Q_UNUSED(class_);
+}
+
const struct wl_shell_surface_interface ShellSurface::shell_surface_interface = {
+ ShellSurface::pong,
ShellSurface::move,
ShellSurface::resize,
ShellSurface::set_toplevel,
ShellSurface::set_transient,
ShellSurface::set_fullscreen,
ShellSurface::set_popup,
- ShellSurface::set_maximized
+ ShellSurface::set_maximized,
+ ShellSurface::set_title,
+ ShellSurface::set_class
};
Qt::MouseButton toQtButton(uint32_t button)
@@ -371,7 +401,7 @@ void ShellSurfaceResizeGrabber::motion(wl_pointer_grab *grab, uint32_t time, int
shell_surface->sendConfigure(resize_grabber->resize_edges,new_width,new_height);
}
-void ShellSurfaceResizeGrabber::button(wl_pointer_grab *grab, uint32_t time, uint32_t button, int32_t state)
+void ShellSurfaceResizeGrabber::button(wl_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state)
{
Q_UNUSED(time)
ShellSurfaceResizeGrabber *self = reinterpret_cast<ShellSurfaceResizeGrabber *>(grab);
@@ -418,7 +448,7 @@ void ShellSurfaceMoveGrabber::motion(wl_pointer_grab *grab, uint32_t time, int32
shell_surface->surface()->damage(QRect(QPoint(0,0),shell_surface->surface()->size()));
}
-void ShellSurfaceMoveGrabber::button(wl_pointer_grab *grab, uint32_t time, uint32_t button, int32_t state)
+void ShellSurfaceMoveGrabber::button(wl_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state)
{
Q_UNUSED(time)
ShellSurfaceResizeGrabber *self = reinterpret_cast<ShellSurfaceResizeGrabber *>(grab);
diff --git a/src/compositor/wayland_wrapper/wlshellsurface.h b/src/compositor/wayland_wrapper/wlshellsurface.h
index 3f8d42a8f..2661afef1 100644
--- a/src/compositor/wayland_wrapper/wlshellsurface.h
+++ b/src/compositor/wayland_wrapper/wlshellsurface.h
@@ -131,6 +131,15 @@ private:
static void set_maximized(struct wl_client *client,
struct wl_resource *shell_surface_resource,
struct wl_resource *output);
+ static void pong(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ static void set_title(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ static void set_class(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *class_);
static const struct wl_shell_surface_interface shell_surface_interface;
};
@@ -163,7 +172,7 @@ public:
static void motion(struct wl_pointer_grab *grab,
uint32_t time, int32_t x, int32_t y);
static void button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t mouse_grabber_button, int32_t state);
+ uint32_t time, uint32_t mouse_grabber_button, uint32_t state);
static const struct wl_pointer_grab_interface resize_grabber_interface;
};
@@ -180,7 +189,7 @@ public:
static void motion(struct wl_pointer_grab *grab,
uint32_t time, int32_t x, int32_t y);
static void button(struct wl_pointer_grab *grab,
- uint32_t time, uint32_t mouse_grabber_button, int32_t state);
+ uint32_t time, uint32_t mouse_grabber_button, uint32_t state);
static const struct wl_pointer_grab_interface move_grabber_interface;
};
diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp
index 68e58fb14..a02739718 100644
--- a/src/compositor/wayland_wrapper/wlsurface.cpp
+++ b/src/compositor/wayland_wrapper/wlsurface.cpp
@@ -475,5 +475,13 @@ void Surface::surface_set_input_region(struct wl_client *client, struct wl_resou
surface->m_inputRegion = region ? resolve<Region>(region)->region() : QRegion(QRect(QPoint(), surface->size()));
}
+void Surface::setTitle(const QString &title)
+{
+ if (m_title != title) {
+ m_title = title;
+ emit waylandSurface()->titleChanged();
+ }
+}
+
} // namespace Wayland
diff --git a/src/compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/wlsurface.h
index 95377b507..071617227 100644
--- a/src/compositor/wayland_wrapper/wlsurface.h
+++ b/src/compositor/wayland_wrapper/wlsurface.h
@@ -123,6 +123,9 @@ public:
static const struct wl_surface_interface surface_interface;
+ QString title() const { return m_title; }
+ void setTitle(const QString &title);
+
private:
Q_DISABLE_COPY(Surface)
@@ -151,6 +154,7 @@ private:
QPointF m_position;
QSize m_size;
+ QString m_title;
inline SurfaceBuffer *currentSurfaceBuffer() const;
bool advanceBufferQueue();
diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
index 96c3fb24b..fd8170f25 100644
--- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
@@ -88,6 +88,19 @@ void QWaylandShellSurface::updateTransientParent(QWindow *parent)
0);
}
+void QWaylandShellSurface::setTitle(const char *title)
+{
+ wl_shell_surface_set_title(m_shell_surface, title);
+}
+
+void QWaylandShellSurface::ping(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t serial)
+{
+ Q_UNUSED(data);
+ wl_shell_surface_pong(wl_shell_surface, serial);
+}
+
void QWaylandShellSurface::configure(void *data,
wl_shell_surface *wl_shell_surface,
uint32_t edges,
@@ -107,6 +120,7 @@ void QWaylandShellSurface::popup_done(void *data,
}
const wl_shell_surface_listener QWaylandShellSurface::m_shell_surface_listener = {
+ QWaylandShellSurface::ping,
QWaylandShellSurface::configure,
QWaylandShellSurface::popup_done
};
diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.h b/src/plugins/platforms/wayland/qwaylandshellsurface.h
index 148bb0e18..143877366 100644
--- a/src/plugins/platforms/wayland/qwaylandshellsurface.h
+++ b/src/plugins/platforms/wayland/qwaylandshellsurface.h
@@ -63,10 +63,15 @@ public:
struct wl_shell_surface *handle() const { return m_shell_surface; }
+ void setTitle(const char *title);
+
private:
struct wl_shell_surface *m_shell_surface;
QWaylandWindow *m_window;
+ static void ping(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t serial);
static void configure(void *data,
struct wl_shell_surface *wl_shell_surface,
uint32_t edges,
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index e9eadf445..c023de58e 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -133,7 +133,10 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent)
void QWaylandWindow::setWindowTitle(const QString &title)
{
- Q_UNUSED(title);
+ if (mShellSurface) {
+ QByteArray titleUtf8 = title.toUtf8();
+ mShellSurface->setTitle(titleUtf8.constData());
+ }
if (mWindowDecoration && window()->isVisible()) {
mWindowDecoration->paintDecoration();
}
diff --git a/tests/auto/client/mockshell.cpp b/tests/auto/client/mockshell.cpp
index f11a53033..cfc439063 100644
--- a/tests/auto/client/mockshell.cpp
+++ b/tests/auto/client/mockshell.cpp
@@ -43,6 +43,15 @@
namespace Impl {
+void shell_surface_pong(wl_client *client,
+ wl_resource *surface_resource,
+ uint32_t serial)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(surface_resource);
+ Q_UNUSED(serial);
+}
+
void shell_surface_move(wl_client *client,
wl_resource *surface_resource,
wl_resource *input_device_resource,
@@ -129,16 +138,37 @@ void shell_surface_set_maximized(wl_client *client,
Q_UNUSED(output);
}
+void shell_surface_set_title(wl_client *client,
+ wl_resource *surface_resource,
+ const char *title)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(surface_resource);
+ Q_UNUSED(title);
+}
+
+void shell_surface_set_class(wl_client *client,
+ wl_resource *surface_resource,
+ const char *class_)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(surface_resource);
+ Q_UNUSED(class_);
+}
+
static void get_shell_surface(wl_client *client, wl_resource *compositorResource, uint32_t id, wl_resource *surfaceResource)
{
static const struct wl_shell_surface_interface shellSurfaceInterface = {
+ shell_surface_pong,
shell_surface_move,
shell_surface_resize,
shell_surface_set_toplevel,
shell_surface_set_transient,
shell_surface_set_fullscreen,
shell_surface_set_popup,
- shell_surface_set_maximized
+ shell_surface_set_maximized,
+ shell_surface_set_title,
+ shell_surface_set_class
};
Q_UNUSED(compositorResource);
diff --git a/wayland_sha1.txt b/wayland_sha1.txt
index 345ea779a..3b2c751c2 100644
--- a/wayland_sha1.txt
+++ b/wayland_sha1.txt
@@ -1,3 +1,3 @@
This version of Qt-Compositor is checked against the following sha1 from the
Wayland repository:
-677c5180e67be18b7a0867fafb7f205b57a6e9ff
+3f7048e0e99af50fe3555ab3f61f0ef1292959e4