Compare commits

..

14 Commits

Author SHA1 Message Date
Vlad Zahorodnii
4e4f3c48ac Add support for xx-fractional-scale-v2 2026-07-02 12:02:06 +03:00
Vlad Zahorodnii
7da48d8af4 Add support for fractional window sizes 2026-07-02 12:01:34 +03:00
Laurent Montel
4488263f94 GIT_SILENT: Remove check about qt6.10. We depend against qt6.10 2026-06-08 13:19:43 +02:00
Bhushan Shah
168d51c848 Update Frameworks version requirement to 6.26.0
GIT_SILENT
2026-05-27 22:47:50 +05:30
Justin Zobel
c0888c1fc8 CI: Require all tests to pass 2026-05-25 20:09:25 +09:30
Bhushan Shah
9feb153716 Update version for new release 6.7.80 2026-05-18 11:47:07 +05:30
Bhushan Shah
ba986ea573 Update version for new release 6.6.90 2026-05-14 13:30:54 +05:30
Bhushan Shah
8be764bb9a Update Frameworks version requirement to 6.24.0
GIT_SILENT
2026-05-14 12:40:04 +05:30
Vlad Zahorodnii
aac600107a Fix spectacle crash
focusWindow may have no platform window.
2026-03-26 10:25:05 +00:00
Laurent Montel
9c02b52291 fix cmake warnings 2026-03-22 11:54:02 +01:00
David Redondo
15f108b536 Remove unneeded Qt version check 2026-03-02 10:46:31 +01:00
Vlad Zahorodnii
dd76feea81 Add Window::screenConfiguration() shim
This shim is for 6.6 to maintain compatibility with previous versions.
2026-01-20 14:35:22 +02:00
Vlad Zahorodnii
430ad3630f Allow specifying explicit desired screen
If the window position is not specified, which is a reasonable thing to
do when using the layer shell protocol, setWidth() and setHeight() can
unintentionally change the screen() to the wrong one.

This change adds a setScreen() function so it's harder to shoot
yourself in the foot while using the layer shell protocol.
2026-01-20 14:12:23 +02:00
Bhushan Shah
68df285294 Update version for new release 6.6.80 2026-01-13 21:58:51 +05:30
5 changed files with 51 additions and 12 deletions

View File

@@ -9,4 +9,4 @@ Dependencies:
'third-party/wayland-protocols': '@latest'
Options:
require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows']
require-passing-tests-on: ['@all']

View File

@@ -4,13 +4,13 @@
cmake_minimum_required(VERSION 3.16)
project(layershellqt)
set(PROJECT_VERSION "6.6.3")
set(PROJECT_VERSION "6.7.80")
set(PROJECT_VERSION_MAJOR 6)
set(CMAKE_C_STANDARD 99)
set(QT_MIN_VERSION "6.10.0")
set(KF6_MIN_VERSION "6.22.0")
set(KF6_MIN_VERSION "6.26.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(CMAKE_CXX_STANDARD 20)
@@ -36,9 +36,7 @@ include(ECMGenerateExportHeader)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
if (Qt6WaylandClient_VERSION VERSION_GREATER_EQUAL "6.10.0")
find_package(Qt6WaylandClientPrivate ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
endif()
find_package(Qt6WaylandClientPrivate ${QT_MIN_VERSION} REQUIRED NO_MODULE)
find_package(WaylandScanner REQUIRED)
find_package(Wayland 1.3 COMPONENTS Client Server)

View File

@@ -7,11 +7,8 @@ add_library(LayerShellQtInterface)
qt6_extract_metatypes(LayerShellQtInterface)
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
set(private_code_option "PRIVATE_CODE")
endif()
qt6_generate_wayland_protocol_client_sources(LayerShellQtInterface
${private_code_option}
PRIVATE_CODE
FILES
${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml

View File

@@ -104,7 +104,11 @@ void QWaylandLayerSurface::zwlr_layer_surface_v1_closed()
void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height)
{
ack_configure(serial);
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
m_pendingSize = QSize(width, height);
#else
m_pendingSize = QSizeF(width, height) / compositorToClientScale();
#endif
if (!m_configured) {
m_configured = true;
@@ -133,6 +137,7 @@ void QWaylandLayerSurface::applyConfigure()
window()->resizeFromApplyConfigure(m_pendingSize);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
{
const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight});
@@ -147,6 +152,22 @@ void QWaylandLayerSurface::setDesiredSize(const QSize &size)
}
set_size(effectiveSize.width(), effectiveSize.height());
}
#else
void QWaylandLayerSurface::setDesiredSize(const QSizeF &size)
{
const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight});
const bool verticallyConstrained = m_interface->anchors().testFlags({Window::AnchorTop, Window::AnchorBottom});
QSize effectiveSize = (size * clientToCompositorScale()).toSize();
if (horizontallyConstrained) {
effectiveSize.setWidth(0);
}
if (verticallyConstrained) {
effectiveSize.setHeight(0);
}
set_size(effectiveSize.width(), effectiveSize.height());
}
#endif
void QWaylandLayerSurface::setAnchor(uint anchor)
{
@@ -155,7 +176,7 @@ void QWaylandLayerSurface::setAnchor(uint anchor)
void QWaylandLayerSurface::setExclusiveZone(int32_t zone)
{
set_exclusive_zone(zone);
set_exclusive_zone(std::round(zone * clientToCompositorScale()));
}
void QWaylandLayerSurface::setExclusiveEdge(uint32_t edge)
@@ -167,7 +188,14 @@ void QWaylandLayerSurface::setExclusiveEdge(uint32_t edge)
void QWaylandLayerSurface::setMargins(const QMargins &margins)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
set_margin(margins.top(), margins.right(), margins.bottom(), margins.left());
#else
set_margin(std::round(margins.top() * clientToCompositorScale()),
std::round(margins.right() * clientToCompositorScale()),
std::round(margins.bottom() * clientToCompositorScale()),
std::round(margins.left() * clientToCompositorScale()));
#endif
}
void QWaylandLayerSurface::setKeyboardInteractivity(uint32_t interactivity)
@@ -181,7 +209,11 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
set_layer(layer);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
void QWaylandLayerSurface::setWindowSize(const QSize &size)
#else
void QWaylandLayerSurface::setWindowSize(const QSizeF &size)
#endif
{
if (m_interface->desiredSize().isNull()) {
setDesiredSize(size);
@@ -204,7 +236,7 @@ bool QWaylandLayerSurface::requestActivate()
return true;
} else {
const auto focusWindow = QGuiApplication::focusWindow();
const auto wlWindow = focusWindow ? static_cast<QtWaylandClient::QWaylandWindow *>(focusWindow->handle()) : window();
const auto wlWindow = focusWindow && focusWindow->handle() ? static_cast<QtWaylandClient::QWaylandWindow *>(focusWindow->handle()) : window();
if (const auto seat = wlWindow->display()->lastInputDevice()) {
const auto tokenProvider = activation->requestXdgActivationToken(wlWindow->display(), wlWindow->wlSurface(), seat->serial(), QString());
connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this, [this](const QString &token) {

View File

@@ -34,7 +34,11 @@ public:
}
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
void setDesiredSize(const QSize &size);
#else
void setDesiredSize(const QSizeF &size);
#endif
void setAnchor(uint32_t anchor);
void setExclusiveZone(int32_t zone);
void setExclusiveEdge(uint32_t edge);
@@ -43,7 +47,11 @@ public:
void setLayer(uint32_t layer);
void applyConfigure() override;
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
void setWindowSize(const QSize &size) override;
#else
void setWindowSize(const QSizeF &size) override;
#endif
bool requestActivate() override;
bool requestActivateOnShow() override;
@@ -58,7 +66,11 @@ private:
QWaylandLayerShellIntegration *m_shell;
LayerShellQt::Window *m_interface;
QtWaylandClient::QWaylandWindow *m_window;
#if QT_VERSION < QT_VERSION_CHECK(6, 13, 0)
QSize m_pendingSize;
#else
QSizeF m_pendingSize;
#endif
QString m_activationToken;
bool m_configured = false;