From ab869119ccc8747b4980ce0e4c4938b7bac6e97c Mon Sep 17 00:00:00 2001 From: Andrew Zambazos Date: Wed, 26 Aug 2026 17:35:00 +1200 Subject: [PATCH] Fix Qt compatibility and VM script docs Updates desktop shell and application code for cross-Qt compatibility: uses begin/endFilterChange for Qt 6.10+, gates LayerShell usage to Qt < 6.5, and adds include handling for generated QML type registration files so nebula-shell builds reliably. Also fixes qInfo size formatting casts and updates README commands to invoke run-sway-vm.sh via `sh` for more portable execution. --- README.md | 2 +- compositor/README.md | 4 ++-- core/applications/ApplicationFilterModel.cpp | 7 +++++++ core/applications/ApplicationService.cpp | 4 ++-- shells/desktop/README.md | 2 +- shells/desktop/shell/CMakeLists.txt | 13 +++++++++++++ shells/desktop/shell/src/main.cpp | 8 ++++++-- 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b034353..58e1f3a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ cmake --build build -j$(nproc) Then, from the repository root: ```bash -./compositor/sway/dev/run-sway-vm.sh +sh compositor/sway/dev/run-sway-vm.sh ``` or: diff --git a/compositor/README.md b/compositor/README.md index 10d8986..d81f6e8 100644 --- a/compositor/README.md +++ b/compositor/README.md @@ -37,7 +37,7 @@ sway -c compositor/sway/nebula-sway.conf Recommended on the Ubuntu VMware VM (repo-root `cd`, cursor environment, software cursors): ```bash -./compositor/sway/dev/run-sway-vm.sh +sh compositor/sway/dev/run-sway-vm.sh ``` Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`. @@ -45,7 +45,7 @@ Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`. Skip shell autostart: ```bash -NEBULA_SHELL_AUTOSTART=0 ./compositor/sway/dev/run-sway-vm.sh +NEBULA_SHELL_AUTOSTART=0 sh compositor/sway/dev/run-sway-vm.sh ``` ### Output / resolution diff --git a/core/applications/ApplicationFilterModel.cpp b/core/applications/ApplicationFilterModel.cpp index ad14140..2e46101 100644 --- a/core/applications/ApplicationFilterModel.cpp +++ b/core/applications/ApplicationFilterModel.cpp @@ -1,6 +1,8 @@ #include "ApplicationFilterModel.hpp" #include "ApplicationModel.hpp" +#include + ApplicationFilterModel::ApplicationFilterModel(QObject *parent) : QSortFilterProxyModel(parent) { @@ -25,7 +27,12 @@ void ApplicationFilterModel::setFilter(const QString &filter) return; m_filter = trimmed; +#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0) + beginFilterChange(); + endFilterChange(); +#else invalidateFilter(); +#endif emit filterChanged(); emit countChanged(); } diff --git a/core/applications/ApplicationService.cpp b/core/applications/ApplicationService.cpp index 06822de..98a497a 100644 --- a/core/applications/ApplicationService.cpp +++ b/core/applications/ApplicationService.cpp @@ -73,7 +73,7 @@ void ApplicationService::refresh() const QStringList directories = applicationDirectories(); qInfo("nebula: scanning %d application director%s", - directories.size(), + int(directories.size()), directories.size() == 1 ? "y" : "ies"); for (const QString &directory : directories) { @@ -103,7 +103,7 @@ void ApplicationService::refresh() } qInfo("nebula: discovered %d launcher application%s", - entries.size(), + int(entries.size()), entries.size() == 1 ? "" : "s"); m_model->setEntries(std::move(entries)); } diff --git a/shells/desktop/README.md b/shells/desktop/README.md index 1ea078a..16da2fb 100644 --- a/shells/desktop/README.md +++ b/shells/desktop/README.md @@ -183,7 +183,7 @@ sway -c compositor/sway/nebula-sway.conf or, recommended on the VM (sets cursor env and starts Sway from the repo root): ```bash -./compositor/sway/dev/run-sway-vm.sh +sh compositor/sway/dev/run-sway-vm.sh ``` That should: diff --git a/shells/desktop/shell/CMakeLists.txt b/shells/desktop/shell/CMakeLists.txt index bd621aa..c60f217 100644 --- a/shells/desktop/shell/CMakeLists.txt +++ b/shells/desktop/shell/CMakeLists.txt @@ -99,6 +99,19 @@ if(TARGET NebulaApplicationsplugin) target_link_libraries(nebula-shell PRIVATE NebulaApplicationsplugin) endif() +# Generated nebula-shell_qmltyperegistrations.cpp includes "OutputTracker.hpp" +# via __has_include. Keep src/ on the include path so that succeeds. +target_include_directories(nebula-shell PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/src" +) + +set_source_files_properties( + "${CMAKE_CURRENT_BINARY_DIR}/nebula-shell_qmltyperegistrations.cpp" + PROPERTIES + COMPILE_OPTIONS "-include;${CMAKE_CURRENT_SOURCE_DIR}/src/OutputTracker.hpp" +) + set_target_properties(nebula-shell PROPERTIES OUTPUT_NAME nebula-shell RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" diff --git a/shells/desktop/shell/src/main.cpp b/shells/desktop/shell/src/main.cpp index ef4d5e4..e9595b7 100644 --- a/shells/desktop/shell/src/main.cpp +++ b/shells/desktop/shell/src/main.cpp @@ -1,7 +1,5 @@ #include "DesktopIconProvider.hpp" -#include - #include #include #include @@ -11,6 +9,10 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) +#include +#endif + namespace { void initializeIconTheme() @@ -45,7 +47,9 @@ void initializeIconTheme() int main(int argc, char *argv[]) { +#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) LayerShellQt::Shell::useLayerShell(); +#endif QGuiApplication app(argc, argv); app.setApplicationName(QStringLiteral("nebula-shell"));