mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-05-28 02:50:21 -04:00
support multi shells within Qt5
This commit is contained in:
parent
3a9d0a490f
commit
678e54a49c
@ -6,6 +6,7 @@
|
||||
|
||||
#include "window.h"
|
||||
#include "../qwaylandlayersurface_p.h"
|
||||
#include "../qwaylandlayershellintegration_p.h"
|
||||
#include <layershellqt_logging.h>
|
||||
#include <private/qwaylandshellsurface_p.h>
|
||||
#include <private/qwaylandwindow_p.h>
|
||||
@ -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<QtWaylandClient::QWaylandWindow *>(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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user