Commit Graph

1267 Commits

Author SHA1 Message Date
rewine 7080047a90 fix: fix potential crash in moveResizeState surface handling
Fixed a potential crash when accessing surface outputs
during move/resize operations. The issue occurred when
moveResizeState.surface->surface() returned a null pointer, causing a
crash when trying to access its outputs. Added a new outputs() method
in SurfaceWrapper that safely handles null surface pointers by returning
an empty list. Also unified container types from QVector to QList for
consistency across the codebase.

Log: Fixed potential crash during window move/resize operations

Influence:
1. Test window move and resize operations to ensure no crashes occur
2. Verify that surfaces properly track output changes during movement
3. Check that pre-launch splash screens handle outputs correctly
4. Test multi-monitor scenarios with window movement between outputs
5. Verify output list consistency across different surface types

fix: 修复moveResizeState表面处理中的潜在崩溃问题

修复了在移动/调整大小操作期间访问表面输出时可能发生的崩溃问题。该问题出
现在moveResizeState.surface->surface()返回空指针时,尝试访问其输出会导致
崩溃。在SurfaceWrapper中添加了新的outputs()方法,通过返回空列表安全处理
空表面指针。同时将容器类型从QVector统一为QList,以保持代码库的一致性。

Log: 修复了窗口移动/调整大小操作期间的潜在崩溃问题

Influence:
1. 测试窗口移动和调整大小操作,确保不会发生崩溃
2. 验证表面在移动过程中是否正确跟踪输出变化
3. 检查预启动闪屏是否正确处理输出
4. 测试多显示器场景下窗口在输出设备间的移动
5. 验证不同表面类型的输出列表一致性
2025-10-30 11:01:56 +08:00
rewine 3e2c877d32 refactor: replace dynamic property with member variable for appId
Replace the use of QObject dynamic property "prelaunchAppId" with a
dedicated member variable m_appId in SurfaceWrapper class. The appId is
now passed through constructor for prelaunch wrappers and accessed via a
new appId() getter method. This improves type safety and performance by
avoiding string-based property lookups.

Log: Improved window management performance and reliability

Influence:
1. Test prelaunch splash functionality with various applications
2. Verify window matching between prelaunch and actual surfaces still
works correctly
3. Check window size persistence for both XDG and XWayland surfaces
4. Test application launching and window creation workflows
5. Verify no regression in window management behavior

refactor: 使用成员变量替代动态属性存储应用ID

将 QObject 动态属性 "prelaunchAppId" 替换为 SurfaceWrapper 类中的专用
成员变量 m_appId。应用ID现在通过构造函数传递给预启动包装器,并通过新的
appId() 获取方法访问。这通过避免基于字符串的属性查找来提高类型安全性和
性能。

Log: 提升了窗口管理性能和可靠性

Influence:
1. 测试各种应用程序的预启动闪屏功能
2. 验证预启动和实际表面之间的窗口匹配仍然正常工作
3. 检查 XDG 和 XWayland 表面的窗口大小持久化
4. 测试应用程序启动和窗口创建工作流程
5. 验证窗口管理行为没有回归
2025-10-30 10:24:15 +08:00
rewine 8c7eb864ab fix: handle surface null case in setOutputs
1. Added null check for surface() in setOutputs method to prevent
crashes when surface is null
2. Added prelaunch outputs storage to preserve output settings during
surface initialization phase
3. Applied prelaunch outputs when converting to normal surface to ensure
proper output assignment
4. This fixes a race condition where WSurface could be null while
WXWaylandSurface still exists

Influence:
1. Test surface creation and output assignment during prelaunch phase
2. Verify that surfaces properly inherit output settings when converted
to normal surfaces
3. Test edge cases where surfaces might be destroyed while operations
are pending
4. Validate that no crashes occur when setting outputs on null surfaces

fix: 修复 setOutputs 中 surface 为 null 的情况处理

1. 在 setOutputs 方法中添加了对 surface() 的空检查,防止 surface 为 null
时崩溃
2. 添加了预启动输出存储功能,在 surface 初始化阶段保留输出设置
3. 在转换为普通 surface 时应用预启动输出,确保正确的输出分配
4. 修复了 WSurface 可能为 null 而 WXWaylandSurface 仍存在的竞态条件

Influence:
1. 测试预启动阶段的 surface 创建和输出分配
2. 验证 surface 转换为普通 surface 时是否正确继承输出设置
3. 测试 surface 可能被销毁而操作仍在挂起的边缘情况
4. 确认在 null surface 上设置输出时不会发生崩溃
2025-10-29 15:18:54 +08:00
rewine d140a7a857 fix: fix corner radius and memory leak issues
1. Fixed corner radius inheritance by passing initial radius parameter
to prelaunch splash
2. Resolved memory leak by replacing direct destroy() call with signal-
based destruction request
3. Improved surface item handling by adding proper change notifications
4. Enhanced type checking for mouse area to exclude undetermined surface
types

Log: Fixed window corner radius display and memory leak during splash
screen cleanup

Influence:
1. Test window creation with different corner radius values
2. Verify prelaunch splash screen properly disappears without memory
leaks
3. Check mouse interaction works correctly on all surface types
4. Validate window decoration borders follow proper radius inheritance
5. Test surface type transitions from undetermined to normal state

fix: 修复圆角和内存泄漏问题

1. 通过向预启动闪屏传递初始半径参数修复圆角继承问题
2. 使用基于信号的销毁请求替换直接destroy()调用解决内存泄漏
3. 添加适当的变更通知改进surface item处理
4. 增强鼠标区域的类型检查以排除未确定表面类型

Log: 修复窗口圆角显示和闪屏清理时的内存泄漏问题

Influence:
1. 测试不同圆角值下的窗口创建
2. 验证预启动闪屏正确消失且无内存泄漏
3. 检查所有表面类型上的鼠标交互是否正常
4. 验证窗口装饰边框是否遵循正确的圆角继承
5. 测试从未确定状态到正常状态的表面类型转换
2025-10-29 11:19:14 +08:00
rewine 61dcb258f0 refactor: extract common surface container update logic
Extracted duplicate parent surface and container update logic
from Xdg and XWayland wrapper initialization into a unified
updateWrapperContainer method. This eliminates code duplication and
improves maintainability. The method handles proper surface hierarchy
management including parent surface relationships and container
assignments.

Influence:
1. Test Xdg toplevel surfaces with and without parent surfaces
2. Test XWayland surfaces with parent surface relationships
3. Verify surface container assignments work correctly
4. Test surface hierarchy changes and parent updates
5. Verify workspace assignments for orphaned surfaces

refactor: 提取公共表面容器更新逻辑

将 Xdg 和 XWayland 包装器初始化中的重复父表面和容器更新逻辑提取到统一的
updateWrapperContainer 方法中。这消除了代码重复并提高了可维护性。该方法
处理正确的表面层次结构管理,包括父表面关系和容器分配。

Influence:
1. 测试带和不带父表面的 Xdg 顶层表面
2. 测试具有父表面关系的 XWayland 表面
3. 验证表面容器分配是否正确工作
4. 测试表面层次结构更改和父表面更新
5. 验证孤立表面的工作区分配
2025-10-27 17:59:09 +08:00
JiDe Zhang b8bb0d4f23 fix: avoid flash when prelauncher disappears
The SurfaceWrapper would flicker when the prelauncher splash screen
disappeared. This was due to `updateVisible` being called immediately
after `convertToNormalSurface`, before the prelaunchSplash was
actually hidden. The fix involves two parts: 1) Delay calling
`updateVisible` until the prelaunchSplash's visibility actually
changes. This is achieved by connecting to the `visibleChanged` signal
of `m_prelaunchSplash`. 2) Add a check in `updateVisible` to return
immediately if the prelaunchSplash is visible, ensuring that visibility
isn't updated prematurely.  Additionally, the initial implicit size is
only set if the prelaunch splash isn't visible, preventing a size reset.
These changes ensure a smoother transition without flashes.

Influence:
1. Launch applications that use prelaunch splash screens and verify that
the window no longer flashes when the splash screen disappears.
2. Test the application with different window sizes and ensure that
the window size remains consistent during and after the splash screen
transition.
3. Verify that window visibility is correctly updated after the splash
screen disappears and the application becomes fully visible.
4. Test minimized and hidden windows to ensure the visibility logic
remains correct.

fix: 修复 prelauncher 消失时闪烁问题

SurfaceWrapper 在 prelauncher 启动画面消失时会出现闪烁。这是因为
在 prelaunchSplash 实际隐藏之前,在 `convertToNormalSurface` 之
后立即调用了 `updateVisible`。 此修复包括两个部分:1)延迟调用
`updateVisible` 直到 prelaunchSplash 的可见性实际发生变化。 这是通过
连接到 `m_prelaunchSplash` 的 `visibleChanged` 信号来实现的。 2)在
`updateVisible` 中添加一个检查,如果 prelaunchSplash 可见,则立即返回,
确保不会过早地更新可见性。此外,只有当 prelaunch splash 不可见时,才会设
置初始隐式大小,从而防止大小重置。 这些更改确保了更平滑的过渡,而不会出
现闪烁。

Influence:
1. 启动使用 prelaunch 启动画面的应用程序,并验证当启动画面消失时窗口不再
闪烁。
2. 使用不同的窗口大小测试应用程序,并确保窗口大小在启动画面过渡期间和之
后保持一致。
3. 验证在启动画面消失并且应用程序完全可见后,窗口可见性是否已正确更新。
4. 测试最小化和隐藏的窗口,以确保可见性逻辑保持正确。
2025-10-16 21:33:40 +08:00
JiDe Zhang db54744b14 chore: update changelog for 0.7.4 release
Update the debian changelog to reflect the changes included in the 0.7.4
release. This includes listing the bug fixes and refactoring efforts
that went into the release, providing a clear record of the changes for
users and maintainers. The changes include fixes for build failures on
Arch Linux, heap-use-after-free issues, Qt private module inclusion for
Qt 6.11, build problems when examples are enabled, and the removal of
branch filters for workflow triggers.

Influence:
This change does not directly affect the application's functionality.
However, it improves the package information and history, which aids in
debugging and maintenance. After the release, verify the changelog is
accurate and accessible through the package manager or documentation.
Ensure build and runtime issues addressed in this release are resolved
by black box testing on the targeted operating systems, especially Arch
Linux.

chore: 更新 0.7.4 版本的更新日志

更新 debian 的更新日志以反映 0.7.4 版本中包含的更改。 这包括列出版本中包
含的错误修复和重构工作,为用户和维护人员提供清晰的更改记录。 这些更改包
括修复 Arch Linux 上的构建失败、堆释放后使用问题、Qt 6.11 的 Qt 私有模块
包含、启用示例时的构建问题以及删除工作流触发器的分支过滤器。

Influence:
此更改不会直接影响应用程序的功能。 但是,它改进了软件包信息和历史记录,
有助于调试和维护。 发布后,验证更改日志是否准确,并且可以通过软件包管理
器或文档访问。 确保通过在目标操作系统(尤其是 Arch Linux)上进行黑盒测试
来解决此版本中解决的构建和运行时问题。
2025-10-16 21:33:40 +08:00
JiDe Zhang 3e2a8a8552 refactor: remove branch filter for workflow triggers
This commit removes the branch filters from the `on` triggers in several
GitHub workflow files. Specifically, the `branches: - master` filter has
been removed from the `push` and `pull_request` triggers in `.github/
workflows/qwlroots-archlinux-build.yml`, `.github/workflows/qwlroots-
debian-build.yml`, `.github/workflows/treeland-archlinux-build.yml`,
`.github/workflows/waylib-archlinux-build.yml`, and `.github/workflows/
waylib-debian-build.yml`.

This change ensures that the workflows are triggered for all branches,
including feature branches and release branches, rather than being
limited to the `master` branch. This provides better coverage for
automated builds and tests whenever changes are pushed or a pull request
is created against *any* branch.  This is important as the project
evolves beyond relying solely on master and introduces feature branches,
ensuring consistent CI across development.

Influence:
1. Verify that all workflows trigger correctly on pushes and pull
requests for all branches, not just master.
2. Create a pull request to a new branch and ensure that all relevant
workflows are triggered.
3. Push a commit to a new branch and verify that all relevant workflows
are triggered.

重构: 移除工作流程触发器的分支筛选器

此提交从多个 GitHub 工作流程文件的 `on` 触发器中删除了分支筛选器。
具体来说,已从 `.github/workflows/qwlroots-archlinux-build.yml`、
`.github/workflows/qwlroots-debian-build.yml`、`.github/workflows/
treeland-archlinux-build.yml`、`.github/workflows/waylib-archlinux-
build.yml` 和 `.github/workflows/waylib-debian-build.yml` 中的 `push` 和
`pull_request` 触发器中删除 `branches: - master` 筛选器。

此更改确保工作流程在所有分支(包括功能分支和发布分支)上触发,而不是仅限
于 `master` 分支。 无论何时推送更改或针对*任何*分支创建拉取请求,这都为
自动构建和测试提供了更好的覆盖范围。 这一点很重要,因为项目的发展不仅仅
依赖于 master,还引入了功能分支,确保了整个开发过程中的持续集成。

Influence:
1. 验证所有工作流程是否在所有分支(不仅仅是 master)的推送和拉取请求上正
确触发。
2. 创建一个到新分支的拉取请求,并确保所有相关的工作流程都被触发。
3. 将提交推送到一个新分支,并验证所有相关的工作流程是否被触发。
2025-10-16 21:33:40 +08:00
JiDe Zhang 85ba2f4108 fix: fix build when treeland examples are enabled
Fixes a build failure that occurs when Treeland examples are enabled,
specifically in higher versions of Qt6. The issue arises because certain
private Qt modules (like `WaylandClientPrivate`) are not automatically
included and need to be explicitly specified using `find_package`.
Failing to do so results in linker errors during the build process. This
change ensures that the necessary private modules are found, allowing
the examples to compile successfully.

Influence:
1. Build the `test_multitaskview` example with Treeland examples
enabled.
2. Verify that the build completes without any errors related to missing
Qt private modules.
3. Confirm that the compiled example runs correctly.

fix: 修复开启 treeland 示例时构建失败的问题

修复了在 Qt6 的较高版本中,启用 Treeland 示例时发生的构建失败。 出现此问
题的原因是某些私有 Qt 模块(如 `WaylandClientPrivate`)不会自动包含,需
要使用 `find_package` 显式指定。 否则,会导致构建过程中出现链接器错误。
此更改确保找到必要的私有模块,从而使示例能够成功编译。

Influence:
1. 在启用 Treeland 示例的情况下构建 `test_multitaskview` 示例。
2. 验证构建是否完成,并且没有与缺少的 Qt 私有模块相关的任何错误。
3. 确认编译后的示例可以正确运行。
2025-10-16 21:33:40 +08:00
Felix Yan dd1fc20d38 fix: compile errors on Arch for forward declared class
`TreelandConfig` became a forward declaration on
fa1e1e6a18 which breaks moc compilation on
Arch with the following errors. Let's use `Q_MOC_INCLUDE` like the
others to workaround it. Note that `Q_DECLARE_OPAQUE_POINTER` should be
avoided here because `TreelandConfig` is a `Q_OBJECT`.

```
[585/700] Building CXX object src/CMakeFiles/libtreeland.dir/libtreeland_autogen/mocs_compilation.cpp.o
FAILED: src/CMakeFiles/libtreeland.dir/libtreeland_autogen/mocs_compilation.cpp.o
/usr/bin/c++ -DDDECLARATIVE_TRANSLATIONS_DIR=\"dtk6/DDeclarative/translations\" -DDSG_DATA_DIR=\"/usr/share/dsg\" -DDSYSINFO_PREFIX=\"\" -DDTK_QML_APP_PLUGIN_PATH=\"/usr/lib/dtk6declarative/qml-app\" -DDTK_QML_APP_PLUGIN_SUBPATH=\"dtkdeclarative/plugins\" -DPREFIX=\"/usr\" -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_FORCE_ASSERTS -DQT_GUI_LIB -DQT_MESSAGELOGCONTEXT -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMETA_LIB -DQT_QMLMODELS_LIB -DQT_QMLWORKERSCRIPT_LIB -DQT_QML_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_XML_LIB -DTREELAND_COMPONENTS_TRANSLATION_DIR=\"/usr/share/treeland/translations\" -DTREELAND_DATA_DIR=\"/usr/share/treeland\" -DTREELAND_PLUGINS_INSTALL_PATH=\"/usr/lib/treeland/plugins\" -DTREELAND_PLUGINS_OUTPUT_PATH=\"/build/treeland/src/treeland/lib/plugins\" -DWLR_USE_UNSTABLE -Dlibtreeland_EXPORTS -I/build/treeland/src/treeland/src -I/build/treeland/src/treeland/src/libtreeland_autogen/include -I/build/treeland/src/treeland/protocols -I/build/treeland/src/treeland/src/config -I/build/treeland/src/treeland/src/core -I/build/treeland/src/treeland/src/effects -I/build/treeland/src/treeland/src/greeter -I/build/treeland/src/treeland/src/input -I/build/treeland/src/treeland/src/interfaces -I/build/treeland/src/treeland/src/output -I/build/treeland/src/treeland/src/seat -I/build/treeland/src/treeland/src/surface -I/build/treeland/src/treeland/src/workspace -I/build/treeland/src/treeland/src/utils -I/build/treeland/src/treeland/src/wallpaper -I/build/treeland/src/treeland/waylib/src/server/kernel -I/build/treeland/src/treeland/waylib/src/server/qtquick -I/build/treeland/src/treeland/waylib/src/server/qtquick/private -I/build/treeland/src/treeland/waylib/src/server/utils -I/build/treeland/src/treeland/waylib/src/server/protocols -I/build/treeland/src/treeland/waylib/src/server/protocols/private -I/build/treeland/src/treeland/waylib/qwlroots/src/generate -I/build/treeland/src/treeland/qwlroots/src -I/build/treeland/src/treeland/qwlroots/src/render -I/build/treeland/src/treeland/qwlroots/src/types -I/build/treeland/src/treeland/qwlroots/src/util -I/build/treeland/src/treeland/qwlroots/src/interfaces -I/build/treeland/src/treeland/src/modules/foreign-toplevel -I/build/treeland/src/treeland/src/modules/primary-output -I/build/treeland/src/treeland/src/modules/personalization -I/build/treeland/src/treeland/src/modules/shortcut -I/build/treeland/src/treeland/src/modules/wallpaper-color -I/build/treeland/src/treeland/src/modules/window-management -I/build/treeland/src/treeland/src/modules/virtual-output -I/build/treeland/src/treeland/src/modules/dde-shell -I/build/treeland/src/treeland/src/modules/capture -I/build/treeland/src/treeland/src/modules/item-selector -I/build/treeland/src/treeland/src/modules/ddm -isystem /usr/include/qt6/QtQml/6.9.2 -isystem /usr/include/qt6/QtQml/6.9.2/QtQml -isystem /usr/include/qt6/QtCore/6.9.2 -isystem /usr/include/qt6/QtCore/6.9.2/QtCore -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/dtk6/DCore -isystem /usr/include/qt6/QtDBus -isystem /usr/include/qt6/QtXml -isystem /usr/include/dtk6/DLog -isystem /usr/include/dtk6/DDeclarative -isystem /usr/include/qt6/QtQuick -isystem /usr/include/qt6/QtGui -isystem /usr/include/qt6/QtQmlMeta -isystem /usr/include/qt6/QtQmlModels -isystem /usr/include/qt6/QtQmlWorkerScript -isystem /usr/include/qt6/QtOpenGL -isystem /usr/include/dtk6/DGui -isystem /usr/include/dtk6/DSystemSettings -isystem /usr/include/wlroots-0.19 -isystem /usr/include/pixman-1 -isystem /usr/include/libdrm -isystem /usr/include/qt6/QtQuickControls2 -isystem /usr/include/qt6/QtQuick/6.9.2 -isystem /usr/include/qt6/QtQuick/6.9.2/QtQuick -isystem /usr/include/qt6/QtGui/6.9.2 -isystem /usr/include/qt6/QtGui/6.9.2/QtGui -isystem /usr/include/qt6/QtQmlModels/6.9.2 -isystem /usr/include/qt6/QtQmlModels/6.9.2/QtQmlModels -isystem /usr/include/qt6/QtQmlMeta/6.9.2 -isystem /usr/include/qt6/QtQmlMeta/6.9.2/QtQmlMeta -isystem /usr/include/qt6/QtQmlWorkerScript/6.9.2 -isystem /usr/include/qt6/QtQmlWorkerScript/6.9.2/QtQmlWorkerScript -isystem /usr/include/qt6/QtConcurrent -isystem /usr/include/ddm/auth -isystem /usr/include/ddm/common -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/treeland/src=/usr/src/debug/treeland -flto=auto -std=gnu++20 -fPIC -mno-direct-extern-access -MD -MT src/CMakeFiles/libtreeland.dir/libtreeland_autogen/mocs_compilation.cpp.o -MF src/CMakeFiles/libtreeland.dir/libtreeland_autogen/mocs_compilation.cpp.o.d -o src/CMakeFiles/libtreeland.dir/libtreeland_autogen/mocs_compilation.cpp.o -c /build/treeland/src/treeland/src/libtreeland_autogen/mocs_compilation.cpp
In file included from /usr/include/qt6/QtCore/qobject.h:18,
                 from /usr/include/qt6/QtCore/qabstractanimation.h:8,
                 from /usr/include/qt6/QtCore/QtCore:19,
                 from /usr/include/qt6/QtQmlIntegration/QtQmlIntegrationDepends:3,
                 from /usr/include/qt6/QtQmlIntegration/QtQmlIntegration:3,
                 from /build/treeland/src/treeland/waylib/src/server/kernel/wglobal.h:8,
                 from /build/treeland/src/treeland/waylib/src/server/qtquick/wsurfaceitem.h:6,
                 from /build/treeland/src/treeland/src/surface/surfacewrapper.h:5,
                 from /build/treeland/src/treeland/src/surface/surfacecontainer.h:5,
                 from /build/treeland/src/treeland/src/libtreeland_autogen/TAC5DWH4SE/../../core/lockscreen.h:6,
                 from /build/treeland/src/treeland/src/libtreeland_autogen/TAC5DWH4SE/moc_lockscreen.cpp:9,
                 from /build/treeland/src/treeland/src/libtreeland_autogen/mocs_compilation.cpp:2:
/usr/include/qt6/QtCore/qmetatype.h: In instantiation of ‘constexpr bool QtPrivate::checkTypeIsSuitableForMetaType() [with X = TreelandConfig*]’:
/usr/include/qt6/QtCore/qmetatype.h:2661:43:   required from ‘constexpr const QtPrivate::QMetaTypeInterface* QtPrivate::qTryMetaTypeInterfaceForType() [with Unique = void; T = TreelandConfig*]’
 2661 |         checkTypeIsSuitableForMetaType<Ty>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qtmochelpers.h:170:51:   required from ‘static constexpr void QtMocHelpers::detail::MetaTypeList<TypeMustBeComplete, T>::copyTo(Result&, uint&) [with Unique = void; Result = QtMocHelpers::MetaObjectContents<255, 112, 807, 45>; bool TypeMustBeComplete = true; T = {TreelandConfig*}; uint = unsigned int]’
  170 |                 qTryMetaTypeInterfaceForType<U, T>()...
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qtmochelpers.h:262:65:   required from ‘constexpr const QtMocHelpers::MetaObjectContents<255, 112, 807, 45> Helper::qt_staticMetaObjectContent<{anonymous}::qt_meta_tag_ZN6HelperE_t>’
  262 |             decltype(input.metaTypes())::template copyTo<Unique>(result, metatypeoffset);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/build/treeland/src/treeland/src/libtreeland_autogen/LTNFY7LWQW/../../seat/helper.h:106:5:   required from ‘constexpr const auto Helper::qt_staticMetaObjectStaticContent<{anonymous}::qt_meta_tag_ZN6HelperE_t>’
  106 |     Q_OBJECT
      |     ^~~~~~~~
/build/treeland/src/treeland/src/libtreeland_autogen/LTNFY7LWQW/moc_helper.cpp:217:5:   required from here
  217 |     qt_staticMetaObjectStaticContent<qt_meta_tag_ZN6HelperE_t>.stringdata,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/treeland/src/treeland/src/libtreeland_autogen/LTNFY7LWQW/../../seat/helper.h:106:5:   in ‘constexpr’ expansion of ‘Helper::qt_create_metaobjectdata<{anonymous}::qt_meta_tag_ZN6HelperE_t>()’
/build/treeland/src/treeland/src/libtreeland_autogen/LTNFY7LWQW/moc_helper.cpp:212:54:   in ‘constexpr’ expansion of ‘QtMocHelpers::metaObjectData<Helper, void, StringRefStorage<char [7], char [12], char [5], char [14], char [5], char [21], char [1], char [21], char [24], char [22], char [18], char [18], char [19], char [28], char [16], char [16], char [8], char [16], char [7], char [21], char [36], char [8], char [28], char [14], char [17], char [18], char [6], char [13], char [10], char [16], char [11], char [10], char [12], char [15], char [14], char [14], char [22], char [15], char [11], char [11], char [21], char [18], char [14], char [17], char [10], char [11], char [7], char [16], char [21], char [5], char [10], char [12], char [7], char [11], char [13], char [14]>, UintData<SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SlotData<void(SurfaceWrapper*, Qt::FocusReason)>, SlotData<void(SurfaceWrapper*)>, SlotData<void(SurfaceWrapper*, Qt::FocusReason)>, SlotData<void(SurfaceWrapper*)>, SlotData<void(SurfaceWrapper*)>, SlotData<bool(SurfaceWrapper*)>, SlotData<void()>, SlotData<void()>, SlotData<void(bool)>, SlotData<void(const QString&, const QDBusObjectPath&)>, MethodData<void()>, MethodData<bool(Waylib::Server::WLayerSurface*) const> >, UintData<PropertyData<bool>, PropertyData<RootSurfaceContainer*>, PropertyData<float>, PropertyData<Helper::OutputMode>, PropertyData<TogglableGesture*>, PropertyData<TogglableGesture*>, PropertyData<SurfaceWrapper*>, PropertyData<Workspace*>, PropertyData<TreelandConfig*>, PropertyData<bool> >, UintData<EnumData<Helper::OutputMode, 2>, EnumData<Helper::CurrentMode, 4> >, UintData<>, ClassInfos<2> >(0, qt_stringData, qt_methods, qt_properties, qt_enums, qt_constructors, qt_classinfo)’
/usr/include/qt6/QtCore/qtmochelpers.h:550:39:   in ‘constexpr’ expansion of ‘(& properties)->QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(result, ((size_t)dataoffset), metatypeoffset)’
/usr/include/qt6/QtCore/qtmochelpers.h:255:21:   in ‘constexpr’ expansion of ‘((const QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >*)this)->QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::data.QtMocHelpers::detail::UintDataStorage<std::integer_sequence<int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9>, QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::forEach<QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(QtMocHelpers::MetaObjectContents<255, 112, 807, 45>&, size_t, uint&) const::<lambda(const auto:60&)> >(<lambda closure object>QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(QtMocHelpers::MetaObjectContents<255, 112, 807, 45>&, size_t, uint&) const::<lambda(const auto:60&)>{ptr, dataoffset, payloadoffset, (* & metatypeoffset), (* & result)})’
/usr/include/qt6/QtCore/qtmochelpers.h:204:19:   in ‘constexpr’ expansion of ‘invoke.QtMocHelpers::detail::UintDataStorage<std::integer_sequence<int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9>, QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::forEach<QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(QtMocHelpers::MetaObjectContents<255, 112, 807, 45>&, size_t, uint&) const::<lambda(const auto:60&)> >(QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(QtMocHelpers::MetaObjectContents<255, 112, 807, 45>&, size_t, uint&) const::<lambda(const auto:60&)>&&) const::<lambda(const auto:59&)>(((const QtMocHelpers::detail::UintDataStorage<std::integer_sequence<int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9>, QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >*)this)->QtMocHelpers::detail::UintDataStorage<std::integer_sequence<int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9>, QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::QtMocHelpers::detail::UintDataEntry<8, QtMocHelpers::PropertyData<TreelandConfig*> >)’
/usr/include/qt6/QtCore/qtmochelpers.h:201:67:   in ‘constexpr’ expansion of ‘(& f)->QtMocHelpers::UintData<QtMocHelpers::PropertyData<bool>, QtMocHelpers::PropertyData<RootSurfaceContainer*>, QtMocHelpers::PropertyData<float>, QtMocHelpers::PropertyData<Helper::OutputMode>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<TogglableGesture*>, QtMocHelpers::PropertyData<SurfaceWrapper*>, QtMocHelpers::PropertyData<Workspace*>, QtMocHelpers::PropertyData<TreelandConfig*>, QtMocHelpers::PropertyData<bool> >::copyTo<void, QtMocHelpers::MetaObjectContents<255, 112, 807, 45> >(QtMocHelpers::MetaObjectContents<255, 112, 807, 45>&, size_t, uint&) const::<lambda(const auto:60&)>(entry.QtMocHelpers::detail::UintDataEntry<8, QtMocHelpers::PropertyData<TreelandConfig*> >::entry)’
/usr/include/qt6/QtCore/qmetatype.h:1209:55: error: static assertion failed: Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)
 1209 |             static_assert(is_complete<Pointed, void>::value,
      |                                                       ^~~~~
/usr/include/qt6/QtCore/qmetatype.h:1209:55: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
/usr/include/qt6/QtCore/qmetatype.h: In instantiation of ‘constexpr bool QtPrivate::checkTypeIsSuitableForMetaType() [with X = TreelandConfig]’:
/usr/include/qt6/QtCore/qmetatype.h:2678:49:   required from ‘static constexpr QMetaType QMetaType::fromType() [with T = TreelandConfig]’
 2678 |     QtPrivate::checkTypeIsSuitableForMetaType<T>();
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt6/QtCore/qtmochelpers.h:559:88:   required from ‘constexpr auto QtMocHelpers::metaObjectData(uint, const Strings&, const Methods&, const Properties&, const Enums&, const Constructors&, const ClassInfo&) [with ObjectType = TreelandConfig; Unique = {anonymous}::qt_meta_tag_ZN14TreelandConfigE_t; Strings = StringRefStorage<char [15], char [15], char [752], char [16], char [20], char [19], char [4], char [23], char [1], char [20], char [7], char [24], char [13], char [4], char [9], char [6], char [19], char [24], char [19], char [23], char [18], char [23], char [25], char [24], char [27], char [23], char [12], char [16], char [27], char [28], char [21], char [18], char [20], char [37], char [16], char [38], char [40], char [32], char [36], char [37], char [31], char [35], char [37], char [26], char [20], char [18], char [18], char [17], char [28], char [24], char [21], char [20], char [23], char [28], char [34], char [28], char [28], char [20], char [19], char [15], char [8], char [15], char [26], char [31], char [26], char [30], char [25], char [30], char [32], char [31], char [34], char [30], char [19], char [23], char [34], char [35], char [28], char [25], char [27], char [44], char [23], char [45], char [47], char [39], char [43], char [44], char [38], char [42], char [44], char [33], char [27], char [25], char [25], char [24], char [35], char [31], char [28], char [27], char [30], char [35], char [41], char [35], char [35], char [12], char [17], char [12], char [16], char [11], char [16], char [18], char [17], char [20], char [16], char [5], char [9], char [20], char [21], char [14], char [11], char [13], char [30], char [9], char [31], char [33], char [25], char [29], char [30], char [24], char [28], char [30], char [19], char [13], char [11], char [11], char [10], char [21], char [17], char [14], char [13], char [16], char [21], char [27], char [21], char [21]>; Methods = UintData<SignalData<void(Dtk::Core::DConfig*)>, SignalData<void(Dtk::Core::DConfig*)>, SignalData<void(const QString&, const QVariant&)>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, SignalData<void()>, MethodData<Dtk::Core::DConfig*() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<QList<QString>() const>, MethodData<bool(const QString&) const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const>, MethodData<bool() const> >; Properties = UintData<PropertyData<QString>, PropertyData<long long int>, PropertyData<bool>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<QString>, PropertyData<QString>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<QString>, PropertyData<long long int>, PropertyData<bool>, PropertyData<long long int>, PropertyData<QString>, PropertyData<QString>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<QString>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<double>, PropertyData<double>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<bool>, PropertyData<bool>, PropertyData<QString>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int>, PropertyData<long long int> >; Enums = UintData<>; Constructors = UintData<>; ClassInfo = ClassInfos<3>; uint = unsigned int]’
  559 |     result.relocatingData.metaTypes[metatypeoffset++] = QMetaType::fromType<ObjectType>().iface();
      |                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/build/treeland/src/treeland/src/libtreeland_autogen/EWIEGA46WW/moc_treelandconfig.cpp:482:91:   required from here
  482 |     return QtMocHelpers::metaObjectData<TreelandConfig, qt_meta_tag_ZN14TreelandConfigE_t>(QMC::MetaObjectFlag{}, qt_stringData,
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  483 |             qt_methods, qt_properties, qt_enums, qt_constructors, qt_classinfo);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qmetatype.h:1203:51: error: static assertion failed: Meta Types must be fully defined
 1203 |         static_assert(is_complete<T, void>::value || std::is_void_v<T>,
      |                                             ~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qmetatype.h:1203:51: note: ‘(((bool)std::integral_constant<bool, false>::value) || ((bool)std::is_void_v<TreelandConfig>))’ evaluates to false
```
2025-10-16 21:33:40 +08:00
JiDe Zhang 652147cbea fix: include Qt private modules for Qt 6.11
This commit explicitly includes `GuiPrivate` and `QuickPrivate` Qt
modules in `CMakeLists.txt` for both the `waylib` and `waylib/src/
server` directories. This is necessary because Qt 6.11 and later
versions no longer implicitly include these private modules. Failing
to include them results in build failures due to missing headers and
symbols.

Log: Fixed build issue with Qt 6.11 and later versions by explicitly
including necessary private Qt modules.

Influence:
1. Verify that the project builds successfully with Qt versions 6.11
and later.
2. Ensure that all functionalities relying on Qt private modules
(e.g., custom QML components, internal Qt API usage) continue to work
as expected.
3. Test on different platforms (Linux, Windows, macOS) where Qt is used.

fix: 为 Qt 6.11 包含 Qt 私有模块

此提交在 `waylib` 和 `waylib/src/server` 目录的 `CMakeLists.txt` 中显式
包含 `GuiPrivate` 和 `QuickPrivate` Qt 模块。 这是必要的,因为 Qt 6.11
及更高版本不再隐式包含这些私有模块。 未能包含它们会导致由于缺少头文件和
符号而导致构建失败。

Log: 通过显式包含必要的私有 Qt 模块,修复了 Qt 6.11 及更高版本的构建
问题。

Influence:
1. 验证项目是否可以使用 Qt 6.11 及更高版本成功构建。
2. 确保所有依赖于 Qt 私有模块的功能(例如,自定义 QML 组件、内部 Qt API
使用)继续按预期工作。
3. 在使用 Qt 的不同平台(Linux、Windows、macOS)上进行测试。
2025-10-16 21:33:40 +08:00
JiDe Zhang 97f078745d fix: fix heap-use-after-free on exit
The WQuickCursor was using a raw pointer to WCursor, which could be
accessed after the WCursor object had been destroyed during application
shutdown, leading to a heap-use-after-free error. This change replaces
the raw pointer with a QPointer, ensuring that the WQuickCursor only
accesses the WCursor object if it is still valid.

Influence:
1. Run the application and exit to ensure no heap-use-after-free error
occurs.
2. Test cursor functionalities to ensure they still work as expected.

fix: 修复程序退出时堆释放后使用问题

WQuickCursor 使用指向 WCursor 的原始指针,该指针可能在应用程序关闭期间
WCursor 对象被销毁后被访问,从而导致堆释放后使用错误。此更改将原始指针替
换为 QPointer,确保 WQuickCursor 仅在 WCursor 对象仍然有效时才访问它。

Influence:
1. 运行应用程序并退出,确保不会发生堆释放后使用错误。
2. 测试光标功能,确保它们仍然按预期工作。
2025-10-16 21:33:40 +08:00
JiDe Zhang d455d1922c fix: fix build failure on Arch Linux
The build was failing on Arch Linux due to an upgrade to Qt 6.10.
This version of Qt requires explicitly finding the private modules
(QuickPrivate, WaylandClientPrivate). This commit updates the
CMakeLists.txt files in the affected directories (src/, src/treeland-
shortcut/, waylib/examples/tinywl/, and waylib/src/server/) to
explicitly find these private modules. It also updates the minimum
required Qt version in some waylib CMakeLists.txt files to 6.8 to align
with the actual required version.

修复了在 Arch Linux 上的构建失败

由于升级到 Qt 6.10,导致在 Arch Linux 上的构建失败。 此版本的 Qt 需要显
式查找私有模块(QuickPrivate, WaylandClientPrivate)。 此提交更新了受影
响目录(src/、src/treeland-shortcut/、waylib/examples/tinywl/ 和 waylib/
src/server/)中的 CMakeLists.txt 文件,以显式查找这些私有模块。 它还在一
些 waylib CMakeLists.txt 文件中更新了最低要求的 Qt 版本到 6.8,以与实际
要求的版本保持一致。
2025-10-16 21:33:40 +08:00
rewine 97956256cf fix: prevent crash when surface destroyed before async AppId resolve
The crash occurred when a surface was destroyed before the async AppId
resolution callback could complete. The callback would attempt to create
a SurfaceWrapper for a surface that no longer existed, leading to null
pointer access in subsequent operations.

Changes:
1. Added m_pendingAppIdResolveToplevels list to track surfaces
undergoing async AppId resolution
2. Check if surface is still valid before creating wrapper in callback
3. Remove surface from pending list when destroyed or when resolution
completes
4. Handle surface removal properly by checking pending list and avoiding
wrapper operations if never created

Log: Fixed crash when closing window before AppId resolution completes

Influence:
1. Test opening and quickly closing applications to trigger async
resolution scenarios
2. Verify no crashes occur when windows are destroyed during AppId
resolution
3. Check that window management functions correctly for both XDG and
XWayland surfaces
4. Test prelaunch wrapper functionality with quick window operations
5. Verify window size persistence still works correctly for valid cases

fix: 修复在异步AppId解析完成前销毁表面导致的崩溃问题

当表面在异步AppId解析回调完成前被销毁时会发生崩溃。回调会尝试为已不存在
的表面创建SurfaceWrapper,导致后续操作中出现空指针访问。

变更内容:
1. 添加m_pendingAppIdResolveToplevels列表来跟踪正在进行异步AppId解析的
表面
2. 在回调中创建包装器前检查表面是否仍然有效
3. 当表面被销毁或解析完成时从待处理列表中移除
4. 正确处理表面移除,检查待处理列表,如果包装器从未创建则避免相关操作

Log: 修复在AppId解析完成前关闭窗口导致的崩溃问题

Influence:
1. 测试打开并快速关闭应用程序以触发异步解析场景
2. 验证在AppId解析期间销毁窗口不会发生崩溃
3. 检查窗口管理功能对XDG和XWayland表面是否正常工作
4. 测试快速窗口操作下的预启动包装器功能
5. 验证窗口大小持久化在有效情况下仍正常工作
2025-10-16 16:28:39 +08:00
rewine ac88ba2f34 refactor: simplify pidfd retrieval from surface
1. Changed from getting pidfd via waylandClient()->pidFD() to directly
using surface->pidFD()
2. Removed unnecessary WSocket include since we no longer access
waylandClient()
3. This simplifies code and reduces dependency chain
4. The functionality remains the same but with cleaner implementation

Influence:
1. Test window creation for both XDG and XWayland surfaces
2. Verify prelaunch splash matching still works correctly
3. Check that appId resolution continues to function properly
4. Test window size persistence functionality

refactor: 简化从 surface 获取 pidfd 的逻辑

1. 将获取 pidfd 的方式从 waylandClient()->pidFD() 改为直接使用
surface->pidFD()
2. 移除了不必要的 WSocket 头文件包含,因为不再需要访问 waylandClient()
3. 简化了代码并减少了依赖链
4. 功能保持不变,但实现更加简洁

Influence:
1. 测试 XDG 和 XWayland surface 的窗口创建
2. 验证预启动闪屏匹配功能仍然正常工作
3. 检查应用 ID 解析功能继续正常运行
4. 测试窗口尺寸持久化功能
2025-10-16 14:23:35 +08:00
JiDe Zhang 4e35c7952c feat: Expose XWayland surface process ID
This change addresses the issue where the client process ID associated
with an XWayland surface could not be directly obtained through
`WClient`. Previously, accessing the `WClient` of an XWayland
surface always returned the XWayland process itself. To resolve
this, two virtual functions, `pid()` and `pidFD()`, have been added
to the `WObject` class and overridden in `WXWaylandSurface`. These
functions allow retrieving the actual PID and PID file descriptor
of the XWayland window's client. The `pidFD` is obtained by using
`syscall(SYS_pidfd_open, pid(), 0)`. This approach enables correct
identification of the client process owning the XWayland surface.

Influence:
1. Verify that the `pid()` function on a `WXWaylandSurface` object
returns the correct process ID of the client application, not the
XWayland process.
2. Confirm that `pidFD()` returns a valid file descriptor for the client
application's PID. Check the returned file descriptor is valid.
3. Ensure that these new functions do not negatively impact other parts
of the Waylib codebase.
4. Test multiple XWayland applications to ensure consistent and accurate
PID retrieval.
5. Test on different platforms to ensure `syscall(SYS_pidfd_open, pid(),
0)` is working correctly, and fallback gracefully if not.

feat: 暴露 XWayland surface 进程 ID

此更改解决了无法通过 `WClient` 直接获取与 XWayland surface 关联的客户
端进程 ID 的问题。 以前,访问 XWayland surface 的 `WClient` 始终返回
XWayland 进程本身。 为了解决这个问题,我们在 `WObject` 类中添加了两个虚
函数 `pid()` 和 `pidFD()`,并在 `WXWaylandSurface` 中重写了它们。 这些函
数允许检索 XWayland 窗口客户端的实际 PID 和 PID 文件描述符。 `pidFD` 通
过使用 `syscall(SYS_pidfd_open, pid(), 0)` 获得。 这种方法可以正确识别拥
有 XWayland surface 的客户端进程。

Influence:
1. 验证 `WXWaylandSurface` 对象上的 `pid()` 函数返回客户端应用程序的正确
进程 ID,而不是 XWayland 进程。
2. 确认 `pidFD()` 为客户端应用程序的 PID 返回有效的文件描述符。 检查返回
的文件描述符是否有效。
3. 确保这些新函数不会对 Waylib 代码库的其他部分产生负面影响。
4. 测试多个 XWayland 应用程序,以确保一致且准确的 PID 检索。
5. 在不同平台上进行测试,以确保 `syscall(SYS_pidfd_open, pid(), 0)` 正常
工作,如果不能正常工作,则优雅地回退。
2025-10-16 14:23:35 +08:00
rewine cefa1744ae chore: update systemd service dependencies and surface wrapper setup
Updated systemd service configuration to use PartOf instead of BindsTo
for better dependency management between treeland service and session
helper. Modified SurfaceWrapper to require explicit shell surface setup
and improved prelaunch splash z-order. Removed obsolete comment about
pendingAppId structure.

The changes include:
1. Replaced BindsTo with PartOf in systemd service for proper restart
propagation
2. Added explicit z-order setting for prelaunch splash screen
3. Simplified SurfaceWrapper setup method to require valid shell surface
4. Removed outdated code comments

Influence:
1. Verify treeland service and session helper start/stop together
correctly
2. Test application prelaunch splash screen visibility
3. Confirm surface wrapper initialization works with valid shell
surfaces
4. Check systemd dependency behavior during service restarts

chore: 更新 systemd 服务依赖关系和表面包装器设置

更新了 systemd 服务配置,使用 PartOf 替代 BindsTo 以改善 treeland 服务和
会话助手之间的依赖管理。修改了 SurfaceWrapper 以要求显式的 shell surface
设置,并改进了预启动闪屏的 z 轴顺序。移除了关于 pendingAppId 结构的过时
注释。

更改包括:
1. 在 systemd 服务中用 PartOf 替换 BindsTo 以实现正确的重启传播
2. 为预启动闪屏添加了显式的 z 轴顺序设置
3. 简化了 SurfaceWrapper 设置方法,要求有效的 shell surface
4. 移除了过时的代码注释

影响:
1. 验证 treeland 服务和会话助手能否正确一起启动/停止
2. 测试应用程序预启动闪屏的可见性
3. 确认表面包装器初始化在有效的 shell surface 下正常工作
4. 检查服务重启期间 systemd 依赖行为
2025-10-15 15:51:33 +08:00
rewine 39a32ed126 refactor: reorganize initialization order and cleanup comments
Moved AppIdResolverManager attachment earlier in Helper::init() to
maintain proper initialization sequence. Removed duplicate attachment
code that was previously placed later. Cleaned up Chinese comments by
translating them to English and removing redundant explanatory comments.
Simplified SurfaceWrapper constructor by directly creating prelaunch
splash instead of having a separate method. Improved code readability
by removing unnecessary comments and ensuring consistent English
documentation.

Log: Improved code organization and documentation clarity

Influence:
1. Verify that AppIdResolverManager is properly initialized during
system startup
2. Test prelaunch splash functionality to ensure it still works
correctly
3. Check that surface conversion from prelaunch to normal mode functions
properly
4. Validate that window management features work as expected after these
changes
5. Test various surface types (toplevel, layer, popup) to ensure no
regression

refactor: 重新组织初始化顺序并清理注释

将 AppIdResolverManager 的附加操作移到 Helper::init() 的早期阶段以保持正
确的初始化顺序。移除了之前放置在后面的重复附加代码。通过将中文注释翻译为
英文并移除冗余解释性注释来清理代码。简化了 SurfaceWrapper 构造函数,直接
创建预启动闪屏而不是使用单独的方法。通过移除不必要的注释并确保一致的英文
文档来提高代码可读性。

Log: 改进了代码组织和文档清晰度

Influence:
1. 验证 AppIdResolverManager 在系统启动期间是否正确初始化
2. 测试预启动闪屏功能以确保其仍正常工作
3. 检查从预启动模式到正常模式的表面转换功能是否正常
4. 验证窗口管理功能在这些更改后是否按预期工作
5. 测试各种表面类型(顶层、图层、弹出窗口)以确保没有回归
2025-10-15 15:51:33 +08:00
rewine fb595f3cc9 fix: improve surface wrapper matching and container management
1. Add null check for m_appIdResolverManager in prelaunch splash handler
2. Remove redundant appId empty checks in pidfd resolution callbacks
3. Simplify surface wrapper matching logic by removing fallback paths
4. Fix XWayland surface parent container management with proper
container switching
5. Ensure parent container is set before emitting surfaceWrapperAdded
signal
6. Remove unnecessary property setting and signal emission in prelaunch
timeout

The changes improve the robustness of surface wrapper matching and
container management. By removing redundant checks and simplifying the
matching logic, the code becomes more maintainable. The XWayland surface
parent handling now properly manages container transitions when parent
surfaces change. The initialization order ensures the wrapper has a
valid parent container before setup operations.

Log: Fixed window container management for XWayland applications with
parent windows

Influence:
1. Test prelaunch splash functionality with valid and invalid app IDs
2. Verify XDG surface creation and matching with prelaunch wrappers
3. Test XWayland surface creation with parent-child relationships
4. Verify container switching when XWayland windows change parents
5. Test window menu and active watcher setup for both XDG and XWayland
surfaces
6. Verify surface wrapper emission timing and parent container validity

fix: 改进表面包装器匹配和容器管理

1. 在预启动闪屏处理程序中添加对 m_appIdResolverManager 的空检查
2. 移除 pidfd 解析回调中冗余的 appId 空检查
3. 通过移除备用路径简化表面包装器匹配逻辑
4. 修复 XWayland 表面父容器管理,实现正确的容器切换
5. 确保在发出 surfaceWrapperAdded 信号前设置好父容器
6. 移除预启动超时中不必要的属性设置和信号发射

Log: 修复了带父窗口的 XWayland 应用程序的窗口容器管理问题

Influence:
1. 测试使用有效和无效应用ID的预启动闪屏功能
2. 验证 XDG 表面创建和与预启动包装器的匹配
3. 测试具有父子关系的 XWayland 表面创建
4. 验证 XWayland 窗口更改父窗口时的容器切换
5. 测试 XDG 和 XWayland 表面的窗口菜单和活动监视器设置
6. 验证表面包装器发射时机和父容器有效性
2025-10-15 15:51:33 +08:00
rewine aa4ad6e623 fix: simplify prelaunch splash transition and cleanup
Remove complex cross-fade animation logic and replace with direct splash
destruction after fade-out. The previous cross-fade implementation was
causing timing issues and potential visual artifacts. Now the splash
simply fades out and gets destroyed when the main surface is ready.

Added destroyAfterFade property to PrelaunchSplash for controlled
destruction. Simplified SurfaceWrapper logic by removing cross-fade
state management and directly calling hideAndDestroy on the splash item.
Also fixed window decoration setup for prelaunch surfaces.

Log: Improved application startup transition by simplifying splash
screen fade-out

Influence:
1. Test application startup with prelaunch splash screen
2. Verify splash screen properly fades out and gets destroyed
3. Check that main window appears without visual artifacts
4. Test window decoration appears correctly after transition
5. Verify no memory leaks with splash screen destruction

fix: 简化预启动闪屏过渡和清理逻辑

移除复杂的交叉淡出动画逻辑,改为在淡出后直接销毁闪屏。之前的交叉淡出实现
存在时序问题和潜在视觉伪影。现在当主界面准备就绪时,闪屏直接淡出并销毁。

为 PrelaunchSplash 添加 destroyAfterFade 属性以控制销毁。简
化 SurfaceWrapper 逻辑,移除交叉淡出状态管理,直接调用闪屏项的
hideAndDestroy 方法。同时修复了预启动界面的窗口装饰设置。

Log: 通过简化闪屏淡出改进应用启动过渡效果

Influence:
1. 测试带预启动闪屏的应用启动过程
2. 验证闪屏正确淡出并被销毁
3. 检查主窗口出现时无视觉伪影
4. 测试过渡后窗口装饰正确显示
5. 验证闪屏销毁无内存泄漏
2025-10-15 15:51:33 +08:00
rewine 529eb78f6b move test_app_id_resolver_helper to tools 2025-10-15 10:17:26 +08:00
rewine 67faae1870 chore: Implement splash screen
log: support splash screen
2025-10-15 10:17:26 +08:00
rewine 2bc9ef62fe chore(debian): update version to 0.7.3
bug fix
2025-09-23 17:38:53 +08:00
April & May fc6d684513 fix: fix WorkspaceSelectionList animation's highlight border size
The calculation of the rectangle is incorrect, and the rectangle will be
wider than its content. Fix it using correct calculation.
2025-09-23 17:23:26 +08:00
April & May 5c701f8767 fix: fix MultitaskView display problem
workspaceDelegateHeight property is removed from new TreelandConfig.
This commit adapt the change and fixed the MultitaskView display
problem.
2025-09-23 17:22:24 +08:00
JiDe Zhang 51f403769e refactor: reduce cursor-related log verbosity
The verbosity of cursor input and touch event logs has been reduced
from `QtDebugMsg` to `QtInfoMsg`.  The high volume of debug logs was
overwhelming during development and debugging, making it difficult to
identify important information.  By reducing the default log level,
only essential cursor-related information will be displayed unless debug
logging is specifically enabled. This change improves the clarity and
usability of log output during development.

Influence:
1. Verify cursor functionality remains unaffected by the log level
change.
2. Confirm that important cursor events are still logged at the
`QtInfoMsg` level.
3. Enable debug logging to ensure detailed cursor information is
available when needed.
4. Test with different input devices (mouse, touchpad, touch screen) to
ensure consistent behavior.

refactor: 降低光标相关日志的详细程度

光标输入和触摸事件日志的详细程度已从 `QtDebugMsg` 降低到 `QtInfoMsg`。
大量的调试日志在开发和调试过程中造成了信息过载,难以识别重要信息。 通过
降低默认日志级别,除非专门启用调试日志记录,否则只会显示基本的光标相关信
息。 此更改提高了开发期间日志输出的清晰度和可用性。

Influence:
1. 验证光标功能是否未受日志级别更改的影响。
2. 确认重要的光标事件仍然以 `QtInfoMsg` 级别记录。
3. 启用调试日志记录以确保在需要时可以使用详细的光标信息。
4. 使用不同的输入设备(鼠标、触摸板、触摸屏)进行测试,以确保行为一致。
2025-09-23 16:49:23 +08:00
April & May e03fd2fdb3 fix: fix MultitaskView display problem caused by refactoring TreelandConfig
This commit cleans up changes left from refactoring TreelandConfig,
which caused MultitaskView display incorrectly.
2025-09-23 15:26:17 +08:00
transifex-integration[bot] 4ef86fc3fd
Updates for project TreeLand (#563) 2025-09-21 15:05:11 +08:00
rewine f2ac25fc05 chore(debian): update version to 0.7.2
fix: crash on startup due to uninitialized m_config
2025-09-19 11:34:44 +08:00
Lu YaNing 6ec120d449 fix: crash on startup due to uninitialized m_config pointer
The m_config member variable contained garbage value instead of
nullptr because C++ doesn't auto-initialize pointer members.
This caused invalid memory access and crash during startup.

Initialize m_config to nullptr to ensure proper initial state.
2025-09-19 10:02:58 +08:00
rewine 03094c5d8a chore(debian): update version to 0.7.1
Update Debian packaging
2025-09-18 13:21:42 +08:00
rewine 04bf8b3ddc fix: Fix socket blocking issue in Wayland server connection handling
1. Set server socket to non-blocking mode to prevent accept() calls from
blocking the main thread indefinitely.
2. Improved wl_os_accept_cloexec function to use accept4 with SOCK_CLOEXEC
flag as the preferred method on modern Linux systems, with fallback to
traditional accept() + fcntl approach for compatibility.
3. Added proper error handling for ENOSYS case when accept4 is not supported.

The blocking issue occurred when the Wayland server was waiting for client
connections, causing the entire compositor to freeze. This fix follows the
same pattern used in libwayland for robust socket handling.

Log: Fixed Wayland server socket blocking in accept() calls

Influence:
1. Test server startup and client connection establishment
2. Verify proper handling of multiple concurrent client connections
3. Check compatibility on systems without accept4 support
4. Ensure no regression in socket file descriptor management

修复:修复Wayland服务器连接处理中的socket阻塞问题

1. 将服务器socket设置为非阻塞模式,防止accept()调用无限期阻塞主线程。
2. 改进wl_os_accept_cloexec函数,在现代Linux系统上优先使用带SOCK_CLOEXEC
标志的accept4方法,同时为兼容性保留传统的accept() + fcntl方法作为后备。
3. 为不支持accept4的ENOSYS情况添加了适当的错误处理。

当Wayland服务器等待客户端连接时会发生阻塞问题,导致整个合成器冻结。此修复
遵循libwayland中用于健壮socket处理的相同模式。

Log: 修复Wayland服务器socket在accept()调用中的阻塞问题

Influence:
1. 测试服务器启动和客户端连接建立
2. 验证多个并发客户端连接的正确处理
3. 检查在不支持accept4的系统上的兼容性
4. 确保socket文件描述符管理中没有回归
2025-09-17 14:32:44 +08:00
rewine 794124ba68 fix: correct window title visibility condition
Changed the visibility condition for window titles in the multitask view
from checking 'highlighted' to checking the surfaceItemDelegate state.
This ensures titles are only shown when in taskview mode, not during
other states like window dragging or animation transitions.

The previous implementation could show titles during transitions when
they shouldn't be visible, causing visual artifacts. The new condition
properly aligns with the intended UI behavior where titles should only
appear in the stable taskview state.

Log: Fixed window titles appearing during transitions in multitask view

Influence:
1. Test multitask view to verify titles only appear in taskview state
2. Check window dragging and transitions to ensure titles remain hidden
3. Verify title visibility with empty/non-empty titles
4. Test with different window states and transitions

fix: 修正窗口标题可见性条件

将多任务视图中窗口标题的可见性条件从检查'highlighted'改为检查
surfaceItemDelegate状态。这确保标题仅在taskview模式下显示,而不是在窗口
拖动或动画过渡等其他状态时显示。

之前的实现在不应显示标题的过渡期间可能会显示标题,导致视觉伪影。新条件正
确符合预期的UI行为,即标题应仅在稳定的taskview状态下出现。

Log: 修复多任务视图中窗口标题在过渡期间出现的问题

Influence:
1. 测试多任务视图,验证标题仅在taskview状态下显示
2. 检查窗口拖动和过渡,确保标题保持隐藏
3. 验证空/非空标题的可见性
4. 测试不同窗口状态和过渡
2025-09-16 14:12:54 +08:00
JiDe Zhang 9556ef8950 fix: Fix client crash when created via security context
1. Fixed a crash issue where clients created through the security
context could not obtain the corresponding WClient object.
2. Clients created via security context use a new socket connection,
which is not managed by WSocket by default.
3. The wlroots protocol provides limited information for monitoring
such wl_clients.
4. This commit adapts the wlroots implementation: in
`security_context_handle_commit`, a new WSocket object is created for
the listening socket, and the new wl_client object created from this
socket is added to WClient for management.

Influence:
1. Test the creation of clients using the security context.
2. Verify that the created clients can correctly obtain the WClient
object.
3. Ensure that newly created sockets are correctly managed.

修复:修复通过安全上下文创建的客户端崩溃问题

1. 修复了通过安全上下文创建的客户端无法获取对应的 WClient 对象导致崩溃的
问题。
2. 通过安全上下文创建的客户端使用新的套接字连接,默认情况下不由 WSocket
管理。
3. wlroots 协议为监控此类 wl_clients 提供的相关信息有限。
4. 本次提交采纳了 wlroots 的实现:在 `security_context_handle_commit`
中,为监听的套接字创建一个新的 WSocket 对象,并将由此套接字创建的新
wl_client 对象添加到 WClient 中进行管理。

Influence:
1. 测试使用安全上下文创建客户端的过程。
2. 验证创建的客户端能否正确获取 WClient 对象。
3. 确保新创建的套接字能够得到正确的管理。
2025-09-15 14:48:34 +08:00
YaoBing Xiao 23192a4b14 feat: add security-context support
create security-context gloabl.

Log:
2025-09-11 19:07:10 +08:00
April & May fa1e1e6a18 fix: Separate DConfig object creation to another thread to avoid blocking
DConfig object creation involves D-Bus communication, which may block
when placed in the main thread. This commit adapt dconfig2cpp tool to
generate DConfig wrapper safely running in another thread, to avoid this
problem.
2025-09-11 19:06:22 +08:00
April & May e66c0a1b74 fix: move DBus call to separate thread to avoid blocking
Since obtaining DBus interface & calling DBus functions may block
current thread, it's better to place DBus-related codes out of the main
thread. This commit puts DBus call to separate thread if possible.
2025-09-11 19:04:47 +08:00
miruku 1411fb2ef7 fix: fixing some trivial memory management bugs. 2025-09-10 13:34:11 +08:00
rewine a43e0ed3d4 feat(core): Add support for XDG toplevel surface and XDG shell in RootSurfaceContainer
- Added include for `wxdgtoplevelsurface.h`
- Added include for `qwxdgshell.h`
- Handled initialization check for XDG toplevel surface
- Updated logic to set owns output and ensure surface position validity for XDG toplevel surface
- Added support to set Xwayland position from surface when initialized

Background:
When the window is destroyed while being dragged, `endMoveResize` is triggered. If `config` function is called after the window is destroyed, it will crash. Therefore, the check for `initialized` is added due to its reset in `reset_xdg_surface` where an `xdg_surface` implementation is reset under the following conditions:
1) A surface is unmapped due to a commit with NULL buffer
2) The `xdg_surface` role object is destroyed
3) `wlr_xdg_surface` is destroyed
2025-09-10 13:28:36 +08:00
JiDe Zhang 1cbcd3e402 fix: correct refresh rate on multi-monitor
1. Fixed an issue where the client window's refresh rate was incorrect
when using multiple monitors.
2. The problem was caused by sending `frame_done` notifications to the
client window regardless of which screen refreshed. This resulted in
double the `frame_done` notifications being sent when using two screens.
3. The solution is to only send `frame_done` notifications to the
surface when the screen with the highest refresh rate, where the surface
is located, commits. This behavior is consistent with how wlroots and
mutter handle it.
4. The code was modified in `WOutputRenderWindow::doRender` to track
which outputs were actually committed and then the `WSurfaceItem` checks
that it only sends `notifyFrameDone` if the `framePacingOutput` was
committed.
5. Added logging for when there is no `WOutputRenderWindow`.

Influence:
1. Test with multiple monitors with different refresh rates.
2. Verify that the client window's refresh rate matches the refresh rate
of the screen it's primarily on.
3. Use a tool like http://testufo.com/ to visually confirm the correct
refresh rate.
4. Test moving the window between screens with different refresh rates
and observe the refresh rate change.

fix: 修复多显示器刷新率错误问题

1. 修复了使用多个显示器时客户端窗口刷新率不正确的问题。
2. 问题的原因是无论哪个屏幕刷新,都会向客户端窗口发送 `frame_done` 通
知。这导致在使用两个屏幕时发送双倍的 `frame_done` 通知。
3. 解决方案是仅在表面所在的具有最高刷新率的屏幕提交时才向该表面发送
`frame_done` 通知。此行为与 wlroots 和 mutter 的处理方式一致。
4. 修改了 `WOutputRenderWindow::doRender` 中的代码以跟踪实际提交的输出,
然后 `WSurfaceItem` 检查它是否仅在 `framePacingOutput` 已提交时才发送
`notifyFrameDone`。
5. 添加了在没有 `WOutputRenderWindow` 时的日志记录。

Influence:
1. 使用具有不同刷新率的多个显示器进行测试。
2. 验证客户端窗口的刷新率与其主要所在的屏幕的刷新率相匹配。
3. 使用 http://testufo.com/ 等工具以直观地确认正确的刷新率。
4. 测试在具有不同刷新率的屏幕之间移动窗口并观察刷新率的变化。
2025-09-08 11:18:20 +08:00
JiDe Zhang 90e2762dcc fix: redraw when frame callback list updates
1.  The previous logic only redrew the surface when the buffer changed,
which is insufficient.
2.  Firefox frequently updates the frame callback list using
`WLR_SURFACE_STATE_FRAME_CALLBACK_LIST`. Receiving such commits should
also trigger a redraw to trigger the frame done event for the surface.
3.  This fixes an issue where Firefox windows would often not refresh
until the mouse was moved.

Influence:
1. Verify that Firefox windows now refresh correctly without requiring
mouse movement.
2. Ensure that other applications are not negatively affected by this
change.
3. Check for any performance regressions related to the increased redraw
frequency.

fix: 当帧回调列表更新时重绘

1. 之前的逻辑仅在缓冲区更改时才重绘表面,这不足够。
2. Firefox 经常使用 `WLR_SURFACE_STATE_FRAME_CALLBACK_LIST` 更新帧回调列
表。收到此类提交也应触发重绘,以触发表面的帧完成事件。
3. 这修复了 Firefox 窗口经常不刷新直到鼠标移动的问题。

Influence:
1. 验证 Firefox 窗口现在可以正确刷新,而无需移动鼠标。
2. 确保其他应用程序不会受到此更改的负面影响。
3. 检查与增加的重绘频率相关的任何性能下降。
2025-09-08 11:18:20 +08:00
rewine e7d27a914c chore(debian): update version to 0.7.0
Log: new tag
2025-08-29 12:05:50 +08:00
April & May 8a8bb8dec5 fix: fix treeland get stuck in lockscreen after crash recovery
Treeland will stuck in lockscreen after crash recovery, which is caused
by unintended login request for (for DDM) already logined user. This
commit adds a new DaemonMessages type, which is used to convey logined
users from DDM after socket connected, to avoid this problem.
2025-08-28 22:06:39 +08:00
YaoBing Xiao 69c55e454f fix: occasional crash during stop preview item handling
Add shellSurface() check in stopPreviewing.

Fixes linuxdeepin/treeland#536 crash3

Log:
2025-08-28 17:15:23 +08:00
April & May 18026e2c1a fix: refine TTY switching
1. Add callback for disableRender, to ensure render is exactly disabled
before DDM doing further actions;
2. Revoke all evdev devices before VT switch (at disableRender()), to
prevent accidental input events during switch;
3. Refine logic of switchToUser, take care of showing lockscreen after
switch;
4. Make event function args const
2025-08-28 13:52:41 +08:00
JiDe Zhang 81f014bf20 refactor: improve code robustness
This commit aims to improve the overall robustness of the code,
potentially addressing a rare crash scenario related to window
animations. While the exact cause of the crash is difficult to
reproduce, the changes implemented here are believed to mitigate the
issue. Specifically, the commit includes two key modifications:

1.  **SurfaceWrapper Destruction:** Enhanced the `SurfaceWrapper`
destructor to properly handle and delete animation objects
(`m_minimizeAnimation`, `m_showDesktopAnimation`). Additionally,
disconnect signals before deleting m_decoration and m_titleBar.
This ensures that these objects are properly cleaned up when the
`SurfaceWrapper` is destroyed, preventing potential dangling pointers
or memory leaks that could lead to crashes, especially in scenarios
involving complex window state transitions.
2.  **QmlEngine Component Ownership:** Modified the ownership
of objects created using `QmlEngine::createComponent`.
The ownership is now explicitly set to follow the parent
object using `QQmlEngine::setObjectOwnership(item,
QQmlEngine::objectOwnership(parent))`. This change ensures that the
QML engine correctly manages the lifecycle of these objects, preventing
potential issues related to object deletion or memory management if the
parent object is destroyed before the created component.

These changes are intended to make the application more stable and
resilient to unexpected conditions, particularly those involving
animations and object lifetime management within the QML engine.

Influence:
1. Thoroughly test window animations, including opening, closing,
minimizing, maximizing, and transitioning between different window
states.
2. Test application under heavy load and stress conditions to trigger
potential race conditions or memory leaks related to object creation
and destruction.
3. Monitor application logs for any warnings or errors related to QML
component creation or object lifetime management.
4. Try to reproduce corner cases when animations are interrupted.

重构: 提高代码健壮性

本次提交旨在提高代码的整体健壮性,可能修复与窗口动画相关的罕见崩溃情况。
虽然崩溃的确切原因难以重现,但相信此处实现的更改可以缓解该问题。具体来
说,此提交包括两个关键修改:

1.  **SurfaceWrapper 析构:** 增强了 `SurfaceWrapper` 析构函数,可以正确
处理和删除动画对象(`m_minimizeAnimation`, `m_showDesktopAnimation`)。此
外,在删除 m_decoration 和 m_titleBar 之前断开信号连接。这样可以确保在销
毁 `SurfaceWrapper` 时正确清理这些对象,防止潜在的悬空指针或内存泄漏,否
则可能导致崩溃,尤其是在涉及复杂窗口状态转换的情况下。
2.  **QmlEngine 组件所有权:** 修改了使用 `QmlEngine::createComponent`
创建的对象的所有权。现在,使用 `QQmlEngine::setObjectOwnership(item,
QQmlEngine::objectOwnership(parent))` 将所有权显式设置为跟随父对象。此更
改确保 QML 引擎正确管理这些对象的生命周期,防止在父对象在创建的组件之前
被销毁时,可能导致与对象删除或内存管理相关的问题。

这些更改旨在使应用程序更加稳定并能够适应意外情况,尤其是涉及 QML 引擎内
动画和对象生命周期管理的情况。

Influence:
1. 全面测试窗口动画,包括打开、关闭、最小化、最大化以及在不同窗口状态之
间转换。
2. 在高负载和压力条件下测试应用程序,以触发与对象创建和销毁相关的潜在竞
争条件或内存泄漏。
3. 监视应用程序日志,查找与 QML 组件创建或对象生命周期管理相关的任何警告
或错误。
4. 尝试重现动画中断时的极端情况。

Fixes: linuxdeepin/treeland#528
2025-08-28 13:51:53 +08:00
YaoBing Xiao 0072a5513a fix: occasional crash when closing x window
the crash originates from improper signal-slot disconnection and object
deletion order, leading to use-after-free scenarios in QObject desructor
chain, especially involving SurfaceWrapper.

Fixes: linuxdeepin/treeland#528

Log:
2025-08-28 13:13:33 +08:00
rewine e344a1e60f fix: resolve brief black screen during standby
1. Move D-Bus includes to fix potential header conflicts
2. Add new D-Bus signal handler for systemd-logind's PrepareForSleep
3. Implement onPrepareForSleep slot to manage rendering during hibernate
4. Improve session management with proper signal connections
5. Add logging for better debugging of power management events

The changes address the brief black screen issue that occurs during
system standby/hibernate transitions by properly managing the rendering
state through systemd-logind's PrepareForSleep signal. When entering
hibernate, we now explicitly disable rendering to prevent visual
artifacts, and re-enable it after waking up. The D-Bus signal handlers
have been reorganized for better maintainability and proper header
inclusion order.

fix: 解决待机时短暂黑屏问题

1. 移动 D-Bus 头文件包含位置以修复潜在的头文件冲突
2. 添加对 systemd-logind PrepareForSleep 信号的新 D-Bus 处理器
3. 实现 onPrepareForSleep 槽函数来管理休眠期间的渲染状态
4. 通过改进的信号连接提升会话管理功能
5. 添加日志记录以便更好地调试电源管理事件
2025-08-27 14:58:37 +08:00
rewine 342396e1d6 chore: remove dde portal screen cast configuration
1. Remove dde-portals.conf installation files and configuration
2. Delete portal directory CMake configuration
3. Remove reference to portal in main CMakeLists.txt
4. Configuration was made obsolete by implemented screen recording
functionality

chore: 删除 dde 门户录屏配置

1. 移除 dde-portals.conf 安装文件和配置
2. 删除 portal 目录的 CMake 配置
3. 从主 CMakeLists.txt 中移除 portal 引用
4. 录屏功能已实现,原有配置不再需要
2025-08-21 21:10:10 +08:00
rewine 7bfcba9efd fix: correct log category and add null check for surface activation
1. Change log category from treelandCore to treelandShell for
consistency
2. Add explicit null check for wrapper parameter
3. Add validation for shellSurface() before accessing it
4. Update log category in unmapped surface check

修复表面激活的日志分类并添加空值检查

1. 将日志分类从 treelandCore 改为保持一致性的 treelandShell
2. 为 wrapper 参数添加显式空值检查
3. 在访问 shellSurface() 前添加有效性验证
4. 更新未映射表面检查中的日志分类
2025-08-21 15:57:43 +08:00