summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/compositor/qml/Screen.qml1
-rw-r--r--examples/wayland/minimal-cpp/compositor.cpp5
-rw-r--r--examples/wayland/minimal-qml/main.qml1
-rw-r--r--examples/wayland/multi-output/qml/GridScreen.qml1
-rw-r--r--examples/wayland/multi-output/qml/ShellScreen.qml1
-rw-r--r--examples/wayland/pure-qml/qml/Screen.qml1
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp5
-rw-r--r--examples/wayland/server-buffer/compositor/main.cpp9
-rw-r--r--examples/wayland/spanning-screens/main.qml2
9 files changed, 16 insertions, 10 deletions
diff --git a/examples/wayland/custom-extension/compositor/qml/Screen.qml b/examples/wayland/custom-extension/compositor/qml/Screen.qml
index a6d5fbc7c..7a87951b7 100644
--- a/examples/wayland/custom-extension/compositor/qml/Screen.qml
+++ b/examples/wayland/custom-extension/compositor/qml/Screen.qml
@@ -45,6 +45,7 @@ import QtWayland.Compositor 1.0
WaylandOutput {
id: output
property alias surfaceArea: background
+ sizeFollowsWindow: true
window: Window {
id: screen
diff --git a/examples/wayland/minimal-cpp/compositor.cpp b/examples/wayland/minimal-cpp/compositor.cpp
index 5e46895c4..5a6249c9a 100644
--- a/examples/wayland/minimal-cpp/compositor.cpp
+++ b/examples/wayland/minimal-cpp/compositor.cpp
@@ -67,8 +67,11 @@ Compositor::~Compositor()
void Compositor::create()
{
- new QWaylandOutput(this, m_window);
+ QWaylandOutput *output = new QWaylandOutput(this, m_window);
+ QWaylandOutputMode mode(QSize(800, 600), 60000);
+ output->addMode(mode, true);
QWaylandCompositor::create();
+ output->setCurrentMode(mode);
connect(this, &QWaylandCompositor::surfaceCreated, this, &Compositor::onSurfaceCreated);
}
diff --git a/examples/wayland/minimal-qml/main.qml b/examples/wayland/minimal-qml/main.qml
index 3d6c3b7bb..d44d0c6a1 100644
--- a/examples/wayland/minimal-qml/main.qml
+++ b/examples/wayland/minimal-qml/main.qml
@@ -47,6 +47,7 @@ WaylandCompositor {
// The output defines the screen.
WaylandOutput {
compositor: wlcompositor
+ sizeFollowsWindow: true
window: Window {
width: 1024
height: 768
diff --git a/examples/wayland/multi-output/qml/GridScreen.qml b/examples/wayland/multi-output/qml/GridScreen.qml
index 3dab99d0a..2a48cf169 100644
--- a/examples/wayland/multi-output/qml/GridScreen.qml
+++ b/examples/wayland/multi-output/qml/GridScreen.qml
@@ -46,6 +46,7 @@ WaylandOutput {
id: output
property alias gridSurfaces: listModel
+ sizeFollowsWindow: true
window: Window {
width: 1024
height: 760
diff --git a/examples/wayland/multi-output/qml/ShellScreen.qml b/examples/wayland/multi-output/qml/ShellScreen.qml
index 9a6122118..7b8a48ff3 100644
--- a/examples/wayland/multi-output/qml/ShellScreen.qml
+++ b/examples/wayland/multi-output/qml/ShellScreen.qml
@@ -46,6 +46,7 @@ WaylandOutput {
id: output
property alias surfaceArea: background
+ sizeFollowsWindow: true
window: Window {
width: 1024
height: 760
diff --git a/examples/wayland/pure-qml/qml/Screen.qml b/examples/wayland/pure-qml/qml/Screen.qml
index 0920a8b95..a12f387fd 100644
--- a/examples/wayland/pure-qml/qml/Screen.qml
+++ b/examples/wayland/pure-qml/qml/Screen.qml
@@ -45,6 +45,7 @@ import QtWayland.Compositor 1.0
WaylandOutput {
id: output
property alias surfaceArea: background
+ sizeFollowsWindow: true
window: Window {
id: screen
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index a55bb3b72..4878c373e 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -139,8 +139,11 @@ Compositor::~Compositor()
void Compositor::create()
{
- new QWaylandOutput(this, m_window);
+ QWaylandOutput *output = new QWaylandOutput(this, m_window);
+ QWaylandOutputMode mode(QSize(800, 600), 60000);
+ output->addMode(mode, true);
QWaylandCompositor::create();
+ output->setCurrentMode(mode);
connect(this, &QWaylandCompositor::surfaceCreated, this, &Compositor::onSurfaceCreated);
connect(defaultSeat(), &QWaylandSeat::cursorSurfaceRequest, this, &Compositor::adjustCursorSurface);
diff --git a/examples/wayland/server-buffer/compositor/main.cpp b/examples/wayland/server-buffer/compositor/main.cpp
index 9c5ee42a1..8c43ce5c5 100644
--- a/examples/wayland/server-buffer/compositor/main.cpp
+++ b/examples/wayland/server-buffer/compositor/main.cpp
@@ -86,15 +86,13 @@ public:
m_view.setColor(Qt::black);
m_view.create();
m_output = new QWaylandQuickOutput(this, &m_view);
+ m_output->setSizeFollowsWindow(true);
connect(&m_view, &QQuickView::afterRendering, this, &QmlCompositor::sendCallbacks);
connect(&m_view, &QQuickView::sceneGraphInitialized, this, &QmlCompositor::initiateServerBuffer,Qt::DirectConnection);
connect(this, &QmlCompositor::serverBuffersCreated, this, &QmlCompositor::createServerBufferItems);
- connect(&m_view, &QWindow::widthChanged, this, &QmlCompositor::sizeAdjusted);
- connect(&m_view, &QWindow::heightChanged, this, &QmlCompositor::sizeAdjusted);
-
connect(this, SIGNAL(windowAdded(QVariant)), m_view.rootObject(), SLOT(windowAdded(QVariant)));
connect(this, SIGNAL(windowResized(QVariant)), m_view.rootObject(), SLOT(windowResized(QVariant)));
connect(this, SIGNAL(serverBufferItemCreated(QVariant)), m_view.rootObject(), SLOT(serverBufferItemCreated(QVariant)));
@@ -211,11 +209,6 @@ private slots:
}
}
protected:
- void sizeAdjusted()
- {
- defaultOutput()->setGeometry(QRect(QPoint(0, 0), m_view.size()));
- }
-
void onSurfaceCreated(QWaylandSurface *surface) {
QWaylandQuickItem *item = new QWaylandQuickItem();
item->setSurface(surface);
diff --git a/examples/wayland/spanning-screens/main.qml b/examples/wayland/spanning-screens/main.qml
index 00bf517fc..32dc11f33 100644
--- a/examples/wayland/spanning-screens/main.qml
+++ b/examples/wayland/spanning-screens/main.qml
@@ -47,6 +47,7 @@ WaylandCompositor {
WaylandOutput {
compositor: wlcompositor
+ sizeFollowsWindow: true
window: Window {
id: topSurfaceArea
width: 1024
@@ -59,6 +60,7 @@ WaylandCompositor {
WaylandOutput {
compositor: wlcompositor
+ sizeFollowsWindow: true
window: Window {
id: bottomSurfaceArea
width: 1024