Skip to content

Re-add missing header when building without KF5Wayland

Otherwise we rely on KWayland/Client/surface.h to implicitly provide QWindow which may not be available.

Partial revert of 9b934629 See also: !80 (merged)

Downstream report: https://bugs.gentoo.org/885101

Snippet:

In file included from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qmainwindow.h:43,
                 from /usr/include/qt5/QtWidgets/QMainWindow:1,
                 from /usr/include/KF5/KXmlGui/kmainwindow.h:20,
                 from /usr/include/KF5/KXmlGui/KMainWindow:1,
                 from /var/tmp/portage/kde-apps/yakuake-9999/work/yakuake-9999/app/mainwindow.h:13,
                 from /var/tmp/portage/kde-apps/yakuake-9999/work/yakuake-9999/app/mainwindow.cpp:9:
/usr/include/qt5/QtCore/qmetatype.h: In instantiation of ‘struct QtPrivate::IsPointerToTypeDerivedFromQObject<QWindow*>’:
/usr/include/qt5/QtCore/qmetatype.h:1756:60:   required from ‘struct QMetaTypeId<QWindow*>’
/usr/include/qt5/QtCore/qmetatype.h:1775:38:   required from ‘struct QMetaTypeId2<QWindow*>’
/usr/include/qt5/QtCore/qobject_impl.h:68:41:   required from ‘struct QtPrivate::TypesAreDeclaredMetaType<QtPrivate::List<QWindow*> >’
/usr/include/qt5/QtCore/qobject.h:262:86:   required from ‘static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType) [with Func1 = void (QGuiApplication::*)(QWindow*); Func2 = void (MainWindow::*)(); typename QtPrivate::FunctionPointer<Func>::Object = QGuiApplication; typename QtPrivate::FunctionPointer<Func2>::Object = MainWindow]’
/var/tmp/portage/kde-apps/yakuake-9999/work/yakuake-9999/app/mainwindow.cpp:1413:12:   required from here
/usr/include/qt5/QtCore/qmetatype.h:1528:9: error: invalid application of ‘sizeof’ to incomplete type ‘QWindow’
 1528 |         Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
      |         ^~~~~~~~~~~~~~~~~
Edited by Andreas Sturmlechner

Merge request reports