Compare commits

...

17 Commits

Author SHA1 Message Date
b8a9938c0d Fix build with Qt6.8
handleExpose was removed in 20fb0e7dd5
2024-02-08 17:50:21 +08:00
f1e50306f8 Update version number for 6.0.80
GIT_SILENT
2024-01-10 14:04:04 +00:00
078f36f8f3 Update version number for 5.92.0
GIT_SILENT
2024-01-10 12:29:03 +00:00
7d3194034c Use ECM QML module so the module can be used outside of repository 2024-01-04 14:42:17 -05:00
e3098a660a Fix constrained check
The value in parantheses was always zero.
2023-12-21 13:58:24 +00:00
d379bc8d8e Update version number for 5.91.90
GIT_SILENT
2023-12-20 18:54:50 +00:00
715e629dd8 Update version number for 5.91.0
GIT_SILENT
2023-12-20 12:02:54 +00:00
8ae3b0aef8 Qt6 check code as apps is qt6 only. 2023-12-15 21:44:24 +01:00
6f0bca5593 Revert "Add a (temporary) way to attach popups to layer surfaces"
This reverts commit fdab1544fb.

Qt 6.6 is out with all the necessary multi-shell apis.
2023-12-08 11:55:52 +00:00
d1ab27dd53 Update Qt version requirement to 6.6.0
GIT_SILENT
2023-12-08 12:10:27 +01:00
4569e78e25 Update version number for 5.90.90
GIT_SILENT
2023-12-07 16:41:03 +00:00
ddb0490592 Change default keyboard interactivity to OnDemand
OnDemand is a better default as it still ensures that the window will
receive keyboard input by default, but it's less aggressive.
2023-11-30 10:06:18 +00:00
3c116e7550 Revert "Change default keyboard interactivity from exclusive to none"
This reverts commit be63783888.

It broke keyboard input in sddm greeter. While defaulting to a non-spec
value is not great, it's also not that critical. It might be worth
considering synchronizing Qt::WindowDoesNotAcceptFocus with the keyboard
interactivity flag, but the tricky part is that the keyboard interactivty
is not just a boolean.

BUG: 477251
2023-11-30 10:06:18 +00:00
9e1c5357ac Update version number for 5.90.0
GIT_SILENT
2023-11-29 10:24:25 +00:00
76e8f33cbc GIT_SILENT: Port to new CI template 2023-11-19 16:20:06 +01:00
25bc38dac1 Update version number for 5.81.80
GIT_SILENT
2023-11-17 12:28:29 +00:00
aa167e8da5 Update version number for 5.81.0
GIT_SILENT
2023-11-09 12:31:25 +00:00
7 changed files with 40 additions and 40 deletions

View File

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

View File

@ -4,12 +4,12 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(layershellqt) project(layershellqt)
set(PROJECT_VERSION "5.27.80") set(PROJECT_VERSION "6.0.80")
set(PROJECT_VERSION_MAJOR 6) set(PROJECT_VERSION_MAJOR 6)
set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD 99)
set(QT_MIN_VERSION "6.5.0") set(QT_MIN_VERSION "6.6.0")
set(KF6_MIN_VERSION "5.240.0") set(KF6_MIN_VERSION "5.240.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.82") set(KDE_COMPILERSETTINGS_LEVEL "5.82")
@ -30,6 +30,7 @@ include(FeatureSummary)
include(GenerateExportHeader) include(GenerateExportHeader)
include(KDEClangFormat) include(KDEClangFormat)
include(ECMQtDeclareLoggingCategory) include(ECMQtDeclareLoggingCategory)
include(ECMQmlModule)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml) find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)

View File

@ -1,9 +1,10 @@
# SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleix.pol_gonzalez@mercedes-benz.com> # SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleix.pol_gonzalez@mercedes-benz.com>
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
qt_add_qml_module(LayerShellQtQml ecm_add_qml_module(LayerShellQtQml
URI "org.kde.layershell" URI "org.kde.layershell"
VERSION 1.0 VERSION 1.0
SOURCES layershellqtplugin.cpp) SOURCES layershellqtplugin.cpp)
target_link_libraries(LayerShellQtQml PRIVATE Qt::Qml LayerShellQtInterface) target_link_libraries(LayerShellQtQml PRIVATE Qt::Qml LayerShellQtInterface)
ecm_finalize_qml_module(LayerShellQtQml DESTINATION ${KDE_INSTALL_QMLDIR})

View File

@ -6,9 +6,6 @@
#include "window.h" #include "window.h"
#include "../qwaylandlayershellintegration_p.h" #include "../qwaylandlayershellintegration_p.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
#include "../qwaylandlayersurface_p.h"
#endif
#include <layershellqt_logging.h> #include <layershellqt_logging.h>
@ -31,7 +28,7 @@ public:
QString scope = QStringLiteral("window"); QString scope = QStringLiteral("window");
Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight}; Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight};
int32_t exclusionZone = 0; int32_t exclusionZone = 0;
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityNone; Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityOnDemand;
Window::Layer layer = Window::LayerTop; Window::Layer layer = Window::LayerTop;
QMargins margins; QMargins margins;
Window::ScreenConfiguration screenConfiguration = Window::ScreenFromQWindow; Window::ScreenConfiguration screenConfiguration = Window::ScreenFromQWindow;
@ -141,21 +138,6 @@ void Window::setCloseOnDismissed(bool close)
d->closeOnDismissed = close; d->closeOnDismissed = close;
} }
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
void Window::attachPopup(QWindow *window, xdg_popup *popup)
{
auto waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow *>(window->handle());
if (!waylandWindow) {
return;
}
auto shellSurface = dynamic_cast<QWaylandLayerSurface *>(waylandWindow->shellSurface());
if (shellSurface) {
shellSurface->get_popup(popup);
}
}
#endif
Window::Window(QWindow *window) Window::Window(QWindow *window)
: QObject(window) : QObject(window)
, d(new WindowPrivate(window)) , d(new WindowPrivate(window))

View File

@ -14,10 +14,6 @@
#include "layershellqt_export.h" #include "layershellqt_export.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
struct xdg_popup;
#endif
namespace LayerShellQt namespace LayerShellQt
{ {
class WindowPrivate; class WindowPrivate;
@ -120,10 +116,6 @@ public:
*/ */
static Window *get(QWindow *window); static Window *get(QWindow *window);
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
static void attachPopup(QWindow *window, xdg_popup *popup);
#endif
static Window *qmlAttachedProperties(QObject *object); static Window *qmlAttachedProperties(QObject *object);
Q_SIGNALS: Q_SIGNALS:

View File

@ -16,6 +16,31 @@
#include <QGuiApplication> #include <QGuiApplication>
namespace
{
template<typename T>
concept QWaylandWindowNewV6Type = requires(T t) { t.sendRecursiveExposeEvent(); };
template<typename T>
concept QWaylandWindowOldV6Type = requires(T t) { t.handleExpose(QRect()); } && !requires(T t) { t.sendRecursiveExposeEvent(); };
class ExposeHelper
{
public:
template<QWaylandWindowOldV6Type T>
[[maybe_unused]] ExposeHelper(T *window, const QSize &pendingSize)
{
window->handleExpose(QRect(QPoint(), pendingSize));
}
template<QWaylandWindowNewV6Type T>
[[maybe_unused]] ExposeHelper(T *window, [[maybe_unused]] const QSize &pendingSize)
{
window->sendRecursiveExposeEvent();
}
};
}
namespace LayerShellQt namespace LayerShellQt
{ {
QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, QtWaylandClient::QWaylandWindow *window) QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, QtWaylandClient::QWaylandWindow *window)
@ -92,7 +117,7 @@ void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint
if (!m_configured) { if (!m_configured) {
m_configured = true; m_configured = true;
window()->resizeFromApplyConfigure(m_pendingSize); window()->resizeFromApplyConfigure(m_pendingSize);
window()->handleExpose(QRect(QPoint(), m_pendingSize)); ExposeHelper helper(window(), m_pendingSize);
} else { } else {
// Later configures are resizes, so we have to queue them up for a time when we // Later configures are resizes, so we have to queue them up for a time when we
// are not painting to the window. // are not painting to the window.
@ -100,7 +125,6 @@ void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint
} }
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *popup) void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *popup)
{ {
std::any anyRole = popup->surfaceRole(); std::any anyRole = popup->surfaceRole();
@ -111,7 +135,6 @@ void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *po
qCWarning(LAYERSHELLQT) << "Cannot attach popup of unknown type"; qCWarning(LAYERSHELLQT) << "Cannot attach popup of unknown type";
} }
} }
#endif
void QWaylandLayerSurface::applyConfigure() void QWaylandLayerSurface::applyConfigure()
{ {
@ -121,6 +144,7 @@ void QWaylandLayerSurface::applyConfigure()
void QWaylandLayerSurface::setAnchor(uint anchor) void QWaylandLayerSurface::setAnchor(uint anchor)
{ {
set_anchor(anchor); set_anchor(anchor);
setWindowGeometry(window()->windowContentGeometry());
} }
void QWaylandLayerSurface::setExclusiveZone(int32_t zone) void QWaylandLayerSurface::setExclusiveZone(int32_t zone)
@ -146,8 +170,8 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry) void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
{ {
const bool horizontallyConstrained = m_interface->anchors() & (Window::AnchorLeft & Window::AnchorRight); const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight});
const bool verticallyConstrained = m_interface->anchors() & (Window::AnchorTop & Window::AnchorBottom); const bool verticallyConstrained = m_interface->anchors().testFlags({Window::AnchorTop, Window::AnchorBottom});
QSize size = geometry.size(); QSize size = geometry.size();
if (horizontallyConstrained) { if (horizontallyConstrained) {

View File

@ -32,9 +32,7 @@ public:
{ {
return m_configured; return m_configured;
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override; void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
#endif
void setAnchor(uint32_t anchor); void setAnchor(uint32_t anchor);
void setExclusiveZone(int32_t zone); void setExclusiveZone(int32_t zone);