diff options
Diffstat (limited to 'examples/qwidget-compositor-mdi')
-rw-r--r-- | examples/qwidget-compositor-mdi/main.cpp | 21 | ||||
-rw-r--r-- | examples/qwidget-compositor-mdi/qt-compositor.pro | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/examples/qwidget-compositor-mdi/main.cpp b/examples/qwidget-compositor-mdi/main.cpp index 7f32c09..752014a 100644 --- a/examples/qwidget-compositor-mdi/main.cpp +++ b/examples/qwidget-compositor-mdi/main.cpp @@ -51,13 +51,12 @@ #include <QPainter> #include <QMouseEvent> -#ifdef QT_COMPOSITOR_WAYLAND_GL -#include <QGLContext> -#include <QGLWidget> -#endif - #include <QDebug> +// This has no GL support, meaning only readback-based GL clients will work. +// Others, e.g. xcomposite-glx, will typically crash the client as there is no +// corresponding integration on the compositor side. + class QSurfaceWidget : public QWidget { Q_OBJECT @@ -70,6 +69,12 @@ public: private slots: void surfaceDamaged(const QRect &rect) { + + // NB! This is dangerous. There may be no paintEvent() called, for + // example if the mdi subwindow is completely covered by another one. + // And in that case there is no frameFinished() -> the client may block + // in its waitForFrameSync() for a long time... + update(rect); } @@ -133,9 +138,9 @@ private slots: void surfaceMapped(const QSize &size) { m_surface->setInputFocus(); - widget()->setMinimumSize(size); - resize(sizeHint()); - show(); + widget()->setMinimumSize(size); + resize(sizeHint()); + show(); } void surfaceDamaged(const QRect &) { diff --git a/examples/qwidget-compositor-mdi/qt-compositor.pro b/examples/qwidget-compositor-mdi/qt-compositor.pro index 59db258..3cd110b 100644 --- a/examples/qwidget-compositor-mdi/qt-compositor.pro +++ b/examples/qwidget-compositor-mdi/qt-compositor.pro @@ -10,6 +10,8 @@ DESTDIR=$$PWD/../../bin/ include (../../src/qt-compositor/qt-compositor.pri) +QT += widgets gui-private widgets-private + # Input SOURCES += main.cpp |