Compare commits

..

2 Commits

Author SHA1 Message Date
David Edmundson
678e54a49c support multi shells within Qt5 2022-06-28 09:38:46 +01:00
David Edmundson
3a9d0a490f Use change signals on Window interface class.
QWaylandLayerSurface pulled data from the Window on startup. The Window
pushed data into the QWaylandLayerSurface on changes. Having two
patterns is a bit off.

This moves everything to a single design, pulling from the public
interface. This allows us to drop a code path that meddles with
QWaylandWindow internals.
2022-06-27 23:25:28 +01:00
6 changed files with 26 additions and 11 deletions

View File

@@ -2,8 +2,6 @@
# SPDX-License-Identifier: CC0-1.0
include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/reuse-lint.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml

View File

@@ -4,13 +4,13 @@
cmake_minimum_required(VERSION 3.16)
project(layershellqt)
set(PROJECT_VERSION "5.26.5")
set(PROJECT_VERSION "5.25.80")
set(PROJECT_VERSION_MAJOR 5)
set(CMAKE_C_STANDARD 99)
set(QT_MIN_VERSION "5.15.2")
set(KF5_MIN_VERSION "5.102.0")
set(KF5_MIN_VERSION "5.94")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(CMAKE_CXX_STANDARD 17)

View File

@@ -1,6 +1,3 @@
# SPDX-FileCopyrightText: None
# SPDX-License-Identifier: CC0-1.0
maintainer:
- vladz
description: Layer Shell Qt

View File

@@ -5,9 +5,11 @@
*/
#include "window.h"
#include "../qwaylandlayersurface_p.h"
#include "../qwaylandlayershellintegration_p.h"
#include <layershellqt_logging.h>
#include <QPointer>
#include <private/qwaylandshellsurface_p.h>
#include <private/qwaylandwindow_p.h>
using namespace LayerShellQt;
@@ -116,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)

View File

@@ -37,7 +37,7 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandC
}
init(shell->get_layer_surface(window->waylandSurface()->object(), output, interface->layer(), interface->scope()));
connect(interface, &Window::layerChanged, this, [this, interface]() {
setLayer(interface->layer());
set_layer(interface->layer());
});
set_anchor(interface->anchors());

View File

@@ -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);