diff --git a/src/interfaces/window.cpp b/src/interfaces/window.cpp index 676d91f..b75619e 100644 --- a/src/interfaces/window.cpp +++ b/src/interfaces/window.cpp @@ -6,6 +6,7 @@ #include "window.h" #include "../qwaylandlayersurface_p.h" +#include "../qwaylandlayershellintegration_p.h" #include #include #include @@ -117,6 +118,23 @@ Window::Window(QWindow *window) , d(new WindowPrivate(window)) { s_map.insert(d->parentWindow, this); + + //BEGIN Compat mode + window->winId(); + window->setFlag(Qt::BypassWindowManagerHint); + + auto ww = dynamic_cast(d->parentWindow->handle()); + if (!ww) { + qCDebug(LAYERSHELLQT) << "window not a wayland window" << d->parentWindow; + return; + } + QWaylandLayerShellIntegration shellIntegration; + shellIntegration.initialize(ww->display()); + shellIntegration.createShellSurface(ww); + // we can't block for configure events + // a round trip should mean we'll have one by the time we attach the buffer + ww->display()->forceRoundTrip(); + //END compat mode } Window *Window::get(QWindow *window) diff --git a/tests/main.cpp b/tests/main.cpp index d6a0517..3e589b9 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -51,7 +51,8 @@ class BasicWindow : public QRasterWindow int main(int argc, char **argv) { - Shell::useLayerShell(); +// Shell::useLayerShell(); + qputenv("QT_WAYLAND_USE_BYPASSWINDOWMANAGERHINT", "1"); QGuiApplication app(argc, argv);