Compare commits

...

895 Commits

Author SHA1 Message Date
rewine 27d5c8cc73 chore(debian): update version to 0.7.6
Log: new version
2025-10-30 20:26:03 +08:00
April & May & June 3bf30e97e5 fix: Put Treeland at the first place for session selection
Treeland should be the first candidate of session selection, this commit ensures that.
2025-10-30 20:25:26 +08:00
rewine 29ac51b15e refactor: replace PopupSurfaceContainer with SurfaceContainer for popup
handling

Changed m_popupContainer from PopupSurfaceContainer to SurfaceContainer
to fix tooltip damage issue caused by PR #428. This is a temporary
fix while a better solution for handling popup click events is being
developed.

Log: Fixed tooltip display issues by changing popup container
implementation

Influence:
1. Test tooltip display functionality across different applications
2. Verify popup windows and menus still work correctly
3. Check for any regression in popup interaction behavior
4. Test various popup types including context menus and tooltips
5. Verify z-ordering of popup elements remains correct

refactor: 将弹出窗口容器从 PopupSurfaceContainer 替换为 SurfaceContainer

将 m_popupContainer 从 PopupSurfaceContainer 改为 SurfaceContainer,以修
复 PR #428 导致的工具提示损坏问题。这是一个临时修复方案,同时正在开发更
好的弹出窗口点击事件处理方案。

Log: 通过更改弹出窗口容器实现修复了工具提示显示问题

Influence:
1. 测试不同应用程序中的工具提示显示功能
2. 验证弹出窗口和菜单是否仍能正常工作
3. 检查弹出窗口交互行为是否有回归问题
4. 测试各种弹出类型,包括上下文菜单和工具提示
5. 验证弹出元素的 Z 轴排序是否保持正确
2025-10-30 18:50:54 +08:00
Lu YaNing f50669edc6 refactor: implement atomic multi-output configuration
- Use WOutputRenderWindow interface for output configuration
- Complete output state management with all properties
- Ensure settings only saved when configuration succeeds
2025-10-30 10:51:03 +08:00
YaoBing Xiao 04791bc889 fix: occasional crash during recording toplevel
WSurfaceEntent::surface may be nullptr, use
WSGTextureProvider::qwBuffer.

Fixes: linuxdeepin/treeland#603

Log
2025-10-24 16:46:17 +08:00
JiDe Zhang 1866331471 fix: use safeConnect for aboutToBeInvalidated
The WSurface's `aboutToBeInvalidated` signal connection was incorrectly
using `QObject::connect` instead of `safeConnect`. This could lead
to issues when the WSurface object is modified using `setSurface`,
as the previous object's `aboutToBeInvalidated` signal would not be
disconnected, potentially causing a crash or unexpected behavior. This
change replaces the regular `QObject::connect` with `safeConnect` to
ensure proper disconnection and avoid potential issues when the surface
is replaced.

Influence:
1. Test replacing a WSurface multiple times with different WSurface
objects using `setSurface`.
2. Verify that the `releaseResources` function is only called when the
current WSurface is truly invalidated and not prematurely.
3. Observe application behavior under heavy WSurface replacement
scenarios to ensure stability and prevent crashes.

fix: 使用 safeConnect 连接 aboutToBeInvalidated 信号

WSurface 的 `aboutToBeInvalidated` 信号连接错误地使用了
`QObject::connect` 而不是 `safeConnect`。当使用 `setSurface` 修改
WSurface 对象时,这可能导致问题,因为前一个对象的 `aboutToBeInvalidated`
信号不会断开,可能导致崩溃或意外行为。此更改将常规的 `QObject::connect`
替换为 `safeConnect`,以确保正确断开连接并避免在表面替换时出现潜在问题。

Influence:
1. 使用 `setSurface` 多次用不同的 WSurface 对象替换 WSurface。
2. 验证 `releaseResources` 函数仅在当前 WSurface 真正失效时才被调用,而
不是过早调用。
3. 观察在大量 WSurface 替换场景下的应用程序行为,以确保稳定并防止崩溃。
2025-10-24 13:57:27 +08:00
transifex-integration[bot] f7e4a195c6
i18n: Updates for project TreeLand (#601)
* [skip CI] Translate wallpaper.en_US.ts in sq

91% of minimum 10% translated source file: 'wallpaper.en_US.ts'
on 'sq'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in sq

95% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'sq'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in sq

100% translated source file: 'lockscreen.en_US.ts'
on 'sq'.

* [skip CI] Translate multitaskview.en_US.ts in sq

100% translated source file: 'multitaskview.en_US.ts'
on 'sq'.

* [skip CI] Translate treeland.en_US.ts in sq

100% translated source file: 'treeland.en_US.ts'
on 'sq'.

---------

Log:
2025-10-21 10:42:49 +08:00
April & May & June 8aa33384f2 refactor: Convert Session to shared_ptr and simplify session lifecycle
使用 shared_ptr 管理 Session 生命周期并简化会话管理

This commit refactors the session management system to use shared_ptr
for automatic memory management and improves session visibility handling:

本次提交重构了会话管理系统,使用 shared_ptr 进行自动内存管理,
并改进了会话可见性处理:

Changes:
- Convert Session* to std::shared_ptr<Session> throughout codebase
- Change m_activeSession to std::weak_ptr to prevent circular references
- Remove manual delete calls for Session objects (automatic cleanup)
- Simplify session switching logic in updateActiveUserSession()
- Add lastActivatedSurface tracking per session
- Remove applySurfaceVisibility() - now handled in updateVisible()
- Update surface visibility check to use surfaceBelongsToCurrentSession()
- Add proper socket enable/disable on session switch
- Restore last activated surface when switching sessions

变更内容:
- 将 Session* 转换为 std::shared_ptr<Session>
- 将 m_activeSession 改为 std::weak_ptr 以防止循环引用
- 移除手动 delete Session 对象的调用(自动清理)
- 简化 updateActiveUserSession() 中的会话切换逻辑
- 为每个会话添加 lastActivatedSurface 跟踪
- 移除 applySurfaceVisibility() - 现在在 updateVisible() 中处理
- 更新表面可见性检查以使用 surfaceBelongsToCurrentSession()
- 在会话切换时正确启用/禁用 socket
- 切换会话时恢复上次激活的表面

Benefits:
- Eliminates memory leaks from manual Session management
- Safer pointer handling with shared_ptr/weak_ptr
- Per-session surface activation state preservation
- More efficient visibility updates (per-surface vs recursive walk)

优点:
- 消除手动 Session 管理导致的内存泄漏
- 使用 shared_ptr/weak_ptr 更安全的指针处理
- 保留每个会话的表面激活状态
- 更高效的可见性更新(按表面更新而非递归遍历)
2025-10-21 10:09:17 +08:00
April & May & June bbdbc40a94 chore: Remove unused code & Add document
This commit removed unused code and add document / comment to newly
added functions
2025-10-21 10:09:17 +08:00
April & May b2661a3d86 feat: Manage per-user Wayland/XWayland sessions via Helper::Session
- add `Session` struct and store `QList<Session*> m_sessions`
- create / reuse a `WSocket` + `WXWayland` pair per uid in
`ensureSession`

通过 Helper::Session 管理每个用户的 Wayland / XWayland 会话

- 添加 `Session` 结构体,并用 `QList<Session*> m_sessions` 保存所有会话
- 在 `ensureSession` 中为每个 uid 创建或复用一对 `WSocket` + `WXWayland`
2025-10-21 10:09:17 +08:00
April & May 6547558cc7 feat: Add per-user XWayland session management
- Track each WXWayland instance by uid so every session gets its own
XWayland socket
- Hide/show XWayland surfaces when switching users to prevent previous
windows leaking

为不同用户管理独立的 XWayland 会话

- 为每个 uid 记录 WXWayland 实例,实现按用户隔离的 XWayland socket
- 切换用户时自动隐藏/显示对应的 XWayland 窗口,避免旧会话窗口外泄
2025-10-21 10:09:17 +08:00
JiDe Zhang 66193ba1bc chore: add ASAN environment variables
Add AddressSanitizer (ASAN) environment variables to the treeland
systemd service file. This aids in debugging memory-related issues
within treeland, particularly when running with ASAN enabled. The
`ASAN_SYMBOLIZER_PATH` variable points to the llvm-symbolizer, enabling
symbolization of ASAN reports. The `ASAN_OPTIONS` variable configures
ASAN to log its output to a specific file (`/tmp/treeland-asan`),
disables leak detection (due to false positives in some environments),
enables immediate abortion on error, and enables symbolization within
the log file. This change facilitates easier debugging of memory
corruption and other ASAN-detectable errors.

Influence:
1. Verify that ASAN logs are generated in the specified log file when
ASAN is enabled.
2. Ensure that the ASAN logs contain symbolized stack traces.
3. Confirm that treeland aborts when memory errors are detected with
ASAN enabled.

chore: 添加 ASAN 环境变量

将 AddressSanitizer (ASAN) 环境变量添加到 treeland systemd 服务文件中。
这有助于调试 treeland 中与内存相关的问题,尤其是在启用 ASAN 的情况下。
`ASAN_SYMBOLIZER_PATH` 变量指向 llvm-symbolizer,从而可以对 ASAN 报告
进行符号化。`ASAN_OPTIONS` 变量配置 ASAN 将其输出记录到特定文件 (`/tmp/
treeland-asan`),禁用泄漏检测(由于某些环境中的误报),在发生错误时立即
中止,并启用日志文件中的符号化。此更改有助于更轻松地调试内存损坏和其他
ASAN 可检测到的错误。

Influence:
1. 验证启用 ASAN 后,是否在指定的日志文件中生成 ASAN 日志。
2. 确保 ASAN 日志包含符号化的堆栈跟踪。
3. 确认在启用 ASAN 的情况下检测到内存错误时,treeland 会中止。
2025-10-16 21:36:37 +08:00
JiDe Zhang 5bde9683eb 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:09:51 +08:00
JiDe Zhang ca8de83d47 chore: change Debian build environment to unstable
The Debian build environment in the CI workflows for both qwlroots and
waylib has been changed from `experimental` to `unstable`. This change
was necessary because the `experimental` environment was proving to
be unstable, frequently causing CI failures. Debian `unstable` is more
reliable and now provides wlroots 0.19 which meets the required version.
The apt sources in the build workflows have been updated to reflect
this change.

Influence:
1. Monitor CI build stability for both qwlroots and waylib on the Debian
unstable environment.
2. Verify that the builds are successful and that the required
dependencies, including wlroots 0.19, are correctly installed.
3. Check for any compatibility issues introduced by the change in the
build environment.

chore: 更改 Debian 构建环境为 unstable

qwlroots 和 waylib 的 CI 工作流程中的 Debian 构建环境已从 `experimental`
更改为 `unstable`。 这一更改是必要的,因为 `experimental` 环境被证明不
稳定,经常导致 CI 失败。 Debian `unstable` 更加可靠,现在提供 wlroots
0.19,满足了所需的版本。 构建工作流程中的 apt 源已更新以反映此更改。

Influence:
1. 监控 Debian unstable 环境上 qwlroots 和 waylib 的 CI 构建稳定性。
2. 验证构建是否成功,以及是否正确安装了所需的依赖项,包括 wlroots 0.19。
3. 检查构建环境更改引入的任何兼容性问题。
2025-10-16 13:28:04 +08:00
JiDe Zhang 5af6a3903d 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-15 15:49:41 +08:00
JiDe Zhang f6af3a539f 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-14 12:20:06 +08:00
JiDe Zhang 3f03884083 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-14 09:49:03 +08:00
April & May 777e0f2a7b fix: Disable minimize / maximize animation for window that doesn't belongs to current user
This should work as intended
2025-10-09 09:56:50 +08:00
April & May 7c11939015 fix: fix private module inclusion on lower version of Qt
GuiPrivate and QuickPrivate cannot be found under Qt <= 6.8. This commit should work as intended.
2025-10-09 09:56:13 +08:00
Felix Yan 4827731cfc 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-09 09:55:27 +08:00
JiDe Zhang 232cf374c2 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-09-29 20:33:10 +08:00
Lu YaNing 16240cba52 feat: add real-time FPS display
Introduces an on-screen FPS overlay with timer-based sampling aligned
to the active screen’s refresh rate. automatic refresh-rate handling
on screen changes.
2025-09-26 11:04:13 +08:00
April & May 8fdd5703a6 feat: support start sessions other than treeland
This commit fixed the SessionModel and SessionList, and enabled session
selection by adding a button to ControlAction.qml. Thus treeland can act
as a greeter of ddm, guide the start of other desktop environment.
2025-09-26 10:33:25 +08:00
miruku d9cd9e855d feat: implement ext-session-lock-v1 support
This commit adds support for the ext-session-lock-v1 protocol to
Treeland compositor.

The implementation allows for a grace delay of 300ms for client to
properly setup locking surfaces before sending locking.
The implementation also disables animation for locking triggered by
ext-session-lock-v1.
When the lock is abandoned, if lockscreen plugin is loaded, treeland
automaticly replace lock surfaces with that provided by the plugin.
If else, the session will remain locked forever.

Implementation Details:
1. lockscreen.cpp: extend the LockScreen class to handle locking
initiated by WSessionLock object.
2. qmlengine: add a fallback LockScreen of solid grey color, in case
if the locking client erronously deleted a lock surface before unlock.
3. treeland.cpp: allow loading the lockscreen plugin without DDM support.
4. output.cpp: allow session lock surfaces to ignore exclusive zones.
5. helper.cpp: attaches WSessionLockManager and handle screen lock logics.
6. surfacewrapper.cpp: added the LockScreen type to SurfaceWrapper
2025-09-26 10:23:25 +08:00
miruku 84379d1ca5 feat(waylib): implement ext-session-lock-v1 protocol support
This commit adds support for the Wayland ext-session-lock-v1 protocol.

1. Added Class
    - WSessionLockManager
    - WSessionLock
    - WSessionLockSurface

2. Implementation Details
Lifecycle of WSessionLock is managed by the WSessionLockManager.

Lifecycle of WSessionLockSurface is managed by its WSessionLock.

WSessionLock handles identification of all possible states a session lock
object can experiance, they are listed as follows:
- Created: default state
- Locked: session locked (after send_locked() is sent)
- Unlocked: client sent unlock_and_destroy()
- Finished: locking denyed by server sending finish()
- Canceled: lock destroyed by client before send_locked() is sent
- Abandoned: lock abnormally destroyed by client after locking

3. tinywl
An example usage is provided in the updated tinywl compositor.
2025-09-26 10:23:25 +08:00
miruku 0544ca405a fix(waylib): Add missing override specifier in wlayersurface
This commit added the override specifier for waylandClient() and
instantRelease() methods in class WLayerSurfacePirvate.

waylandClient() is a virtual function in class WObjectPrivate,
instantRelease() is a virtual function in clas WWrapObjectPrivate.
2025-09-26 10:23:25 +08:00
miruku b10c1f427b fix(qwlroots): allow server side destruction of qw_session_lock_v1
This commit exposes wlr_session_lock_v1_destroy as
qw_session_lock_v1::destroy(), which allows the compositor
to send finished() event on an ext_session_lock_v1 object.

qw_session_lock_v1 objects are not the owner of their handles,
thus cannot be properly destroyed via operator delete. Exposing
the destroy() method as public is necessary.

According to wayland protocol, compositor should have the ability
to deny a session lock request.
2025-09-26 10:23:25 +08:00
Lu YaNing 5b4d7b5de5 fix: Delete useless display text in copy mode
Remove debug display text in copy mode
2025-09-26 10:01:53 +08:00
Lu YaNing e843122e9e fix: enhance output validation in restore copy mode
Add invalid output detection to prevent crashes
2025-09-26 10:01:53 +08:00
April & May f4386256ca fix: use separate TreelandConfig for each user
This should work as intended.
2025-09-24 15:30:16 +08:00
JiDe Zhang b0601f90d1 fix: Ensure proper object destruction before app exit
This commit addresses an issue where the application would fail with
an assertion failure related to `qw_buffer` objects not being properly
released upon exiting the application. The previous implementation
directly called `QCoreApplication::exit` or `QCoreApplication::quit`,
which would trigger the destruction of various `QObject` instances
(such as `Helper` and `QmlEngine`) *after* the Qt event loop had already
exited.

Since many of these objects relied on `deleteLater` for their
destruction, and `deleteLater` calls are ineffective once the event loop
has terminated, these objects were not being fully destructed, leading
to resource leaks and the aforementioned assertion failure.

The solution involves ensuring that all necessary objects are
explicitly destroyed *before* calling `QCoreApplication::exit` or
`QCoreApplication::quit`.  Specifically:

1.  A `quit()` method has been added to the `Treeland` class, which
disconnects the object from all signals and slots, and then resets the
`d_ptr` (unique pointer to the private implementation) to ensure all
Treeland related objects are properly deleted. This cleanup happens
before calling `qApp->quit()`.
2.  The signal connection between `QQmlEngine::quit` and
`QCoreApplication::quit` is changed to a `Qt::QueuedConnection` to avoid
potential issues when the quit call originates from within an event
handler (e.g., a cursor button press/release event).
3.  A new signal `requestQuit()` is introduced in `Helper` and emitted
instead of directly calling `qApp->quit()`.  This signal is then
connected to the `Treeland::quit()` method using `Qt::QueuedConnection`.
4.  In the `tinywl` example, the `QmlEngine` object is now
dynamically allocated and explicitly deleted before `app.exit()`
is called. The `Helper::requestQuit` signal is also connected to
`QmlEngine::deleteLater`.

These changes ensure that all relevant objects have been properly
cleaned up before the application terminates, resolving the assertion
failure and preventing potential resource leaks.

Influence:
1. Verify that the application exits cleanly without any assertion
failures related to `qw_buffer` or other resources.
2. Test exiting the application using various methods (e.g., the window
close button, a menu item, or a keyboard shortcut).
3. Ensure that all application data is saved correctly before exiting.
4. Test that the `LockScreen` object is properly destroyed by manually
creating and destroying a LockScreen object with the setLockScreenImpl
call in Helper.

修复程序退出前对象未正确销毁的问题

此提交修复了应用程序退出时,由于 `qw_buffer` 对象未正确释放而导
致的断言失败问题。 之前的实现直接调用 `QCoreApplication::exit` 或
`QCoreApplication::quit`,导致各种 `QObject` 实例(例如 `Helper` 和
`QmlEngine`)在 Qt 事件循环结束后才被销毁。

由于许多这些对象依赖于 `deleteLater` 进行销毁,并且一旦事件循环终止,
`deleteLater` 调用将无效,因此这些对象没有被完全销毁,从而导致资源泄漏和
前面提到的断言失败。

解决方案包括确保在调用 `QCoreApplication::exit` 或
`QCoreApplication::quit` 之前显式销毁所有必要的对象。 具体来说:

1.  在 `Treeland` 类中添加了一个 `quit()` 方法,该方法断开对象与所有
信号和槽的连接,然后重置 `d_ptr`(指向私有实现的唯一指针),以确保与
Treeland 相关的所有对象都得到正确删除。 此清理发生在调用 `qApp->quit()`
之前。
2.  `QQmlEngine::quit` 和 `QCoreApplication::quit` 之间的信号连接已更改
为 `Qt::QueuedConnection`,以避免在退出调用源自事件处理程序内(例如,光
标按钮按下/释放事件)时出现潜在问题。
3.  在 `Helper` 中引入了一个新的信号 `requestQuit()`,并发出该信号而不是
直接调用 `qApp->quit()`。 然后使用 `Qt::QueuedConnection` 将此信号连接到
`Treeland::quit()` 方法。
4. 在`tinywl`示例中,`QmlEngine` 对象现在是动态分配的,并在调
用 `app.exit()` 之前显式删除。 `Helper::requestQuit` 信号也连接到
`QmlEngine::deleteLater`。

这些更改确保在应用程序终止之前已正确清理所有相关对象,从而解决了断言失败
并防止了潜在的资源泄漏。

Influence:
1. 验证应用程序是否干净地退出,而不会出现与 `qw_buffer` 或其他资源相关的
任何断言失败。
2. 使用各种方法(例如,窗口关闭按钮、菜单项或键盘快捷键)测试退出应用
程序。
3. 确保在退出之前正确保存所有应用程序数据。
4. 通过使用 Helper 中的 setLockScreenImpl 调用手动创建和销毁 LockScreen
对象来测试 LockScreen 对象是否已正确销毁。
2025-09-24 11:38:46 +08:00
JiDe Zhang 801e2fbf24 fix: improve resource management for RenderControl
1.  Changed the destruction timing of RenderControl. Using deleteLater()
on RenderControl caused a crash when OpenGL makeCurrent() was called.
This is because the RenderControl was being deleted in a deferred
manner, potentially after the OpenGL context was already being used
or destroyed.
2.  Switched to immediate deletion of RenderControl in the
WOutputRenderWindow destructor to avoid the crash.
3.  Modified WBufferRenderer to use std::unique_ptr for buffer
management to ensure timely unlocking.

Influence:
1.  Verify that applications using WOutputRenderWindow do not crash
on shutdown.
2.  Check resource usage related to graphics buffers to ensure proper
allocation and deallocation.
3.  Run performance tests to ensure that the change in deletion timing
does not negatively impact rendering performance.
4.  Test the texture provider to verify the buffer is handled correctly.

fix: 改善 RenderControl 的资源管理

1.  更改了 RenderControl 的销毁时机。在 RenderControl 上使用
deleteLater() 会导致调用 OpenGL makeCurrent() 时崩溃。这是因为
RenderControl 以延迟方式被删除,可能在 OpenGL 上下文已经被使用或销毁
之后。
2.  切换到在 WOutputRenderWindow 析构函数中立即删除 RenderControl,以避
免崩溃。
3.  修改 WBufferRenderer 以使用 std::unique_ptr 进行缓冲区管理,以确保及
时解锁。

Influence:
1.  验证使用 WOutputRenderWindow 的应用程序在关闭时不会崩溃。
2.  检查与图形缓冲区相关的资源使用情况,以确保正确分配和释放。
3.  运行性能测试以确保删除时机的变化不会对渲染性能产生负面影响。
4.  测试纹理提供程序以验证缓冲区是否已正确处理。
2025-09-24 11:38:46 +08:00
JiDe Zhang 5d16c8cada 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-09-24 11:38:46 +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
rewine e14a6a4935 fix: resolve window resize crash during image capture
1. Add wlr_buffer.h header to access buffer locking functionality
2. Lock buffer during copy operation to prevent race conditions
3. Implement comprehensive validation of source and destination buffers
4. Add dynamic constraint updating when buffer size mismatches occur
5. Handle client buffer source explicitly for better compatibility
6. Add detailed logging for debugging copy operations

The changes fix a critical crash that occurred during window resizing by
ensuring proper buffer synchronization and validation. The fix includes
safety checks to validate buffer dimensions, pointer validity, and
proper constraint handling when sizes change. By locking buffers during
copy operations and properly handling client buffer sources, we prevent
race conditions that could lead to crashes during window resizing.

fix: 修复录窗口时resize崩溃

1. 添加 wlr_buffer.h 头文件以访问缓冲区锁定功能
2. 在复制操作期间锁定缓冲区以防止竞争条件
3. 实现对源缓冲区和目标缓冲区的全面验证
4. 在缓冲区大小不匹配时动态更新约束条件
5. 显式处理客户端缓冲区源以提高兼容性
6. 添加详细的日志记录用于调试复制操作
2025-08-21 11:49:25 +08:00
April & May 3aa68efc92 fix: fix wrong display render issue when switching VT too quickly
When cooperating with DDM, switching VT will not drop DRM FD. This makes
treeland still able to draw to the DRM after VT switch, which will cause
wrong display rendering when switching VT too quickly. This commit
cooperate new treeland-ddm-v1 protocol and expose interface to enable /
disable global rendering, which is used in DDM to control render before
/ after TTY switching, to solve the render issue.
2025-08-21 11:48:26 +08:00
April & May 547da09cbf Totally disable lockscreen animation when switching TTY to prevent stuck for switching too quickly
Treeland will failed to deactivate session when the animation is still
playing, and get the whole VT stuck. Disable all animation to prevent it
as mostly as possible.
2025-08-20 09:45:28 +08:00
April & May c2094e85d2 feat: Support TTY switching with DDM
1. Remove dependence of seatd-dde.service, use system provided seatd
service;
2. Add private wayland protocol treeland-private-protocol.xml for IPC
3. Acquire VT control immediately after first rendering complete;
4. Call DDM to switch VT when Ctrl+Alt+Fx is pressed, if available;
5. Expose wayland request for deactivate and re-activate session to DDM;
2025-08-20 09:45:28 +08:00
transifex-integration[bot] 511473c286
Updates for project TreeLand (#515)
* [skip CI] Translate lockscreen.en_US.ts in fi

77% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'fi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in fi

100% translated source file: 'lockscreen.en_US.ts'
on 'fi'.

* [skip CI] Translate wallpaper.en_US.ts in fi

66% of minimum 10% translated source file: 'wallpaper.en_US.ts'
on 'fi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate wallpaper.en_US.ts in fi

100% translated source file: 'wallpaper.en_US.ts'
on 'fi'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: zccrs <zhangjide@deepin.org>
2025-08-19 16:18:46 +08:00
YaoBing Xiao b3e5f82d83 feat(waylib): add WBufferDumper utility for dumping buffer contents to image files
- WBufferDumper provides functionality to dump buffer data as images for debugging and analysis.
2025-08-19 15:03:34 +08:00
rewine cf91ae1312 refactor: use unified CI build preset with Werror
1. Replace manual CMake configuration with --preset ci in all ArchLinux
workflows
2. Add new CI build preset in CMakePresets.json with -Werror enabled
3. Remove redundant per-project CMake configuration steps
4. Simplify workflow steps by combining configure and build phases
5. Maintain compatibility with existing build requirements while
standardizing

The changes standardize build configuration across projects using a
centralized CMake preset. This ensures consistent build behavior while
maintaining the strict -Werror flag for CI builds. The update simplifies
workflow maintenance and improves build reliability by using CMake's
modern preset system.
2025-08-18 16:01:51 +08:00
rewine d1adcf4739 build: enable -Werror compiler flag
1. Added -Werror compiler flag to treat warnings as errors
2. This enforces stricter code quality standards
3. Helps catch potential issues early in development
4. Improves overall code reliability and maintainability

build: 启用 -Werror 编译器标志

1. 添加 -Werror 编译器标志将警告视为错误
2. 这执行了更严格的代码质量标准
3. 有助于在开发早期发现潜在问题
4. 提高整体代码的可靠性与可维护性
2025-08-15 10:14:06 +08:00
rewine 4cb9bd7c47
fix: prevent crash during preview item handling (#512)
1. Replace WWrapPointer with QPointer for SurfaceWrapper
2. Add shellSurface() check before accessing preview item properties
3. Fix race condition where SurfaceWrapper might be invalid

The changes prevent a crash that occurred when accessing a
SurfaceWrapper object after it had been invalidated. Using QPointer
with an explicit shellSurface() validity check ensures we don't access
dangling pointers, as the SurfaceWrapper::aboutToBeInvalidated signal
doesn't nullify WWrapPointer in time.

fix: 修复预览项处理时的崩溃问题

1. 将 SurfaceWrapper 的指针类型从 WWrapPointer 改为 QPointer
2. 在访问预览项属性前增加 shellSurface() 有效性检查
3. 解决 SurfaceWrapper 被标记为无效后仍被访问的竞态条件

这些修改解决了在 SurfaceWrapper 对象被销毁后仍然尝试访问其属性导致的崩溃
问题。使用 QPointer 并配合显式的 shellSurface() 有效性检查,可以确保不会
访问到悬空指针,因为 SurfaceWrapper::aboutToBeInvalidated 信号无法及时将
WWrapPointer 置空。
2025-08-14 16:37:04 +08:00
zccrs 10652f2741
fix: prevent cursor flicker during screen recording
1.  Remove `WBufferRenderer::resetTextureProvider` to avoid accidentally
cleaning the cached buffer in `WBufferRenderer` when switching from a
software cursor to a hardware cursor.
2.  The root cause was that switching from a software cursor
to a hardware cursor inadvertently cleared the cached buffer
in `WBufferRenderer`, causing the buffer referenced by
`BufferRendererProxy` to become null.
3.  The `resetTextureProvider` function was originally introduced in
the `WOutputLayer` implementation (https://github.com/vioken/waylib/
commit/ea814c44), and the buffer lock/unlock mechanism was introduced
in https://github.com/vioken/waylib/commit/35fdcb72. The lock/unlock
mechanism is a new design, so manually resetting the buffer is no longer
necessary.
4.  Update `WSGTextureProvider::setBuffer` to emit `textureChanged()`
signal when `buffer` is not null and the buffer object is not changed,
but maybe the buffer's content is changed.

Influence:
1.  Verify that the cursor no longer flickers during screen recording,
especially when switching between software and hardware cursors.
2.  Test screen sharing and ensure that the shared content is displayed
correctly without any visual artifacts.
3.  Check the buffer management to ensure that buffers are properly
locked and unlocked, and that no memory leaks occur.

fix: 修复录屏时光标闪烁问题

1.  移除 `WBufferRenderer::resetTextureProvider` 以避免在从软光标切换到
硬光标时意外清理 `WBufferRenderer` 中的缓存 buffer。
2.  根本原因是,从软光标切换到硬光标时,无意中清除了 `WBufferRenderer`
中的缓存 buffer,导致 `BufferRendererProxy` 引用的 buffer 变为 null。
3.  `resetTextureProvider` 函数最初是在 `WOutputLayer` 实现中引入的
(https://github.com/vioken/waylib/commit/ea814c44),buffer 锁/解锁机制是
在 https://github.com/vioken/waylib/commit/35fdcb72 中引入的。 锁/解锁机
制是一种新的设计,因此不再需要手动重置 buffer。
4.  更新 `WSGTextureProvider::setBuffer`,当 `buffer` 不为 null 且
buffer 对象没有更改时,发出 `textureChanged()` 信号,但 buffer 的内容可
能会更改。

Influence:
1.  验证在屏幕录制过程中,尤其是在软件和硬件光标之间切换时,光标不再
闪烁。
2.  测试屏幕共享,确保共享内容显示正确,没有任何视觉伪影。
3.  检查 buffer 管理,确保 buffer 被正确锁定和解锁,并且没有发生内存
泄漏。
2025-08-12 20:48:50 +08:00
rewine 672fdba375 docs: add comprehensive logging guidelines and update module logging
Add detailed logging guidelines for both treeland and waylib modules,
and update logging implementation across multiple files to follow the
new standards.

1. Create comprehensive logging documentation covering:
   - Category organization patterns for treeland and waylib
   - Log level usage guidelines
   - Best practices for message formatting and context
   - Implementation examples for both module types
   - Debugging tips and common mistakes to avoid

2. Update waylib modules with new logging categories:
   - wcursor.cpp: Add detailed cursor-related categories and update
logging statements
   - winputdevice.cpp: Add input device category and improve debug
messages
   - woutput.cpp: Add output-related categories and enhance buffer/
output logging
   - wseat.cpp: Replace old logging categories with new structured ones
   - wsocket.cpp: Add socket management category and improve connection
logging

3. Remove outdated logging categories:
   - Remove lcGeneral from wglobal.cpp
   - Remove obsolete qLcWlrCursor and related categories

4. Improve logging quality throughout:
   - Add contextual information to log messages
   - Use appropriate log levels for different message types
   - Add missing debug statements for important state changes
   - Fix incorrect
2025-08-11 18:21:02 +08:00
rewine af951c4194 feat: add centralized logging system and standardize log usage
1. Added new centralized logging system in common/treelandlogging.h
and .cpp
2. Replaced local logging categories with standardized ones across all
modules
3. Added comprehensive logging category definitions covering all system
components
4. Updated CMakeLists.txt to include new logging files
5. Modified multiple source files to use the standardized logging
categories

The changes provide a unified logging framework across the entire
codebase, enabling better log management and filtering. The centralized
system improves maintainability and ensures consistent log formatting
across different components.

feat: 添加集中化日志系统并规范日志使用

1. 在 common/treelandlogging.h 和 .cpp 中添加了新的集中化日志系统
2. 替换所有模块中的本地日志分类为标准化分类
3. 添加了涵盖所有系统组件的综合日志分类定义
4. 更新 CMakeLists.txt 以包含新的日志文件
5. 修改多个源文件以使用标准化日志分类

这些更改提供了统一的日志框架,改进了整个代码库的日志管理能力。集中化的系
统提高了可维护性,并确保不同组件之间日志格式的一致性。
2025-08-11 18:21:02 +08:00
YaoBing Xiao 501533e4c8 feat: ssd title bar displays the window title information
Fixes: linuxdeepin/treeland#501

Log:
2025-08-11 11:25:21 +08:00
YaoBing Xiao 7642cb91cf fix: maximize/restore icon in the SSD title bar displays incorrectly
updates the condition to use surface.shellSurface.isMaximized, ensuring the icon
accurately reflects the window's maximized state when using the shell surface.

Fixes: linuxdeepin/treeland#501

Log:
2025-08-11 11:25:21 +08:00
transifex-integration[bot] b48e9f3a7d [skip CI] Translate lockscreen.en_US.ts in es
90% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
2025-08-08 10:19:35 +08:00
transifex-integration[bot] c48f8dcf6a [skip CI] Translate lockscreen.en_US.ts in es
90% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
2025-08-08 10:19:35 +08:00
transifex-integration[bot] 3ac5fb78b4 [skip CI] Translate lockscreen.en_US.ts in es
90% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
2025-08-08 10:19:35 +08:00
rewine 6c921b8ed4 fix: resolve multiple compiler warnings
1. Fix multiple compiler warning issues across various header files
2. Corrected template typedef naming in qobject.h for better clarity
3. Removed semicolons after QW_FUNC_MEMBER macros in several header
files
4. Added missing compiler warning disables for -Wreorder in
qtwaylandscanner.cpp
5. Fixed Q_DECLARE_FLAGS macro usage in surfacewrapper.h
6. Fixed W_DECLARE_PUBLIC macro usage in winputdevice.cpp

These changes eliminate compiler warnings during the build process while
maintaining full functionality and improving code consistency across
the codebase.

修复: 解决多个编译器警告

1. 修复多个头文件中的编译器警告问题
2. 在 qobject.h 中修正了模板类型定义名称以提高清晰度
3. 在多个头文件中移除了 QW_FUNC_MEMBER 宏后的分号
4. 在 qtwaylandscanner.cpp 中添加了缺失的 -Wreorder 警告禁用指令
5. 修正了 surfacewrapper.h 中的 Q_DECLARE_FLAGS 宏使用
6. 修正了 winputdevice.cpp 中的 W_DECLARE_PUBLIC 宏使用

这些修改在保持完整功能的同时消除了构建过程中的编译器警告
2025-08-08 10:03:45 +08:00
YaoBing Xiao a1895f9161 fix(waylib): prevent duplicate signal connections using Qt::UniqueConnection
- Initialize Content pointer to nullptr for safety.
- Use Qt::UniqueConnection when connecting BlitTextureProvider::textureChanged
to Content::update, both in Content and WRenderBufferBlitterPrivate, to avoid
multiple identical connections and ensure the slot is triggered only once per
signal emission.
2025-08-08 10:01:54 +08:00
YaoBing Xiao 7176521287 fix(waylib): prevent crash by safely managing textureChanged connection
- Add QMetaObject::Connection and QMutex members to WQuickTextureProxyPrivate
to track and protect the textureChanged signal connection.
- Disconnect previous textureChanged connections in initSourceItem to
avoid dangling or duplicate connections.
- Use a mutex to ensure thread-safety when establishing the textureChanged
connection in updatePaintNode.

This change helps prevent occasional crashes when moving the cursor by ensuring
signals are properly managed and connections are safely handled.

Fixes: #494

Log:
2025-08-08 10:01:54 +08:00
rewine d2df8a0a11 fix: use exec to replace process and avoid duplicate logs in treeland.sh
- Use exec to replace treeland.sh process with treeland, avoiding dual processes
- Include all user arguments in --try-exec test for environment consistency
- Disable systemd logs from treeland.sh to prevent duplicate journal entries
- Add English comments explaining the process replacement logic

This resolves the issue where treeland.sh and treeland would run as separate
processes, and eliminates duplicate log entries in journalctl.
2025-08-07 21:41:46 +08:00
YaoBing Xiao 26b0e3eebb fix(waylib): Occasional crash when moving the cursor
Use the q pointer as the context object host.
Use QPointer to prevent crash when WOutputCursor is
destroyed during signal handling.

Fixes: linuxdeepin/treeland#490

Log:
2025-08-07 19:10:41 +08:00
rewine 1e6625bd9b fix: improve type safety in render buffer node
1. Replace generic static_assert with Qt-specific type check
2. Use QtPrivate::HasQ_OBJECT_Macro to ensure proper QObject inheritance
3. Add explicit QObject include for better header dependency management
4. Maintain existing functionality while improving compile-time safety

The change replaces a generic type trait check with Qt's specific type
validation mechanism, ensuring that template parameters properly inherit
from QObject. This provides better error messages and stronger type
safety guarantees during compilation.

fix: 改进渲染缓冲节点的类型安全性

1. 用 Qt 特定的类型检查替换通用的 static_assert
2. 使用 QtPrivate::HasQ_OBJECT_Macro 确保正确的 QObject 继承关系
3. 添加显式的 QObject 包含头文件以改善头文件依赖管理
4. 在保持现有功能的同时提高编译时的安全性

该修改将通用类型特征检查替换为 Qt 的特定类型验证机制,确保模板参数正确地
继承自 QObject。这提供了更好的错误提示信息,并在编译时提供了更强的类型安
全保证。
2025-08-07 19:08:26 +08:00
rewine aa645014b8 chore: enable Qt logging context and adjust cursor shape manager version
1. Added QT_MESSAGELOGCONTEXT definition to enable detailed logging in
Qt applications
2. Downgraded cursor shape manager protocol version from 2 to 1
temporarily due to wlroots version constraints
3. The changes help with debugging while maintaining compatibility with
current wlroots version (pre-0.20)

chore: 启用 Qt 日志上下文并调整光标形状管理器版本

1. 添加 QT_MESSAGELOGCONTEXT 定义以启用 Qt 应用程序的详细日志记录功能
2. 由于 wlroots 版本限制(尚未升级到 0.20),临时将光标形状管理器协议版
本从 2 降级为 1
3. 这些更改有助于调试,同时保持与当前 wlroots 版本的兼容性
2025-08-07 19:08:26 +08:00
rewine 795309a4aa refactor: update cursor shape manager version to 2
Update the version number of the CURSOR_SHAPE_MANAGER_V1 protocol from
1 to 2 to reflect recent implementation changes and ensure protocol
version consistency across components.

refactor: 更新光标形状管理器版本至 2

将 CURSOR_SHAPE_MANAGER_V1 协议的版本号从 1 更新至 2,以反映最近的实现更
改,并确保组件间的协议版本一致性。
2025-08-07 19:08:26 +08:00
rewine bba9eca457 fix: remove unused setOutputProxy function
1. Remove setOutputProxy method from Helper class
2. Delete corresponding declaration in header file
3. The function was never implemented and not used anywhere in the
codebase
4. Cleaning up unused code improves code maintainability and reduces
technical debt

fix: 移除未使用的 setOutputProxy 函数

1. 从 Helper 类中移除 setOutputProxy 方法
2. 同时删除头文件中的相应声明
3. 该函数从未被实现且代码库中没有任何使用
4. 清理未使用的代码可提高代码可维护性并减少技术债务
2025-08-07 19:08:26 +08:00
rewine 3a013bcf5a fix: replace Q_EMIT and Q_SLOTS with signals/slots
Replace all instances of Q_EMIT with the modern signal
emission syntax
and replace Q_SLOTS with the modern slots syntax. Also add
[[maybe_unused]] attributes to parameters that are intentionally unused.

fix: 替换 Q_EMIT 和 Q_SLOTS 为 Qt5 风格的信号/槽

替换所有 Q_EMIT 为现代风格的信号发射语法,并将 Q_SLOTS 替换为现代风格的槽语法。
同时为故意未使用的参数添加 [[maybe_unused]] 属性。
2025-08-07 19:08:26 +08:00
rewine 4cb0da6d21 fix: resolve compilation warnings and improve code structure
1. Fix order of member variable initialization in qw_interface
constructor
2. Move add_compile_options after ASAN flags to ensure proper priority
3. Fix member variable order in TreelandConfig to match declaration
4. Add [[maybe_unused]] attribute to unused function parameters
5. Fix surface wrapper bitfield member ordering
6. Fix cursor image index comparison type mismatch
7. Fix various minor code style and structure issues

fix: 解决编译警告并改进代码结构

1. 修复 qw_interface 构造函数中成员变量的初始化顺序
2. 将 add_compile_options 移至 ASAN 标志之后以确保优先级
3. 修复 TreelandConfig 中成员变量顺序以匹配声明
4. 为未使用的函数参数添加 [[maybe_unused]] 属性
5. 修复 surface wrapper 位域成员顺序
6. 修复光标图像索引比较的类型不匹配问题
7. 解决其他次要的代码风格和结构问题
2025-08-07 19:08:26 +08:00
rewine 97c07bd06f chore(debian): update version to 0.6.2
log: 0.6.2
2025-08-04 18:19:28 +08:00
YaoBing Xiao 78ee985666 fix(waylib): the screen flickering issue during screencopy
Added resetGlState() call immediately after ending frame to ensure correct
OpenGL state before committing outputs in doRender(), improving GPU context
handling, prevent gles2-render exception in wlroots.

Fixes: linuxdeepin/treeland#488

Log:
2025-08-04 18:18:53 +08:00
rewine ce2c4057b4 fix: resolve library versioning and installation path issues
1. Add proper versioning to libtreeland and capture module with VERSION
and SOVERSION properties
2. Remove duplicate and unnecessary qml directory installation commands
that were causing conflicts
3. Add XCB dependency to libtreeland target_link_libraries for improved
X11 compatibility
4. Clean up commented-out installation code that was no longer needed

fix: 解决库版本和安装路径问题

1. 为 libtreeland 和 capture 模块添加正确的版本信息,使用 VERSION 和
SOVERSION 属性
2. 移除导致冲突的重复 qml 目录安装命令
3. 在 libtreeland 的 target_link_libraries 中添加 XCB 依赖以提升 X11 兼
容性
4. 清理不再需要的注释掉的安装代码
2025-08-04 17:41:01 +08:00
rewine e4ca014d0e chore(debian): update version to 0.6.1
log: 0.6.1
2025-08-01 13:58:04 +08:00
rewine 0ef3153e20 fix: improve D-Bus connection handling and QML hover visibility
1. Add proper boolean parameter passing in LockScreen component method
calls
2. Fix QML hover state reference to use correct item ID
3. Add error handling for D-Bus connection failure in Helper class
4. Improve logging for D-Bus connection issues

The changes address three different issues:
- LockScreen component methods now properly pass boolean parameters
- QML hover state visualization was incorrectly referencing the parent
container
- D-Bus connection failure handling was missing proper error reporting

fix: 改进 D-Bus 连接处理和 QML 悬停可见性

1. 在 LockScreen 组件方法调用中添加正确的布尔参数传递
2. 修复 QML 悬停状态引用以使用正确组件ID
3. 在 Helper 类中添加 D-Bus 连接失败的错误处理
4. 增强 D-Bus 连接问题的日志记录

这些修改解决了三个不同问题:
- LockScreen 组件方法现在能正确传递布尔参数
- QML 悬停状态显示错误引用了父容器的问题已修复
- D-Bus 连接失败处理缺少错误报告的问题得到解决
2025-08-01 13:32:16 +08:00
YaoBing Xiao f96555f5e3 feat: CLI option: switch from --disable-debug-view to --enable-debug-view
- Replace `disableDebugView` logic with `enableDebugView` for improved clarity.
- Avoid displaying debug view during Debug compilation

Log:
2025-08-01 13:06:55 +08:00
YaoBing Xiao b7b6708a4b fix(waylib): Specify required rendering flags in WSGRenderFootprintNode
The QRhi-based render() implementation in WSGRenderFootprintNode relies on explicit rendering
flags to ensure correct and efficient rendering behavior. This commit introduces an override
for the flags() method, returning a combination of QSGRenderNode::NoExternalRendering and
QSGRenderNode::BoundedRectRendering. These flags clarify the rendering node's capabilities
to the Qt scene graph, preventing potential rendering issues or crashes.
This change may address issues reported in https://github.com/linuxdeepin/treeland/issues/478.

Log:
2025-08-01 10:16:45 +08:00
rewine 7e13237fd7 chore(debian): update version to 0.6.0
Log: New version adapt to wlroots-0.19
2025-07-31 21:38:28 +08:00
rewine 5cee95f2aa fix: improve image capture error handling and code structure
1. Replace Q_ASSERT with proper error handling in image capture code
2. Add comprehensive validation checks for null pointers and invalid
states
3. Replace manual memory management with RAII-style helper classes
4. Move constraint building logic to dedicated helper struct
5. Add proper copyright headers to source files
6. Update CMakeLists.txt with consistent TODO markers
7. Implement WPixmanRegion class for automatic region management
8. Add detailed debug logging for capture operations

The changes enhance code reliability by properly handling error
conditions instead of relying on assertions, improve memory safety
through better resource management, and make the code more maintainable

with clearer structure and documentation.

fix: 改进图像捕获错误处理和代码结构

1. 在图像捕获代码中替换 Q_ASSERT 为适当的错误处理
2. 添加全面的空指针和无效状态验证检查
3. 使用 RAII 风格的辅助类替代手动内存管理
4. 将约束构建逻辑移至专用辅助结构体
5. 为源文件添加正确的版权标头
6. 在 CMakeLists.txt 中使用一致的 TODO 标记
7. 实现 WPixmanRegion
2025-07-31 20:37:24 +08:00
rewine a503276e46 feat: add foreign toplevel image capture support
1. Added support for Wayland foreign toplevel image capture protocol
2. Implemented capture source creation and handling in Helper class
3. Added new protocol files for ext-image-capture-source and ext-
foreign-toplevel-list
4. Created WExtImageCaptureSourceV1Impl for handling actual image
capture logic
5. Added findSurfaceByHandle method to support reverse lookup from
protocol handles
6. Implemented frame scheduling and buffer copying with format
constraints handling

feat: 添加外部顶层窗口图像捕获支持

1. 添加对 Wayland 外部顶层窗口图像捕获协议的支持
2. 在 Helper 类中实现捕获源创建和处理逻辑
3. 添加了 ext-image-capture-source 和 ext-foreign-toplevel-list 的新协议
文件
4. 创建 WExtImageCaptureSourceV1Impl 类来处理实际的图像捕获逻辑
5. 添加 findSurfaceByHandle 方法以支持从协议句柄进行反向查找
6. 实现帧调度和缓冲区复制,并处理格式约束条件
2025-07-31 20:37:24 +08:00
rewine 72f4ff54a6 feat: add image capture source support
1. Add new header files for ext_image_capture_source_v1
2. Implement QW_CLASS_OBJECT for ext_image_capture_source_v1 with
signals and methods
3. Add interface header for ext_image_capture_source_v1
4. Improve ext_image_copy_capture_frame_v1 with proper object model
and methods

feat: 添加图像捕获源支持

1. 为 ext_image_capture_source_v1 添加新头文件
2. 使用信号和方法实现 ext_image_capture_source_v1 的 QW_CLASS_OBJECT
3. 添加 ext_image_capture_source_v1 的接口头文件
4. 通过正确的对象模型和方法改进 ext_image_copy_capture_frame_v1
2025-07-31 20:37:24 +08:00
April & May c3501eac2b chore: Use parameter to control lockscreen animation instead of property
Use parameter to control lockscreen animation instead of QML property.
2025-07-31 19:29:34 +08:00
April & May 5f767e541f fix: Check virtual device for QInputEvent
Qt will create virtual device for QInputEvent when no physical device
available (e.g. switched to another VT), which will leads to a failed
assertion and make treeland crash. This commit applies a special guarded
getter for such case.
2025-07-31 19:29:34 +08:00
April & May efa48c3154 fix: Skip lockscreen animation when switching back from TTY
When switching back from TTY the Greeter will be re-created, and somehow
leads to an incorrect lockscreen animation on HiRes screen. This commit
adds skip function to lockscreen animation, and skips the animation when
the first time it adds to an output.
2025-07-31 19:29:34 +08:00
April & May cd0478c044 feat: Support TTY switching
Support TTY switching by calling wlr_session_change_vt(). Currently not
working with ddm because of the VT_BOUND mode.
2025-07-31 19:29:34 +08:00
April & May 5a8e15f1c7 feat: Add qwlroots interface for wl_session object
Add qwlroots interface for wl_session object, which can serve for VT
switching.
2025-07-31 19:29:34 +08:00
JiDe Zhang 60c30ec0db ci: Trigger waylib builds when qwlroots changes
This commit modifies the GitHub Actions workflows for waylib builds to
ensure they are triggered when qwlroots code changes occur, since waylib
depends on qwlroots.

Changes:
1. Added 'qwlroots/**' to the paths trigger for waylib-archlinux-build.yml
2. Added 'qwlroots/**' to the paths trigger for waylib-debian-build.yml
3. Updated README.md to document the CI workflow dependencies
4. Updated README.zh_CN.md to maintain consistency across all language versions

This ensures proper dependency management and prevents build failures
when qwlroots modifications affect waylib compilation.

ci: 当qwlroots代码修改时触发waylib构建

此提交修改了waylib构建的GitHub Actions工作流,确保在qwlroots
代码发生变化时触发waylib构建,因为waylib依赖于qwlroots。

变更内容:
1. 在waylib-archlinux-build.yml的路径触发器中添加'qwlroots/**'
2. 在waylib-debian-build.yml的路径触发器中添加'qwlroots/**'
3. 更新README.md文档记录CI工作流的依赖关系
4. 更新README.zh_CN.md保持所有语言版本文档的一致性

这确保了正确的依赖管理,防止qwlroots修改影响waylib编译时
出现构建失败的情况。
2025-07-30 17:57:57 +08:00
rewine b68ea9f76e fix: remove unused quit full button and add helper activation
1. Remove the unused "quitFullBtn" Loader component that was not visible
2. Add Helper.activateSurface call before maximizing window
3. This ensures proper window activation before state change

fix: 删除未使用的退出全屏按钮并添加窗口激活

1. 移除了未使用的 "quitFullBtn" Loader 组件
2. 在窗口最大化前添加了 Helper.activateSurface 调用
3. 这确保了在状态改变前正确激活窗口
2025-07-30 17:57:37 +08:00
rewine 6c1aab65be fix: prevent title bar and window buttons from stealing focus
1. Added Qt.NoFocus policy to title bar component to prevent keyboard
focus
2. Added focusPolicy to all window control buttons (minimize, close,
maximize)
3. Ensures focus remains with active window content during window
operations
4. Improves accessibility and prevents focus-related UI glitches

fix: 防止标题栏和窗口按钮获取焦点

1. 为标题栏组件添加 Qt.NoFocus 策略以阻止键盘焦点
2. 为所有窗口控制按钮(最小化、关闭、最大化)添加 focusPolicy
3. 确保窗口操作期间焦点保留在活动窗口内容上
4. 提升可访问性并防止焦点相关的界面故障
2025-07-30 16:45:53 +08:00
YaoBing Xiao 837d349e96 feat: add wl_drm support
Add wl_drm protocol
2025-07-30 15:32:25 +08:00
immortalrover a6134c2e40 feat: create ext-data-control manager
support ext-data-control-v1 protocol
2025-07-29 20:33:01 +08:00
zccrs 26b95540cd
fix: Handle VT switching keys (#469)
* fix: Handle VT switching keys

This commit addresses an issue where the XF86Switch_VT_1 to
XF86Switch_VT_12 keys were not properly handled by Qt. Qt does not
directly support these keys. The fix involves converting these keys to
Ctrl+Alt+F1 through Ctrl+Alt+F12 when the Ctrl and Alt modifiers are
already pressed. This enables users to switch virtual terminals within
the Wayland environment using these key combinations, matching the
expected behavior on traditional Linux systems. This conversion only
happens when Ctrl+Alt are already pressed, preventing accidental mapping
of other keys.

fix: 处理 VT 切换键

此提交解决了一个 Qt 无法正确处理 XF86Switch_VT_1 到 XF86Switch_VT_12
键的问题。Qt 不直接支持这些键。此修复包括将这些键转换为 Ctrl+Alt+F1
到 Ctrl+Alt+F12(如果 Ctrl 和 Alt 修改键已被按下)。这使得用户能够在
Wayland 环境中使用这些组合键切换虚拟终端,从而匹配传统 Linux 系统上的预
期行为。此转换仅在 Ctrl+Alt 已被按下时发生,防止意外映射其他键。
2025-07-25 11:00:58 +08:00
rewine 7039d9ede6 feat: add Nix flake support for project configuration
1. Introduce `default.nix` at the root to define Nix packages and
dependencies
2. Migrate CMakeLists.txt to use `option()` and `add_feature_info()` for
better feature management
3. Update `flake.nix` to import and organize Nix modules and packages
4. Modify `nix/default.nix` to use `nix-filter.lib` and add new
dependencies like `qwlroots` and `waylib`
5. Update `waylib/flake.nix` and `waylib/nix/default.nix` to improve
test support and source filtering

feat: 添加 Nix flake 支持以优化项目配置

1. 在项目根目录引入 `default.nix` 来定义 Nix 包及其依赖
2. 将 CMakeLists.txt 中的配置改为使用 `option()` 和 `add_feature_info()`
以更好地管理功能选项
3. 更新 `flake.nix` 以导入并组织 Nix 模块和包
4. 修改 `nix/default.nix` 使用 `nix-filter.lib` 并添加 `qwlroots` 和
`waylib` 等包
2025-07-24 20:07:56 +08:00
rewine 531c316379 fix: prevent workspace moveSurfaceTo crash on null wrapper
1. Add null check for wrapper in WindowSelectionGrid.qml before calling
moveSurfaceTo
2. Add conditional checks in WorkspaceSelectionList.qml to verify both
wrapper and model exist before workspace move
3. Use optional chaining operator (dragManager.item?.wrapper) for safer
null handling
4. Prevent potential crashes when moving surfaces between workspaces
during drag operations

fix: 防止工作区 moveSurfaceTo 在空包装器时崩溃

1. 在 WindowSelectionGrid.qml 中调用 moveSurfaceTo 前添加对 wrapper 的空
值检查
2. 在 WorkspaceSelectionList.qml 中添加条件检查以验证包装器和模型存在后
再进行工作区移动
3. 使用可选链操作符 (dragManager.item?.wrapper) 以更安全地处理空值
4. 防止在拖放操作期间跨工作区移动时出现潜在崩溃
2025-07-24 15:02:29 +08:00
rewine 41aac0ddea fix: remove redundant submodule options and configs
1. Remove duplicate CMake option for WITH_SUBMODULE_WAYLIB that was both
defined and set to ON
2. Eliminate redundant build presets (submodule & submodule-with-clang)
that only differed by compiler settings
3. Simplify CMakePresets.json by keeping only essential configurations
4. Maintain single source of truth for binary directory configuration

fix: 删除冗余的子模块选项和配置

1. 移除重复定义的 WITH_SUBMODULE_WAYLIB 选项,该选项已被设置为 ON
2. 删除冗余的构建预设(submodule 和 submodule-with-clang),这些配置仅编
译器设置不同
3. 简化 CMakePresets.json 文件,保留必要配置
4. 维护单一可信的二进制目录配置来源
2025-07-24 14:46:01 +08:00
rewine 826fe21051 chore: update nix dependencies and clean up configurations
1. Remove redundant seatd service configuration in flake.nix that was
previously used for testing
2. Clean up development shell packages by removing unnecessary Wayland-
related dependencies
3. Update wlroots dependency to wlroots_0_19 in both flake.nix and
default.nix
4. Update project version from 0.2.2 to 0.5-unstable to reflect recent
development progress
5. Add depsBuildBuild input for pkg-config to ensure proper build
environment setup
6. Remove outdated wlroots reference from nativeBuildInputs

chore: 更新 nix 依赖并清理配置

1. 移除 flake.nix 中冗余的 seatd 服务配置(之前用于测试)
2. 清理开发环境中的 shell 包,移除不必要的 Wayland 相关依赖
3. 在 flake.nix 和 default.nix 中将 wlroots 依赖更新为 wlroots_0_19
4. 将项目版本从 0.2.2 更新为 0.5-unstable 以反映最新开发进展
5. 添加 pkg-config 的 depsBuildBuild 输入以确保正确的构建环境
2025-07-23 17:09:40 +08:00
renovate[bot] ffa43d0167 chore(deps): update actions/checkout action to v4 2025-07-23 15:36:31 +08:00
renovate[bot] c4aba6382e chore(deps): update fsfe/reuse-action action to v5 2025-07-23 15:35:30 +08:00
transifex-integration[bot] e321eed150 [skip CI] Translate lockscreen.en_US.ts in uk
100% translated source file: 'lockscreen.en_US.ts'
on 'uk'.
2025-07-23 15:34:37 +08:00
transifex-integration[bot] 9adc345b56 [skip CI] Translate multitaskview.en_US.ts in fr
100% translated source file: 'multitaskview.en_US.ts'
on 'fr'.
2025-07-23 15:34:37 +08:00
transifex-integration[bot] e71660c914 [skip CI] Translate lockscreen.en_US.ts in pl
100% translated source file: 'lockscreen.en_US.ts'
on 'pl'.
2025-07-23 15:34:37 +08:00
transifex-integration[bot] 3a471672c6 [skip CI] Translate wallpaper.en_US.ts in pl
100% translated source file: 'wallpaper.en_US.ts'
on 'pl'.
2025-07-23 15:34:37 +08:00
transifex-integration[bot] 7d4aec0795 [skip CI] Translate multitaskview.en_US.ts in pl
100% translated source file: 'multitaskview.en_US.ts'
on 'pl'.
2025-07-23 15:34:37 +08:00
transifex-integration[bot] 3c6c4c01e9 [skip CI] Translate treeland.en_US.ts in pl
100% translated source file: 'treeland.en_US.ts'
on 'pl'.
2025-07-23 15:34:37 +08:00
April & May 6a7b46ad64 fix: Scaling animation not shown while return from shutdown page
Signed-off-by: April & May <apr3vau@outlook.com>
2025-07-23 15:28:21 +08:00
JiDe Zhang 54e8ed840b chore: Force Ninja build during deb packaging
This commit enforces the use of Ninja as the build system during the
debian package creation process for treeland, qwlroots, and waylib.
This change was made to significantly improve build times, as Ninja
generally offers faster and more efficient builds compared to the
default make system. The changes involve adding `ninja-build` as a
build dependency in the `debian/control` files and adding `-GNinja` to
the `dh_auto_configure` commands in the `debian/rules` files for all
three packages. This ensures that CMake uses Ninja to generate the build
files.

chore: 在 deb 打包过程中强制使用 Ninja 构建

此提交强制在 treeland、qwlroots 和 waylib 的 debian 包创建过程中使用
Ninja 作为构建系统。 此更改旨在显着缩短构建时间,因为与默认的 make 系统
相比,Ninja 通常提供更快、更高效的构建。 更改包括在 `debian/control` 文
件中添加 `ninja-build` 作为构建依赖项,并在所有三个包的 `debian/rules`
文件中的 `dh_auto_configure` 命令中添加 `-GNinja`。 这确保 CMake 使用
Ninja 来生成构建文件。
2025-07-23 15:27:52 +08:00
JiDe Zhang 7c74bf1e17 fix: add timeout to protocol tests
This commit adds a timeout of 3 seconds to several protocol unit tests
in their respective CMakeLists.txt files. These tests were observed
to block indefinitely in certain build environments, specifically
when building deb packages. Adding a timeout ensures that these tests
will not hang the build process, improving overall build reliability
and preventing potential deadlocks. The timeout value of 3 seconds
was chosen to allow sufficient time for the tests to complete under
normal conditions while still providing a reasonable safeguard against
indefinite blocking.

fix: 为协议测试添加超时

此提交在其各自的 CMakeLists.txt 文件中为多个协议单元测试添加了 3 秒的超
时。据观察,这些测试在某些构建环境中(尤其是在构建 deb 软件包时)会无限
期地阻塞。添加超时可确保这些测试不会使构建过程挂起,从而提高整体构建可靠
性并防止潜在的死锁。选择 3 秒的超时值是为了在正常情况下为测试完成留出足
够的时间,同时仍提供合理的保护以防止无限期阻塞。
2025-07-23 15:27:52 +08:00
JiDe Zhang 2427b2025a feat: Upload build artifacts as zip archives
The ArchLinux build workflows for qwlroots, treeland and waylib now
create a zip archive of the installed files in a staging directory
and upload it as an artifact. This allows for easy inspection of the
built files and verification of the build process's correctness. The
zip includes a `PACKAGE_INFO.txt` containing package metadata, build
configuration details, and a list of installed files. Pacman is used to
install the zip tool if it isn't already available.

feat: 上传构建产物为 zip 压缩包

qwlroots、treeland 和 waylib 的 ArchLinux 构建工作流程现在会在暂存目录中
创建已安装文件的 zip 压缩包,并将其作为工件上传。这样可以方便地检查构建
的文件并验证构建过程的正确性。该 zip 包含一个 `PACKAGE_INFO.txt`,其中包
含包元数据、构建配置详细信息和已安装文件列表。 如果 zip 工具尚不可用,则
使用 Pacman 安装它。
2025-07-23 15:27:52 +08:00
JiDe Zhang 644b7315d3 chore: fix CI and enable independent builds
1.  Fixes and updates CI configurations for treeland.
2.  Merges `reuse` files for comprehensive license information.
3.  Updates dependencies in `debian/control` to align with the combined
codebase.
4.  Introduces separate build workflows for `waylib` and `qwlroots` to
ensure they can be built independently.
5.  This ensures modularity and prevents accidental breakages during
future development, maintaining the option to separate these components
again.

chore: 修复 CI 并启用独立构建

1. 修复并更新了 treeland 的 CI 配置。
2. 合并 `reuse` 文件以提供全面的许可证信息。
3. 更新了 `debian/control` 中的依赖项,以与合并的代码库保持一致。
4. 引入了 `waylib` 和 `qwlroots` 的独立构建工作流程,以确保它们可以独立
构建。
5. 确保模块化,防止未来开发过程中意外损坏,保持再次分离这些组件的选项。
2025-07-23 15:27:52 +08:00
JiDe Zhang 2a0093ad46 refactor: merge qwlroots and waylib source code into treeland
Removed qwlroots and waylib from git submodules, and merged their
source code directly into the treeland repository. This change
reduces development overhead during the rapid iteration phase of
treeland, as frequent coordinated changes are required across
treeland, qwlroots, and waylib. By merging them now, we simplify
development and maintenance. In the future, when the project
stabilizes, we may consider splitting them back into independent
repositories.

To prepare for this possible future split, the original directory
structures and all files from qwlroots and waylib are preserved and
placed under separate subdirectories in treeland.

Original project commits at the time of merge:
- qwlroots: https://github.com/vioken/qwlroots(00b09f9047ac0eaf26757e8af3d31f35d22bbce3)
- waylib: https://github.com/vioken/waylib(9564027cc6c89dc5262c03d183f743b71a0e621e)

重构:将 qwlroots 和 waylib 项目代码合并到 treeland

将 qwlroots 和 waylib 从 git 子模块中移除,直接把它们的代码合并
到 treeland 项目中。这样做是为了在 treeland 快速迭代期间减少开发
成本,因为经常需要同时修改 treeland、waylib 和 qwlroots,合并后
开发会更方便,待项目稳定后再考虑重新拆分为独立项目。

为方便将来拆分,保留了原项目的目录结构和全部文件,并使用独立子
目录维护代码。

合并时原项目的提交信息如下:
- qwlroots: https://github.com/vioken/qwlroots(00b09f9047ac0eaf26757e8af3d31f35d22bbce3)
- waylib: https://github.com/vioken/waylib(9564027cc6c89dc5262c03d183f743b71a0e621e)
2025-07-23 15:27:52 +08:00
JiDe Zhang aee46508f7 chore: Use treeland-specific seatd service
This commit modifies the treeland systemd service file to use the
`seatd-dde.service` instead of the generic `seatd.service`. This change
is necessary because treeland now utilizes a dedicated seatd instance,
`seatd-dde`, specifically configured for its requirements.  By switching
to the dedicated service, treeland avoids potential conflicts or
misconfigurations that could arise from sharing a common seatd instance
with other applications or services.

chore: 使用 treeland 专用的 seatd 服务

此提交修改了 treeland systemd 服务文件,以使用 `seatd-dde.service` 而不
是通用的 `seatd.service`。 这一更改是必要的,因为 treeland 现在使用专门
为其需求配置的专用 seatd 实例 `seatd-dde`。 通过切换到专用服务,treeland
可以避免因与其他应用程序或服务共享通用 seatd 实例而可能引起的潜在冲突或
错误配置。
2025-07-21 10:58:17 +08:00
rewine ede2f8230d feat: implement ext-foreign-toplevel-list
Log: need https://github.com/vioken/waylib/pull/640
2025-07-16 10:04:01 +08:00
renovate[bot] df2a7442b2 chore(deps): lock file maintenance 2025-07-15 13:52:09 +08:00
transifex-integration[bot] 2f48f6d110 [skip CI] Translate lockscreen.en_US.ts in es
81% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
2025-07-15 13:50:00 +08:00
renovate[bot] 1cf99b5540 chore(deps): update waylib digest to 9564027 2025-07-15 13:47:10 +08:00
transifex-integration[bot] 9d4c3cb5cd
i18n: Updates for project TreeLand (#440)
* [skip CI] Translate lockscreen.en_US.ts in pl

27% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'pl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in pt_BR

100% translated source file: 'treeland.en_US.ts'
on 'pt_BR'.

---------

Log:
2025-07-10 19:30:10 +08:00
JiDe Zhang 1713074802 chore: remove polkit rules for login1
The polkit rules for `org.freedesktop.login1.manage` are no longer
required because the DDE user no longer logs in via the `login1`
interface. This change removes the `misc/polkit-1` directory,
the `debian/treeland.install` reference to polkit rules, and the
corresponding `CMakeLists.txt` entry. This simplifies the codebase and
removes unnecessary configuration files.

chore: 移除 login1 的 polkit 规则

由于 DDE 用户不再通过 `login1` 接口登录,因此不再需要
`org.freedesktop.login1.manage` 的 polkit 规则。此更改移除了 `misc/
polkit-1` 目录、`debian/treeland.install` 中对 polkit 规则的引用以及相应
的 `CMakeLists.txt` 条目。这简化了代码库并删除了不必要的配置文件。
2025-07-09 14:58:24 +08:00
YaoBing Xiao 34c158934e feat: add support for alpha modifier protocol
It allows clients to explicitly communicate their use of
alpha transparency.

Log: add support for alpha modifier protocol
2025-07-02 14:23:43 +08:00
Zhang Dingyuan 6afd8348fa fix: cannot export dbus services
I can't explain this phenomenon. As long as the DLog registration
function is before QApplication, it is impossible to obtain all the
contents registered by dbus.

DTK Team reported that other projects encountered the same problem and
suspected that it was a Qt problem.

Log:
2025-07-02 13:55:32 +08:00
rewine 77d2cd1936 Revert "fix: should not maximize when client set maxsize"
This reverts commit 0d21c93100. which
broken maximize of firefox
2025-07-01 17:39:12 +08:00
transifex-integration[bot] dd7148ee5d
Updates for project TreeLand (#431)
* [skip CI] Translate treeland.en_US.ts in fi

100% translated source file: 'treeland.en_US.ts'
on 'fi'.

* [skip CI] Translate wallpaper.en_US.ts in fr

100% translated source file: 'wallpaper.en_US.ts'
on 'fr'.

* [skip CI] Translate treeland.en_US.ts in fr

100% translated source file: 'treeland.en_US.ts'
on 'fr'.

* [skip CI] Translate lockscreen.en_US.ts in fr

100% translated source file: 'lockscreen.en_US.ts'
on 'fr'.

* [skip CI] Translate multitaskview.en_US.ts in fi

100% translated source file: 'multitaskview.en_US.ts'
on 'fi'.

* [skip CI] Translate lockscreen.en_US.ts in pt_BR

100% translated source file: 'lockscreen.en_US.ts'
on 'pt_BR'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-07-01 13:17:25 +08:00
Zhang Dingyuan da8cf4ad11 fix: Treeland does not exit when logging out of session
only treeland-session-shutdown.service can be clean TREELAND_RUN_MODE.

treeland-session-shutdown.service need TREELAND_RUN_MODE env, but
environment unset before treeland service stop.

Log:
2025-07-01 13:07:37 +08:00
Zhang Dingyuan b9d8d7a756 fix: cannot use treeland user session mode
LightDM will not store the desktop file name used for startup in DESKTOP_SESSION,
so we need a wrapper to provide new environment for treeland user mode.

Log:
2025-07-01 11:14:48 +08:00
rewine 327ab03444 fix: add [[maybe_unused]] attribute to unused parameters
1. Added [[maybe_unused]] attribute to multiple function parameters
across various modules
2. This resolves compiler warnings about unused variables in Wayland
interface implementations
3. The changes affect DDE shell interfaces, foreign toplevel handling,
personalization manager, output management, and other components
4. Modern C++ compilers can now properly ignore these parameters without
generating unnecessary warnings

fix: 为未使用的参数添加 [[maybe_unused]] 属性

1. 在多个模块的函数参数中添加了 [[maybe_unused]] 属性
2. 这解决了Wayland接口实现中关于未使用变量的编译器警告问题
3. 修改涉及DDE shell接口、外部顶层窗口处理、个性化管理器、输出管理以及其
他组件
4. 现代C++编译器现在可以正确忽略这些参数,而不会生成不必要的警告
2025-06-30 13:42:23 +08:00
rewine fb35b0c890 chore: improvement fixes the translation configuration
This improvement fixes the translation configuration to automatically support multiple languages instead of being limited to Chinese and English only.

Created `cmake/TranslationUtils.cmake` file with two main functions:

- `setup_translations(TARGET_NAME TRANSLATION_PREFIX)`: For plugin and example translation configuration
- `setup_main_translations(TARGET_NAME)`: For main program translation configuration

Uses `file(GLOB ...)` command to automatically discover all available translation files, supporting languages including:

- Afrikaans (af)
- Amharic (am_ET)
- Arabic (ar)
- Asturian (ast)
- Azerbaijani (az)
- Bulgarian (bg)
- Bengali (bn)
- Tibetan (bo)
- Bakhtiari (bqi)
- Breton (br)
- Catalan (ca)
- Kurdish (ckb)
- Czech (cs)
- Danish (da)
- German (de)
- Greek (el)
- English (en_US)
- Spanish (es)
- Persian (fa)
- Finnish (fi)
- French (fr)
- Galician (gl_ES)
- Hebrew (he)
- Hindi (hi_IN)
- Croatian (hr)
- Hungarian (hu)
- Indonesian (id)
- Italian (it)
- Japanese (ja)
- Georgian (ka)
- Kabyle (kab)
- Khmer (km_KH)
- Korean (ko)
- Kurdish (ku)
- Lithuanian (lt)
- Malay (ms)
- Norwegian (nb)
- Nepali (ne)
- Dutch (nl)
- Polish (pl)
- Portuguese (pt)
- Brazilian Portuguese (pt_BR)
- Romanian (ro)
- Russian (ru)
- Sinhala (si)
- Slovak (sk)
- Slovenian (sl)
- Albanian (sq)
- Serbian (sr)
- Swedish (sv)
- Tamil (ta)
- Telugu (te)
- Thai (th)
- Turkish (tr)
- Tamazight (tzm)
- Uyghur (ug)
- Ukrainian (uk)
- Vietnamese (vi)
- Simplified Chinese (zh_CN)
- Traditional Chinese (zh_HK, zh_TW)

- `src/CMakeLists.txt`: Main program translation configuration
- `src/plugins/lockscreen/CMakeLists.txt`: Lock screen plugin translation configuration
- `src/plugins/multitaskview/CMakeLists.txt`: Multitask view plugin translation configuration
- `examples/test_set_treeland_wallpaper/CMakeLists.txt`: Wallpaper setting example translation configuration
- `cmake/TranslationUtils.cmake`: New translation utilities file
2025-06-30 13:40:51 +08:00
rewine 71aa66bff3 feat: add popup surface container for handling popup windows
1. Added ninja build tool to nativeBuildInputs in nix/default.nix to
support faster builds
2. Added popupsurfacecontainer files to CMakeLists.txt for proper
compilation
3. Created new PopupSurfaceContainer class to handle popup surfaces with
mouse event detection
4. Modified WindowMenu.qml to set modal property ensuring proper popup
behavior
5. Updated ShellHandler to use PopupSurfaceContainer instead of generic
SurfaceContainer

The changes implement a specialized container for handling
popup surfaces with proper event handling and closure logic. The
PopupSurfaceContainer class provides specific functionality for managing
popup windows, including detecting mouse press events outside popup
areas and closing popups accordingly. This improves the user experience
by ensuring popups are properly dismissed when users interact outside
their boundaries.
2025-06-26 17:55:08 +08:00
transifex-integration[bot] 267bb639ad
Updates for project TreeLand (#427)
* [skip CI] Translate treeland.en_US.ts in af

10% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'af'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in th

20% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'th'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in te

20% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'te'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ku

20% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ku'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in nb

10% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'nb'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in uk [Manual Sync]

100% translated source file: 'treeland.en_US.ts'
on 'uk'.

* [skip CI] Translate wallpaper.en_US.ts in uk [Manual Sync]

66% of minimum 1% translated source file: 'wallpaper.en_US.ts'
on 'uk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in uk [Manual Sync]

100% translated source file: 'multitaskview.en_US.ts'
on 'uk'.

* [skip CI] Translate multitaskview.en_US.ts in ja

100% translated source file: 'multitaskview.en_US.ts'
on 'ja'.

* [skip CI] Translate treeland.en_US.ts in ja

100% translated source file: 'treeland.en_US.ts'
on 'ja'.

* [skip CI] Translate wallpaper.en_US.ts in ja

100% translated source file: 'wallpaper.en_US.ts'
on 'ja'.

* [skip CI] Translate lockscreen.en_US.ts in ja

100% translated source file: 'lockscreen.en_US.ts'
on 'ja'.

* [skip CI] Translate multitaskview.en_US.ts in ca

100% translated source file: 'multitaskview.en_US.ts'
on 'ca'.

* [skip CI] Translate wallpaper.en_US.ts in ca

100% translated source file: 'wallpaper.en_US.ts'
on 'ca'.

* [skip CI] Translate wallpaper.en_US.ts in uk

100% translated source file: 'wallpaper.en_US.ts'
on 'uk'.

* [skip CI] Translate lockscreen.en_US.ts in uk

59% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'uk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate wallpaper.en_US.ts in pt_BR

100% translated source file: 'wallpaper.en_US.ts'
on 'pt_BR'.

* [skip CI] Translate wallpaper.en_US.ts in es

100% translated source file: 'wallpaper.en_US.ts'
on 'es'.

* [skip CI] Translate treeland.en_US.ts in es

100% translated source file: 'treeland.en_US.ts'
on 'es'.

* [skip CI] Translate multitaskview.en_US.ts in es

100% translated source file: 'multitaskview.en_US.ts'
on 'es'.

* [skip CI] Translate lockscreen.en_US.ts in pt_BR

95% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ca

100% translated source file: 'treeland.en_US.ts'
on 'ca'.

* [skip CI] Translate multitaskview.en_US.ts in pt_BR

100% translated source file: 'multitaskview.en_US.ts'
on 'pt_BR'.

* [skip CI] Translate lockscreen.en_US.ts in ca

100% translated source file: 'lockscreen.en_US.ts'
on 'ca'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-06-26 16:32:01 +08:00
transifex-integration[bot] ad74f7ad57
[skip CI] Updates for project TreeLand (#425)
* [skip CI] Translate treeland.en_US.ts in ja

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ja'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ko

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ko'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in cs

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'cs'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in it

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in sr

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'sr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in hu

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'hu'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in zh_TW

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'zh_TW'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ro

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ro'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in fi

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'fi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate wallpaper.en_US.ts in zh_CN

83% of minimum 10% translated source file: 'wallpaper.en_US.ts'
on 'zh_CN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ms

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ms'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in uk

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'uk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in sv

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'sv'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ar

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ar'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in fr

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in es

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in he

60% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'he'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in hi_IN

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'hi_IN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in pl

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'pl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in az

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'az'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ka

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ka'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in gl_ES

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'gl_ES'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in am_ET

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'am_ET'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in bg

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'bg'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in zh_CN

100% translated source file: 'multitaskview.en_US.ts'
on 'zh_CN'.

* [skip CI] Translate multitaskview.en_US.ts in ms

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ms'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in bg

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'bg'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ta

40% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ta'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in de

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'de'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in zh_HK

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'zh_HK'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in am_ET

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'am_ET'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ne

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ne'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in cs

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'cs'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in si

10% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'si'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in sk

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'sk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in km_KH

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'km_KH'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in sq

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'sq'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ru

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ru'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in fi

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'fi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in tr

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'tr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in lt

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'lt'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in id

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'id'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in de

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'de'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in zh_CN

27% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_CN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in tzm

30% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'tzm'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in el

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'el'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ka

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ka'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in nl

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'nl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in zh_TW

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'zh_TW'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ast

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ast'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in br

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'br'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in el

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'el'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ca

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ca'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in sq

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'sq'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in hi_IN

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'hi_IN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in kab

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'kab'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in bo

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'bo'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in sl

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'sl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in pt_BR

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in it

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in bqi

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'bqi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ro

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ro'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in zh_HK

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'zh_HK'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in hr

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'hr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in uk

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'uk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in sk

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'sk'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in fa

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'fa'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in vi

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'vi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in da

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'da'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in id

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'id'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ja

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ja'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ca

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ca'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in zh_CN

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'zh_CN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in gl_ES

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'gl_ES'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ug

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ug'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in sl

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'sl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in bo

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'bo'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in sr

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'sr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in hr

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'hr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ar

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ar'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in da

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'da'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in bqi

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'bqi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in fr

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in pt

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'pt'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in pt

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'pt'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in hu

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'hu'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in pl

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'pl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in az

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'az'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ast

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ast'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ckb

20% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ckb'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in tr

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'tr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in bn

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'bn'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in nl

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'nl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in ug

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'ug'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in pt_BR

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in ru

50% of minimum 10% translated source file: 'multitaskview.en_US.ts'
on 'ru'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in es

80% of minimum 10% translated source file: 'treeland.en_US.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate treeland.en_US.ts in zh_CN

100% translated source file: 'treeland.en_US.ts'
on 'zh_CN'.

* [skip CI] Translate multitaskview.en_US.ts in zh_HK

100% translated source file: 'multitaskview.en_US.ts'
on 'zh_HK'.

* [skip CI] Translate treeland.en_US.ts in zh_TW

100% translated source file: 'treeland.en_US.ts'
on 'zh_TW'.

* [skip CI] Translate lockscreen.en_US.ts in zh_TW

27% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_TW'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate multitaskview.en_US.ts in zh_TW

100% translated source file: 'multitaskview.en_US.ts'
on 'zh_TW'.

* [skip CI] Translate treeland.en_US.ts in zh_HK

100% translated source file: 'treeland.en_US.ts'
on 'zh_HK'.

* [skip CI] Translate lockscreen.en_US.ts in zh_HK

27% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_HK'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate wallpaper.en_US.ts in zh_CN

100% translated source file: 'wallpaper.en_US.ts'
on 'zh_CN'.

* [skip CI] Translate lockscreen.en_US.ts in zh_TW

63% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_TW'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in zh_HK

63% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_HK'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip CI] Translate lockscreen.en_US.ts in zh_CN

63% of minimum 10% translated source file: 'lockscreen.en_US.ts'
on 'zh_CN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: rewine <luhongxu@deepin.org>
2025-06-24 15:12:46 +08:00
rewine 1570936d55 chore: configure translation files and update Chinese translations
1. Add .tx/config file to set up Transifex translation management with
multiple resource configurations for different components
2. Update Simplified Chinese translations in wallpaper plugin by
removing 'type="unfinished"' from several entries
3. Update Simplified Chinese translations in lockscreen plugin by
removing 'type="unfinished"' from multiple translation tags

These changes improve translation management workflow through proper
Transifex configuration and ensure the Chinese translations are marked
as completed rather than unfinished.

chore: 配置翻译文件并更新中文翻译

1. 添加 .tx/config 文件,配置多个组件的 Transifex 翻译资源管理
2. 在壁纸插件中更新简体中文翻译,移除多个条目中的 'type="unfinished"'
3. 在锁屏插件中更新简体中文翻译,移除多个标签中的 'type="unfinished"'

这些更改通过正确的 Transifex 配置改进了翻译管理工作流程,并确保中文翻译
标记为已完成状态而非未完成状态。
2025-06-24 14:43:20 +08:00
rewine 7a12c9ad62 chore: configure transifex translation files
1. Create configuration for Transifex localization workflow
2. Add four translation file filters for different modules:
   - Main treeland translations
   - Lockscreen plugin translations
   - Multitaskview plugin translations
   - Wallpaper example translations
3. Set up QT file format with proper source and target paths
4. Configure PR branch naming pattern for automated updates

chore: 配置 Transifex 翻译文件

1. 创建 Transifex 本地化工作流配置
2. 添加四个翻译文件过滤器,分别对应不同模块:
   - 主程序 treeland 的翻译
   - 锁屏插件 lockscreen 的翻译
   - 多任务视图插件 multitaskview 的翻译
   - 壁纸示例 wallpaper 的翻译
3. 设置 QT 文件格式及对应的源文件和目标路径
4. 配置用于自动化更新的 PR 分支命名规则
2025-06-24 13:36:37 +08:00
YaoBing Xiao 7acf621712 feat: adapt to wlroots-0.19
update waylib submodule
2025-06-23 14:28:13 +08:00
renovate[bot] 28ca983e8d chore(deps): lock file maintenance 2025-06-23 13:23:55 +08:00
renovate[bot] b8b0dc8b9f chore(config): migrate config renovate.json 2025-06-23 13:22:14 +08:00
Lu Hongxu 76f9538656 fix: various compiler warnings
- Adjust member initialization order in `DDEShellSurfaceInterfacePrivate`
- Use `static_cast<size_t>` for type-safe assertion in `CaptureSource::copyBuffer`
- Reorder member variables in `treelandconfig.h` to match initialization order
- Remove unused static functions and redundant friend declarations
2025-06-20 09:53:45 +08:00
rewine e6447c783e refactor: remove jemalloc dependency
1. Removed jemalloc from the build dependencies in debian/control
2. Eliminated jemalloc reference in nix/default.nix
3. Deleted pkg_check_modules(JEMALLOC) call in src/CMakeLists.txt
4. Removed PkgConfig::JEMALLOC from target_link_libraries in src/
CMakeLists.txt
5. This change simplifies the build process and reduces external
dependencies

重构:移除jemalloc依赖

1. 从debian/control中删除jemalloc的构建依赖
2. 在nix/default.nix中消除对jemalloc的引用
3. 删除src/CMakeLists.txt中的pkg_check_modules(JEMALLOC)调用
4. 从src/CMakeLists.txt的target_link_libraries中移除PkgConfig::JEMALLOC
5. 此更改简化了构建过程并减少了外部依赖项
2025-06-18 13:39:00 +08:00
renovate[bot] 9bfa75519e chore(deps): lock file maintenance 2025-05-28 14:20:31 +08:00
renovate[bot] c31cda69cb chore(deps): update waylib digest to 12ff83a 2025-05-28 14:19:48 +08:00
rewine 33071245ea chore(debian): update version to 0.5.21
Log: update version
2025-04-17 15:24:44 +08:00
zhaoyingzhen 644bfacb5d fix: inputted password and capsIndicator button are covered
as title

Log: as title
Pms: bug-295213
2025-04-01 20:23:04 +08:00
rewine b01ae031cb chore(debian): bump version to 0.5.20
Log: bump version to 0.5.17
2025-03-10 18:56:25 +08:00
rewine 755c412ca9 fix: activeColor not saved to dconfig
Log: activeColor not save
2025-03-10 11:42:08 +08:00
JiDe Zhang e2cdab9846 feat: supports enable debug menu bar view on runtime
Add shortcut Ctrl+Shift+Meta+F11 to toggle the debug view.
If you wnat to disable the shortcut, please with --disable-debug-view to
start treeland.
2025-02-26 18:22:10 +08:00
rewine 343a962b80 fix: send error output enter for layer shell
Log: The layer surface must appear on a specific screen. This should be handled in OutputLayerSurfaceContainer and not by RootSurfaceContainer. It is unreasonable to calculate the screen based on the position when the layer surface is not fully initialized.
2025-02-26 17:59:48 +08:00
rewine 34a855f3a7 chore: move all QSettings config to AppConfigLocation
close: https://github.com/linuxdeepin/treeland/issues/383
2025-02-26 10:33:25 +08:00
rewine d52b29e50b chore: remove dependabot and only use renovate
Log: only need renovate
2025-02-26 10:20:29 +08:00
renovate[bot] 297276e940 chore(deps): lock file maintenance 2025-02-20 19:27:46 +08:00
renovate[bot] 8b4698b9fa chore(deps): update waylib digest to 130abe2 2025-02-20 19:27:28 +08:00
rewine 8203289eeb chore: input popup should not use radius
log: enforcing rounded corners is ugly without client cooperation
2025-02-20 16:04:37 +08:00
rewine abcfd99664 chore(debian): bump version to 0.5.19
Log: new release
2025-02-20 15:41:25 +08:00
rewine dbcff753c0 fix: can't load plugin in debug build
Log: ddm is started as user dde and cannot access other users' home directories
Fix: https://github.com/linuxdeepin/treeland/issues/388
2025-02-19 13:31:17 +08:00
rewine ed527f0594 feat: support idlenotify idleinhibit and outputpowermanagement
Log: protocols used for idle behavior such as screen blanking, locking, and screensaving
2025-02-18 19:20:40 +08:00
renovate[bot] 5e65502002 chore(deps): lock file maintenance 2025-02-18 19:19:18 +08:00
renovate[bot] 2952b2f8f8 chore(deps): update waylib digest to 0871453 2025-02-18 19:18:58 +08:00
rewine c66f8dce5d fix: layer shell's popup not enter popup container
Log: When the parent of the container is different, the z-axis cannot be compared and you need to look up to find the common ancestor
2025-02-17 11:47:27 +08:00
rewine 6696bdc9dd fix: can't set output's postion
Log: OutputViewport are anchor to it's parent, should setX/Y for it's
parent
2025-02-14 17:34:15 +08:00
rewine 3fc260703e chore(debian): bump version to 0.5.18
Log: new release
2025-02-14 15:06:01 +08:00
dependabot[bot] 30b59ff4eb chore(deps): bump waylib from `6cd803b` to `5c4844f`
Bumps [waylib](https://github.com/vioken/waylib) from `6cd803b` to `5c4844f`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](6cd803bd54...5c4844fa72)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 14:48:59 +08:00
rewine 2239ab4d65 feat: cache outputs settings
Log: Record screen configuration information and restore the configuration at next startup
2025-02-14 14:42:52 +08:00
JiDe Zhang b889f1441d fix: can't start on VirtualBox
This is a workaround.
On the VirtualBox no 3D accelerate, eglInitialize will crash.

Depends https://github.com/vioken/waylib/pull/615
2025-02-12 09:33:47 +08:00
rewine 2593f214d0 chore: update nix package
log: fix nix build
2025-02-11 17:53:49 +08:00
rewine a1b7ca0fdf chore: clear up cmake
Log: only support qt >= 6.8
2025-02-10 13:17:32 +08:00
rewine 5c43c7a8b1 chore: add missing license
Log: fix reuse check
2025-02-10 05:16:07 +00:00
rewine da52accec9 fix: the tooltip text may disappear unexpectedly
Log: shouldn't set elide for tooltip, and I forgot why I didn't use AlignHCenter before, but now it works fine
Only update the transparency of tooltipText/titleIconText, no longer modify visible, to prevent both from being invisible when the state is wrong
2025-01-22 15:36:56 +08:00
groveer bb269282b0 chore(debian): bump version to 0.5.17
release 0.5.17

Log: bump version to 0.5.17
2025-01-15 11:14:19 +08:00
JiDe Zhang cbfa5af6ee Fix missing treeland's translations 2025-01-15 10:59:07 +08:00
rewine 25c9bf5ebf fix: nix ci for build 2025-01-14 20:03:41 +08:00
zhangkun d140a8a6e7 chore: bump version to 0.5.16
release 0.5.16

Log: bump version to 0.5.16
2025-01-14 16:28:07 +08:00
YeShanShan d859d3336d fix: crashed at accessing surface
add check.
2025-01-14 16:05:37 +08:00
JiDe Zhang 81ae0adf19 Fix crash at QStyleHints
This bug is from 76c3d88e84.
The waylib no a valid QStyleHints now.
2025-01-14 15:42:57 +08:00
zhangkun 7b73b9bf52 chore: bump version to 0.5.15
release 0.5.15

Log: bump version to 0.5.15
2025-01-14 13:21:13 +08:00
JiDe Zhang 76c3d88e84 Fix cursor not flash on login passwd edit 2025-01-14 13:19:42 +08:00
zhangkun 62cd9d8e7c chore: update default window corner size
The default value is 12

pms: BUG-286881
2025-01-14 13:00:34 +08:00
JiDe Zhang 8531d6d765 Fix treeland shortcut not restart after treeland crash 2025-01-14 12:58:50 +08:00
JiDe Zhang 9512cb36a0 chore(debian): bump version to 0.5.14 2025-01-13 18:15:41 +08:00
JiDe Zhang 6a7e3389f3 Add a background color for DockPreview 2025-01-13 17:32:24 +08:00
JiDe Zhang 4ab5a96bf8 Fix crash at PersonalizationAttached::noTitlebar
Fixes: #635
2025-01-13 17:29:11 +08:00
JiDe Zhang 598067c3b6 chore(debian): bump version to 0.5.13 2025-01-13 11:09:18 +08:00
JiDe Zhang 34681ba758 Ignore window rounded radius when maximized 2025-01-13 10:56:45 +08:00
JiDe Zhang afe7aa6125 Fix typo 2025-01-13 10:20:47 +08:00
rewine c9451e58fd fix: popup of screen recorder is below it's parent
The z-index of the surface for deepin-screen-recorder is higher than that of ordinary popups, so special handling is required for the popups of such applications
2025-01-13 09:52:41 +08:00
JiDe Zhang 48c2d27142 Add TREELAND_SESSION_ENVIRONMENTS env
Use this env, the OS can export some envs only to the treeland session.
2025-01-10 18:40:05 +08:00
Zhang Dingyuan ae349f6fce feat: add ctrl-alt-del shortcut key
maybe should use shortcut protocol in dde

Log:
2025-01-10 17:47:16 +08:00
groveer dda79312dc chore(debian): bump version to 0.5.12 2025-01-08 11:26:28 +08:00
JiDe Zhang 7a582df640 Update waylib 2025-01-08 11:16:10 +08:00
JiDe Zhang 6fecadb9ea Fix maybe freeze when display DockPreview
See https://bugreports.qt.io/browse/QTBUG-132588.

Fixes: bug-view-291567
2025-01-08 11:16:10 +08:00
zhangkun 0e84ace6f6 feat: update default values
- Add system default wallpaper.
- Modify the default values of some dconfig

pms: BUG-297641
2025-01-06 17:02:51 +08:00
YeShanShan 0c3c9e8db7 fix: adjust UI for greeter
Adjust button's sequence of Power.
Fix Icon's color not following changes  by replacing DciIcon.
Adjust color of windowText, maybe it should adjust by window's themeType.

pms: BUG-291189
2025-01-02 14:37:28 +08:00
groveer be493066db chore(debian): bump version to 0.5.11 2024-12-25 18:49:04 +08:00
YeShanShan 873acac238 fix: logout can't work for greeter
Add permission  for dde when call login1's Terminate by polkit-1 rules.
Ingore multiple seat.

pms: BUG-291189
2024-12-25 18:43:51 +08:00
Yixue Wang 60bd51a703 chore: mark uncreatable
Mark Workspace and WorkspaceModel as uncreatable to suppress warnings.
2024-12-25 18:42:36 +08:00
Yixue Wang 67546da22e fix: easing curve not correct for multitaskview
Adjust to Easing.OutExpo.
2024-12-25 18:42:09 +08:00
Lu YaNing 6f297d1182 fix: Adjust menu positioning
Ensure correct positioning of primary and secondary menus.
2024-12-25 18:41:41 +08:00
Lu YaNing 04c450e925 refactor: optimize popup window positioning
Split popup handling for LayerShell and regular windows.
Fix edge positioning issues.
Optimize multi-screen support for regular windows.
2024-12-25 09:33:03 +08:00
groveer 0d21c93100 fix: should not maximize when client set maxsize
Log:
2024-12-25 09:32:39 +08:00
groveer 451a03b1f5 fix: some x11 window not scale
Log:
2024-12-24 18:53:22 +08:00
YeShanShan 271be4c503 fix: adjust UI for greeter
Adjust font and color of  password input.
Add blur, and using Treeland's Blur for RoundBlur.
Refact ControlAction's Item, and fix Power's state of expand.
Add isLocked to distinguish between
greeter and lockscreen.

pms: BUG-297083 BUG-297027 BUG-297015 BUG-297009 BUG-296977
2024-12-24 18:53:00 +08:00
groveer 1d0cb7297e fix: not use jemalloc in debian package
Log:
2024-12-24 13:14:43 +08:00
groveer 1a928414f8 fix: shadow not show in NewAnimation
Log:
2024-12-23 19:14:32 +08:00
groveer 5e9ccc85f3 fix(example): do't set overlay always
Log:
2024-12-23 19:13:43 +08:00
Lu YaNing a061c13a9b fix: layer-shell windows do not require decorators 2024-12-23 14:18:18 +08:00
groveer 3de45c690c chore(debian): bump version to 0.5.10 2024-12-20 16:54:27 +08:00
groveer 403c178e34 chore(debian): use jemalloc
Log:
2024-12-20 16:54:12 +08:00
Zhang Dingyuan 1959d3b98e chore: move treeland to system service
This modification has multiple benefits. DM and the synthesizer will
become two independent parts. If one of them crashes, it will not cause
a large-scale component crash.

DM should also delegate the user's session to systemd for management in
the future, so that if any of the three parts crash, they can rely on
crash recovery to restart.

By the way, DDE users will not have sessions, so the pulseaudio service
will not be started in advance on deepin, and the file permissions of
/dev/dri/renderD128 are set by logind using acl when activating the
session. Now that dde is not a logged-in session, the activation
relationship between normal users will be correct, and I hope that the
sudden panic rhi rendering crash can be solved.

Log:
2024-12-20 15:06:21 +08:00
groveer 4f86d23a44 fix: adapte wine program
depend: https://github.com/vioken/waylib/pull/601

Log:
2024-12-20 11:39:33 +08:00
rewine 5869fa5fdd fix: better skip dock for x11 2024-12-19 16:53:22 +08:00
Yixue Wang 14a9d24093 fix: capture layer z order not specified
Specify capture layer z order when creating.
2024-12-19 16:35:20 +08:00
Yixue Wang 982f57c496 feat: use wwrappointer from waylib
Port WrapPointer back to waylib.
2024-12-19 16:34:38 +08:00
rewine 1fc366fe18 feat: only allow `Overlay` layer surface get focus when it set 'OnDemand' mode 2024-12-19 16:14:52 +08:00
Yixue Wang 43c4ce7350 fix: capture mask regarded deleted in qml
Should reparent capture mask surface wrapper before destructor. Its
QQmlData is marked as isQueuedForDeletion before destructor of
CaptureSourceSelector is invoked.
2024-12-18 18:04:23 +08:00
groveer 42893c681c chore(debian): bump version to 0.5.9 2024-12-18 11:06:55 +08:00
groveer ca30d9dc6a feat: add ai shortcuts
Log:
2024-12-17 20:41:13 +08:00
groveer 9ead704e4e fix: notification not toggle
Log:
2024-12-17 19:37:24 +08:00
YeShanShan f37b6a0e1e fix: lock lockscreen when session locked
Only show LockScreen for primary output.
Add logout function.
adjust lockscreen UI
Lock lockscreen when session locked.
Lock lockscreen when clicking some PowerAction.

pms: BUG-291189 BUG-291179
2024-12-17 19:14:27 +08:00
zhangkun c80f32c053 chore: update default value of titlebar height
set the default value to 40

pms: BUG-289525
2024-12-17 19:11:13 +08:00
rewine 77b8c44bbf fix: don't send info to dock if set skipDockPreView
log: Implement the interface required by the dde-shell protocol
2024-12-16 17:34:30 +08:00
groveer 775fd7d08d feat: add atoms for xwayland
depend: https://github.com/vioken/waylib/pull/597

remove: https://github.com/deepin-community/wlroots/pull/17

Log:
2024-12-16 17:30:35 +08:00
Lu YaNing 49403748da fix: Use maybe_unused instead of Q_UNUSED 2024-12-16 17:30:19 +08:00
Zhang Dingyuan 3da6a550d4 chore: move some environment to dde-session
only dde-session can set

Log:
2024-12-16 17:29:59 +08:00
Lu YaNing cc0d72ddf2 fix: Repeated destruction leads to crash 2024-12-16 16:58:39 +08:00
Zhang Dingyuan 3969098e11 chore: update waylib submodule
update wayulib submodule

Log:
2024-12-16 10:21:07 +08:00
Zhang Dingyuan d773c6835d fix: wrong qml import path
missing qt

Log:
2024-12-16 10:21:07 +08:00
Zhang Dingyuan 502f96c9b2 fix: cursor is valid type
use Q_MOC_INCLUDE

Log:
2024-12-16 10:21:07 +08:00
Zhang Dingyuan 40ff8988c4 fix: debian missing qml files install
missing treeland.install

Log:
2024-12-14 14:39:00 +08:00
Zhang Dingyuan 4bae4b77a3 refactor: split directory
as title

Log:
2024-12-14 14:25:48 +08:00
rewine 41cba6fa19 fix: crash in disconnect connections in foreign-toplevel 2024-12-14 14:11:59 +08:00
groveer 07dddd00da chore(debian): bump version to 0.5.8
Log:
2024-12-13 15:57:19 +08:00
Zhang Dingyuan 20d3b9d622 fix: not send surface appid changed
fix typo

Log:
2024-12-13 15:56:59 +08:00
Zhang Dingyuan 8a1f8cab29 chore: not support user nopassword login
remove hide password field visibility

Log:
2024-12-13 11:14:20 +08:00
Lu YaNing 2f4ba1e43e fix: Unplug the screen without changing the window state 2024-12-12 19:45:40 +08:00
groveer 8a265ae106 refactor: mv treeland-wallpaper to examples
Log:
2024-12-12 17:42:16 +08:00
rewine 5eeac930e8 fix: crash when forceActivateSurface nullptr 2024-12-12 15:49:17 +08:00
rewine 60aa721c33 fix: maximized surface not resize after exclusive zone changed 2024-12-12 13:53:55 +08:00
groveer 0ef0090789 fix(output): set yoffset when surface resize
Log:
2024-12-12 13:50:56 +08:00
Lu YaNing fc127cc30c fix: Avoid layshell not receiving ouput updates 2024-12-12 13:50:46 +08:00
Zhang Dingyuan fbf4f9caf3 chore: update submodule
update waylib submodule

Log:
2024-12-11 16:28:53 +08:00
rewine 862ea089da feat: add readme for treeland 2024-12-11 11:09:32 +08:00
Yixue Wang 9c0eddaa57 fix: window selection grid not centered
Should consider horizontal margin in curX.
2024-12-10 21:04:00 +08:00
Yixue Wang 58dd1ce193 fix: multitaskview not scaled correctly
Should scale all metrics.
2024-12-10 21:04:00 +08:00
Lu YaNing 3c53f56856 fix: dde-shell scale is incorrect 2024-12-10 20:43:55 +08:00
Yixue Wang 7071c46609 fix: test capture crash
Do not destroy capture manager after application destroys.
2024-12-10 20:15:18 +08:00
groveer 27a42912a4 chore(debian): bump version to 0.5.7 2024-12-10 20:11:38 +08:00
Yixue Wang c18298788a feat: supports user cancel and block shortcuts
* Supports user cancel by pressing ESC;
* Blocks all system shortcuts and application shortcuts.
2024-12-10 18:30:20 +08:00
pengwenhao a1bfb1e54f fix: lock screen prompts from right angle to round corner
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-12-10 17:49:54 +08:00
Yixue Wang 241c8c50fe feat: exit item selection mode after first click
Exit item selection mode after first click.
2024-12-10 15:04:22 +08:00
Yixue Wang 1c7e4d0667 fix: double resource destroy
When exit normally, capture manager resource might destroy twice.
Remove client resource when destructor is invoked.
2024-12-10 15:04:22 +08:00
Yixue Wang adb0bbfc29 fix: monitor mask surface
Use wrappointer to monitor mask surface.
2024-12-10 15:04:22 +08:00
Yixue Wang f31901124a fix: initialization of nullptr
Add nullptr_t specialization. Mark noexcept constructors.
2024-12-10 15:04:22 +08:00
Yixue Wang 99a2f62dfe fix: xwayland surface not in multitaskview
When run in user dde, XWayland surface's uid is not current user
uid.
2024-12-10 11:09:35 +08:00
rewine 8502f2a259 fix: build error in pr 564 2024-12-09 20:58:23 +08:00
rewine d46707c77d chore: suppress some compile and runtime warnings 2024-12-09 16:29:40 +08:00
YaoBing Xiao 2e97483845 fix treeland crash
add disconnec on removeSurface
2024-12-09 13:06:57 +08:00
pengwenhao 1861662084 feat: sort the task switcher according to active order
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-12-09 11:35:38 +08:00
YaoBing Xiao 63f8a59a62 fix xwindow NoTitleBar&NoDecoration handle error 2024-12-09 11:22:18 +08:00
rewine da49daebfd chore: update nix flake 2024-12-09 11:21:26 +08:00
rewine 3d0c81a969 chore: remove yellow placeholder for icon 2024-12-09 11:21:26 +08:00
Zhang Dingyuan 7dd988006b fix: new window will show on lockscreen
update check

Log:
2024-12-07 17:23:58 +08:00
Zhang Dingyuan 121e740707 fix: treeland-wayland-session package is empty
not install treeland-user.desktop file

Log:
2024-12-07 11:12:14 +08:00
rewine 27b46ad4af chore(debian): bump version to 0.5.6 2024-12-06 17:08:59 +08:00
groveer 98406e0cab fix(socket): add dbus env
Log:
2024-12-06 16:53:30 +08:00
Zhang Dingyuan ae7d91bf44 fix: surface wrapper memary leak
The show animation has not ended yet and the window has been destroyed.

Log:
2024-12-06 16:52:02 +08:00
Zhang Dingyuan 1fa1af45f9 chore: layer surface need manual request for no titlebar mode
as title

Log:
2024-12-06 16:52:02 +08:00
lbwtw 8352ef463d add acceptKeyboardFocus control 2024-12-06 16:49:42 +08:00
rewine 1913bcd2f7 fix: dde shell can't minimize application due to lose active 2024-12-06 14:58:24 +08:00
groveer d8e7b58e51 chore(debian): bump version to 0.5.5 2024-12-06 09:40:04 +08:00
dependabot[bot] c16720c879 chore(deps): bump waylib from `24d7fec` to `b3e13b4`
Bumps [waylib](https://github.com/vioken/waylib) from `24d7fec` to `b3e13b4`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](24d7fec74d...b3e13b4694)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 09:39:46 +08:00
rewine fb169e8923 fix: refactor popup focus handling 2024-12-06 09:39:32 +08:00
pengwenhao 13f58d6eaa fix: reduce continue switch speed
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-12-06 09:37:50 +08:00
rewine fe011a32fb fix: focus fallback never considered RemoveWorkspaceModel 2024-12-05 17:10:13 +08:00
Zhang Dingyuan 0f2d82efa6 chore: update dconfig visibility
some keys change to public

Log:
2024-12-05 17:09:48 +08:00
Zhang Dingyuan d44e64d23e chore: move some settings to treelandconfig
move appearance window radius and icontheme to treelandconfig

Log:
2024-12-05 15:44:09 +08:00
dependabot[bot] 19819e4382 chore(deps): bump waylib from `4f991ae` to `24d7fec`
Bumps [waylib](https://github.com/vioken/waylib) from `4f991ae` to `24d7fec`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](4f991ae0a1...24d7fec74d)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 13:33:38 +08:00
rewine a0978fedd5 fix: more clear up in markWrapperToRemoved 2024-12-05 13:33:22 +08:00
rewine fe1f3dc2fe fix: never set surface state when wrapperAbortToRemove 2024-12-05 13:33:22 +08:00
Zhang Dingyuan bed4a2ed9a fix: notitlebar window not show border
notitlebar window is a special type that expects to use the shadows,
borders and rounded corners provided by the compositor, but does not
want the SSD titlebar.

Log:
2024-12-05 13:28:04 +08:00
rewine a9af62b64d fix: use reposition is to early to arrangePopupSurface 2024-12-05 13:25:55 +08:00
pengwenhao a3bce282aa fix: blur effect exceeds listview width
- usage alt + ~

Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-12-04 17:27:47 +08:00
groveer 2778c09db0 fix: error env for `treeland -r`
Log:
2024-12-04 17:14:52 +08:00
Zhang Dingyuan 93dcc2abac fix: remove window radius limit
Appropriate rounded corners should be calculated when the window changes

Log:
2024-12-04 17:14:43 +08:00
Zhang Dingyuan 95bd69cbfa fix: wrong current user
UserModel will auto select current user on init

Log:
2024-12-04 16:14:46 +08:00
Zhang Dingyuan 6ae7ac8fe2 chore: set popup window radius to 8
TODO: move to dconfig

Log:
2024-12-04 16:14:46 +08:00
pengwenhao 2ad9016393 fix: drag listview beyond the boundary
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-12-04 11:48:12 +08:00
rewine 58d0108ab9 fix: should give keyboardfocus to parent when a popup reuqest 2024-12-04 10:36:35 +08:00
groveer f67b37a3ea fix(switchview): no radius for SurfaceProxy
Log:
2024-12-04 10:02:49 +08:00
dependabot[bot] 2ac6c455e6 chore(deps): bump waylib from `d25fa01` to `4f991ae`
Bumps [waylib](https://github.com/vioken/waylib) from `d25fa01` to `4f991ae`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](d25fa01f06...4f991ae0a1)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-03 19:55:03 +08:00
rewine f2aac76923 fix: input popup should't consider titlebarGeometry 2024-12-03 19:54:51 +08:00
lbwtw 9d60da86ca fix muti WXWayland object 2024-12-03 19:53:13 +08:00
groveer a6aa834f70 fix warning
Log:
2024-12-03 19:52:24 +08:00
Zhang Dingyuan 3733085f8e chore: split treeland user session entry
add treeland-wayland-session package

Log:
2024-12-03 19:22:23 +08:00
Lu YaNing 955a14ff94 fix: Other workspace activation windows crash 2024-12-03 16:15:57 +08:00
Zhang Dingyuan 287caef73e refactor: wallpaper
remove useless image provider, because animateimage component doesn't
support it.

fix multi screen will wrong remove other wallpaper

Log:
2024-12-03 13:31:55 +08:00
Yixue Wang a0648ae388 fix: wallpaper not scaled
ShapePath fillItem will use original textureProvider that is not scaled
by ShaderEffectSource. Do the scale transform on fillTransform.
2024-12-03 13:30:03 +08:00
pengwenhao bc70d2cb95 fix: auto displayed window are show and the hidden 2024-12-03 10:22:55 +08:00
Yixue Wang 8888d3f9a1 fix: animation clipped
Multitaskview should be in initial state when created. Otherwise
it do not receive a state change when first to taskview.
2024-12-03 10:22:27 +08:00
justforlxz 33aad59b94 refactor: window blur
Merge into surface content for centralized post-processing

Log:
2024-12-03 09:37:32 +08:00
Yixue Wang 176e66ae77 fix: nullptr wrap data
WrapData is only constructed for non-null ptr. By the way, connection
is not connected to the life scope of wrapdata. Invalidate WrapData
on destructed.
2024-12-03 09:23:15 +08:00
lbwtw 197480b610 fix: incorrect activation causing xwindow stack error 2024-12-02 21:02:47 +08:00
Yixue Wang 388659e02b fix: invisible windows appear in quick selection
Do not quick select invisible items.
2024-12-02 20:31:32 +08:00
Yixue Wang 1ad54e3103 fix: scale not considered in capture
Apply scale in cropRect.
2024-12-02 20:25:31 +08:00
Lu YaNing f5ea81a00e fix: Pulling out the screen does not exit the multitasking view 2024-12-02 20:23:40 +08:00
Lu YaNing 1709b7589e fix: Screen plug-in window does not move 2024-12-02 20:08:15 +08:00
Yixue Wang f69a543fab fix: duplicate data_control_manager
Remove duplicate data_control_manager.
2024-12-02 17:59:55 +08:00
rewine 08ee59a8c6 fix: ignore xdg popup reposition when size is empty 2024-12-02 17:59:22 +08:00
lbwtw 3016532eaa support _DEEPIN_NO_TITLEBAR for x11 app
-link commit: 991af1c5d6
2024-12-02 16:17:51 +08:00
rewine 7eb44f1740 feat: support reposition for xdg popup surface 2024-12-02 16:14:50 +08:00
dependabot[bot] 5132d249ca chore(deps): bump waylib from `9531265` to `d25fa01`
Bumps [waylib](https://github.com/vioken/waylib) from `9531265` to `d25fa01`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](9531265bf5...d25fa01f06)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 14:35:48 +08:00
Yixue Wang a944b6218c fix: layout metrics not scaled
Scale layout metrics according to devicePixelRatio.
2024-12-02 14:32:42 +08:00
Yixue Wang dbe2008be0 optimization: save one layer
Directly apply shape path to wallpaper and workspace proxy separately.
2024-12-02 14:31:38 +08:00
Yixue Wang b452d26b82 feat: add smart pointer wrappointer
WrapPointer is a smart pointer for WrapObject. It will become null
automatically when wrap object becomes invalid. Note that WrapObject
should provide a signal called aboutToBeInvalidated.
2024-12-02 14:25:37 +08:00
Yixue Wang f5dbd46833 fix: use deleteLater to be thread safe
Use deleteLater instead of delete it directly.
2024-12-02 14:25:37 +08:00
lbwtw b262080f4a fix treeland crash due to wl_client_destroy 2024-12-02 09:24:19 +08:00
groveer 425d6b2b72 chore(debian): bump version to 0.5.4
Log:
2024-11-30 15:54:50 +08:00
groveer 8b1ab283bc fix: xwayland surface scale
dep: https://github.com/vioken/waylib/pull/566

Log:
2024-11-30 15:52:23 +08:00
Lu YaNing ab79e229d6 fix: Window displays problem when switching workspace
After setting the show desktop, switching the workspace should exit
the show desktop mode and restore the real state of the window.
2024-11-30 15:19:44 +08:00
rewine 6d8b402df3 fix: should allow xdg popup get keyboard focus 2024-11-30 15:19:29 +08:00
Yixue Wang 019a403638 fix: display appid
Do not display appid on window selection grid.
2024-11-30 14:35:19 +08:00
Lu YaNing d1ae2372bd fix: The window title bar exceeds the screen area at startup 2024-11-30 13:17:40 +08:00
pengwenhao b2e0c88058 feat: add alt tab fast task switcher 2024-11-30 10:11:54 +08:00
pengwenhao f48132c93e feat: add reverse taskview animation 2024-11-30 10:11:54 +08:00
JiDe Zhang f1940c1285 Fix xwayland surface's corners radius 2024-11-30 09:27:39 +08:00
groveer 4913b619ff chore(debian): bump version to 0.5.3
Log:
2024-11-29 16:01:58 +08:00
dependabot[bot] f7c2dfa0f0 chore(deps): bump waylib from `0f78500` to `9531265`
Bumps [waylib](https://github.com/vioken/waylib) from `0f78500` to `9531265`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](0f78500b3e...9531265bf5)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-29 16:01:33 +08:00
rewine c60cd2f263 fix: crash when resize or remove output while a SurfaceWrapper destory 2024-11-29 15:34:49 +08:00
Zhang Dingyuan 4edc55ccca fix: not set default font name
add font name and mono font name

Log:
2024-11-29 14:26:02 +08:00
Zhang Dingyuan ea914b3b46 fix: fontsize need to be multiplied by 10
default size change to 105

Log:
2024-11-29 14:26:02 +08:00
Zhang Dingyuan a6da6fa577 fix: first unlock will crash
check m_activatedSurface exist

Log:
2024-11-29 12:32:10 +08:00
Zhang Dingyuan 8aaaf6f2b6 fix: font context not send change
move to treelandconfig

Log:
2024-11-29 12:00:01 +08:00
Zhang Dingyuan c867f8ff21 fix: not hide desktop on lockscreen
missing desktop animation, hide window now

Log:
2024-11-29 12:00:01 +08:00
lbwtw 067b438808 fix: surface display abnormality under output scale
link commit: 11c0f80a87
2024-11-29 11:40:10 +08:00
Yixue Wang 12e43e6b3c feat: asynchronously load wallpaper
Use retainWhileLoading for asynchronous loading.
2024-11-29 11:08:16 +08:00
Lu YaNing 0fcba8d63b fix: Crash when removing last screen 2024-11-29 11:06:20 +08:00
Yixue Wang cc85d5f01c fix: screenshot not exit
Exit after screenshot.
2024-11-28 21:24:41 +08:00
Yixue Wang 477c9c6e4f chore: remove some unused statements
Remove some unused statements.
2024-11-28 21:24:41 +08:00
Yixue Wang 6e46dfd441 chore: use unique connection for frame
Use unique connection.
2024-11-28 21:24:41 +08:00
Yixue Wang a278da53b8 chore: remove unused property
m_selectableItems is unused now.
2024-11-28 21:24:41 +08:00
Yixue Wang 9b032b7e2c fix: incorrect image on selection done
Should not render, connect to renderEnd, create image asynchronously.
2024-11-28 21:24:41 +08:00
YeShanShan f0f665c21d chore: adjust ui of ShutDown
as title.
2024-11-28 21:23:18 +08:00
Zhang Dingyuan 12226af4f4 fix: not hide multitaskview on lockscreen
immediately exit multitaskview

Log:
2024-11-28 21:22:31 +08:00
rewine e72dd99b2f fix: crash when close x11 surface frequently 2024-11-28 17:02:25 +08:00
groveer 1be0295c21 fix: cannot get focus in lockscreen
Log:
2024-11-28 16:52:15 +08:00
rewine 144f3a3008 fix: x11 surface's parent may not associate 2024-11-28 15:48:47 +08:00
groveer 23d3c78457 refactor: use qt logging category
Log:
2024-11-28 15:47:47 +08:00
rewine 8141c27329 chore: handle some cppcheck and clang-tidy warnings 2024-11-28 14:39:35 +08:00
Zhang Dingyuan 7cdd3d39b1 feat: Restore lock state after a crash
need DDM switch to greeter and state sync

https://github.com/linuxdeepin/ddm/pull/22

Log:
2024-11-28 14:34:40 +08:00
YeShanShan 54090eaca0 fix: workspace doesn't hide when showing greeter
Add translations.
Hide workspace when showing greeter UI.
2024-11-28 13:47:59 +08:00
Zhang Dingyuan 77ddb569e7 fix: cursor dconfig not init
cursor default theme change to bloom, dconfig already bloom.
cursor size save to dconfig use int value.

Log:
2024-11-28 10:10:11 +08:00
dependabot[bot] eacc75712e chore(deps): bump waylib from `d6a78cb` to `0f78500`
Bumps [waylib](https://github.com/vioken/waylib) from `d6a78cb` to `0f78500`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](d6a78cbb91...0f78500b3e)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-28 10:08:58 +08:00
Zhang Dingyuan 42f9e420c3 chore: change logo font size for greeter show
120 -> 32

remove blur background

Log:
2024-11-27 17:42:29 +08:00
Zhang Dingyuan 4420603635 fix: overlap checker not working
wrong enum and HiDPI support

Log:
2024-11-27 17:39:08 +08:00
Zhang Dingyuan 7a3c3b973b fix: if dde-daemon is invalid
use getuid replace current user

Log:
2024-11-27 09:35:00 +08:00
Zhang Dingyuan d8da342709 fix: crash when ddm send dde user
DDM will active dde user to show greeter

Log:
2024-11-27 09:35:00 +08:00
Zhang Dingyuan 41cf6a1568 fix: csd window not top radius
check no titlebar property

Log:
2024-11-27 09:35:00 +08:00
groveer 0fd3b4c8da chore(debian): bump version to 0.5.2
Log:
2024-11-26 15:53:12 +08:00
groveer f01b819086 refactor: modify quit shortcut
Log:
2024-11-26 15:51:39 +08:00
Zhang Dingyuan 637e9cbc53 fix: shortcut will send keys before keyrelease
add keypress check and send key after

Log:
2024-11-26 15:51:13 +08:00
Zhang Dingyuan dc3ebae064 fix: launchpad cover not clip output
as title

Log:
2024-11-26 15:51:13 +08:00
Zhang Dingyuan 44a10f6183 refactor: user wallpaper not show
Provide the current user using greeter's usermodel

Log:
2024-11-26 15:51:13 +08:00
Lu YaNing 6406f62ed3 fix: Synchronize status to the client when exiting the show desktop 2024-11-26 15:00:25 +08:00
Lu YaNing 81a348e6cc fix: Repeated judgment 2024-11-26 14:57:46 +08:00
Zhang Dingyuan 1a99d913d7 fix: not hide layer surface on lockscreen show
add hide by lockscreen

Log:
2024-11-26 14:44:54 +08:00
pengwenhao 70bcac7613 fix: task switch preview flicker 2024-11-26 14:39:21 +08:00
groveer fd15cd9f26 feat: force software cursor when use NVIDIA card
Log:
2024-11-26 13:41:51 +08:00
JiDe Zhang b6f00799b9 feat: auto calculate screen scale 2024-11-26 13:35:47 +08:00
tsic404 43b24792f4 fix: layershell not shown on init
The internal information of an uninitialized shell surface may not be correct.
If configure it at this time, the client will receive an error message.
For example, if the layershell surface has no anchor information, its size will be incorrect.

pms: BUG-288905
2024-11-26 11:31:22 +08:00
pengwenhao bd78bf4c7e fix: gesture left and right sliding animation is not started. 2024-11-25 20:28:40 +08:00
Zhang Dingyuan bccc30e0c9 fix: cursor protocol not working
send data to client

Log:
2024-11-25 20:19:49 +08:00
Zhang Dingyuan 0039ac6d63 chore: don't manual register Treeland.Greeter
and remove duplicate logo provider

Log:
2024-11-25 20:10:10 +08:00
Yixue Wang 8dab45ab13 fix: exclusive zone not considered
Place content in non-exclusive zone.
2024-11-25 16:07:09 +08:00
Yixue Wang f2da186fe4 feat: add frame done mechanism
Only send next frame when client acknowledged last frame.
2024-11-25 15:44:50 +08:00
Lu YaNing 4370d03e5f fix: Repeatedly set copy mode crash 2024-11-25 13:11:02 +08:00
Zhang Dingyuan 4ba26e4ff5 refactor: move greeter qml to plugin
greeter qml will shared.

Log:
2024-11-25 10:38:25 +08:00
Zhang Dingyuan ac27edd202 chore: support user lock
listen ddm signal switch to lockscreen

Log:
2024-11-25 10:38:25 +08:00
Lu YaNing 3e520c5b30 fix: Window lost in multiple screens 2024-11-25 10:25:41 +08:00
pengwenhao c3fc03f839 fix: four figner gesture auto exit 2024-11-25 10:23:44 +08:00
lbwtw a51d6c8ccb fix: popup y-axis position display error
- Offset the height of the title bar downward
2024-11-25 10:14:43 +08:00
groveer 99d51f3a25 refactor: use ShapePath inseatd TRadiusEffect
Log:
2024-11-25 10:12:18 +08:00
Ye ShanShan dd072b8a86 feat: add lockscreen protocol
Implement lockscreen protol about ShutDown,Lock and SwitchUser.
Refact PowerList UI.
2024-11-23 16:24:39 +08:00
groveer a59e16c705 chore(debian): bump version to 0.5.1
Log:
2024-11-22 19:19:14 +08:00
rewine 5d2f302f22 fix: popup crash when parent is layer shell 2024-11-22 19:19:03 +08:00
Yixue Wang 723a6d0f3d fix: heap use after free
Pass QByteArrayView as interface name.
2024-11-22 15:19:04 +08:00
Yixue Wang 33483f990e fix: make config shared library
Make config shared library to avoid odr error.
2024-11-22 15:19:04 +08:00
Yixue Wang a4dfbb6a7a fix: correct size calculation. 2024-11-22 11:00:33 +08:00
JiDe Zhang 082524f368 Allows disable DDM on building
Add the "DISABLE_DDM" build option in cmake.
2024-11-22 10:06:52 +08:00
groveer 4ad281ae86 chore(debian): bump version to 0.5.0
Log:
2024-11-21 19:54:25 +08:00
JiDe Zhang 3cb8185daa Update waylib submodule 2024-11-21 19:53:55 +08:00
rewine f24731cff5 feat: support wlroots 0.18 and qt 6.8 2024-11-21 17:55:55 +08:00
Zhang Dingyuan 96f5b9dbaf chore: update ts
update chinese ts

Log:
2024-11-21 14:23:54 +08:00
Zhang Dingyuan f722059deb chore: remove recongnition of specific window
remove dde-shell/dock

Log:
2024-11-21 14:23:54 +08:00
Zhang Dingyuan 0389f48e96 feat: add some new shortcuts
as title

Log:
2024-11-21 14:23:54 +08:00
Zhang Dingyuan c9c6a17252 refactor: change modules name
Some protocols, such as dde-shell, have the same name as the project.

Log:
2024-11-21 11:29:08 +08:00
Zhang Dingyuan 386b13cf1f chore: update translate
as title

Log:
2024-11-21 09:30:17 +08:00
rewine c22985b0d8 fix: clear m_shellSurface when it aboutToBeInvalidated
This may fix many crash in SurfaceWrapper::~SurfaceWrapper
2024-11-20 17:35:13 +08:00
Yixue Wang f9ebe63509 fix: use pathline to run on Qt 6.6 2024-11-20 17:22:00 +08:00
pengwenhao 86400eb537 fix: usage focus reason enable active animation 2024-11-20 15:52:44 +08:00
Yixue Wang 9da502a182 fix: compile error on standalone 2024-11-20 15:48:15 +08:00
Yixue Wang 9a08b85421 chore: remove unused includes and declaration 2024-11-20 15:48:15 +08:00
rewine bf3a0a46b0 fix: workspace should not remove when only have one 2024-11-20 14:27:15 +08:00
Yixue Wang 3ade3f0de5 feat: update example to support record
* Add tool buttons
* Support switch between screenshot and record
2024-11-20 13:44:08 +08:00
Yixue Wang 760e057d96 feat: handle session creation and start
Send dmabuf attributes to treeland capture session.
2024-11-20 13:44:08 +08:00
Yixue Wang 1f8166b666 refact: allow xdg surface created on non-workspace
Xdg surface is allowed to be created on non-workspace container.
2024-11-20 13:44:08 +08:00
Yixue Wang 885dbe7274 chore: tidy code for capture
* Remove some useless code
* Fix some warnings from clazy
* Remove one TODO(done)
2024-11-20 13:44:08 +08:00
Yixue Wang 615ade4bc2 fix: treeland capture module not installed
Register Treeland.Capture in treeland.cpp.
2024-11-20 13:44:08 +08:00
Zhang Dingyuan d3040dd623 fix: remove useless include for greeter
remove _pam_types.h

Log:
2024-11-20 13:28:49 +08:00
Zhang Dingyuan 522736fbb0 fix: appearance not send state
send changes to all clients

Log:
2024-11-20 13:28:49 +08:00
pengwenhao 9449ac92c5 fix: taskswitcher not active surface 2024-11-20 13:28:38 +08:00
pengwenhao 5f10b395e4 fix: taskswitcher exposes part of item 2024-11-20 13:28:38 +08:00
rewine f17c54f755 fix: crash when call remove x11 surface after dissociate
Log: when x11 notify_dissociate wl_surface maybe null
2024-11-20 13:22:38 +08:00
Lu YaNing 7b70adc648 fix: Re-implement show desktop 2024-11-20 13:15:38 +08:00
Zhang Dingyuan f7ac013a2e fix: cannot release focus when exit multitaskview
as title

Log:
2024-11-20 10:58:32 +08:00
Zhang Dingyuan 7083e53e4e fix: greeter not load translation
change dir to treeland

Log:
2024-11-19 19:35:42 +08:00
lbwtw b6d0fd2c28 refactor dde shell interface 2024-11-19 14:53:15 +08:00
lbwtw 71f37a03f6 add qt style waylandscanner tool 2024-11-19 14:53:15 +08:00
Zhang Dingyuan d62e09259c fix: wrong plugin load path
re-call GNUINstallDir_get_absolute_install_dir

Log:
2024-11-19 11:15:44 +08:00
Zhang Dingyuan 9fa6b63adf chore: disable export target
modules library doesn't support export

Log:
2024-11-19 10:52:24 +08:00
Zhang Dingyuan 32d8786a2e chore: Only allow normal mode to set window focus
as title

Log:
2024-11-19 10:52:24 +08:00
Zhang Dingyuan a96bc4750a fix: missing multitaskview plugin
add install

Log:
2024-11-19 10:52:24 +08:00
Zhang Dingyuan d7db6bd7fc fix: missing treeland-dev package
add treeland-dev package

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan ecc085f790 fix: missing some licenses
add licenses

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan ccc75cc08e refactor: add plugins
add plugin interface and global shortcuts manager

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan a917a45506 refactor: move qml to core
Optimize the directory structure, and put qml in the location required
by the module instead of a unified one.

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan d0c3b73003 refactor: install modules library files
install lib

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan 0b6698980c refactor: change to shared library
all target shared

Log:
2024-11-18 20:06:10 +08:00
Zhang Dingyuan 3e5cebaaa2 refactor: rename src/treeland to src/core
add treeland core

Log:
2024-11-18 20:06:10 +08:00
lbwtw 470264452c Disable radius effect in CPU rendering mode 2024-11-18 19:24:33 +08:00
lbwtw 62b023700e titleBarHeight is 0, uses the default configuration height place 2024-11-18 10:59:49 +08:00
pengwenhao cae2ed7ab8 fix: tasksiwtcher current index error value 2024-11-18 10:59:24 +08:00
lbwtw b7b30526cb fixed the wpModle is nullptr caused an assert 2024-11-15 18:55:29 +08:00
groveer ed2c2e24e9 chore(debian): bump version to 0.4.4
Log:
2024-11-15 14:38:21 +08:00
Yixue Wang b903f8c83a correct examples option. 2024-11-15 14:37:55 +08:00
Yixue Wang 88ffee65e8 Revert too new clang-format standard. 2024-11-15 14:37:55 +08:00
lbwtw 4f437ba24c feat: improve window smart-cascading placement logic
- Add boundary checks to ensure windows stay within valid screen area
- Change top-left direction offset reference to window's top-right corner
2024-11-15 14:14:42 +08:00
pengwenhao d2066a752b fix: transparent window is activated again 2024-11-15 11:45:33 +08:00
lbwtw 752518e1c5 add surface arrange 2024-11-15 11:03:18 +08:00
Zhang Dingyuan 2272da159f fix: crash when dock hide
check client relative surface object lifetime.

Log:
2024-11-14 18:40:18 +08:00
Lu YaNing 38d4c955e9 fix: Some scenes show that the desktop is invalid
When the window is always in the visible workspace, it is invalid
when the desktop is displayed.
2024-11-14 16:30:02 +08:00
dependabot[bot] ff8e3c0256 chore(deps): bump waylib from `f181257` to `f50eb6b`
Bumps [waylib](https://github.com/vioken/waylib) from `f181257` to `f50eb6b`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](f1812571fa...f50eb6be22)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-14 15:25:13 +08:00
Yixue Wang 1927cd29d0 fix: deprecated option in clang format
Refer to https://clang.llvm.org/docs/ClangFormatStyleOptions.html#breaktemplatedeclarations
2024-11-14 15:24:57 +08:00
Lu YaNing ec2839a47d fix: The display level of desktop animation is incorrect 2024-11-14 15:24:45 +08:00
Zhang Dingyuan 2d3a19dca0 chore: rename BUILD_TEST_EXAMPLES to BUILD_EXAMPLES
remove test prefix

Log:
2024-11-14 15:08:48 +08:00
Zhang Dingyuan 28cbc9512c chore: add unit tests
add ctest and qt test.

Log:
2024-11-14 14:40:23 +08:00
Yixue Wang 652740410a fix: compilation error on Qt 6.6
setFocusPolicy is introduced in Qt 6.7.
2024-11-14 13:34:02 +08:00
Yixue Wang 30f1e9a326 chore: remove useless link 2024-11-14 13:33:36 +08:00
dependabot[bot] 1a5921b441 chore(deps): bump waylib from `d1adccc` to `f181257`
Bumps [waylib](https://github.com/vioken/waylib) from `d1adccc` to `f181257`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](d1adccca2f...f1812571fa)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-14 13:18:05 +08:00
Yixue Wang abc4db3462 feat: add mask in example 2024-11-14 11:20:16 +08:00
Yixue Wang 3254e86dc0 feat: add toolbar to switch mode 2024-11-14 11:20:16 +08:00
Yixue Wang f57d323b2b fix: license and header protection 2024-11-14 11:20:16 +08:00
Yixue Wang 8d01968144 feat: add treeland window picker 2024-11-14 11:20:16 +08:00
Yixue Wang da5379c374 fix: window titlebar height dconfig initialization 2024-11-14 11:20:16 +08:00
Yixue Wang 54b84b8591 refact: set property in qml 2024-11-14 11:20:16 +08:00
Yixue Wang 12105cb4eb fix: module capture
* Fix base function
* Extract item selector
2024-11-14 11:20:16 +08:00
Yixue Wang 379482f002 fix: default workspace count not correct 2024-11-14 11:20:04 +08:00
Lu YaNing f4bd757ce4 fix: Spelling Errors 2024-11-13 18:26:38 +08:00
Lu YaNing e6cf67c06c fix: Incorrect settings 2024-11-13 18:26:38 +08:00
rewine 18678af778 fix: can't preview surface in other workspace 2024-11-13 18:26:09 +08:00
pengwenhao df2fc21b4e fix: taskwitcher shortcut key cannot work 2024-11-13 18:25:29 +08:00
Zhang Dingyuan 0c242b0a7e fix: click popup window crash when open multitaskview
check wrapper has capability Activate

Log:
2024-11-13 18:23:08 +08:00
pengwenhao 4fef422ebf fix: no animation when there is only one 2024-11-13 18:22:32 +08:00
rewine 6f8a871efc fix: not close WindowMenu when open multitaskview 2024-11-13 18:19:27 +08:00
groveer 08b396089a chore(debian): bump version to 0.4.3
Log:
2024-11-13 16:26:59 +08:00
dependabot[bot] 26f95242d3 chore(deps): bump waylib from `67a8954` to `d1adccc`
Bumps [waylib](https://github.com/vioken/waylib) from `67a8954` to `d1adccc`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](67a89545fb...d1adccca2f)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-12 20:33:24 +08:00
rewine e24d492835 fix: data not ready when add surface to workspacemodel 2024-11-08 17:46:51 +08:00
Yixue Wang 910a86efa0 fix: out of range in calc layout 2024-11-08 16:24:07 +08:00
rewine 63b2631ad6 fix: some error on move workspace by WindowMenu 2024-11-08 15:47:44 +08:00
pengwenhao 8d6e75a2ec fix: same appid task switch 2024-11-08 15:47:22 +08:00
pengwenhao 8c887ba673 fix: add holdgesture
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-11-08 14:53:33 +08:00
Zhang Dingyuan f69b8cd5f7 fix: launchpad cover background not sync animation
shadereffectsource will not capture scale animation

Log:
2024-11-08 14:50:24 +08:00
Yixue Wang 8963fef34f fix: crash when moving to neighboor workspace
Should use id instead of index.
2024-11-08 13:54:45 +08:00
groveer 42c2ecc118 refactor: rm DDE_CURRENT_COMPOSITOR env
Log:
2024-11-08 13:13:11 +08:00
rewine 487e6b3e18 chore: enable QT_FORCE_ASSERTS for better debug 2024-11-08 11:50:35 +08:00
dependabot[bot] fb42c4fe3d chore(deps): bump waylib from `7101408` to `67a8954`
Bumps [waylib](https://github.com/vioken/waylib) from `7101408` to `67a8954`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](7101408d4a...67a89545fb)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-08 10:22:33 +08:00
Zhang Dingyuan 64428585bd fix: Wrong protocol implementation
Collect all window geometry and check against the geometry provided by
the protocol.

Only handles non-layershell surfaces.

Log:
2024-11-08 10:21:08 +08:00
Zhang Dingyuan d242714adf chore: remove debug info
as title

Log:
2024-11-08 10:21:08 +08:00
Zhang Dingyuan 8beb60db32 fix: crash when twice call window overlap checker
not remove resource from wl_list

Log:
2024-11-08 10:21:08 +08:00
Zhang Dingyuan 44d0eac919 fix: launchpad blur not show
doesn't hide cover content

Log:
2024-11-08 10:18:04 +08:00
lbwtw 70f7ce0550 support dnd and event monitoring 2024-11-08 10:14:30 +08:00
pengwenhao 60a3699480 fix: prevent task switcher preview index calculation errors 2024-11-08 10:13:51 +08:00
Zhang Dingyuan f9495ec3a6 fix: dock overlap checker not working
use surfacewrapper

Log:
2024-11-07 15:34:17 +08:00
rewine 20e425e86b fix: workspace model should not set visable for surface 2024-11-07 15:27:27 +08:00
Yixue Wang ca10f72f16 fix: not limiting drag delete and hover add 2024-11-07 14:08:07 +08:00
Yixue Wang cbda42b3bd fix: not limiting drag delete and hover add 2024-11-07 13:56:07 +08:00
rewine fe279737bb fix: menu popup must use QPointF 2024-11-07 13:55:24 +08:00
pengwenhao e569fa8b3c fix: task switcher cannot exit, click to fail
- increase preview window min size
2024-11-07 13:47:08 +08:00
rewine cb7f7a5c21 fix: fixup implicit width for dockpreview 2024-11-07 13:45:48 +08:00
Yixue Wang be03850f5a fix: crash in removing surface
SurfaceWrapper is invalid in handleSurfaceRemoved, cannot check any
of its content.
2024-11-07 13:44:54 +08:00
Zhang Dingyuan c600831d5f chore: rename show desktop animation
m_showAnimation -> m_showDesktopAnimation

Log:
2024-11-07 13:44:32 +08:00
Zhang Dingyuan 9540a7f829 feat: add layershell animation
add animation

Log:
2024-11-07 13:41:55 +08:00
rewine 08fdb2f209 fix: don't connect surface request in surface proxy 2024-11-07 13:39:25 +08:00
lbwtw 66e8ad5508 fix xdgsurface size is abnormal after output scaling
link: https://github.com/vioken/waylib/pull/531/files
2024-11-06 17:26:21 +08:00
rewine 2f6835d6a4 fix: crash when close a parent surface 2024-11-06 13:52:49 +08:00
rewine 70253b9290 fix: xwayland position in muittaskview 2024-11-05 21:13:22 +08:00
groveer dd5c72f9c4 refactor: rename TreeLand to Treeland
Log:
2024-11-05 21:02:22 +08:00
pengwenhao cd5102f603 fix: alt+shift is not exit taskswitcher
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-11-05 21:02:05 +08:00
Lu YaNing 2a0580256e fix: Crash when dragging the workspace to swap the workspace position
According to Qt official usage, beginMoveRows should return false
when it fails, and endMoveRows should not be executed, otherwise
an exception will occur.
2024-11-05 19:27:18 +08:00
Zhang Dingyuan 909597d23a chore: release 0.4.1
release 0.4.1

Log:
2024-11-05 15:46:53 +08:00
rewine 3b11314763 fix: support treeland-protocols for nix 2024-11-05 14:51:14 +08:00
Yixue Wang 17c28754d3 feat: add multitaskview toggle request
Add multitaskview context in dde-shell. Provide toggle request.

Depends-on: https://github.com/linuxdeepin/treeland-protocols/pull/6
2024-11-04 11:39:00 +08:00
Yixue Wang 1c49d4daa3 fix: ui and surface delegate focus
* Adjust add button, titlebox and emptyHint ui.
* Fix close button cannot be clicked.
2024-11-04 11:39:00 +08:00
rewine 3487808936 fix: check x11 window type for foreign toplevel 2024-11-04 11:23:43 +08:00
Zhang Dingyuan a137ce67ec fix: missing pam build dep
add libpam0g-dev

Log:
2024-11-01 13:31:16 +08:00
Zhang Dingyuan 5bf40be893 feat: update appearance protocol
add font protocol

Log:
2024-11-01 13:04:09 +08:00
pengwenhao 567f2e96a7 fix: task switcher quick switch 2024-11-01 13:03:56 +08:00
rewine 264104eccf fix: layer surface in multi-screen 2024-11-01 10:52:08 +08:00
pengwenhao f5bfd5da34 fix: filter the touchpad data to repair flicker
touchpad data has the following problems
- there may be duplicate data on the touchpad
- The accuracy between data is very small
- The maximum touch may not be 1.0, there is a certain error.
  Currently, 0.98 is tentative

Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-11-01 10:36:22 +08:00
pengwenhao 5161803ab0 fix: task switch exit animation abnormal 2024-11-01 10:20:06 +08:00
Yixue Wang 3dace0c8b7 chore: delete useless code 2024-11-01 10:07:41 +08:00
Yixue Wang cd880d4a95 feat: support add and remove workspace by keyboard 2024-11-01 10:07:41 +08:00
Yixue Wang 54e5400109 fix: always on all workspace does not show
* Show surface showing on all workspace in workspace preview and window
  grid.
* Fix window not activated after set to always visible.
2024-10-31 16:22:12 +08:00
Yixue Wang 0e9a0022b3 fix: lost background blur 2024-10-31 16:22:12 +08:00
Yixue Wang 228bad921c fix: hover switch errors
* Fix do not switch to correct workspace after release
* Fix can not switch to previous workspace
2024-10-31 16:22:12 +08:00
Lu YaNing 87d22c127a fix: Crash when exiting treeland
layershell null pointer crash.

After layershell is destroyed, if the screen exists, dock will recreate
layershell and cause a crash.
2024-10-31 16:14:47 +08:00
Yixue Wang e9715f41ce fix: right button can move
* Separate left button handler and right button handler.
* Block hover events.
2024-10-31 16:12:44 +08:00
dependabot[bot] 36f9dbaab5 chore(deps): bump waylib from `e90f1c7` to `6e88ca5`
Bumps [waylib](https://github.com/vioken/waylib) from `e90f1c7` to `6e88ca5`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](e90f1c767e...6e88ca56c1)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 14:16:05 +08:00
Lu YaNing bfc96fc260 fix: The shortcut Alt + F4 does not work
Unify the shortcut functions of Alt + other keys
2024-10-31 13:06:20 +08:00
rewine 8490714598 fix: set cursor shape for dock preview 2024-10-31 11:19:43 +08:00
rewine fecd0ef52c fix: DockPreview should use `force` ActivateSurface 2024-10-31 10:58:56 +08:00
Yixue Wang a256adf633 feat: add vertical drag for workspace thumb 2024-10-31 10:45:34 +08:00
Yixue Wang f1e94de998 fix: use id instead of index
Id is unique for workspace now.
2024-10-31 10:45:34 +08:00
rewine d814278a66 feat: use dtk menu and set check 2024-10-30 20:05:49 +08:00
rewine 5e3990e864 fix: xwayland has error position 2024-10-30 18:00:12 +08:00
rewine d9d06a4c73 Setup decoration for xdg popup 2024-10-30 17:57:43 +08:00
pengwenhao e643943018 fix: left and right sliding workspace
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-30 17:57:25 +08:00
Lu YaNing ef1e60de3a fix: Unable to activate window from dock
Added desktop status judgment processing when activating the
window from the dock bar after triggering the show desktop.
2024-10-30 17:56:46 +08:00
Yixue Wang 9eae874a0b feat: show app id 2024-10-30 17:23:39 +08:00
Yixue Wang 71c4fe4b5f feat: add key navigation 2024-10-30 17:23:39 +08:00
rewine 94d621f22d Deny window animation for xdg popup 2024-10-30 17:20:30 +08:00
lbwtw bb4aa5fee9 Revert "fixed TRadiusEffect rounded corner accuracy issue"
This reverts commit c11e305e70.
2024-10-30 17:08:46 +08:00
pengwenhao c51cff5066 fix: gesture activation multi-task view
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-29 14:57:40 +08:00
Zhang Dingyuan 6793505575 fix: window switcher not exit
add quit handle.

Log:
2024-10-29 14:26:39 +08:00
Zhang Dingyuan b67e67e1b0 fix: meta shortcut not working
using pending check

Log:
2024-10-29 14:26:39 +08:00
dependabot[bot] 28d19692e5 chore(deps): bump waylib from `68b6927` to `e90f1c7`
Bumps [waylib](https://github.com/vioken/waylib) from `68b6927` to `e90f1c7`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](68b6927116...e90f1c767e)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-29 13:49:43 +08:00
Lu YaNing befd648d88 fix: Optimize shortcut key implementation logic
Avoid multiple conversion events and judgments
2024-10-29 13:08:39 +08:00
Lu YaNing e69824987c fix: Delete useless code 2024-10-29 11:24:09 +08:00
Lu YaNing 4208f0fa72 feat: Add shortcut keys
Add shortcut keys to close windows and maximize/undo maximization
2024-10-29 11:13:06 +08:00
Yixue Wang dfe5ec952c fix: switch animation flash 2024-10-29 10:48:11 +08:00
groveer 0166811605 fix: set container to surfaceproxy
Log:
2024-10-29 09:30:46 +08:00
groveer 113ec3a021 fix(taskswitch): crash when `alt` pressed and `alt + tab` not pressed
Log:
2024-10-29 09:30:46 +08:00
Lu YaNing a0febc7194 fix: compoile error 2024-10-29 08:56:50 +08:00
Zhang Dingyuan f0f9d9be38 fix: can handle shortcut on lockscreen
add lock state init

Log:
2024-10-28 21:15:18 +08:00
Zhang Dingyuan c2954006b6 fix: multi user window will show all
surface wrapper add socket enabled

Log:
2024-10-28 21:15:18 +08:00
Zhang Dingyuan f6f8be4999 chore: register logger at first
move DLogManager to function first

Log:
2024-10-28 21:15:18 +08:00
Zhang Dingyuan 393a1fab47 fix: switch user not working
systemd socket service not reconnect treeland

Log:
2024-10-28 21:15:18 +08:00
Zhang Dingyuan dbf2e2df8d feat: add workspace and unlock animation
as title

Log:
2024-10-28 21:15:18 +08:00
rewine e97882061f fix: some bug for dock preview 2024-10-28 20:42:29 +08:00
Lu YaNing f302f091b9 feat: Refactoring the primaryoutput settings 2024-10-28 20:41:41 +08:00
Yixue Wang 2da341ee27 fix: no decoration and radius of minimized surface
There is no need to disable radius and decoration on a invisible
SurfaceWrapper. Meanwhile, multitaskview and task switcher might
need to show minimized windows, it should have the same appearance
as normal state.
2024-10-28 20:40:49 +08:00
Yixue Wang 6d48c1b2f9 fix: some bugs in multitaskview
* Fix order and layout error in removing model.
* Add hint label when there is no windows.
* Add wheel handler to switch workspace when scrolling.
* Add utility function in Helper, filter windows not belong to current
user.
* Handle surface addition and removal correctly.
* Handle surface mapped() state correctly.
* Handle minimized animation correctly.
* Add shortcut triggers of multitaskview.
2024-10-28 20:40:49 +08:00
groveer e1ae32805c feat: add forceSoftwareCursor config
Log:
2024-10-28 15:37:42 +08:00
groveer 6d14a3f7e8 fix: launchpad not blur
Log:
2024-10-28 09:32:46 +08:00
groveer 15369ae839 refactor: mv some qml to owen dir
Log:
2024-10-25 17:50:35 +08:00
groveer 3e8ac3695f refactor: code review
Log:
2024-10-25 17:49:08 +08:00
lbwtw dcccdbe13f fixed the rounded corner flickering issue
Solve the problem of visual afterimage caused by jump.
2024-10-25 17:36:32 +08:00
pengwenhao e9d9126561 fix: taskswitcher layout parameters use valid area
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-25 15:44:35 +08:00
pengwenhao 39aa48739f fix: task view window thumbnail title bar is set to 38 px
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-25 15:42:40 +08:00
Yixue Wang 66649f96ff feat: shield input events for surface wrapper
SurfaceProxy should shield all input events to SurfaceWrapper and
shadow.
2024-10-25 15:22:31 +08:00
Zhang Dingyuan bd17088758 fix: TreeLandProtocols -> TreelandProtocols
change typing

Log:
2024-10-25 15:19:38 +08:00
Zhang Dingyuan 9680ce996f chore: extract treeland-protocols
repo: linuxdeepin/treeland-protocols

Log:
2024-10-25 14:40:49 +08:00
rewine 60b8eb53a1 chore: update nix flake lock 2024-10-25 11:47:13 +08:00
pengwenhao ff96334b58 fix: task switcher left and right keys cannot be used
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-24 16:34:26 +08:00
pengwenhao eaecd965ba fix: task switcher minimized window is restored
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-24 16:34:26 +08:00
pengwenhao f4a6d849fe fix: task switch windows of the same type in reverse
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-24 16:34:26 +08:00
groveer e0c3573c21 fix: crashed when surface maximied after taskswitch created
Log: taskswitch 不析构导致
2024-10-24 16:20:46 +08:00
groveer 54bd3af6f8 refactor: code review
- [x] gestures.cpp 251 注释代码需要对齐
- [x] inputdevice.h 12 : 确认是否需要
- [x] inputdevice.cpp 5: 删除#include "global.h"
- [x] inputdevice.cpp 21行:删除Q_DECLARE_LOGGING_CATEGORY(inputdevice);
- [ ] lockscreen.cpp 1:开源许可: 其他文件统一改成公司的 ->
  开源许可在开源时统一处理
- [x] lockscreen.cpp 20: 添加300ms 注释说明
- [x] lockscreen.cpp 63: 添加item 断言
- [ ] qmlengine.h 33: 窗口相关的单独分模块处理 -> 由于复杂性,暂不处理
- [x] qmlengine.cpp 228: if 统一加{}
- [x] qmlengine.cpp item 断言判断统一改成:qCFatal(qLcTreelandEngine)
- [ ] surfaceproxy.cpp 115: size().isEmpty() 待确认 ->
  未出问题前维持现状
- [x] surfacewarpper.cpp 69: 修改为直接发送信号
- [x] surfacewarpper.cpp 207: targetGeometry 属性可能已经删除 待确认
- [ ] surfacewarpper.cpp 719: 检查Xdg、xwayland ->
  添加todo,需要详细优化
- [x] surfacewarpper.cpp 1069:使用宏Workspace::ShowOnAllWorkspaceIndex替换0
- [x] surfacewarpper.cpp 1147:拼写修改
- [x] surfacewarpper.cpp 检查哪些属性需要readonly
- [x] surfacewarpper.cpp 1198: isDdeShellSurface 修改为 isDDEShellSurface 其他同样修改

Log:
2024-10-23 17:19:27 +08:00
pengwenhao f5310a1ad2 fix: taskswitcher improves the way to add surfaces
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-23 14:50:48 +08:00
Yixue Wang 039741a115 refact: extract subcomponent from multitaskview
Extract WorkspaceSelectionList and WindowSelectionGrid from
multitaskview.
2024-10-23 13:58:18 +08:00
Yixue Wang 1af3282ea6 feat: use auto-increment id for WorkspaceModel
* Each WorkspaceModel has an unique id (auto-increment id) now.
* Implement moveModelTo for Workspace.
2024-10-23 13:58:18 +08:00
Yixue Wang a5cd12e648 chore: do not need modelData
There is already rolename workspace and required property workspace.
2024-10-23 13:58:18 +08:00
Yixue Wang cc8796f6f6 refact: use button add icon 2024-10-23 13:58:18 +08:00
Yixue Wang dad57fe740 refact: use tradiuseffect instead of itemviewport 2024-10-23 13:58:18 +08:00
Yixue Wang 2010ceffe3 fix: SurfaceProxy crashes when SurfaceWrapper destroys 2024-10-23 13:58:18 +08:00
pengwenhao f1502cdb46 feat: window and multitaskview gesture
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-23 13:56:55 +08:00
pengwenhao c0861296bd fix: taskswitcher preview window white edge afterimage
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-22 20:54:00 +08:00
pengwenhao 1e5ed568ed fix: click the task view thumbnail cannot activate the window
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-22 19:33:30 +08:00
Zhang Dingyuan 00e0b3e175 chore: update waylib submodule
as title

Log:
2024-10-22 19:26:25 +08:00
Zhang Dingyuan 7879d711cf feat: support launchpad animation
add window animation and cover

Log:
2024-10-22 19:26:25 +08:00
rewine 7a6edb40ad fix: setup xwayland's parentitem and decoration 2024-10-22 19:03:28 +08:00
groveer f229c05d65 refactor: use boundingRect from XdgShadow
Log:
2024-10-22 18:51:01 +08:00
groveer fbb3d72c71 refactor(qmlengine): use one method to create qml compoment
Log:
2024-10-22 17:55:25 +08:00
groveer 25fea9ec69 fix(shadow): not radius property on XdgShadow init
Log:
2024-10-22 16:14:08 +08:00
rewine 59c2a1dccc fix: warning in WindowMenu when surface is null 2024-10-22 16:13:24 +08:00
Zhang Dingyuan 02d931e4ed fix: layer container cannot use qmlEngine get context
add surfacecontainer to parent

Log:
2024-10-22 15:37:52 +08:00
groveer 9caa7437af fix(multitaskview): crash when exit
Log:
2024-10-22 14:00:30 +08:00
groveer ae52e48ed6 refactor: update clang-format
Log:
2024-10-22 11:33:48 +08:00
groveer 5ebc117fd5 refactor: use Blur replace MultiEffects
Log:
2024-10-22 09:30:30 +08:00
groveer d8394337f9 refactor(helper): rm useless head file
Log:
2024-10-22 09:30:30 +08:00
groveer 2b0c2963a5 refactor(blur): make blur more versatile
Log: 使 blur 更具通用性
2024-10-22 09:30:30 +08:00
Zhang Dingyuan 6b5a29cae2 fix: wallpaper scale
keep image preserve aspect

Log:
2024-10-21 15:04:57 +08:00
rewine 1fc883a518 chore: move shell implement to shellhandler 2024-10-21 15:04:34 +08:00
Lu YaNing 113d83210f fix: Invalid window animation when csd application is closed 2024-10-21 15:02:50 +08:00
lbwtw 56c83765a0 fix personalization related interface destruction logic exception 2024-10-18 17:46:54 +08:00
pengwenhao 311915f2f5 feat: switch window of the some appid
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-18 17:46:36 +08:00
lbwtw 3248d3cd2c fixed TitleBar is not smooth and shows aliasing 2024-10-18 17:37:42 +08:00
Zhang Dingyuan bae5afaec1 fix: not show fallback wallpaper
add settings check

Log:
2024-10-18 15:06:20 +08:00
justforlxz fdabc2651c fix: Shortcut keys and built-in keys respond simultaneously
The processing of shortcut keys should be placed in the after event to
ensure that the compositor and Qt have processed all events.

Log:
2024-10-18 14:29:20 +08:00
groveer 39b09ff76f feat: support animate image
Log:
2024-10-18 11:25:26 +08:00
pengwenhao 75a9ba8031 fix: task switcher afterimage
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-18 11:23:50 +08:00
lbwtw ded864877c Add drop event for treeland_dde_active_v1 interface
Only add event, not implemented in compositor yet
2024-10-18 11:23:19 +08:00
爱折腾的小竹同学 77e730eb22
Merge pull request #249 from Groveer/master
Merge branch `refactor`
2024-10-18 09:30:53 +08:00
groveer 1337e8d7ac Merge branch 'refactor' 2024-10-18 09:21:06 +08:00
justforlxz 39280e4ed4 fix: all window force has titlebar
reset titlebar when personalization does not set notitlebar

Log:
2024-10-17 18:48:15 +08:00
pengwenhao 24d3939e68 fix: task switcher alt show
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-17 18:45:14 +08:00
justforlxz 82c8c8b92b fix: wallpaper color not init
init wallpaper color

Log:
2024-10-17 18:31:56 +08:00
Lu YaNing c3f02dfb24 feat: refactor virtual output 2024-10-17 18:10:02 +08:00
justforlxz 9036fe54ff fix: dtk notitlebar
support notitiebar window

Log:
2024-10-17 17:23:49 +08:00
Yixue Wang ceebc33af7 fix: handlers and shortcut
Fix handlers not responded correctly.
2024-10-17 17:20:35 +08:00
Yixue Wang 28b30ea796 refact: use force active
Emit force active instead of activate.
2024-10-17 17:20:35 +08:00
Yixue Wang 51ddb6ffe6 feat: add workspace switch animation controller 2024-10-17 17:20:35 +08:00
lbwtw c11e305e70 fixed TRadiusEffect rounded corner accuracy issue 2024-10-17 17:10:35 +08:00
pengwenhao 0c8e93f4fe feat: add task switcher animation
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-17 17:05:02 +08:00
justforlxz 11b12d1dd4 feat: add surface blur background
add surface blur

Log:
2024-10-17 13:54:14 +08:00
Yixue Wang 8d9c053b3e fix: compilation on Qt 6.8.0
Pass viewCount to QSGOpaqueTextureMaterialRhiShader.
2024-10-17 13:53:35 +08:00
pengwenhao f220002cd8 feat add gesture base
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-17 13:32:05 +08:00
groveer b9b917540b fix: TitleBar transparent in maximized window
Log:
2024-10-17 11:25:09 +08:00
Yixue Wang 46006cfb46 fix: multitask not shown 2024-10-17 09:37:31 +08:00
justforlxz 8f4825e67d feat: support set cursor theme and size
as title

Log:
2024-10-16 17:24:35 +08:00
rewine 70ff9f7b24 fix: better active control and fix some error assert 2024-10-16 17:15:03 +08:00
groveer bc0e81d3d7 feat: adapter TRadiusEffect item
Log:
2024-10-16 16:48:09 +08:00
Yixue Wang 636cba9f1b fix: black wallpaper when switching workspace
* Asynchronously load the wallpaper image.
* Always draw wallpaper proxy in multitaskview
* Disable surfaceProxy.
2024-10-16 14:42:44 +08:00
lbwtw 7cf74c7705 fix missing pointer initialization 2024-10-16 14:37:36 +08:00
Yixue Wang 9cdb098e7d fix: do not activate surface
Activate surface when switch to workspace.
2024-10-16 13:53:35 +08:00
lbwtw f30659ccbe implementing shell_surface and dde_active 2024-10-16 13:47:43 +08:00
Yixue Wang 1f53c4e2d8 feat: add multitaskview 2024-10-16 13:40:02 +08:00
Yixue Wang 48e299754b fix: correct greeter qml path
Use slash instead of dot.
2024-10-16 13:40:02 +08:00
Yixue Wang d2ddc6e67d feat: add property monitor
Add utility property monitor.
2024-10-16 13:40:02 +08:00
Yixue Wang 726d49dfb5 feat: add treeland config
Class for global config and dconfig
2024-10-16 13:40:02 +08:00
rewine e21d4f1999 feat: support fallback when activedsurface loss capacity 2024-10-16 11:29:03 +08:00
Lu YaNing 58b81f8fbb fix: Characters appear during shortcut key operations 2024-10-16 10:49:43 +08:00
Yixue Wang 27f3af8fd6 fix: cannot access rootContainer in qml
Do not use opaque pointer, use moc include.
2024-10-16 10:46:15 +08:00
groveer 8a4f660b51 fix: cannot createShadow
Log:
2024-10-16 10:04:16 +08:00
groveer 72bb884be0 chore(Border): update xdgsurface's border color
Log:
2024-10-15 20:43:20 +08:00
rewine 5585d63a9b chore: stop use dtk menu
log: dtk menu has bug in treeland, use qt's menu replace
2024-10-15 19:22:21 +08:00
rewine f9c3971f06 fix: event not block by TapHandler 2024-10-15 17:38:06 +08:00
Lu YaNing c3c742f1c6 fix: Prevent being overwritten by client shortcut keys 2024-10-15 16:30:06 +08:00
groveer f1cd001522 refator: optizime decoration's shadow effect
Log:
2024-10-15 16:07:30 +08:00
Lu YaNing a3417938ec feat: Add show desktop shortcut keys 2024-10-15 16:06:43 +08:00
Zhang Dingyuan 26e6f0fd9d fix: cannot build on archlinux
m_surfaceContainer -> m_rootSurfaceContainer

Log:
2024-10-15 14:41:24 +08:00
Zhang Dingyuan 85488dea07 fix: wrong wallpaper settings content
as title

Log:
2024-10-15 09:19:22 +08:00
Zhang Dingyuan 1ea156aec1 feat: wallpaper provider use personalization data
as title

Log:
2024-10-14 20:29:52 +08:00
groveer 22421ea36f fix: activeSurface should be activateSurface
Log:
2024-10-14 20:26:02 +08:00
Lu YaNing c4b074c97f feat: Add display desktop animation 2024-10-14 19:34:42 +08:00
groveer 83a56fb7ff refactor(helper): Use named functions instead of lambdas
Log:
2024-10-14 18:41:20 +08:00
rewine 06e47aa528 fix: treeland wallpaper color v1 2024-10-14 16:05:01 +08:00
rewine 0544a1e615 feat: remove debug panel in release 2024-10-14 16:05:01 +08:00
Zhang Dingyuan 56ce3d0266 fix: cannot max-window
call surface requestToggleMaximize

Log:
2024-10-14 11:48:40 +08:00
groveer f9caf40cfc fix: spelling error
Log:
2024-10-14 10:26:35 +08:00
Lu YaNing 88177803e4 feat: add minimize animation 2024-10-14 10:19:02 +08:00
Zhang Dingyuan ee5e11f960 feat: update titlebar style
update button

Log:
2024-10-12 17:50:12 +08:00
groveer dfe1ca191f refactor: code review
Log:
2024-10-12 17:23:04 +08:00
Zhang Dingyuan 6881d85e88 fix: wrong DISPLAY env
as title

Log:
2024-10-12 14:27:49 +08:00
Zhang Dingyuan 00fe420164 fix: not shwo fallback wallpaper
remove qrc prefix

Log:
2024-10-12 11:29:50 +08:00
rewine 6edcc123d7 fix: foreign toplevel states bit conflict 2024-10-12 10:27:08 +08:00
rewine 3c34443fff feat: support window menu 2024-10-12 09:59:34 +08:00
Zhang Dingyuan 5152b9105a feat: re-add shortcut support
shortcut support

Log:
2024-10-12 09:57:26 +08:00
Zhang Dingyuan 53a0722929 feat: update fallback wallpaper
use desktop.webp

Log:
2024-10-11 16:01:46 +08:00
groveer 65bae5be3f refactor(greeter): rm useless module
Log:
2024-10-11 15:50:00 +08:00
Yixue Wang c4fc2e322c fix: workspace switcher crash
Adapt to WallpaperController.
2024-10-11 15:24:23 +08:00
Yixue Wang 9c65592c71 chore: correct cmake
* Correct project name.
 * Output qml to build directory.
2024-10-11 15:24:23 +08:00
Yixue Wang df10796368 refactor: use model as workspace not container
* Use WorkspaceModel not WorkspaceContainer.
 * Add capability to show on all workspaces.
2024-10-11 15:24:23 +08:00
rewine 7eda0e6bbc fix: rename TreeLand.Protocols -> Treeland.Protocols 2024-10-11 15:15:08 +08:00
rewine 6cb0e95ed1 Support treeland foreign toplevel and dock preview 2024-10-11 15:15:08 +08:00
Lu YaNing a6ebd5a51e refactor: adapte waylib refactor
depend:
vioken/waylib#513
vioken/waylib#515
vioken/waylib#516
vioken/waylib/commit/7e4b7340e88421b418e4a0a26a399f6fea3b127a
2024-10-11 14:57:54 +08:00
Zhang Dingyuan e42ecc66d8 feat: add cmdline
Use cmdline to manage treeland startup parameters and provide unified
query

Log:
2024-10-11 11:35:29 +08:00
rewine 3e58508217 chore: update waylib submodule 2024-10-11 10:17:19 +08:00
Lu YaNing 6a0875c3cc fix: Optimize code 2024-10-11 09:32:50 +08:00
Lu YaNing 42466ef037 fix: layershell window crashes
Restrict normal window startup animation
2024-10-10 21:05:07 +08:00
Zhang Dingyuan 9d40634d2c fix: greeter should not show when not on DDM
check socket argument

Log:
2024-10-10 21:04:32 +08:00
Zhang Dingyuan e9d90cdbf9 refactor: re-add greeter module
show greeter

Log:
2024-10-10 17:51:56 +08:00
pengwenhao 08ab273273 feat: add task switcher
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-10 14:07:21 +08:00
groveer 4b6aacd390 refactor: adapte waylib refactor
depend: https://github.com/vioken/waylib/pull/518

Log:
2024-10-10 13:57:33 +08:00
Lu YaNing 3cfa36be98 feat: add new window animation 2024-10-10 10:20:48 +08:00
groveer 6292855bdb fix: debian package build failed
Log:
2024-10-09 09:23:00 +08:00
groveer 7b3d7c7c69 fix: data and protocol should be all package
Log:
2024-10-09 09:23:00 +08:00
Tsic Liu ee9de5e571 fix: cmake install at incorrect pos
log: as title
2024-10-09 09:18:21 +08:00
Tsic Liu 060ff90e2b fix: cmake install at incorrect pos
log: as title
2024-10-08 20:41:46 +08:00
Zhang Dingyuan 92f7fe8f73 fix: remove useless include
as title

Log:
2024-10-08 17:15:01 +08:00
Zhang Dingyuan 0d3daf3096
refactor: re-add treeland and modules init
restore treeland modules init

Log:
2024-10-08 16:50:21 +08:00
pengwenhao 579e951a93 fix: enable modues error
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-10-08 10:32:10 +08:00
groveer df30d47648 fix: wlr-randr get null info
Log:
2024-09-29 17:29:29 +08:00
groveer 600581eb6a refactor: mv tinywl to treeland
Log:
2024-09-29 14:24:58 +08:00
groveer 26aa16c285 fix: debian package build failed
Log:
2024-09-29 13:07:21 +08:00
groveer 090ab99484 fix: data and protocol should be all package
Log:
2024-09-29 10:59:29 +08:00
pengwenhao 523b0ccd50 feat: add wallpaper item and switch animation
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-09-27 17:27:20 +08:00
Yixue Wang d8aabddad5 fix: modelData not defined
Explicitly require modelData.
2024-09-27 17:09:37 +08:00
rewine 2b15061ee4 chore: set default theme to bloom 2024-09-27 16:41:46 +08:00
pengwenhao e56438c0b3 fix: workspace gesture quickly slides to black screen
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-09-27 16:01:52 +08:00
Zhang Dingyuan 481ea96e20 fix: Clean up environment variables after session logout
reset some systemd environment for session

Log:
2024-09-27 15:57:01 +08:00
Zhang Dingyuan 9c08b358bb chore: release 0.3
release 0.3

Log:
2024-09-26 17:35:41 +08:00
groveer ee7577f633 chore: format code
Log:
2024-09-25 13:07:23 +08:00
Yixue Wang 470b850703 chore: use relative path for cpack compatibility
Use relative path so that cmake --install --prefix works.
2024-09-24 17:10:42 +08:00
Zhang Dingyuan 49a0b476a9 feat: add treeland_personalization_appearance
add new context

Log:
2024-09-24 09:40:25 +08:00
lbwtw 0ec5ed1661 fix: interfaceName error causes crash
returns the correct protocol name.

Log:

Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-23 17:20:12 +08:00
Yixue Wang c2b531daf2 chore: install treeland capture
Install treeland capture protocol file to treeland-protocol
2024-09-23 10:25:30 +08:00
Yixue Wang f8f244c960 feat: use ScreenCast portal from wlr
Temporarily use ScreenCast portal from wlroots. Might be removed
when xdg-desktop-portal-dde is ready for treeland.
2024-09-20 18:13:56 +08:00
Yixue Wang c04c81cb44 fix: shaders resource name conflict 2024-09-20 17:35:32 +08:00
Yixue Wang ab80e8ae82 test: add test capture
Add test for capture.
2024-09-20 17:35:32 +08:00
Yixue Wang 64e54b5ae5 feat: add and implement treeland-capture
Add and implement treeland-capture protocol.

Depends-on: https://github.com/vioken/waylib/pull/496
2024-09-20 17:35:32 +08:00
Yixue Wang adda5145fd chore: correct QML_IMPORT_PATH 2024-09-20 17:35:32 +08:00
dependabot[bot] 94bb6452ba chore(deps): bump waylib from `7655b75` to `52dcdfb`
Bumps [waylib](https://github.com/vioken/waylib) from `7655b75` to `52dcdfb`.
- [Release notes](https://github.com/vioken/waylib/releases)
- [Commits](7655b75147...52dcdfb447)

---
updated-dependencies:
- dependency-name: waylib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-20 17:18:53 +08:00
groveer 486c1aadf5 feat: add clang for cmake presets
Log:
2024-09-20 16:38:58 +08:00
groveer 42e6f817fa refactor: specification protocols
Log:
2024-09-20 11:45:49 +08:00
Zhang Dingyuan 6aaba92446 chore: format all xml files
use xmlformatter

Log:
2024-09-19 15:40:22 +08:00
groveer f21228b607 fix: MultiTaskView show err windows
Log:
2024-09-19 14:28:24 +08:00
Tsic Liu 66717b51bd chore: add cmake and pkgconf to find treeland protocols
log: as title
2024-09-19 13:06:40 +08:00
groveer f46d6e01b7 chore: code reviwe for `src/utils`(part1)
Log:
2024-09-19 11:11:16 +08:00
Yixue Wang e434ea06d7 chore: upgrade licenses
Upgrade reuse license method, add some missing copyright and licenses.
2024-09-18 18:32:26 +08:00
Zhang Dingyuan df6cada986 feat: add treeland-dde-shell-v1 protocol
only for DDE

Log:
2024-09-18 17:48:02 +08:00
groveer f5d94dfd0f chore: code review for greeter: cpp code
Log:
2024-09-14 15:46:44 +08:00
groveer 5ca0d30059 chore: code review for greeter: qml code
Log:
2024-09-14 15:46:44 +08:00
groveer 60c8861e00 chore: code review for greeter: dir specification
Log:
2024-09-14 15:46:44 +08:00
Lu YaNing 7d83a4d17e fix: Add BDs wlr-protocols
Add submodule qwlroots to compile dependency wlr-protocols.

Format debian folder.
2024-09-14 08:04:44 +08:00
Zhang Dingyuan 136041f358 chore: change quit code
Exiting using the shortcut key is considered an abnormal exit. DDM will
count the number of abnormal exits and will not start treeland
afterwards.

Log:
2024-09-13 18:43:54 +08:00
groveer e3a5128aff fix: treeland should depend treeland-data
Log:
2024-09-13 18:43:01 +08:00
lbwtw d46c1e2ae6 fix: decoration is not smooth and shows aliasing
currently only one machine has been found to be stable.

Log:

Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-13 17:18:00 +08:00
groveer 262f7e6812 chore(shortcut): optimize log and format
Log:
2024-09-10 15:49:35 +08:00
groveer 518e57bf08 feat: support animated wallpaper
Log:
2024-09-09 18:31:19 +08:00
groveer 7184f32153 fix: cannot show dci icon
Log:
2024-09-09 17:48:38 +08:00
lbwtw 3aa8486d51 feat: add data_control_manager test
added an example for SystemClipboard developers to use
wlr-data-control-unstable-v1 transparently in Wayland.
implementation based on Qt Wayland Extension.

Log:

Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-09 10:21:06 +08:00
groveer e2559f486e chore: code review for treeland.cpp
Log:
2024-09-09 10:20:21 +08:00
groveer e6d5eb134d chore: code review for use dtk InWindowBlur
Log:
2024-09-09 10:20:21 +08:00
groveer 54fe5ed45d chore: code review for split debian package
Log:
2024-09-09 10:20:21 +08:00
groveer e282c11e67 chore: code review for dir specification
Log:
2024-09-09 10:20:21 +08:00
groveer ee74b32e14 chore: code review for cmake files
Log:
2024-09-09 10:20:21 +08:00
groveer ecdcb129cc chore: code review for dconfig and debian files
Log: 按 code review 遗留问题修改
2024-09-09 10:20:21 +08:00
Zhang Dingyuan c5e95556db feat: add cmake presets
add some cmake presets for developer

Log:
2024-09-09 09:29:27 +08:00
Lu YaNing 9d83e688cb fix: The window is not centered
The window is centered for the first time, and subsequent Windows
are arranged in a linear manner.
2024-09-09 09:20:19 +08:00
Lu YaNing 01ad069833 feat: Repositioning the screen when unplugged
Repositioning the position of the OutputDelegate when the screen is
unplugged, No longer need to move the mouse position.

The screen with literacy layout will only be rearranged when x or y
intersects with the removed screen.
2024-09-05 18:42:51 +08:00
Zhang Dingyuan 8bec8dcbc3 fix: xdg-shell not get focus
when layer shell surface close, focus not return to toplevelcontainer

Log:
2024-09-05 17:26:05 +08:00
Yixue Wang 88340c2115 fix: input popup surface now shown
Properties not declared correctly for InputPopupSurface.
2024-09-05 12:08:39 +08:00
lbwtw 72f6027837 fix: support zwlr_data_control_manager_v1
Log:
Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-05 11:33:26 +08:00
lbwtw 789dd9b3d5 fix: build failed
delete the useless dbus Interface.

Log:
Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-05 11:33:26 +08:00
lbwtw 2f31b685bb feat: add DRadiusEffect Item
1,DRadiusEffect supports scissor the material of a sourceItem to
different radius at bottomLeft, bottomRight, topLeft, topRight.
2,replace the Decoration and SurfaceItemContent rounded corners
implementation.

Log:
Signed-off-by: lbwtw <xiaoyaobing@uniontech.com>
2024-09-03 17:49:03 +08:00
Yixue Wang b51a51c41a feat: add scrolling in multitaskview
When there are a lot of windows, layout them in a flickable and then
scroll them.
2024-09-02 16:38:33 +08:00
pengwenhao 73304ff753 feat: add gesture bounce
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-09-02 16:38:20 +08:00
rewine d0a3e39db3 feat: add animation for dockpreview/tooltip changed
Log: better Animation for dockpreview
2024-09-02 16:37:17 +08:00
rewine 3e43202b2b chore: remove outdate getOutputName function
log: we can get name from waylib now
2024-09-02 14:09:00 +08:00
Zhang Dingyuan b8735b82f7 chore: add auto-update submodule
as title

Log:
2024-08-29 10:12:05 +08:00
pengwenhao 2cb05a8783 fix: no window decorator
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-29 09:58:51 +08:00
Yixue Wang 762ab51e6b feat: add animation in multitask view
* Add switch animation in multitask view.
* Optimize layout.
* Recover adding and removing workspace.
* Refactor workspace animation.
2024-08-29 09:58:33 +08:00
rewine ff338a4d16 feat: adjust dock preview animations 2024-08-29 09:56:02 +08:00
Lu YaNing ee93eb9c86 fix: Window display incomplete
Adapt Waylib refactoring and replace WaylandSurface with wSurface.

When the component is loaded, saveState cannot save the geometry of
the actual surfaceItem, resulting in incomplete display of the window
during layout recovery.
2024-08-28 13:07:09 +08:00
rewine 92fcb04129 fix: foreigntoplevelmanagerv1 for xwayland and fix error parent
Log: more like https://github.com/vioken/waylib/pull/472
2024-08-27 13:30:54 +08:00
Zhang Dingyuan 645ebd796b refactor: remove unnecessary function in personalization
xdg-shell has resizable and movable

Log:
2024-08-27 13:30:38 +08:00
groveer c4a6ac89a6 feat(shortcut): support ApplicationManager launch
Log:
2024-08-27 13:29:21 +08:00
Lu YaNing a3fceac770 fix: Layershell window foolproof function fails
When layershell is located in the foolproof region, the layershell
icon cannot be dragged.

Merge window drag function.
2024-08-26 17:46:25 +08:00
rewine f2aa36fa9f feat: support dock preview and tooltop animations 2024-08-23 16:43:13 +08:00
Zhang Dingyuan 6b0a9d1c50 fix: personalization datas not refresh
if some window create window slow, after protocol init, will lost datas

Log:
2024-08-23 09:03:31 +08:00
Zhang Dingyuan 086206c826 fix: add set_ prefix to personalization protocol
as title

Log:
2024-08-23 09:03:31 +08:00
groveer e1ff7cdd31 feat: add test hide window demo
Log: 用于测试隐藏窗口需求
2024-08-22 11:11:52 +08:00
pengwenhao 7faeb12f80 fix: wlr-randr scale not work
drm is pending, commit will fail, set scale to become
invalid. do not commit and wait until the next frame to
complete the scaling settings.

Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-22 11:00:28 +08:00
Zhang Dingyuan 8fc64da93b fix: launchpad animation flash
white flash on startup

Log:
2024-08-22 10:33:30 +08:00
Zhang Dingyuan 70660cc37f refactor: new personalization
add new functions

Log:
2024-08-22 10:33:30 +08:00
groveer a3f98a4e7c feat: add pinch handler test
Log: 用于测试二指手势
2024-08-22 09:39:37 +08:00
groveer efd20f62ab chore: add QT_IM_MODULE env 2024-08-20 15:22:24 +08:00
pengwenhao 20d01c526a fix: fast gesture swip causes black screen artifacts
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-20 15:03:41 +08:00
Zhang Dingyuan ac48b8f225 feat: force all qt program use wayland
set QT_QPA_PLATFORM is wayland

Log:
2024-08-18 13:52:10 +08:00
Zhang Dingyuan ed30c4eb45 feat: support xwayland work on ddm
Finally found a solution, assign permissions to specific users through
xhost.

Log:
2024-08-17 11:32:05 +08:00
Zhang Dingyuan 666d5e7921 fix: cannot resize dock
don't check layer surface

Log:
2024-08-17 11:32:05 +08:00
Zhang Dingyuan 57d9a9edfb optimize: window maximize animation
as title

Log:
2024-08-16 11:38:20 +08:00
pengwenhao 90f8877f99 feat: four-finger touchpad slides left and right
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-15 18:35:44 +08:00
Lu YaNing 15204fc1ec Updating without cursor on multiple screens
When removing the output, the cursor did not update to the second screen,
resulting in lastActivecursor not updating and the window not moving to
the second screen.
2024-08-15 16:23:51 +08:00
Zhang Dingyuan 424429d87f refactor: new lock animation
change toplevel container scale and opacity

Log:
2024-08-14 10:17:41 +08:00
Zhang Dingyuan 5c3b79ba88 refactor: new greeter animation
refactor layout

Log:
2024-08-14 10:17:41 +08:00
Lu YaNing 28e6e54c07 fix window initial position is incorrect
Assignment type error caused
2024-08-14 10:08:38 +08:00
rewine b1aa2437a9 fix: rectangleChanged never emit
log: minimize animation use this
2024-08-14 10:04:21 +08:00
lbwtw 578a11ec8d fix: fixed alt+tab displaying minimized windows
for minimized windows, when no activation is
triggered, the hidden window should not be
displayed and animated.

Log:
2024-08-13 15:22:50 +08:00
rewine 3b5229f170 feat: support minimize animation to icon geometry 2024-08-12 16:10:13 +08:00
Zhang Dingyuan 2e16e95b1f fix: High cpu usage
Files are changed too frequently

Log:
2024-08-12 13:12:57 +08:00
Yixue Wang 0df6ef5136 refact: delay changing workspace id
Only modify currentWorkspaceId when animation is finished.
2024-08-12 11:46:35 +08:00
Yixue Wang 97fa8f8d29 feat: add feedback for not wrapping
Switching is not wrapped, should give feedback to user.
2024-08-12 11:46:35 +08:00
Zhang Dingyuan 2f865847dd fix: window not set active
use touchpad single finger click

Log:
2024-08-12 11:36:01 +08:00
groveer c06dd401c4 chore: rm OBS SCM/CI workflow
Log:
2024-08-12 11:00:28 +08:00
Zhang Dingyuan 7f2b61fa20 feat: add log panel
only enable on debug mode

Log:
2024-08-12 10:46:56 +08:00
Yixue Wang 3c17620d8f Update waylib 2024-08-12 10:31:25 +08:00
lbwtw b3dd9ce075 fix: rounded corner scaling animator is abnormal
the rounded corners of WindowPreview in WindowsSwitcher
are not scaled.

Log:
2024-08-09 17:55:45 +08:00
Zhang Dingyuan a7e2cb2516 fix: layer shell surface not get focus
waylandSurface rename to wSurface

Log:
2024-08-09 16:31:44 +08:00
Lu YaNing e0068490d4 feat: Refactoring replication mode 2024-08-09 13:20:32 +08:00
Zhang Dingyuan 68f8caf49f fix: greeter cover animation flash
use behavor to replace states

Log:
2024-08-09 13:13:11 +08:00
rewine d5e13414ac fix: not found woutputitem_p.h when build 2024-08-09 10:54:38 +08:00
Yixue Wang 4d97b97787 fix: exclusive margins in multitask view
Account for exclusive margins in multitask view.
2024-08-08 18:48:23 +08:00
Zhang Dingyuan 2ce885a5b4 feat: add layershell blur
as title

Log:
2024-08-08 17:43:59 +08:00
Zhang Dingyuan c9ed3b6e33 refactor: use Helper to check force blur
as title

Log:
2024-08-08 17:43:59 +08:00
Zhang Dingyuan 0483815883 refactor: launchpad animation use states
If the launchpad is redisplayed using only the map operation, the
animation can be interrupted midway.

Log:
2024-08-08 17:43:59 +08:00
Zhang Dingyuan 25da459efb refactor: launchpad animation and greeter animation
as title

Log:
2024-08-08 17:43:59 +08:00
Zhang Dingyuan 3dbf54f3a0 feat: add launchpad only animation
add new animation

Log:
2024-08-08 17:43:59 +08:00
Yixue Wang e788d0cb14 fix: live not work
* Don't hide desktop when multitask view is shown.
 * Improves preview, add radius and shadow.
2024-08-08 17:37:27 +08:00
lbwtw 934dee4ebe fix: Alt+tab to display no window in workspace
when there is no window in the workspace, it is
forbidden to use the shortcut key to open the
alt+tab view.

Log:
2024-08-08 17:33:00 +08:00
lbwtw 67a959bb87 fix: alt+tab low probability window does not hide
the time interval between two alt+tabs is too short, and
the previous window animation is not stopped, causing
problems. added an interruption mechanism.

Log:
2024-08-08 17:11:47 +08:00
lbwtw e93d579818 fix: Window left and right key events are abnormal
Key_Right and Key_Left should not truncate event delivery.

Log:
2024-08-08 13:41:56 +08:00
lbwtw e85b51bc4f fix: WorkspaceMask flashes
WorkspaceMask initial opacity should be 0.

Log:
2024-08-08 13:25:49 +08:00
lbwtw 24993663fd fix: Alt+Key_Left or Key_Right display WindowsSwitcher
when switcher.visible is false, ignore Key_Right and
Key_Left event.

Log:
2024-08-08 13:11:43 +08:00
lbwtw 0c1581923c feat: Improve window preview for alt+tab
1,in WindowsSwitcher, when taking a snapshot of a
SurfaceItem, a BoxShadow may be obtained, and a
black image will appear around the rounded corners
of the snapshot.
2,no Boxshadow on the preview window edges.
3,preview window's shadow flickers when animator
end.

Log:
2024-08-08 10:11:00 +08:00
Yixue Wang b6a0bec671 feat: support composing multiple animations
Handle triggerring animations when in animation.
2024-08-07 17:30:41 +08:00
Zhang Dingyuan 45e3f06418 feat: update wallpaper animation cover
add black cover

Log:
2024-08-07 17:29:50 +08:00
Zhang Dingyuan f9d5e6ef1d feat: update layershell fullscreen animation
scale 0.2 -> 0.3

Log:
2024-08-07 17:29:50 +08:00
groveer 4801ddee85 chore: sync from waylib
depend: https://github.com/vioken/waylib/pull/458

Log:
2024-08-07 17:28:09 +08:00
pengwenhao 4c79626f02 fix: task-view gestures and shortcuts interaction
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 17:27:54 +08:00
pengwenhao a8886bfeba fix: three-finger window maximized rebound
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 17:27:54 +08:00
pengwenhao 31ae22d604 fix: shortcut method task view animation window jump
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 17:27:54 +08:00
groveer d9e28248b7 chore: rm `back to normal`
Log:
2024-08-07 15:28:30 +08:00
Zhang Dingyuan 7700d46fe9 fix: launchpad will show on lockscreen
add lockscreen check

Log:
2024-08-07 14:21:00 +08:00
Zhang Dingyuan 3355ef7db3 feat: update greeter style
update style

Log:
2024-08-07 14:21:00 +08:00
lbwtw ff26a27e8f feat: Support left and right key switching
Bind the left and right buttons to Switcher::Previous
and Switcher::Next.

Log:
2024-08-07 13:20:28 +08:00
pengwenhao e4ea6a804e feat: task view four-finger follow
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 11:41:18 +08:00
pengwenhao e10ea1588d feat: fast togglable gesture state
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 11:41:18 +08:00
pengwenhao e156245b8b feat: finger register process.
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-08-07 11:41:18 +08:00
Yixue Wang cd4604cb0c fix: surface move to workspace not work
Use wrapper instead of surface item.
2024-08-07 11:34:33 +08:00
Zhang Dingyuan a9e95f4151 refactor: user shortcut move to qml
add ShortcutModel

Log:
2024-08-07 11:17:21 +08:00
lbwtw bd60a843e5 feat: add window activation animator and WorkspaceMask
1,Add WorkspaceMask as background mask to make the desktop
look translucent.
2,Add window activation animator to make the window transition
from the preview position to the original position.
3,window activation animator is limited to 18 windows at most.

Log:
2024-08-07 11:14:23 +08:00
groveer dba2eeb46c fix: greeter and xdgsurface focus error
Log: 修复普通窗口失焦问题,修复登录时greeter失焦问题
2024-08-06 17:45:01 +08:00
Zhang Dingyuan 74487dfedd fix: blur not working
remove viewport

Log:
2024-08-06 15:28:50 +08:00
Zhang Dingyuan 6c5ba1894d fix: wallpaper will not refresh
lock state

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan 1d2ad45f08 feat: add greeter show animation
as title

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan 7ca0fb03c9 fix: greeter logo not shift with parent
wrong level

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan b220cbbfc0 feat: add unlock animation
all window need hide

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan 9153784c5c refactor: wallpaper controller add lock state
only allow one controller get control

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan be72e3f0f3 fix: high cpu use
foreign toplevel parent surface loop

Log:
2024-08-06 09:16:38 +08:00
Zhang Dingyuan 23d7b9243f fix: window wallpaper not working
refactor wallpaper item

Log:
2024-08-06 09:16:38 +08:00
JiDe Zhang a22c282542 Fix surface freeze when enable corner rounded effect 2024-08-02 18:50:45 +08:00
JiDe Zhang 377f1843b2 Revert "Fix surface freeze when enable corner rounded effect"
This reverts commit 66ee5851b6.
2024-08-02 18:50:45 +08:00
JiDe Zhang 66ee5851b6 Fix surface freeze when enable corner rounded effect 2024-08-02 17:25:33 +08:00
lbwtw c632d6dd36 WindowsSwitcher: Improve the preview fade-in and fade-out animation 2024-08-02 15:55:18 +08:00
rewine ec601eb8f4 fix: can't set cursor theme 2024-08-02 15:33:49 +08:00
JiDe Zhang fbd51f62f3 Add window corner radius effect 2024-08-02 14:33:45 +08:00
Yixue Wang e4ab11196c feat: handle workspace quick jump
Add shortcuts for workspace quick jump.
2024-08-02 11:29:07 +08:00
Lu YaNing 1b37d393dd Fix black screen for setting replication mode
Adaptive rendering optimization
2024-08-01 15:57:30 +08:00
lbwtw ebbc51230f fix: switchView.model undefined 2024-08-01 15:27:07 +08:00
Lu YaNing 93bb6fbf09 fix: The secondary screen cannot be set as a mirror screen 2024-08-01 14:03:54 +08:00
Yixue Wang c6fe0e2239 chore: set invisible instead of comment
Set destroyBtn and createBtn invisible instead of commenting them out.
2024-08-01 11:33:48 +08:00
Yixue Wang 191818ae12 feat: support animation across workspace switch
Add an animation component to animate across workspace switch.
2024-08-01 11:33:48 +08:00
Yixue Wang 72c042b76d fix: assign to non-existent property
workspaceId has been renamed to wid.
2024-08-01 11:33:48 +08:00
Yixue Wang 4a1aeedb12 fix: connection to nullptr
Do not connect to newActivate when it's nullptr.
2024-08-01 11:33:48 +08:00
Yixue Wang c93bdf8c9c feat: add drag move transition
Add drag move transition for workspace thumb items.
2024-08-01 11:33:48 +08:00
Yixue Wang 9822514c92 fix: warning by qml
Use an accurate type.
2024-08-01 11:33:48 +08:00
Yixue Wang 2faaefa4d1 feat: add right button handler
Add RightButton handler.
2024-08-01 11:33:48 +08:00
Yixue Wang 7861ac3ba9 fix: close icon style
Adjust close icon style according to design.
2024-08-01 11:33:48 +08:00
JiDe Zhang 129c321789 Update waylib submodule 2024-08-01 11:33:34 +08:00
lbwtw ef9fd7518b feat: add animation for alt+tab switch
add animation for visible and preview switch.

Log: add animation for alt+tab switch
2024-08-01 11:12:26 +08:00
Yixue Wang 63697367b3 fix: multitaskview functions
Fix dragging in multitaskview.
2024-08-01 11:12:14 +08:00
Yixue Wang 2f717f1d83 fix: some qml warnings
Fix some null warnings.
2024-08-01 11:12:14 +08:00
rewine 0421a6387b fix: set set activate surface before start move or for csd
log: csd not active when moving or resizing
2024-07-30 18:08:10 +08:00
rewine 200bfb14ce fix: move layer surface out of non-root FocusScope
log: layer surface is not part of workspace and should not hide when desktop preview
2024-07-30 11:21:26 +08:00
rewine 188040883b feat: sync refactor cursor of waylib
log: https://github.com/vioken/waylib/pull/413
2024-07-30 10:44:21 +08:00
rewine 7c3313f569 chore: rect to qwlroots's refactor
Log: fix build
2024-07-30 10:44:21 +08:00
Lu YaNing ae30602ff2 fix: The dock area icon cannot be clicked 2024-07-26 18:35:08 +08:00
rewine 455ec14cba fix: dock preview can't work
log: getSurfaceItemFromWaylandSurface should return shell not only item
2024-07-26 17:46:15 +08:00
rewine 00ef99c762 fix: layer shell animation never call error stop
Log: fix popup error size of layersurface
2024-07-26 16:27:03 +08:00
Lu YaNing 6b21ca2b59 fix: window-proofing optimize
Add the screen edge drag limit of 5 pixels when the window is dragged
to prevent the window from dragging out of the screen area.
2024-07-26 14:37:52 +08:00
groveer e67f91ba7a feat: add treeland-examples package
Log:
2024-07-26 11:46:03 +08:00
Zhang Dingyuan b0e4dd3183 fix: surface not show
as title

Log:
2024-07-26 11:34:48 +08:00
Lu YaNing b4c9734925 feat: layershell foolproof
Layershell with dedicated area adds fool-proof function
2024-07-25 18:18:31 +08:00
Zhang Dingyuan a5241c3952 refactor: wallpaper controller
WallpaperProxy will proxy show wallpaper
WallpaperControll will provide action for wallpaper
WallpaperManager will provide management

Log:
2024-07-25 17:44:23 +08:00
pengwenhao 61dc46e220 fix: pinch gesture toggled window maximize
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-25 17:26:13 +08:00
lbwtw 3e4e4f87c8 refractor alt+tab 2024-07-25 14:12:40 +08:00
Zhang Dingyuan 603631117a fix: layer animation signal error
use property function type.

Log:
2024-07-24 14:24:46 +08:00
Zhang Dingyuan d563f66b54 fix: cannot login again
user state not refresh

Log:
2024-07-24 14:24:46 +08:00
Zhang Dingyuan 718e60cb7c feat: add wallpaper animation
as title

Log:
2024-07-24 14:24:46 +08:00
Zhang Dingyuan 177b76da8b feat: add fullscreen layershell animation
as title

Log:
2024-07-24 14:24:46 +08:00
pengwenhao 5a0b48979f fix: gtk app show server decoration
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-23 14:45:07 +08:00
Zhang Dingyuan edfdb127e2 chore: layershell not show
layershell need shellSurface

Log:
2024-07-23 13:43:33 +08:00
Zhang Dingyuan f537e3be48 feat: support layershell animation
add layershell single anchor animation

Log: 支持 LayerShell 窗口动画
2024-07-23 13:43:33 +08:00
Zhang Dingyuan b5c8b842b8 feat: update window animation
update animation params

Log:
2024-07-22 16:43:44 +08:00
pengwenhao 5494aa9e4a fix: no touchpad crash
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-22 13:39:44 +08:00
groveer edbb148df8 refactor: all surface use surfaceCreator
Log:
2024-07-19 15:30:24 +08:00
Lu YaNing 70e7102ab4 feat: Implement treeland_virtual_manager_v1 function
Implementing Virtual Output
2024-07-18 18:12:19 +08:00
pengwenhao cbdedf4e55 feat: three finger move and window Maximize
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-18 18:10:29 +08:00
pengwenhao 74a9a36765 fix: input device enable tap
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-18 18:10:29 +08:00
Zhang Dingyuan ed9b247bfd feat: disable xwayland on DDM mode
DDM not support running xwayland.

Log:
2024-07-18 10:43:14 +08:00
lbwtw 6af1fcc410 chore: use === or !==
== and !== may perform type coercion.

Log:
2024-07-18 10:41:17 +08:00
Yixue Wang 0635305db5 Update waylib 2024-07-18 10:39:48 +08:00
Yixue Wang 2c106ef97d fix: adapt to waylib update
Update waylib and adapt to changes.
2024-07-16 14:51:22 +08:00
pengwenhao 1dfcc95507 fix: resize move cursor and change cursor shape
Signed-off-by: pengwenhao <pengwenhao@uniontech.com>
2024-07-11 11:31:39 +08:00
lbwtw bc0f2b36c9 feat: long press the title bar to display the menu
in a touch screen environment, long pressing the
titlebar is equivalent to right-clicking the mouse.

Log: long press the title bar to display the menu
2024-07-10 10:06:48 +08:00
lbwtw 4bfcf6f313 fix: support touch screen single-finger double-click
touch screen double-click to maximize/restore window.

Log: support touch screen single-finger double-click
2024-07-10 10:06:48 +08:00
rewine 241a23cf1c
Merge pull request #10 from asterwyx/master
Update waylib
2024-07-09 17:20:55 +08:00
Yixue Wang 7fdfede9e4 Update waylib 2024-07-09 17:10:11 +08:00
lbwtw 4d63473dab fix: jagged corners of the title bar
use ItemViewport to generate rounded corners mask.

Log: jagged corners of the title bar
2024-07-09 11:36:02 +08:00
groveer 39fcd6dac4 chore: clean up useless file
Log:
2024-07-05 11:42:51 +08:00
Yixue Wang b50cde3697 Update waylib 2024-07-05 10:16:50 +08:00
1094 changed files with 107391 additions and 11360 deletions

View File

@ -38,12 +38,12 @@ BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
@ -68,10 +68,6 @@ PPIndentWidth: 2
AlignAfterOpenBracket: Align
AlwaysBreakTemplateDeclarations: true
# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that.
AllowShortFunctionsOnASingleLine: Inline
# As clang-format 13 can regroup includes we enable this feature.
# basically according to https://wiki.qt.io/Coding_Conventions#Including_headers
# and https://github.com/linuxdeepin/deepin-styleguide
@ -110,13 +106,14 @@ IncludeCategories:
- Regex: '^<'
Priority: 3
IncludeIsMainRegex: '((T|t)est)?$'
SortIncludes: true
SortIncludes: CaseSensitive
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
# Break constructor initializers before the colon and after the commas.
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
# Add "// namespace <namespace>" comments on closing brace for a namespace
# Ignored for namespaces that qualify as a short namespace,
@ -139,6 +136,8 @@ SpaceBeforeCpp11BracedList: false
AllowAllArgumentsOnNextLine: false
AllowShortLambdasOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowAllParametersOfDeclarationOnNextLine: false
AlignTrailingComments: true
BinPackArguments: false
BinPackParameters: false

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: export
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

View File

@ -0,0 +1,87 @@
name: Build qwlroots on Arch Linux (independent)
on:
push:
paths:
- 'qwlroots/**'
- '.github/workflows/qwlroots-archlinux-build.yml'
pull_request:
paths:
- 'qwlroots/**'
- '.github/workflows/qwlroots-archlinux-build.yml'
jobs:
container:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- uses: actions/checkout@v4
- name: Run in container
run: |
pacman-key --init
pacman -Syu --noconfirm
- name: Install dependencies
run: |
pacman -Syu --noconfirm qt6-base cmake pkgconfig wlroots0.19 pixman wayland-protocols wlr-protocols
pacman -Syu --noconfirm clang ninja base-devel git
- name: Configure and build qwlroots
working-directory: qwlroots
run: |
echo "Working directory:" $PWD
cmake --preset ci
cmake --build --preset ci
- name: Install qwlroots to staging directory
working-directory: qwlroots
run: |
echo "Installing qwlroots to staging directory..."
mkdir -p /tmp/qwlroots-install
DESTDIR=/tmp/qwlroots-install cmake --install build
echo "✅ qwlroots installed to staging directory"
echo "Installed files:"
find /tmp/qwlroots-install -type f | head -20
echo "Total files installed: $(find /tmp/qwlroots-install -type f | wc -l)"
- name: Create qwlroots installation package
run: |
cd /tmp/qwlroots-install
# Install zip if not available
pacman -Syu --noconfirm zip
# Create package info
echo "Creating package info..."
cat > PACKAGE_INFO.txt << EOF
Package: qwlroots-archlinux-build
Version: $(date +%Y%m%d-%H%M%S)
Architecture: x86_64
Built-on: Arch Linux
CMake-Config: Default configuration
Installation Instructions:
1. Extract this package to /
2. Run: sudo ldconfig (if libraries are included)
3. Ensure dependencies are installed on target system
Files included in this package:
EOF
find . -type f | sort >> PACKAGE_INFO.txt
# Create the zip package
zip -r /tmp/qwlroots-archlinux-$(date +%Y%m%d-%H%M%S).zip .
echo "✅ qwlroots installation package created"
ls -la /tmp/qwlroots-archlinux-*.zip
- name: Upload qwlroots ArchLinux build artifacts
uses: actions/upload-artifact@v4
with:
name: qwlroots-archlinux-build
path: "/tmp/qwlroots-archlinux-*.zip"
if-no-files-found: error
retention-days: 30

View File

@ -0,0 +1,59 @@
name: Build qwlroots on Debian unstable (independent)
on:
push:
paths:
- 'qwlroots/**'
- '.github/workflows/qwlroots-debian-build.yml'
pull_request:
paths:
- 'qwlroots/**'
- '.github/workflows/qwlroots-debian-build.yml'
jobs:
container:
runs-on: ubuntu-latest
container: debian:unstable
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
working-directory: qwlroots
run: |
# Configure apt sources for unstable
echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get install -y devscripts equivs
# Add deepin community repository to install wlr-protocols
echo "deb [trusted=yes] https://community-packages.deepin.com/beige/ crimson main commercial community" > /etc/apt/sources.list.d/deepin-community.list
# Update package lists (ignore signature errors for this temporary repo)
apt-get update --allow-unauthenticated
# Install wlr-protocols package directly
apt-get install -y --allow-unauthenticated wlr-protocols
# Remove deepin repository to avoid system pollution
rm -f /etc/apt/sources.list.d/deepin-community.list
apt-get update
# Install other build dependencies from control file
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
- name: Build qwlroots deb package
working-directory: qwlroots
run: |
dpkg-buildpackage -uc -us -b
echo "✅ qwlroots deb package built successfully!"
ls -la ../*.deb
- name: Upload qwlroots deb packages as artifacts
uses: actions/upload-artifact@v4
with:
name: qwlroots-deb-packages
path: "*.deb"
if-no-files-found: error
retention-days: 30

View File

@ -0,0 +1,129 @@
name: Build treeland on Arch Linux
# This workflow builds treeland with merged waylib and qwlroots code
# Dependencies are based on the official ArchLinux PKGBUILD plus
# additional dependencies from the integrated waylib and qwlroots code
# treeland-protocols-git is installed from AUR
on:
push:
pull_request:
jobs:
container:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Run in container
run: |
cat /etc/pacman.d/mirrorlist
pacman-key --init
pacman --noconfirm --noprogressbar -Syu
- name: Install base dependencies
run: |
pacman -Syu --noconfirm --noprogressbar base-devel git cmake ninja pkgconfig clang make
pacman -Syu --noconfirm --noprogressbar fakeroot meson sudo
- name: Install Qt6 dependencies
run: |
# Qt6 dependencies matching qwlroots and waylib builds
pacman -Syu --noconfirm --noprogressbar qt6-base qt6-declarative qt6-wayland qt6-tools
- name: Install graphics and wayland dependencies
run: |
# Core graphics and wayland dependencies (matching qwlroots and waylib builds)
pacman -Syu --noconfirm --noprogressbar pixman vulkan-headers wayland wayland-protocols wlr-protocols
pacman -Syu --noconfirm --noprogressbar wlroots0.19 libinput pam systemd-libs jemalloc gcc-libs glibc
- name: Install additional waylib/qwlroots dependencies
run: |
# Additional dependencies from waylib and qwlroots build configs
pacman -Syu --noconfirm --noprogressbar libdrm xcb-util-errors libxdmcp
- name: Install DTK dependencies
run: |
# Try to install DTK from available packages
# If not available, the build will proceed without them (may fail)
pacman -Syu --noconfirm --noprogressbar dtk6core dtk6declarative dtk6systemsettings
- name: Install DDM dependencies
run: |
# Try to install DDM from available packages
pacman -Syu --noconfirm --noprogressbar ddm
- name: Build and Install treeland-protocols
run: |
echo "Building treeland-protocols from source..."
git clone https://github.com/linuxdeepin/treeland-protocols.git --depth 1
cd treeland-protocols
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
echo "✅ treeland-protocols built and installed from source"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure and Build treeland with ci preset
run: |
echo "Working directory:" $PWD
echo "Configuring treeland with merged waylib and qwlroots code..."
cmake --preset ci
cmake --build --preset ci
echo "✅ treeland built successfully with merged waylib and qwlroots code!"
- name: Install treeland to staging directory
run: |
echo "Installing treeland to staging directory..."
mkdir -p /tmp/treeland-install
DESTDIR=/tmp/treeland-install cmake --install build
echo "✅ treeland installed to staging directory"
echo "Installed files:"
find /tmp/treeland-install -type f | head -20
echo "Total files installed: $(find /tmp/treeland-install -type f | wc -l)"
- name: Create treeland installation package
run: |
cd /tmp/treeland-install
# Install zip if not available
pacman -Syu --noconfirm zip
# Create package info
echo "Creating package info..."
cat > PACKAGE_INFO.txt << EOF
Package: treeland-archlinux-build
Version: $(date +%Y%m%d-%H%M%S)
Architecture: x86_64
Built-on: Arch Linux
Built-with: merged waylib and qwlroots code
CMake-Config: -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib
Installation Instructions:
1. Extract this package to /
2. Run: sudo ldconfig (if libraries are included)
3. Ensure dependencies are installed on target system
Files included in this package:
EOF
find . -type f | sort >> PACKAGE_INFO.txt
# Create the zip package
zip -r /tmp/treeland-archlinux-$(date +%Y%m%d-%H%M%S).zip .
echo "✅ treeland installation package created"
ls -la /tmp/treeland-archlinux-*.zip
- name: Upload treeland ArchLinux build artifacts
uses: actions/upload-artifact@v4
with:
name: treeland-archlinux-build
path: "/tmp/treeland-archlinux-*.zip"
if-no-files-found: error
retention-days: 30

View File

@ -0,0 +1,100 @@
name: Build waylib on Arch Linux (independent)
on:
push:
paths:
- 'waylib/**'
- 'qwlroots/**'
- '.github/workflows/waylib-archlinux-build.yml'
pull_request:
paths:
- 'waylib/**'
- 'qwlroots/**'
- '.github/workflows/waylib-archlinux-build.yml'
jobs:
container:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Run in container
run: |
cat /etc/pacman.d/mirrorlist
pacman-key --init
pacman --noconfirm --noprogressbar -Syu
- name: Install dependencies
run: |
pacman -Syu --noconfirm --noprogressbar base-devel qt6-base qt6-declarative cmake pkgconfig pixman vulkan-headers wlroots0.19 wayland-protocols wlr-protocols git
pacman -Syu --noconfirm --noprogressbar clang ninja make
pacman -Syu --noconfirm --noprogressbar fakeroot meson sudo
- uses: actions/checkout@v4
with:
submodules: true
- name: Create qwlroots symlink for waylib
run: |
cd waylib
ln -sf ../qwlroots qwlroots
echo "✅ Created symlink: waylib/qwlroots -> ../qwlroots"
ls -la qwlroots
- name: Configure and Build waylib with ci preset
working-directory: waylib
run: |
echo "Working directory:" $PWD
cmake --preset ci -DWITH_SUBMODULE_QWLROOTS=ON
cmake --build --preset ci
- name: Install waylib to staging directory
working-directory: waylib
run: |
echo "Installing waylib to staging directory..."
mkdir -p /tmp/waylib-install
DESTDIR=/tmp/waylib-install cmake --install build
echo "✅ waylib installed to staging directory"
echo "Installed files:"
find /tmp/waylib-install -type f | head -20
echo "Total files installed: $(find /tmp/waylib-install -type f | wc -l)"
- name: Create waylib installation package
run: |
cd /tmp/waylib-install
# Install zip if not available
pacman -Syu --noconfirm zip
# Create package info
echo "Creating package info..."
cat > PACKAGE_INFO.txt << EOF
Package: waylib-archlinux-build
Version: $(date +%Y%m%d-%H%M%S)
Architecture: x86_64
Built-on: Arch Linux
Built-with: qwlroots submodule enabled
CMake-Config: -DWITH_SUBMODULE_QWLROOTS=ON
Installation Instructions:
1. Extract this package to /
2. Run: sudo ldconfig (if libraries are included)
3. Ensure dependencies are installed on target system
Files included in this package:
EOF
find . -type f | sort >> PACKAGE_INFO.txt
# Create the zip package
zip -r /tmp/waylib-archlinux-$(date +%Y%m%d-%H%M%S).zip .
echo "✅ waylib installation package created"
ls -la /tmp/waylib-archlinux-*.zip
- name: Upload waylib ArchLinux build artifacts
uses: actions/upload-artifact@v4
with:
name: waylib-archlinux-build
path: "/tmp/waylib-archlinux-*.zip"
if-no-files-found: error
retention-days: 30

View File

@ -0,0 +1,84 @@
name: Build waylib on Debian unstable (independent)
on:
push:
paths:
- 'waylib/**'
- 'qwlroots/**'
- '.github/workflows/waylib-debian-build.yml'
pull_request:
paths:
- 'waylib/**'
- 'qwlroots/**'
- '.github/workflows/waylib-debian-build.yml'
jobs:
container:
runs-on: ubuntu-latest
container: debian:unstable
steps:
- uses: actions/checkout@v4
- name: Build qwlroots first
working-directory: qwlroots
run: |
# Configure apt sources for unstable
echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get install -y devscripts equivs
# Add deepin community repository to install wlr-protocols
echo "deb [trusted=yes] https://community-packages.deepin.com/beige/ crimson main commercial community" > /etc/apt/sources.list.d/deepin-community.list
# Update package lists (ignore signature errors for this temporary repo)
apt-get update --allow-unauthenticated
# Install wlr-protocols package directly
apt-get install -y --allow-unauthenticated wlr-protocols
# Remove deepin repository to avoid system pollution
rm -f /etc/apt/sources.list.d/deepin-community.list
apt-get update
# Install other build dependencies for qwlroots
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
# Build qwlroots deb package
dpkg-buildpackage -uc -us -b
echo "✅ qwlroots deb package built successfully!"
ls -la ../*.deb
- name: Install qwlroots deb package
run: |
# Install the built qwlroots package
dpkg -i qwlroots*.deb || apt-get install -f -y
echo "✅ qwlroots package installed!"
- name: Build waylib deb package
working-directory: waylib
run: |
# Install remaining build dependencies for waylib
apt-get install -y devscripts equivs
# Install waylib build dependencies (qwlroots is now available from the installed deb)
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
# Build waylib with submodule disabled (use system qwlroots)
# Modify debian/rules to disable submodule
sed -i 's/-DCMAKE_INSTALL_PREFIX=\/usr/-DCMAKE_INSTALL_PREFIX=\/usr -DWITH_SUBMODULE_QWLROOTS=OFF/' debian/rules
echo "Modified debian/rules to disable qwlroots submodule:"
cat debian/rules
dpkg-buildpackage -uc -us -b
echo "✅ waylib deb package built successfully!"
ls -la ../*.deb
- name: Upload waylib deb packages as artifacts
uses: actions/upload-artifact@v4
with:
name: waylib-deb-packages
path: "*.deb"
if-no-files-found: error
retention-days: 30

17
.gitignore vendored
View File

@ -1,6 +1,7 @@
.vscode/
.cache/
build*/
.qtcreator/
*.user
@ -38,4 +39,18 @@ CMakeLists.txt.user
# qtcreator
*.autosave
.qmlls.ini
.qmlls.ini
# dpkg-buildpackage
debian/.debhelper/
debian/tmp/
debian/treeland*/
debian/debhelper-build-stamp
debian/files
debian/*.substvars
debian/*.debhelper.log
obj-*-linux-gnu/
# ai
.cursor
.specstory

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "waylib"]
path = waylib
url = https://github.com/vioken/waylib

View File

@ -1,177 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: treeland
Source: https://github.com/vioken/treeland
# ci
Files: .github/* .obs/*.yml garnix.yaml
Copyright: None
License: CC0-1.0
# config
Files: .clang-format
.editorconfig
*.frag
*.ui
*.vert
**/qmldir
Copyright: None
License: CC0-1.0
# debian rpm archlinux
Files: debian/* rpm/* archlinux/*
Copyright: None
License: CC0-1.0
# Nix Develop files
Files: *.nix .envrc flake.lock renovate.json
Copyright: None
License: CC0-1.0
# docs
Files: docs/*
Copyright: None
License: CC0-1.0
# translation
Files: translations/* po/* **/*.qm **/*.ts
Copyright: vioken
License: GPL-2.0-only
# png svg
Files: **/*.svg **/*.png **/*.jpg **/*.jpeg **/*.webp **/*.dci **/*.gif logo.png
Copyright: vioken
License: CC0-1.0
# xml toml json conf yaml ...
Files: **/*.json
**/*.service
**/*.txt
**/*.sh
**/*.html
**/conf
.gitignore
.gitmodules
INSTALL.md
**/*.desktop
**/*.css
**/*.ttf
*.conf
**/*.xml
.release.json
**/*.in
Copyright: None
License: CC0-1.0
# README and changelog
Files: **/*.md
README.md
README.zh_CN.md
CONTRIBUTING.md
ChangeLog
CONTRIBUTORS
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
# Project file
Files: **/*.cmake
**/CMakeLists.txt
*.in *.qrc
CMakeLists.txt
data/*
services/*
releng/create_changelog.pl
Copyright: None
License: GPL-2.0-only
# test
Files: test/*
Copyright: None
License: GPL-2.0-only
# SDDM license
Files:
releng/prepare-relnotes
src/auth/Auth.cpp
src/auth/Auth.h
src/auth/AuthMessages.h
src/auth/AuthPrompt.cpp
src/auth/AuthPrompt.h
src/auth/AuthRequest.cpp
src/auth/AuthRequest.h
src/common/ConfigReader.cpp
src/common/ConfigReader.h
src/common/Configuration.cpp
src/common/Configuration.h
src/common/MessageHandler.h
src/common/Messages.h
src/common/SafeDataStream.cpp
src/common/SafeDataStream.h
src/common/Session.cpp
src/common/Session.h
src/common/SignalHandler.cpp
src/common/SignalHandler.h
src/common/SocketWriter.cpp
src/common/SocketWriter.h
src/common/ThemeConfig.cpp
src/common/ThemeConfig.h
src/common/ThemeMetadata.cpp
src/common/ThemeMetadata.h
src/common/VirtualTerminal.cpp
src/common/VirtualTerminal.h
src/common/XAuth.cpp
src/common/XAuth.h
src/daemon/DaemonApp.cpp
src/daemon/DaemonApp.h
src/daemon/Display.cpp
src/daemon/Display.h
src/daemon/DisplayManager.cpp
src/daemon/DisplayManager.h
src/daemon/DisplayServer.cpp
src/daemon/DisplayServer.h
src/daemon/Greeter.cpp
src/daemon/Greeter.h
src/daemon/PowerManager.cpp
src/daemon/PowerManager.h
src/daemon/Seat.cpp
src/daemon/Seat.h
src/daemon/SeatManager.cpp
src/daemon/SeatManager.h
src/daemon/SocketServer.cpp
src/daemon/SocketServer.h
src/daemon/Utils.h
src/daemon/WaylandDisplayServer.cpp
src/daemon/WaylandDisplayServer.h
src/daemon/XorgDisplayServer.cpp
src/daemon/XorgDisplayServer.h
src/daemon/XorgUserDisplayServer.cpp
src/daemon/XorgUserDisplayServer.h
src/greeter/GreeterApp.h
src/greeter/GreeterProxy.cpp
src/greeter/GreeterProxy.h
src/greeter/SessionModel.cpp
src/greeter/SessionModel.h
src/greeter/UserModel.cpp
src/greeter/UserModel.h
src/helper/Backend.cpp
src/helper/Backend.h
src/helper/HelperApp.cpp
src/helper/HelperApp.h
src/helper/HelperStartWayland.cpp
src/helper/HelperStartX11User.cpp
src/helper/UserSession.cpp
src/helper/UserSession.h
src/helper/backend/PamBackend.cpp
src/helper/backend/PamBackend.h
src/helper/backend/PamHandle.cpp
src/helper/backend/PamHandle.h
src/helper/waylandhelper.cpp
src/helper/waylandhelper.h
src/helper/waylandsocketwatcher.cpp
src/helper/waylandsocketwatcher.h
src/helper/xorguserhelper.cpp
src/helper/xorguserhelper.h
src/common/LogindDBusTypes.cpp
src/common/LogindDBusTypes.h
src/greeter/GreeterApp.cpp
Copyright: None
License: GPL-2.0-only

26
.tx/config Normal file
View File

@ -0,0 +1,26 @@
[main]
host = https://www.transifex.com
[o:linuxdeepin:p:treeland:r:f56f82288bfe7a231b1be25f7b0cb008]
file_filter = translations/treeland.<lang>.ts
source_file = translations/treeland.en_US.ts
source_lang = en_US
type = QT
[o:linuxdeepin:p:treeland:r:b675317802ed042606e0660179b6b04f]
file_filter = src/plugins/lockscreen/translations/lockscreen.<lang>.ts
source_file = src/plugins/lockscreen/translations/lockscreen.en_US.ts
source_lang = en_US
type = QT
[o:linuxdeepin:p:treeland:r:7309e9da01b4b7fbf5c2ac9c2a2d23a6]
file_filter = src/plugins/multitaskview/translations/multitaskview.<lang>.ts
source_file = src/plugins/multitaskview/translations/multitaskview.en_US.ts
source_lang = en_US
type = QT
[o:linuxdeepin:p:treeland:r:1eff66bc82bf8f288b9c56e8c724ea20]
file_filter = examples/test_set_treeland_wallpaper/translations/wallpaper.<lang>.ts
source_file = examples/test_set_treeland_wallpaper/translations/wallpaper.en_US.ts
source_lang = en_US
type = QT

23
.tx/transifex.yaml Normal file
View File

@ -0,0 +1,23 @@
filters:
- filter_type: file
source_file: translations/treeland.en_US.ts
file_format: QT
source_language: en_US
translation_files_expression: translations/treeland.<lang>.ts
- filter_type: file
source_file: src/plugins/lockscreen/translations/lockscreen.en_US.ts
file_format: QT
source_language: en_US
translation_files_expression: src/plugins/lockscreen/translations/lockscreen.<lang>.ts
- filter_type: file
source_file: src/plugins/multitaskview/translations/multitaskview.en_US.ts
file_format: QT
source_language: en_US
translation_files_expression: src/plugins/multitaskview/translations/multitaskview.<lang>.ts
- filter_type: file
source_file: examples/test_set_treeland_wallpaper/translations/wallpaper.en_US.ts
file_format: QT
source_language: en_US
translation_files_expression: examples/test_set_treeland_wallpaper/translations/wallpaper.<lang>.ts
settings:
pr_branch_name: transifex_update_<br_unique_id>

View File

@ -1,14 +1,11 @@
cmake_minimum_required(VERSION 3.25.0)
project(TreeLand
VERSION 0.2.2
project(Treeland
VERSION 0.7.0
LANGUAGES CXX C)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -17,47 +14,109 @@ include(GNUInstallDirs)
# Macros
include(FeatureSummary)
option(WITH_SUBMODULE_WAYLIB "Use the waylib from git submodule" OFF)
include(cmake/DefineTarget.cmake)
option(WITH_SUBMODULE_WAYLIB "Use the waylib from git submodule" ON)
add_feature_info(submodule_waylib WITH_SUBMODULE_WAYLIB "Use waylib from submodule")
option(ADDRESS_SANITIZER "Enable address sanitize" OFF)
option(ADDRESS_SANITIZER "Enable address sanitizer" OFF)
add_feature_info(ASanSupport ADDRESS_SANITIZER "https://github.com/google/sanitizers/wiki/AddressSanitizer")
option(BUILD_TEST_CLIENTS "Build clients demo to test treeland" OFF)
option(BUILD_TREELAND_EXAMPLES "Build clients demo to test treeland" OFF)
add_feature_info(DemoClents BUILD_TEST_CLIENTS "clients demo for testing")
option(DISABLE_DDM "Disable DDM and greeter" OFF)
if (DISABLE_DDM)
add_compile_definitions("DISABLE_DDM")
endif()
# Alternative lock mechanism: Wayland ext-session-lock
option(EXT_SESSION_LOCK_V1 "Enable Wayland ext-session-lock support (alternative to DDM)" ON)
add_feature_info(ext_session_lock_v1 EXT_SESSION_LOCK_V1 "Enable ext-session-lock-v1 protocol support in Treeland")
if (EXT_SESSION_LOCK_V1)
add_compile_definitions("EXT_SESSION_LOCK_V1")
endif()
# Heads-up if both are enabled: ext-session-lock is intended as an alternative to DDM
if (NOT EXT_SESSION_LOCK_V1 AND DISABLE_DDM)
message(WARNING "no ext-session-lock support and no DDM, treeland will not have session locking ability.")
endif()
if (ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer)
add_link_options(-fsanitize=address)
endif()
# NOTE: Qt keywords conflict with wlroots. but dtksystemsettings still uses it.
# add_definitions("-DQT_NO_KEYWORDS")
set(QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/qt/qml;${QML_IMPORT_PATH}" CACHE STRING "For LSP" FORCE)
# NOTE: Enable Qt logging with context.
add_definitions("-DQT_MESSAGELOGCONTEXT")
set(LOCAL_QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/qt/qml")
if(WITH_SUBMODULE_WAYLIB)
set(WITH_SUBMODULE_QWLROOTS ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/qwlroots/cmake/WaylandScannerHelpers.cmake)
add_subdirectory(waylib)
set(QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/src/server;${QML_IMPORT_PATH}" CACHE STRING "For LSP" FORCE)
list(APPEND LOCAL_QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/waylib/src/server")
else()
find_package(Waylib REQUIRED Server)
endif()
# PKG-CONFIG
find_package(PkgConfig)
set(QML_IMPORT_PATH "${LOCAL_QML_IMPORT_PATH}" CACHE STRING "For LSP" FORCE)
# PKG-CONFIG
find_package(PkgConfig REQUIRED)
find_package(Qt6 CONFIG REQUIRED Core DBus Gui Qml Quick QuickControls2 LinguistTools Test QuickTest)
qt_standard_project_setup(REQUIRES 6.6)
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots-0.19)
qt_standard_project_setup(REQUIRES 6.8)
# Set constants
set(TREELAND_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/treeland/" CACHE PATH "treeland data install directory")
set(COMPONENTS_TRANSLATION_DIR "${TREELAND_DATA_DIR}/translations" CACHE PATH "Components translations directory")
set(TREELAND_DATA_DIR "${CMAKE_INSTALL_DATADIR}/treeland/" CACHE PATH "treeland data install directory")
set(TREELAND_COMPONENTS_TRANSLATION_DIR "${TREELAND_DATA_DIR}/translations" CACHE PATH "Components translations directory")
set(TREELAND_PLUGINS_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib/plugins" CACHE PATH "treeland plugins output directory")
set(TREELAND_PLUGINS_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/treeland/plugins" CACHE PATH "treeland plugins install directory")
add_compile_definitions("TREELAND_DATA_DIR=\"${TREELAND_DATA_DIR}\"")
GNUInstallDirs_get_absolute_install_dir(
TREELAND_FULL_DATA_DIR
TREELAND_DATA_DIR
DATADIR
)
GNUInstallDirs_get_absolute_install_dir(
TREELAND_FULL_PLUGINS_INSTALL_PATH
TREELAND_PLUGINS_INSTALL_PATH
LIBDIR
)
GNUInstallDirs_get_absolute_install_dir(
TREELAND_FULL_COMPONENTS_TRANSLATION_DIR
TREELAND_COMPONENTS_TRANSLATION_DIR
DATADIR
)
add_compile_definitions("TREELAND_DATA_DIR=\"${TREELAND_FULL_DATA_DIR}\"")
# NOTE:: remove force assert before stable version
add_compile_definitions("QT_FORCE_ASSERTS")
add_compile_definitions("TREELAND_PLUGINS_INSTALL_PATH=\"${TREELAND_FULL_PLUGINS_INSTALL_PATH}\"")
add_compile_definitions("TREELAND_PLUGINS_OUTPUT_PATH=\"${TREELAND_PLUGINS_OUTPUT_PATH}\"")
add_compile_definitions("TREELAND_COMPONENTS_TRANSLATION_DIR=\"${TREELAND_FULL_COMPONENTS_TRANSLATION_DIR}\"")
set(PROJECT_RESOURCES_DIR "${CMAKE_SOURCE_DIR}/misc")
enable_testing(true)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(misc)
add_subdirectory(tests)
if (BUILD_TEST_CLIENTS)
add_subdirectory(tests)
if (BUILD_TREELAND_EXAMPLES)
add_subdirectory(examples)
endif()
# Display feature summary

71
CMakePresets.json Normal file
View File

@ -0,0 +1,71 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"include": [],
"configurePresets": [
{
"name": "default",
"displayName": "Default Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build"
},
{
"name": "clang",
"displayName": "Default Config for clang",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "ci",
"displayName": "CI Build Config",
"description": "Build configuration with warnings as errors",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
"CMAKE_C_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow"
}
},
{
"name": "deb",
"displayName": "Debian Package Build Config",
"description": "Build configuration for Debian packaging with examples enabled",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
"CMAKE_C_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
"BUILD_TREELAND_EXAMPLES": "ON"
}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "clang",
"configurePreset": "clang"
},
{
"name": "ci",
"configurePreset": "ci"
},
{
"name": "deb",
"configurePreset": "deb"
}
]
}

1
LICENSES/HPND.txt Symbolic link
View File

@ -0,0 +1 @@
../waylib/LICENSES/HPND.txt

View File

@ -0,0 +1,8 @@
Licensees holding valid commercial Qt licenses may use this software in
accordance with the the terms contained in a written agreement between
you and The Qt Company. Alternatively, the terms and conditions that were
accepted by the licensee when buying and/or downloading the
software do apply.
For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions.
For further information use the contact form at https://www.qt.io/contact-us.

23
LICENSES/MIT.txt Normal file
View File

@ -0,0 +1,23 @@
MIT License
Copyright (c) 2017, 2018 Drew DeVault
Copyright (c) 2014 Jari Vetoniemi
Copyright (c) 2023 The wlroots contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

133
README.md
View File

@ -1,107 +1,68 @@
## INTRODUCTION
# Treeland
DDM is a fork of SDDM. And use single compositor and session management functionality.
treeland is a wayland compositor based on wlroots and QtQuick, designed to provide efficient and flexible graphical interface support.
SDDM is a modern display manager for X11 and Wayland sessions aiming to
be fast, simple and beautiful.
It uses modern technologies like QtQuick, which in turn gives the designer the ability to
create smooth, animated user interfaces.
## Dependencies
SDDM is extremely themeable. We put no restrictions on the user interface design,
it is completely up to the designer. We simply provide a few callbacks to the user interface
which can be used for authentication, suspend etc.
Check the `debian/control` file to understand specific build and runtime dependencies, or use `cmake` to check for missing necessary components.
To further ease theme creation we provide some premade components like a textbox,
a combox etc.
Core build dependencies:
There are a few sample themes distributed with SDDM.
They can be used as a starting point for new themes.
- [waylib](https://github.com/vioken/waylib): A Wayland compositor development library based on wlroots and QtQuick
- Qt >= 6.8.0
- wlroots = 0.19
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols): Private Wayland protocols used by treeland
## SCREENSHOTS
Recommended runtime dependencies:
![sample screenshot](https://raw.github.com/ddm/ddm/master/src/greeter/theme/maui.jpg)
- [ddm](https://github.com/linuxdeepin/ddm): A display manager optimized for multiple users
## VIDEOS
## Building
* [Video background](https://www.youtube.com/watch?v=kKwz2FQcE3c)
* [Maui theme 1](https://www.youtube.com/watch?v=-0d1wkcU9DU)
* [Maui theme 2](https://www.youtube.com/watch?v=dJ28mrOeuNA)
Treeland uses cmake for building. The WITH_SUBMODULE_WAYLIB option can force the use of the waylib code from the submodule. If you want to use the system-provided waylib, set this option to OFF.
## RESOURCES
Using the system-provided waylib:
* [Issue tracker](https://github.com/ddm/ddm/issues)
* [Wiki](https://github.com/ddm/ddm/wiki)
* [Mailing List](https://groups.google.com/group/ddm-devel)
* IRC channel `#ddm` on [chat.freenode.net](https://webchat.freenode.net?channels=ddm)
## INSTALLATION
Qt >= 5.15.0 is required to use SDDM.
SDDM runs the greeter as a system user named "ddm" whose home directory needs
to be set to `/var/lib/ddm`.
If pam and systemd are available, the greeter will go through logind
which will give it access to drm devices.
Distributions without pam and systemd will need to put the "ddm" user
into the "video" group, otherwise errors regarding GL and drm devices
might be experienced.
## VIRTUAL TERMINALS
SDDM is assumed to start at the tty specified by the cmake variable
SDDM_INITIAL_VT which is an integer and defaults to 1.
If SDDM_INITIAL_VT wasn't available, SDDM will use the next available one
instead.
You can override SDDM_INITIAL_VT if you want to have a different one if,
for example, you were planning on using tty1 for something else.
## LICENSE
Source code of SDDM is licensed under GNU GPL version 2 or later (at your choosing).
QML files are MIT licensed and images are CC BY 3.0.
## TROUBLESHOOTING
### NVIDIA Prime
Add this at the bottom of the Xsetup script:
```sh
if [ -e /sbin/prime-offload ]; then
echo running NVIDIA Prime setup /sbin/prime-offload, you will need to manually run /sbin/prime-switch to shut down
/sbin/prime-offload
fi
```shell
$ git clone git@github.com:linuxdeepin/treeland.git
$ cd treeland
$ cmake -Bbuild -DWITH_SUBMODULE_WAYLIB=OFF
$ cmake --build build
```
### No User Icon
Using the waylib from the submodule:
SDDM reads user icon from either ~/.face.icon or FacesDir/username.face.icon
You need to make sure that SDDM user have permissions to read those files.
In case you don't want to allow other users to access your $HOME you can use
ACLs if your filesystem does support it.
```sh
setfacl -m u:ddm:x /home/username
setfacl -m u:ddm:r /home/username/.face.icon
```shell
$ git clone git@github.com:linuxdeepin/treeland.git --recursive
$ cd treeland
$ cmake -Bbuild -DWITH_SUBMODULE_WAYLIB=ON
$ cmake --build build
```
### Custom DPI
## Packaging
In order to set custom DPI for high resolution screens you should configure
Xorg yourself. An easy way is to pass an additional argument to Xorg.
A `debian` folder is provided to build the package under the *deepin* linux desktop distribution. To build the package, use the following command:
Edit ``/etc/ddm.conf``, go to the ``X11`` section and change ``ServerArguments`` like this:
```
ServerArguments=-nolisten tcp -dpi 192
```shell
$ sudo apt build-dep . # install build dependencies
$ dpkg-buildpackage -uc -us -nc -b # build binary package(s)
```
to set DPI to 192.
## GitHub Actions / CI
As an alternative you can edit Xorg configuration ``xorg.conf``, please refer to the
Xorg documentation.
This project uses GitHub Actions for continuous integration. The following workflows are configured:
- **qwlroots builds**: Triggered when `qwlroots/**` files are modified
- **waylib builds**: Triggered when `waylib/**` or `qwlroots/**` files are modified (since waylib depends on qwlroots)
- **treeland builds**: Main project builds
The waylib workflows are configured to also trigger when qwlroots code changes, ensuring that waylib builds remain compatible with qwlroots modifications.
## Getting Involved
- [Code contribution via GitHub](https://github.com/linuxdeepin/treeland/)
- [Submit bug or suggestions to GitHub Issues or GitHub Discussions](https://github.com/linuxdeepin/developer-center/issues/new/choose)
## License
treeland is licensed under Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only.

View File

@ -1 +1,67 @@
TODO:
# Treeland
treeland 是一个基于 wlroots 和 QtQuick 开发的 Wayland 合成器,旨在提供高效且灵活的图形界面支持。
## 依赖
查看 `debian/control` 文件来了解具体的构建与运行时依赖,或者使用 `cmake` 检查缺失的必要组件。
核心构建依赖:
- [waylib](https://github.com/vioken/waylib) 整合 wlroots 和 QtQuick 的 Wayland 合成器开发库
- Qt >= 6.8.0
- wlroots = 0.19
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols) treeland 使用的私有 wayland 协议
推荐的运行时依赖:
- [ddm](https://github.com/linuxdeepin/ddm) 为多用户优化的登录管理器
## 构建
treeland 使用 cmake 进行构建,`WITH_SUBMODULE_WAYLIB` 选项可以强制使用子模块中的 `waylib` 代码,如果希望使用系统提供的 `waylib` 应该设置为 `OFF`
使用系统库提供的 `waylib`
```shell
$ git clone git@github.com:linuxdeepin/treeland.git
$ cd treeland
$ cmake -Bbuild -DWITH_SUBMODULE_WAYLIB=OFF
$ cmake --build build
```
使用子模块中的 `waylib`
```shell
$ git clone git@github.com:linuxdeepin/treeland.git --recursive
$ cd treeland
$ cmake -Bbuild -DWITH_SUBMODULE_WAYLIB=ON
$ cmake --build build
```
## 打包
*deepin* 桌面发行版进行此软件包的构建,我们还提供了一个 `debian` 目录。若要构建软件包,可参照下面的命令进行构建:
```shell
$ sudo apt build-dep . # 安装构建依赖
$ dpkg-buildpackage -uc -us -nc -b # 构建二进制软件包
```
## GitHub Actions / 持续集成
本项目使用 GitHub Actions 进行持续集成。配置了以下工作流:
- **qwlroots 构建**:当 `qwlroots/**` 文件被修改时触发
- **waylib 构建**:当 `waylib/**``qwlroots/**` 文件被修改时触发(因为 waylib 依赖于 qwlroots
- **treeland 构建**:主项目构建
waylib 工作流配置为在 qwlroots 代码变化时也会触发,确保 waylib 构建与 qwlroots 修改保持兼容。
## 参与贡献
- [通过 GitHub 发起代码贡献](https://github.com/linuxdeepin/treeland/)
- [通过 GitHub Issues 与 GitHub Discussions 汇报缺陷与反馈建议](https://github.com/linuxdeepin/developer-center/issues/new/choose)
## 许可协议
**Treeland** 使用 Apache-2.0, LGPL-3.0-only, GPL-2.0-only 或 GPL-3.0-only 许可协议进行发布。

252
REUSE.toml Normal file
View File

@ -0,0 +1,252 @@
version = 1
SPDX-PackageName = "treeland"
SPDX-PackageDownloadLocation = "https://github.com/linuxdeepin/treeland"
[[annotations]]
path = [".github/**", ".obs/**.yml", "garnix.yaml", ".tx/*"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = [".clang-format", ".editorconfig", "**.frag", "**.ui", "**.vert", "**/qmldir"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["debian/**", "rpm/**", "archlinux/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["**.nix", ".envrc", "flake.lock", "renovate.json"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["translations/**", "po/**", "**.qm", "**.ts"]
precedence = "aggregate"
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
SPDX-License-Identifier = "GPL-2.0-only"
[[annotations]]
path = ["**.svg", "**.png", "**.jpg", "**.jpeg", "**.webp", "**.dci", "**.gif"]
precedence = "aggregate"
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["REUSE.toml", "**.json", "**.service", "**.txt", "**.ini", "**.sh", "**.html", ".gitignore", ".gitmodules", "INSTALL.md", "**.desktop", "**.css", "**.ttf", "**.conf", "**.xml", ".release.json"]
precedence = "aggregate"
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["**.md", "README.md", "README.zh_CN.md", "CONTRIBUTING.md", "ChangeLog", "CONTRIBUTORS"]
precedence = "aggregate"
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
SPDX-License-Identifier = "CC-BY-4.0"
[[annotations]]
path = ["**.cmake", "CMakeLists.txt", "**.in", "**.qrc", "misc/**", "services/**", "releng/create_changelog.pl"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "GPL-2.0-only"
[[annotations]]
path = ["src/greeter/**.h", "src/greeter/**.cpp"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "GPL-2.0-only"
[[annotations]]
path = ["qwlroots/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "Apache-2.0"
# ===== WAYLIB REUSE Configuration =====
# CI and build files for waylib
[[annotations]]
path = ["waylib/.github/**", "waylib/.obs/**.yml", "waylib/renovate.json"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Gitignore and git modules for waylib
[[annotations]]
path = ["waylib/.gitignore", "waylib/.gitmodules"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Project files for waylib
[[annotations]]
path = ["waylib/**.cmake", "waylib/*CMakeLists.txt", "waylib/**.pc.in", "waylib/**cmake.in"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# README for waylib
[[annotations]]
path = ["waylib/README.md", "waylib/README.zh_CN.md"]
precedence = "aggregate"
SPDX-FileCopyrightText = "JiDe Zhang"
SPDX-License-Identifier = "CC-BY-4.0"
# Nix Develop files for waylib
[[annotations]]
path = ["waylib/**.nix", "waylib/.envrc", "waylib/flake.lock"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Debian package for waylib
[[annotations]]
path = ["waylib/debian/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# C++ pch files for waylib
[[annotations]]
path = ["waylib/src/server/pch/pch.hxx"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Core waylib files
[[annotations]]
path = [
"waylib/examples/tinywl/qml.qrc",
"waylib/tests/manual/cursor/cursor.qrc",
"waylib/src/server/kernel/WBackend",
"waylib/src/server/kernel/WCursor",
"waylib/src/server/kernel/WInputDevice",
"waylib/src/server/kernel/WInputEvent",
"waylib/src/server/kernel/WOutput",
"waylib/src/server/kernel/WSeat",
"waylib/src/server/kernel/WEvent",
"waylib/src/server/kernel/WServer",
"waylib/src/server/kernel/WServerInterface",
"waylib/src/server/kernel/WSurface",
"waylib/src/server/kernel/WSurfaceLayout",
"waylib/src/server/kernel/WTexture",
"waylib/src/server/kernel/WXdgShell",
"waylib/src/server/kernel/WXdgSurface",
"waylib/src/server/kernel/WLayerSurface",
"waylib/src/server/qtquick/WQuickRenderControl",
"waylib/src/server/qtquick/WSurfaceItem",
"waylib/src/server/utils/WSignalConnector",
"waylib/src/server/utils/WThreadUtils",
"waylib/src/server/utils/WCursorImage",
"waylib/src/server/utils/WWrapPointer",
"waylib/tests/main.cpp",
"waylib/tests/test.h"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "JiDe Zhang"
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
# Waylib protocol files
[[annotations]]
path = [
"waylib/src/server/protocols/WCursorShapeManagerV1",
"waylib/src/server/protocols/WForeignToplevel",
"waylib/src/server/protocols/WInputMethodHelper",
"waylib/src/server/protocols/WLayerSurface",
"waylib/src/server/protocols/WOutputManagerV1",
"waylib/src/server/protocols/WXdgOutput",
"waylib/src/server/protocols/WXdgShell",
"waylib/src/server/protocols/WXdgSurface",
"waylib/src/server/protocols/WLayerShell",
"waylib/src/server/protocols/WInputPopupSurface",
"waylib/src/server/protocols/WXWayland",
"waylib/src/server/protocols/WXWaylandSurface",
"waylib/src/server/protocols/WXdgDecorationManager",
"waylib/src/server/protocols/WSessionLock",
"waylib/src/server/protocols/WSessionLockManager",
"waylib/src/server/protocols/WSessionLockSurface"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
# Misc files for waylib
[[annotations]]
path = [
"waylib/tests/manual/cursor/res/HandCursor.png",
"waylib/examples/tinywl/res/xx.jpg"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Protocol files with HPND license for waylib
[[annotations]]
path = ["waylib/src/server/protocols/private/text-input-unstable-v2.xml"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "HPND"
# ===== QWLROOTS REUSE Configuration =====
# CI for qwlroots
[[annotations]]
path = ["qwlroots/.github/**", "qwlroots/.obs/**.yml", "qwlroots/garnix.yaml"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Project files for qwlroots
[[annotations]]
path = [
"qwlroots/**.cmake",
"qwlroots/*CMakeLists.txt",
"qwlroots/**.pc.in",
"qwlroots/**cmake.in",
"qwlroots/.gitignore",
"qwlroots/.cursorindexingignore",
"qwlroots/.cursor/rules/**.mdc",
"qwlroots/.gitmodules"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Simple header files for qwlroots
[[annotations]]
path = [
"qwlroots/**/qwkeyboard.h",
"qwlroots/**/qwpointer.h",
"qwlroots/**/qwswitch.h",
"qwlroots/**/qwtablet.h",
"qwlroots/**/qwtabletpad.h",
"qwlroots/**/qwtouch.h"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# README and documentation for qwlroots
[[annotations]]
path = ["qwlroots/README.md", "qwlroots/README.zh_CN.md", "qwlroots/doc/ai/**.md"]
precedence = "aggregate"
SPDX-FileCopyrightText = "JiDe Zhang"
SPDX-License-Identifier = "CC-BY-4.0"
# Nix Develop files for qwlroots
[[annotations]]
path = ["qwlroots/**.nix", "qwlroots/.envrc", "qwlroots/flake.lock"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
# Debian package for qwlroots
[[annotations]]
path = ["qwlroots/debian/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2023 rewine <luhongxu@outlook.com>"
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"

60
cmake/DefineTarget.cmake Normal file
View File

@ -0,0 +1,60 @@
include(CMakeParseArguments)
function(impl_treeland)
set(one_value_args NAME)
set(multi_value_args SOURCE INCLUDE LINK)
cmake_parse_arguments(
PARSE_ARG_PREFIX
""
"${one_value_args}"
"${multi_value_args}"
${ARGN}
)
if(NOT PARSE_ARG_PREFIX_NAME)
message(FATAL_ERROR "NAME is a required argument!")
endif()
add_library(${PARSE_ARG_PREFIX_NAME} INTERFACE)
target_sources(${PARSE_ARG_PREFIX_NAME}
INTERFACE
${PARSE_ARG_PREFIX_SOURCE}
)
target_include_directories(${PARSE_ARG_PREFIX_NAME}
INTERFACE
${PARSE_ARG_PREFIX_INCLUDE}
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_link_libraries(${PARSE_ARG_PREFIX_NAME}
INTERFACE
${PARSE_ARG_PREFIX_LINK}
# TODO: remove this
Dtk6::Core
Dtk6::Declarative
Dtk6::SystemSettings
Waylib::WaylibServer
Qt6::Quick
Qt6::QuickControls2
Qt6::QuickPrivate
Qt6::DBus
Qt6::Concurrent
PkgConfig::PIXMAN
PkgConfig::WAYLAND
PkgConfig::LIBINPUT
# TODO: end remove
)
target_link_libraries(libtreeland
PRIVATE
${PARSE_ARG_PREFIX_NAME}
)
endfunction()

View File

@ -0,0 +1,62 @@
# TranslationUtils.cmake
# Provides common functions for handling translation files
function(setup_translations TARGET_NAME TRANSLATION_PREFIX)
# Automatically discover all translation files
file(GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/translations/${TRANSLATION_PREFIX}.*.ts")
# Filter out non-translation files (if any)
list(FILTER TS_FILES INCLUDE REGEX ".*\\.ts$")
# Set translation files variable
set(TRANSLATED_FILES)
# Add lupdate target
qt_add_lupdate(
SOURCE_TARGETS ${TARGET_NAME}
TS_FILES ${TS_FILES}
NO_GLOBAL_TARGET
)
# Add lrelease target
qt_add_lrelease(
TS_FILES ${TS_FILES}
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
)
# Install translation files
install(FILES ${TRANSLATED_FILES} DESTINATION ${TREELAND_COMPONENTS_TRANSLATION_DIR})
# Set TRANSLATED_FILES variable to parent scope
set(TRANSLATED_FILES ${TRANSLATED_FILES} PARENT_SCOPE)
endfunction()
function(setup_main_translations TARGET_NAME)
# Automatically discover all main translation files
file(GLOB TS_FILES "${CMAKE_SOURCE_DIR}/translations/treeland.*.ts")
# Filter out non-translation files (if any)
list(FILTER TS_FILES INCLUDE REGEX ".*\\.ts$")
# Set translation files variable
set(TRANSLATED_FILES)
# Add lupdate target
qt_add_lupdate(
SOURCE_TARGETS ${TARGET_NAME}
TS_FILES ${TS_FILES}
NO_GLOBAL_TARGET
)
# Add lrelease target
qt_add_lrelease(
TS_FILES ${TS_FILES}
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
)
# Install translation files
install(FILES ${TRANSLATED_FILES} DESTINATION ${TREELAND_COMPONENTS_TRANSLATION_DIR})
# Set TRANSLATED_FILES variable to parent scope
set(TRANSLATED_FILES ${TRANSLATED_FILES} PARENT_SCOPE)
endfunction()

View File

@ -1,12 +0,0 @@
install(FILES
"dbus/org.deepin.compositor1.conf"
DESTINATION "${CMAKE_INSTALL_DATADIR}/dbus-1/system.d"
)
install(FILES
"dconfig/org.deepin.Treeland.json"
DESTINATION "${CMAKE_INSTALL_DATADIR}/dsg/configs/org.deepin.Treeland"
)
add_subdirectory(systemd)
add_subdirectory(wayland-sessions)

View File

@ -1,160 +0,0 @@
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"ShowOnLock": {
"value": false,
"serial": 0,
"flags": ["user-public"],
"name": "ShowOnLock",
"name[zh_CN]": "显示在锁屏之上",
"description": "Allow show context on lock screen",
"description[zh_CN]": "允许在锁屏界面上显示内容",
"permissions": "readwrite",
"visibility": "private"
},
"LostScreen": {
"value": "MoveToPrimary",
"serial": 0,
"flags": ["user-public"],
"name": "Behaivor when lost screen",
"name[zh_CN]": "丢失屏幕的行为",
"description": "Behaivor when lost screen, allow value: MoveToPrimary、Minimize",
"description[zh_CN]": "丢失屏幕的行为可选值为MoveToPrimary、Minimize",
"permissions": "readwrite",
"visibility": "private"
},
"Font": {
"value": "",
"serial": 0,
"flags": ["user-public"],
"name": "Font",
"name[zh_CN]": "字体",
"description": "Font Family",
"description[zh_CN]": "字体",
"permissions": "readwrite",
"visibility": "private"
},
"FontSize": {
"value": 14,
"serial": 0,
"flags": ["user-public"],
"name": "Font Size",
"name[zh_CN]": "字体大小",
"description": "Font Size",
"description[zh_CN]": "字体大小",
"permissions": "readwrite",
"visibility": "private"
},
"PreferDark": {
"value": false,
"serial": 0,
"flags": ["user-public"],
"name": "Prefer Dark",
"name[zh_CN]": "倾向暗色",
"description": "Color scheme is prefer dark",
"description[zh_CN]": "颜色方案是否倾向暗色",
"permissions": "readwrite",
"visibility": "private"
},
"ThemeName": {
"value": "",
"serial": 0,
"flags": ["user-public"],
"name": "Theme Name",
"name[zh_CN]": "主题名称",
"description": "Theme Name",
"description[zh_CN]": "主题名称",
"permissions": "readwrite",
"visibility": "private"
},
"IconThemeName": {
"value": "",
"serial": 0,
"flags": ["user-public"],
"name": "Icon Theme Name",
"name[zh_CN]": "图标主题名称",
"description": "Icon Theme Name",
"description[zh_CN]": "图标主题名称",
"permissions": "readwrite",
"visibility": "private"
},
"CursorThemeName": {
"value": "",
"serial": 0,
"flags": ["user-public"],
"name": "Cursor Theme Name",
"name[zh_CN]": "光标主题名称",
"description": "Cursor Theme Name",
"description[zh_CN]": "光标主题名称",
"permissions": "readwrite",
"visibility": "private"
},
"CursorSize": {
"value": "",
"serial": 0,
"flags": ["user-public"],
"name": "Cursor Size",
"name[zh_CN]": "光标大小",
"description": "Cursor Size",
"description[zh_CN]": "光标大小",
"permissions": "readwrite",
"visibility": "private"
},
"CursorBlink": {
"value": true,
"serial": 0,
"flags": ["user-public"],
"name": "Cursor Blink",
"name[zh_CN]": "光标闪烁",
"description": "Whether the cursor should blink",
"description[zh_CN]": "光标是否应闪烁",
"permissions": "readwrite",
"visibility": "private"
},
"CursorBlinkTime": {
"value": 1200,
"serial": 0,
"flags": ["user-public"],
"name": "Cursor Blink Time",
"name[zh_CN]": "光标闪烁时间",
"description": "Length of the cursor blink cycle, in milleseconds",
"description[zh_CN]": "光标闪烁周期的长度,以千秒为单位",
"permissions": "readwrite",
"visibility": "private"
},
"DoubleClickTime": {
"value": 250,
"serial": 0,
"flags": ["user-public"],
"name": "Double Click Time",
"name[zh_CN]": "双击时间",
"description": "Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)",
"description[zh_CN]": "两次单击之间允许被视为双击的最长时间(以毫秒为单位)",
"permissions": "readwrite",
"visibility": "private"
},
"DoubleClickDistance": {
"value": 5,
"serial": 0,
"flags": ["user-public"],
"name": "Double Click Distance",
"name[zh_CN]": "双击距离",
"description": "Maximum distance allowed between two clicks for them to be considered a double click (in pixels)",
"description[zh_CN]": "两次单击之间允许被视为双击的最大距离(以像素为单位)",
"permissions": "readwrite",
"visibility": "private"
},
"DndDragThreshold": {
"value": 8,
"serial": 0,
"flags": ["user-public"],
"name": "Dnd Drag Threshold",
"name[zh_CN]": "拖动阈值",
"description": "Number of pixels the cursor can move before dragging",
"description[zh_CN]": "拖动之前光标可以移动的像素数",
"permissions": "readwrite",
"visibility": "private"
}
}
}

339
debian/changelog vendored
View File

@ -1,3 +1,342 @@
treeland (0.7.6) unstable; urgency=medium
* refactor: implement atomic multi-output configuration
* fix: occasional crash during recording toplevel
* fix: use safeConnect for aboutToBeInvalidated
* i18n: Updates for project TreeLand (#601)
* refactor: Convert Session to shared_ptr and simplify session
lifecycle
* chore: Remove unused code & Add document
* feat: Manage per-user Wayland/XWayland sessions via Helper::Session
* feat: Add per-user XWayland session management
* chore: add ASAN environment variables
* feat: Expose XWayland surface process ID
* chore: change Debian build environment to unstable
* refactor: remove branch filter for workflow triggers
* fix: fix build when treeland examples are enabled
* fix: fix build failure on Arch Linux
* fix: Disable minimize / maximize animation for window that doesn't
belongs to current user
* fix: fix private module inclusion on lower version of Qt
* fix: compile errors on Arch for forward declared class
* fix: include Qt private modules for Qt 6.11
* feat: add real-time FPS display
* feat: support start sessions other than treeland
* feat: implement ext-session-lock-v1 support
* feat(waylib): implement ext-session-lock-v1 protocol support
* fix(waylib): Add missing override specifier in wlayersurface
* fix(qwlroots): allow server side destruction of qw_session_lock_v1
* fix: Delete useless display text in copy mode
* fix: enhance output validation in restore copy mode
* fix: use separate TreelandConfig for each user
* fix: Ensure proper object destruction before app exit
* fix: improve resource management for RenderControl
* fix: fix heap-use-after-free on exit
-- rewine <luhongxu@uniontech.com> Thu, 30 Oct 2025 14:04:56 +0800
treeland (0.7.3) unstable; urgency=medium
* fix: fix WorkspaceSelectionList animation's highlight border size
* fix: fix MultitaskView display problem
* refactor: reduce cursor-related log verbosity
* fix: fix MultitaskView display problem caused by refactoring
TreelandConfig
* Updates for project TreeLand (#563)
-- rewine <luhongxu@uniontech.com> Tue, 23 Sep 2025 17:24:35 +0800
treeland (0.7.2) unstable; urgency=medium
* fix: crash on startup due to uninitialized m_config pointer
-- rewine <luhongxu@uniontech.com> Fri, 19 Sep 2025 10:06:51 +0800
treeland (0.7.1) unstable; urgency=medium
* fix: Fix socket blocking issue in Wayland server connection handling
* fix: correct window title visibility condition
* fix: Fix client crash when created via security context
* feat: add security-context support
* fix: Separate DConfig object creation to another thread to avoid
blocking
* fix: move DBus call to separate thread to avoid blocking
* fix: fixing some trivial memory management bugs.
* feat(core): Add support for XDG toplevel surface and XDG shell in
RootSurfaceContainer
* fix: correct refresh rate on multi-monitor
* fix: redraw when frame callback list updates
-- rewine <luhongxu@uniontech.com> Thu, 18 Sep 2025 11:46:00 +0800
treeland (0.7.0) unstable; urgency=medium
* fix: fix treeland get stuck in lockscreen after crash recovery
* fix: occasional crash during stop preview item handling
* refactor: improve code robustness
* fix: occasional crash when closing x window
* fix: resolve brief black screen during standby
* chore: remove dde portal screen cast configuration
* fix: correct log category and add null check for surface activation
* fix: resolve window resize crash during image capture
* fix: fix wrong display render issue when switching VT too quickly
* Totally disable lockscreen animation when switching TTY to prevent
stuck for switching too quickly
* feat: Support TTY switching with DDM
* Updates for project TreeLand (#515)
* feat(waylib): add WBufferDumper utility for dumping buffer contents
to image files
* refactor: use unified CI build preset with Werror
* build: enable -Werror compiler flag
* fix: prevent crash during preview item handling (#512)
* fix: prevent cursor flicker during screen recording
* docs: add comprehensive logging guidelines and update module logging
* feat: add centralized logging system and standardize log usage
* feat: ssd title bar displays the window title information
* fix: maximize/restore icon in the SSD title bar displays incorrectly
* fix: resolve multiple compiler warnings
* fix(waylib): prevent duplicate signal connections using
Qt::UniqueConnection
* fix(waylib): prevent crash by safely managing textureChanged
connection
* fix: use exec to replace process and avoid duplicate logs in
treeland.sh
* fix(waylib): Occasional crash when moving the cursor
-- rewine <luhongxu@uniontech.com> Fri, 29 Aug 2025 10:23:45 +0800
treeland (0.6.2) unstable; urgency=medium
* fix: resolve library versioning and installation path issues
-- rewine <luhongxu@uniontech.com> Mon, 04 Aug 2025 17:42:40 +0800
treeland (0.6.1) unstable; urgency=medium
* fix: improve D-Bus connection handling and QML hover visibility
* feat: CLI option: switch from --disable-debug-view to --enable-debug-
view
* fix(waylib): Specify required rendering flags in
WSGRenderFootprintNode
-- rewine <luhongxu@uniontech.com> Fri, 01 Aug 2025 13:33:07 +0800
treeland (0.6.0) unstable; urgency=medium
* fix: improve image capture error handling and code structure
* feat: add foreign toplevel image capture support
* feat: add image capture source support
* fix: remove unused quit full button and add helper activation
* fix: prevent title bar and window buttons from stealing focus
* feat: add wl_drm support
* feat: create ext-data-control manager
* fix: Handle VT switching keys (#469)
* feat: add Nix flake support for project configuration
* fix: prevent workspace moveSurfaceTo crash on null wrapper
* fix: remove redundant submodule options and configs
* chore: update nix dependencies and clean up configurations
* fix: Scaling animation not shown while return from shutdown page
* chore: Force Ninja build during deb packaging
* fix: add timeout to protocol tests
* feat: Upload build artifacts as zip archives
* chore: fix CI and enable independent builds
* refactor: merge qwlroots and waylib source code into treeland
* chore: Use treeland-specific seatd service
* feat: implement ext-foreign-toplevel-list
* i18n: Updates for project TreeLand (#440)
* chore: remove polkit rules for login1
* feat: add support for alpha modifier protocol
* fix: cannot export dbus services
* Revert "fix: should not maximize when client set maxsize"
* Updates for project TreeLand (#431)
* fix: Treeland does not exit when logging out of session
* fix: cannot use treeland user session mode
* fix: add [[maybe_unused]] attribute to unused parameters
* chore: improvement fixes the translation configuration
* feat: add popup surface container for handling popup windows
* chore: configure translation files and update Chinese translations
* chore: configure transifex translation files
* feat: adapt to wlroots-0.19
* refactor: remove jemalloc dependency
-- rewine <luhongxu@uniontech.com> Thu, 31 Jul 2025 20:40:50 +0800
treeland (0.5.21) unstable; urgency=medium
* fix: inputted password and capsIndicator button are covered
-- rewine <luhongxu@deepin.org> Thu, 17 Apr 2025 15:17:48 +0800
treeland (0.5.20) unstable; urgency=medium
* fix: activeColor not saved to dconfig
* fix: send error output enter for layer shell
* chore: input popup should not use radius
-- rewine <luhongxu@deepin.org> Mon, 10 Mar 2025 16:20:35 +0800
treeland (0.5.19) unstable; urgency=medium
* fix: can't set output's postion
* fix: layer shell's popup not enter popup container
-- rewine <luhongxu@deepin.org> Sat, 15 Feb 2025 15:30:10 +0800
treeland (0.5.18) unstable; urgency=medium
* fix: the tooltip text may disappear unexpectedly
* fix: can't start on VirtualBox
* feat: cache outputs settings
-- rewine <luhongxu@deepin.org> Fri, 14 Feb 2025 10:31:38 +0800
treeland (0.5.17) unstable; urgency=medium
* fix: nix ci for build
* Fix missing treeland's translations
-- Groveer <guoyao@uniontech.com> Wed, 15 Jan 2025 11:02:18 +0800
treeland (0.5.16) unstable; urgency=medium
* fix: crashed at accessing surface
* Fix crash at QStyleHints
-- zhangkun <zhangkun2@uniontech.com> Tue, 14 Jan 2025 16:16:43 +0800
treeland (0.5.15) unstable; urgency=medium
* chore: update default window corner size
-- zhangkun <zhangkun2@uniontech.com> Tue, 14 Jan 2025 11:45:30 +0800
treeland (0.5.14) unstable; urgency=medium
* Fix crash at PersonalizationAttached::noTitlebar
* Add a background color for DockPreview
-- JiDe Zhang <zhangjide@uniontech.com> Mon, 13 Jan 2025 18:13:21 +0800
treeland (0.5.13) unstable; urgency=medium
* feat: add ctrl-alt-del shortcut key
* Add TREELAND_SESSION_ENVIRONMENTS env
* fix: popup of screen recorder is below it's parent
* Fix typo
* Ignore window rounded radius when maximized
-- JiDe Zhang <zhangjide@uniontech.com> Mon, 13 Jan 2025 11:02:32 +0800
treeland (0.5.12) unstable; urgency=medium
* Fix maybe freeze when display DockPreview
* feat: update default values
* fix: adjust UI for greeter
-- Groveer <guoyao@uniontech.com> Wed, 08 Jan 2025 11:22:31 +0800
treeland (0.5.11) unstable; urgency=medium
* bump version to 0.5.11
-- Groveer <guoyao@uniontech.com> Wed, 25 Dec 2024 18:47:45 +0800
treeland (0.5.10) unstable; urgency=medium
* bump version to 0.5.10
-- Groveer <guoyao@uniontech.com> Fri, 20 Dec 2024 16:04:58 +0800
treeland (0.5.9) unstable; urgency=medium
* bump version to 0.5.9
-- Groveer <guoyao@uniontech.com> Tue, 17 Dec 2024 21:04:15 +0800
treeland (0.5.8) unstable; urgency=medium
* bump version to 0.5.8
-- Groveer <guoyao@uniontech.com> Fri, 13 Dec 2024 14:14:01 +0800
treeland (0.5.7) unstable; urgency=medium
* bump version to 0.5.7
-- Groveer <guoyao@uniontech.com> Tue, 10 Dec 2024 18:29:02 +0800
treeland (0.5.6) unstable; urgency=medium
* bump version to 0.5.6
-- rewine <luhongxu@deepin.org> Fri, 06 Dec 2024 15:05:05 +0800
treeland (0.5.5) unstable; urgency=medium
* bump version to 0.5.5
-- Groveer <guoyao@uniontech.com> Thu, 05 Dec 2024 21:22:32 +0800
treeland (0.5.4) unstable; urgency=medium
* bump version to 0.5.4
-- Groveer <guoyao@uniontech.com> Sat, 30 Nov 2024 15:52:51 +0800
treeland (0.5.3) unstable; urgency=medium
* bump version to 0.5.3
-- Groveer <guoyao@uniontech.com> Fri, 29 Nov 2024 15:58:26 +0800
treeland (0.5.2) unstable; urgency=medium
* bump version to 0.5.2
-- Groveer <guoyao@uniontech.com> Tue, 26 Nov 2024 15:01:56 +0800
treeland (0.5.1) unstable; urgency=medium
* bump version to 0.5.1
-- Groveer <guoyao@uniontech.com> Fri, 22 Nov 2024 18:10:04 +0800
treeland (0.5.0) unstable; urgency=medium
* bump version to 0.5.0
-- Groveer <guoyao@uniontech.com> Thu, 21 Nov 2024 17:02:20 +0800
treeland (0.4.4) unstable; urgency=medium
* bump version to 0.4.4
-- Groveer <guoyao@uniontech.com> Fri, 15 Nov 2024 14:15:57 +0800
treeland (0.4.3) unstable; urgency=medium
* bump version to 0.4.3
-- Groveer <guoyao@uniontech.com> Mon, 11 Nov 2024 19:10:14 +0800
treeland (0.4.1) unstable; urgency=medium
* update appearance protocol
-- Dingyuan Zhang <zhangdingyuan@uniontech.com> Thu, 01 Nov 2024 11:20:00 +0800
treeland (0.4) unstable; urgency=medium
* update workspace
-- Dingyuan Zhang <zhangdingyuan@uniontech.com> Thu, 01 Nov 2024 11:20:00 +0800
treeland (0.3) unstable; urgency=medium
* support windows animation
-- Dingyuan Zhang <zhangdingyuan@uniontech.com> Thu, 25 Jul 2024 18:20:00 +0800
treeland (0.2.3) unstable; urgency=medium
* refactor protocol from qml to c++

98
debian/control vendored
View File

@ -1,58 +1,86 @@
Source: treeland
Priority: optional
Maintainer: rewine <luhongxu@deepin.org>
Build-Depends: debhelper-compat (= 13),
cmake (>= 3.4~),
pkg-config,
Build-Depends: cmake (>= 3.4~),
debhelper-compat (= 13),
ninja-build,
extra-cmake-modules (>= 1.4.0~),
libddm-dev,
libdtk6core-bin,
libdtk6core-dev,
libdtk6declarative-dev,
libdtk6gui-dev,
libdtk6systemsettings-dev,
libdtkcommon-dev,
libsystemd-dev [linux-any],
systemd,
libwlroots-0.19-dev,
libpixman-1-dev,
libxcb-ewmh-dev,
libdrm-dev,
pkg-config,
qml6-module-qtquick-templates,
qt6-base-dev (>= 6.6.1~),
qt6-base-private-dev (>= 6.6.1~),
qt6-base-dev-tools (>= 6.6.0),
qt6-declarative-dev (>= 6.6.1~),
qt6-declarative-private-dev (>= 6.6.0),
qt6-shadertools-dev,
qt6-tools-dev,
qt6-tools-dev-tools (>= 6.6.1~),
qt6-wayland,
qt6-wayland-dev,
qt6-wayland-private-dev,
libdtk6declarative-dev,
libdtk6gui-dev,
libdtk6core-dev,
libdtk6systemsettings-dev,
libdtkcommon-dev,
systemd [linux-any],
libddm-dev,
libwaylib-dev,
libqwlroots-dev,
libwlroots-dev (>=0.17.0)
wayland-protocols,
wlr-protocols,
treeland-protocols,
libpam0g-dev,
Standards-Version: 4.6.0
Section: libs
Section: dde
Homepage: https://github.com/linuxdeepin/treeland.git
#Vcs-Browser: https://salsa.debian.org/debian/treeland
#Vcs-Git: https://salsa.debian.org/debian/treeland.git
Rules-Requires-Root: no
Package: treeland
Section: dde
Architecture: any
Multi-Arch: same
Depends: qml6-module-qtquick-layouts,
qml6-module-qtquick-particles,
treeland-data (= ${source:Version}),
xwayland,
${shlibs:Depends},
Conflicts: libwaylib, qwlroots
Replaces: libwaylib, qwlroots
Recommends: ddm,
Description: a Wayland compositor based on wlroots and QML, designed with an attractive and elegant appearance.
Package: treeland-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
qml6-module-qtquick,
qml6-module-qtquick-controls,
qml6-module-qtquick-layouts,
qml6-module-qtqml-workerscript,
qml6-module-qtquick-templates,
qml6-module-qtquick-particles,
qml6-module-qtquick-dialogs,
qml6-module-qtquick-window,
qml6-module-qt5compat-graphicaleffects,
qml6-module-qtquick-effects,
qml6-module-qt-labs-folderlistmodel,
adduser,
seatd,
qt6-wayland,
libqt6svg6,
libdtk6declarative,
libdtk6systemsettings
Recommends: libpam-systemd, xwayland
Description: a modern display manager for Wayland sessions aiming to be fast, simple and beautiful.
Depends: ${misc:Depends}, treeland( =${source:Version}),
Conflicts: libwaylib-dev, qwlroots
Replaces: libwaylib-dev, qwlroots
Description: a Wayland compositor based on wlroots and QML, designed with an attractive and elegant appearance.
Package: treeland-examples
Section: dde
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
Description: examples for treeland.
Package: treeland-data
Section: dde
Architecture: all
Depends: ${misc:Depends},
Description: data files of treeland.
Package: treeland-wayland-session
Section: dde
Architecture: all
Depends: ${misc:Depends},
treeland (= ${source:Version}),
Description: treeland user session files of treeland.

88
debian/copyright vendored
View File

@ -1,21 +1,75 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: treeland
Source: https://github.com/vioken/treeland
Source: https://github.com/linuxdeepin/treeland
License: LGPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU Lesser General
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
Files: .github/* .obs/*.yml garnix.yaml
Copyright: None
License: CC0-1.0
Files: .clang-format
.editorconfig
*.frag
*.ui
*.vert
**/qmldir
Copyright: None
License: CC0-1.0
Files: debian/* rpm/* archlinux/*
Copyright: None
License: CC0-1.0
Files: *.nix .envrc flake.lock renovate.json
Copyright: None
License: CC0-1.0
Files: translations/* po/* *.qm *.ts
Copyright: UnionTech Software Technology Co., Ltd.
License: GPL-2.0-only
Files: *.svg *.png *.jpg *.jpeg *.webp *.dci *.gif
Copyright: UnionTech Software Technology Co., Ltd.
License: CC0-1.0
Files: *.json
*.service
*.txt
*.sh
*.html
.gitignore
.gitmodules
INSTALL.md
*.desktop
*.css
*.ttf
*.conf
*.xml
.release.json
Copyright: UnionTech Software Technology Co., Ltd.
License: CC0-1.0
Files: *.md
README.md
README.zh_CN.md
CONTRIBUTING.md
ChangeLog
CONTRIBUTORS
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
Files: *.cmake
CMakeLists.txt
*.in *.qrc
misc/*
services/*
releng/create_changelog.pl
Copyright: None
License: GPL-2.0-only
Files: src/greeter/*.h src/greeter/*.cpp
Copyright: None
License: GPL-2.0-only
Files: src/*.h src/*.cpp src/*.qml tests/*.cpp tests/*.h tests/*.qml
Copyright: UnionTech Software Technology Co., Ltd.
License: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

7
debian/rules vendored
View File

@ -8,11 +8,12 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
include /usr/share/dpkg/architecture.mk
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- --preset deb

3
debian/treeland-data.install vendored Normal file
View File

@ -0,0 +1,3 @@
usr/share/dsg/configs/*
usr/share/treeland/shortcuts/*
usr/share/wayland-sessions/treeland.desktop

5
debian/treeland-dev.install vendored Normal file
View File

@ -0,0 +1,5 @@
usr/include/*
usr/lib/*/cmake/*
usr/lib/*/pkgconfig/*
usr/lib/*/lib*.so
usr/lib/*/lib*.a

1
debian/treeland-examples.install vendored Normal file
View File

@ -0,0 +1 @@
usr/bin/test*

View File

@ -0,0 +1,2 @@
usr/share/wayland-sessions/treeland-user.desktop
usr/bin/treeland-user-wrapper

10
debian/treeland.install vendored Normal file
View File

@ -0,0 +1,10 @@
usr/bin/treeland
usr/bin/treeland.sh
usr/lib/systemd/user/*
usr/lib/systemd/system/*
usr/libexec/*
usr/share/*/translations/*
usr/share/dbus-1/system.d/*
usr/lib/*/lib*.so.*
usr/lib/*/treeland/plugins/lib*.so

27
default.nix Normal file
View File

@ -0,0 +1,27 @@
{
pkgs ? import <nixpkgs> { },
nix-filter,
ddm,
treeland-protocols,
}:
rec {
qwlroots = pkgs.qt6Packages.callPackage ./qwlroots/nix {
inherit nix-filter;
wlroots = pkgs.wlroots_0_19;
};
waylib = pkgs.qt6Packages.callPackage ./waylib/nix {
inherit nix-filter qwlroots;
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
};
treeland = pkgs.qt6Packages.callPackage ./nix {
inherit
nix-filter
ddm
treeland-protocols
qwlroots
waylib
;
};
}

177
docs/logging-guidelines.md Normal file
View File

@ -0,0 +1,177 @@
# Logging Guidelines for Treeland Project
This document provides guidelines for logging in the Treeland project, covering both treeland and waylib modules.
## Overview
The Treeland project uses Qt's logging system with customized categories. There are two different approaches for treeland and waylib modules:
- **treeland**: Uses centralized logging categories defined in `treelandlogging.h/.cpp`
- **waylib**: Uses local logging category definitions in each file
## Logging Categories
### Treeland Module Categories
All logging categories for the treeland module are centrally defined in `src/common/treelandlogging.h`:
```cpp
// Core functionality
Q_DECLARE_LOGGING_CATEGORY(treelandCore)
// Input device handling
Q_DECLARE_LOGGING_CATEGORY(treelandInput)
// Output/display management
Q_DECLARE_LOGGING_CATEGORY(treelandOutput)
// Plugin system
Q_DECLARE_LOGGING_CATEGORY(treelandPlugin)
// And more...
```
### Waylib Module Categories
Waylib modules define their categories locally in each file. The category naming follows this pattern:
`waylib.<module>.<component>[.<subcomponent>]`
Example from wcursor.cpp:
```cpp
// Cursor management and movement
Q_LOGGING_CATEGORY(waylibCursor, "waylib.server.cursor", QtInfoMsg)
// Cursor input events
Q_LOGGING_CATEGORY(waylibCursorInput, "waylib.server.cursor.input", QtDebugMsg)
// Cursor gesture events
Q_LOGGING_CATEGORY(waylibCursorGesture, "waylib.server.cursor.gesture", QtDebugMsg)
```
## Log Levels
Use appropriate log levels based on the message importance:
- **Debug (qCDebug)**: Detailed information for debugging
- **Info (qCInfo)**: General operational information
- **Warning (qCWarning)**: Potentially harmful situations
- **Critical (qCCritical)**: Critical errors that need immediate attention
Example:
```cpp
qCDebug(waylibCursor) << "Processing cursor motion at" << position;
qCWarning(waylibCursorInput) << "Invalid button code:" << code;
qCCritical(treelandCore) << "Failed to initialize core component";
```
## Best Practices
1. **Clear and Contextual Messages**
- Include relevant context in log messages
```cpp
// Good
qCDebug(waylibCursor) << "Cursor moved from" << oldPos << "to" << newPos;
// Bad
qCDebug(waylibCursor) << "Cursor moved";
```
2. **Appropriate Log Levels**
- Debug: Development and troubleshooting
- Info: Normal operations
- Warning: Unexpected but recoverable
- Critical: Serious errors
3. **Category Organization**
- Use specific categories for better filtering
```cpp
// Instead of
qCDebug(waylibCursor) << "Touch event received";
// Use
qCDebug(waylibCursorTouch) << "Touch event received";
```
4. **State Changes**
- Log important state changes with before/after values
```cpp
qCDebug(waylibCursor) << "Visibility changed from" << oldVisible << "to" << newVisible;
```
5. **Error Handling**
- Include error details and potential impact
```cpp
qCWarning(waylibCursor) << "Failed to attach device" << device->name()
<< "- not a pointing device";
```
## Implementation Examples
### Treeland Module
```cpp
#include "treelandlogging.h"
void ExampleClass::processEvent()
{
qCDebug(treelandCore) << "Processing event:" << eventType;
if (error) {
qCWarning(treelandCore) << "Event processing failed:" << errorDetails;
}
}
```
### Waylib Module
```cpp
// Local category definition
Q_LOGGING_CATEGORY(waylibExample, "waylib.module.example", QtInfoMsg)
void ExampleClass::processEvent()
{
qCDebug(waylibExample) << "Processing event:" << eventType;
if (error) {
qCWarning(waylibExample) << "Event processing failed:" << errorDetails;
}
}
```
## Debugging Tips
1. **Enable/Disable Categories**
```bash
export QT_LOGGING_RULES="waylib.server.cursor.debug=true"
export QT_LOGGING_RULES="waylib.*.debug=false"
```
2. **Log to File**
```bash
export QT_LOGGING_TO_FILE=1
export QT_LOGGING_OUTPUT=/path/to/logfile.txt
```
## Common Mistakes to Avoid
1. **Don't expose sensitive information**
```cpp
// Bad
qCDebug(treelandCore) << "User password:" << password;
```
2. **Don't mix categories inappropriately**
```cpp
// Bad
qCDebug(treelandInput) << "Cursor position changed"; // Should use cursor category
```
3. **Don't overuse Critical level**
```cpp
// Bad
qCCritical(waylibCursor) << "Minor position adjustment failed";
```
## Contributing
When contributing to the project:
1. Follow the established category naming patterns
2. Use appropriate log levels
3. Provide clear and contextual messages
4. Add new categories through proper channels (centralized for treeland, local for waylib)
For questions about logging, please refer to this guide or contact the maintainers.

View File

@ -0,0 +1,177 @@
# Treeland 项目日志指南
本文档提供了 Treeland 项目的日志指南,涵盖了 treeland 和 waylib 模块。
## 概述
Treeland 项目使用 Qt 的日志系统并自定义了日志类别。treeland 和 waylib 模块采用了两种不同的方式:
- **treeland**:使用在 `treelandlogging.h/.cpp` 中集中定义的日志类别
- **waylib**:在各个文件中本地定义日志类别
## 日志类别
### Treeland 模块类别
所有 treeland 模块的日志类别都集中定义在 `src/common/treelandlogging.h` 中:
```cpp
// 核心功能
Q_DECLARE_LOGGING_CATEGORY(treelandCore)
// 输入设备处理
Q_DECLARE_LOGGING_CATEGORY(treelandInput)
// 输出/显示管理
Q_DECLARE_LOGGING_CATEGORY(treelandOutput)
// 插件系统
Q_DECLARE_LOGGING_CATEGORY(treelandPlugin)
// 更多...
```
### Waylib 模块类别
Waylib 模块在各自的文件中定义类别。类别命名遵循以下模式:
`waylib.<模块>.<组件>[.<子组件>]`
来自 wcursor.cpp 的示例:
```cpp
// 光标管理和移动
Q_LOGGING_CATEGORY(waylibCursor, "waylib.server.cursor", QtInfoMsg)
// 光标输入事件
Q_LOGGING_CATEGORY(waylibCursorInput, "waylib.server.cursor.input", QtDebugMsg)
// 光标手势事件
Q_LOGGING_CATEGORY(waylibCursorGesture, "waylib.server.cursor.gesture", QtDebugMsg)
```
## 日志级别
根据消息的重要性使用适当的日志级别:
- **Debug (qCDebug)**:调试信息,用于开发调试
- **Info (qCInfo)**:一般操作信息
- **Warning (qCWarning)**:潜在的有害情况
- **Critical (qCCritical)**:需要立即关注的严重错误
示例:
```cpp
qCDebug(waylibCursor) << "正在处理光标移动,位置:" << position;
qCWarning(waylibCursorInput) << "无效的按钮代码:" << code;
qCCritical(treelandCore) << "核心组件初始化失败";
```
## 最佳实践
1. **清晰和上下文相关的消息**
- 在日志消息中包含相关上下文
```cpp
// 好的做法
qCDebug(waylibCursor) << "光标从" << oldPos << "移动到" << newPos;
// 不好的做法
qCDebug(waylibCursor) << "光标移动";
```
2. **适当的日志级别**
- Debug开发和故障排除
- Info正常操作
- Warning意外但可恢复的情况
- Critical严重错误
3. **类别组织**
- 使用特定类别以便更好地过滤
```cpp
// 不要这样
qCDebug(waylibCursor) << "收到触摸事件";
// 应该这样
qCDebug(waylibCursorTouch) << "收到触摸事件";
```
4. **状态变化**
- 记录重要的状态变化,包含前后的值
```cpp
qCDebug(waylibCursor) << "可见性从" << oldVisible << "变更为" << newVisible;
```
5. **错误处理**
- 包含错误详情和潜在影响
```cpp
qCWarning(waylibCursor) << "设备" << device->name()
<< "附加失败 - 不是指针设备";
```
## 实现示例
### Treeland 模块
```cpp
#include "treelandlogging.h"
void ExampleClass::processEvent()
{
qCDebug(treelandCore) << "正在处理事件:" << eventType;
if (error) {
qCWarning(treelandCore) << "事件处理失败:" << errorDetails;
}
}
```
### Waylib 模块
```cpp
// 本地类别定义
Q_LOGGING_CATEGORY(waylibExample, "waylib.module.example", QtInfoMsg)
void ExampleClass::processEvent()
{
qCDebug(waylibExample) << "正在处理事件:" << eventType;
if (error) {
qCWarning(waylibExample) << "事件处理失败:" << errorDetails;
}
}
```
## 调试技巧
1. **启用/禁用类别**
```bash
export QT_LOGGING_RULES="waylib.server.cursor.debug=true"
export QT_LOGGING_RULES="waylib.*.debug=false"
```
2. **日志输出到文件**
```bash
export QT_LOGGING_TO_FILE=1
export QT_LOGGING_OUTPUT=/path/to/logfile.txt
```
## 常见错误避免
1. **不要暴露敏感信息**
```cpp
// 错误
qCDebug(treelandCore) << "用户密码:" << password;
```
2. **不要混用类别**
```cpp
// 错误
qCDebug(treelandInput) << "光标位置改变"; // 应该使用光标类别
```
3. **不要过度使用 Critical 级别**
```cpp
// 错误
qCCritical(waylibCursor) << "轻微的位置调整失败";
```
## 贡献指南
在为项目贡献代码时:
1. 遵循既定的类别命名模式
2. 使用适当的日志级别
3. 提供清晰和上下文相关的消息
4. 通过正确的方式添加新类别treeland 集中定义waylib 本地定义)
如有关于日志的问题,请参考本指南或联系维护者。

19
examples/CMakeLists.txt Normal file
View File

@ -0,0 +1,19 @@
set(MODULE_PATH ${PROJECT_SOURCE_DIR}/src/modules)
add_subdirectory(test_window_bg)
add_subdirectory(test_wallpaper_color)
add_subdirectory(test_show_desktop)
add_subdirectory(test_window_cursor)
add_subdirectory(test_xdgport_wallpaper)
add_subdirectory(test_virtual_output)
add_subdirectory(test_pinch_handler)
add_subdirectory(test_hide_window)
add_subdirectory(test_data_control_manager)
add_subdirectory(test_window_overlapped)
add_subdirectory(test_capture)
add_subdirectory(test_window_appearance)
add_subdirectory(test_super_overlay_surface)
add_subdirectory(test_monitor_active_event)
add_subdirectory(test_primary_output)
add_subdirectory(test_multitaskview)
add_subdirectory(test_set_treeland_wallpaper)

View File

@ -0,0 +1,46 @@
find_package(PkgConfig REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core Gui WaylandClient Quick)
find_package(TreelandProtocols REQUIRED)
pkg_check_modules(EGL REQUIRED IMPORTED_TARGET egl gl)
qt_add_executable(test-capture
main.cpp
)
qt_add_qml_module(test-capture
URI capture
VERSION 2.0
SOURCES
capture.h
capture.cpp
subwindow.h
subwindow.cpp
player.h
player.cpp
QML_FILES
Main.qml
)
qt_add_resources(test-capture "test_capture_assets"
PREFIX "/"
BASE ${CMAKE_CURRENT_LIST_DIR}/images
FILES
${CMAKE_CURRENT_LIST_DIR}/images/watermark.png
)
qt6_generate_wayland_protocol_client_sources(test-capture
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-capture-unstable-v1.xml
)
target_link_libraries(test-capture
PRIVATE
Qt6::Core
Qt6::Gui
Qt6::WaylandClient
Qt6::WaylandClientPrivate
Qt6::Quick
Qt6::QuickPrivate
Qt6::QuickControls2
PkgConfig::EGL
)
install(TARGETS test-capture RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,80 @@
// Copyright (C) 2024 Dingyuan Zhang <lxz@mkacg.com>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import capture
Window {
id: canvas
width: 600
height: 400
visible: !TreelandCaptureManager.recordStarted
color: "transparent"
flags: regionReady ? 0 : Qt.WindowTransparentForInput
property rect captureRegion: TreelandCaptureManager.context?.captureRegion ?? Qt.rect(0, 0, 0, 0)
property bool regionReady: captureRegion.width !== 0 && captureRegion.height !== 0
Image {
id: watermark
visible: false
source: "qrc:/watermark.png"
sourceSize: Qt.size(100, 100)
fillMode: Image.Tile
x: captureRegion.x
y: captureRegion.y
width: captureRegion.width
height: captureRegion.height
}
SubWindow {
id: toolBar
parent: canvas
visible: regionReady
x: captureRegion.x
y: Math.min(captureRegion.bottom, canvas.height - 2 * height)
width: row.width
height: row.height
color: "transparent"
Row {
id: row
Button {
width: 100
height: 30
text: watermark.visible ? "Hide watermark" : "Show watermark"
onClicked: {
watermark.visible = !watermark.visible
}
}
Button {
width: 100
height: 30
text: TreelandCaptureManager.record ? "Screenshot" : "Record"
onClicked: {
TreelandCaptureManager.record = !TreelandCaptureManager.record
}
}
Button {
width: 100
height: 30
text: "Finish"
onClicked: {
TreelandCaptureManager.finishSelect()
}
}
}
}
Window {
id: playerWindow
visible: TreelandCaptureManager.recordStarted
width: player.width
height: player.height
color: "black"
Player {
id: player
width: 100
height: 100
captureContext: TreelandCaptureManager.context
}
}
}

View File

@ -0,0 +1,287 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "capture.h"
#include <private/qguiapplication_p.h>
#include <private/qwaylanddisplay_p.h>
#include <private/qwaylandintegration_p.h>
#include <QPointer>
inline QtWaylandClient::QWaylandIntegration *waylandIntegration()
{
return dynamic_cast<QtWaylandClient::QWaylandIntegration *>(
QGuiApplicationPrivate::platformIntegration());
}
inline QPointer<QtWaylandClient::QWaylandDisplay> waylandDisplay()
{
return waylandIntegration()->display();
}
TreelandCaptureManager *TreelandCaptureManager::instance()
{
static TreelandCaptureManager manager;
return &manager;
}
TreelandCaptureManager *TreelandCaptureManager::create(QQmlEngine *, QJSEngine *)
{
auto manager = instance();
QQmlEngine::setObjectOwnership(manager, QQmlEngine::CppOwnership);
return manager;
}
TreelandCaptureManager::TreelandCaptureManager()
: QWaylandClientExtensionTemplate<TreelandCaptureManager>(1)
, QtWayland::treeland_capture_manager_v1()
{
connect(this, &TreelandCaptureManager::activeChanged, this, [this] {
if (!isActive()) {
delete m_context;
}
});
}
TreelandCaptureContext *TreelandCaptureManager::ensureContext()
{
if (m_context)
return m_context;
auto context = get_context();
m_context = new TreelandCaptureContext(context, this);
connect(m_context, &TreelandCaptureContext::destroyed, this, [this] {
m_context = nullptr;
Q_EMIT contextChanged();
});
Q_EMIT contextChanged();
return m_context;
}
void TreelandCaptureContext::treeland_capture_context_v1_source_ready(int32_t region_x,
int32_t region_y,
uint32_t region_width,
uint32_t region_height,
uint32_t source_type)
{
m_captureRegion = QRect(region_x, region_y, region_width, region_height);
m_sourceType = static_cast<QtWayland::treeland_capture_context_v1::source_type>(source_type);
Q_EMIT captureRegionChanged();
Q_EMIT sourceReady(QRect(region_x, region_y, region_width, region_height), source_type);
}
void TreelandCaptureContext::treeland_capture_context_v1_source_failed(uint32_t reason)
{
Q_EMIT sourceFailed(reason);
}
TreelandCaptureFrame *TreelandCaptureContext::ensureFrame()
{
if (m_frame)
return m_frame;
auto object = QtWayland::treeland_capture_context_v1::capture();
m_frame = new TreelandCaptureFrame(object, this);
connect(m_frame, &TreelandCaptureFrame::destroyed, this, [this] {
m_frame = nullptr;
Q_EMIT frameChanged();
});
Q_EMIT frameChanged();
return m_frame;
}
TreelandCaptureContext::TreelandCaptureContext(::treeland_capture_context_v1 *object,
QObject *parent)
: QObject(parent)
, QtWayland::treeland_capture_context_v1(object)
{
}
TreelandCaptureContext::~TreelandCaptureContext()
{
delete m_frame;
delete m_session;
destroy();
}
void TreelandCaptureContext::selectSource(uint32_t sourceHint,
bool freeze,
bool withCursor,
::wl_surface *mask)
{
select_source(sourceHint, freeze, withCursor, mask);
}
TreelandCaptureSession *TreelandCaptureContext::ensureSession()
{
if (m_session)
return m_session;
auto object = create_session();
m_session = new TreelandCaptureSession(object, this);
connect(m_session, &TreelandCaptureSession::destroyed, this, [this] {
m_session = nullptr;
Q_EMIT sessionChanged();
});
Q_EMIT sessionChanged();
return m_session;
}
TreelandCaptureFrame::TreelandCaptureFrame(::treeland_capture_frame_v1 *object, QObject *parent)
: QObject(parent)
, QtWayland::treeland_capture_frame_v1(object)
, m_shmBuffer(nullptr)
, m_pendingShmBuffer(nullptr)
{
}
TreelandCaptureFrame::~TreelandCaptureFrame()
{
delete m_shmBuffer;
delete m_pendingShmBuffer;
destroy();
}
void TreelandCaptureFrame::treeland_capture_frame_v1_buffer(uint32_t format,
uint32_t width,
uint32_t height,
uint32_t stride)
{
if (stride != width * 4) {
qDebug() << "Receive a buffer format which is not compatible with "
"QWaylandShmBuffer."
<< "format:" << format << "width:" << width << "height:" << height
<< "stride:" << stride;
return;
}
if (m_pendingShmBuffer)
return; // We only need one supported format
m_pendingShmBuffer = new QtWaylandClient::QWaylandShmBuffer(
waylandDisplay(),
QSize(width, height),
QtWaylandClient::QWaylandShm::formatFrom(static_cast<::wl_shm_format>(format)));
copy(m_pendingShmBuffer->buffer());
}
void TreelandCaptureFrame::treeland_capture_frame_v1_flags(uint32_t flags)
{
m_flags = flags;
}
void TreelandCaptureFrame::treeland_capture_frame_v1_ready()
{
if (m_shmBuffer)
delete m_shmBuffer;
m_shmBuffer = m_pendingShmBuffer;
m_pendingShmBuffer = nullptr;
Q_EMIT ready(*m_shmBuffer->image());
}
void TreelandCaptureFrame::treeland_capture_frame_v1_failed()
{
Q_EMIT failed();
}
TreelandCaptureSession::TreelandCaptureSession(::treeland_capture_session_v1 *object,
QObject *parent)
: QObject(parent)
, QtWayland::treeland_capture_session_v1(object)
{
}
TreelandCaptureSession::~TreelandCaptureSession() { }
void TreelandCaptureSession::start()
{
QtWayland::treeland_capture_session_v1::start();
m_started = true;
Q_EMIT started();
}
void TreelandCaptureSession::doneFrame()
{
// Note: Must close all fds here in the client.
for (const auto &object : std::as_const(objects())) {
close(object.fd);
}
m_objects.clear();
frame_done(m_tvSecHi, m_tvSecLo, m_tvUsec);
m_frameValid = false;
Q_EMIT invalid();
}
void TreelandCaptureSession::treeland_capture_session_v1_frame(int32_t offset_x,
int32_t offset_y,
uint32_t width,
uint32_t height,
uint32_t buffer_flags,
uint32_t flags,
uint32_t format,
uint32_t mod_high,
uint32_t mod_low,
uint32_t num_objects)
{
m_objects.clear();
m_objects.reserve(num_objects);
m_offset = { offset_x, offset_y };
m_bufferWidth = width;
m_bufferHeight = height;
m_bufferFlags = buffer_flags;
m_bufferFormat = format;
m_flags = static_cast<QtWayland::treeland_capture_session_v1::flags>(flags);
m_modifierUnion.modLow = mod_low;
m_modifierUnion.modHigh = mod_high;
}
void TreelandCaptureSession::treeland_capture_session_v1_object(uint32_t index,
int32_t fd,
uint32_t size,
uint32_t offset,
uint32_t stride,
uint32_t plane_index)
{
m_objects.push_back({ .index = index,
.fd = fd,
.size = size,
.offset = offset,
.stride = stride,
.planeIndex = plane_index });
}
void TreelandCaptureSession::treeland_capture_session_v1_ready(uint32_t tv_sec_hi,
uint32_t tv_sec_lo,
uint32_t tv_nsec)
{
m_tvSecHi = tv_sec_hi;
m_tvSecLo = tv_sec_lo;
m_tvUsec = tv_nsec;
m_frameValid = true;
Q_EMIT ready();
}
void TreelandCaptureSession::treeland_capture_session_v1_cancel(uint32_t reason)
{
if (reason == QtWayland::treeland_capture_session_v1::cancel_reason_permanent) {
for (const auto &object : std::as_const(objects())) {
close(object.fd);
}
m_objects.clear();
} else {
doneFrame();
}
}
void TreelandCaptureManager::setRecord(bool newRecord)
{
if (m_record == newRecord)
return;
m_record = newRecord;
Q_EMIT recordChanged();
}
bool TreelandCaptureManager::recordStarted() const
{
if (m_context && m_context->session()) {
return m_context->session()->started();
} else {
return false;
}
}

View File

@ -0,0 +1,273 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include "qwayland-treeland-capture-unstable-v1.h"
#include <private/qwaylandclientextension_p.h>
#include <private/qwaylandshmbackingstore_p.h>
#include <QQmlEngine>
#include <qqmlregistration.h>
class TreelandCaptureFrame
: public QObject
, public QtWayland::treeland_capture_frame_v1
{
Q_OBJECT
QML_ANONYMOUS
public:
TreelandCaptureFrame(struct ::treeland_capture_frame_v1 *object, QObject *parent = nullptr);
~TreelandCaptureFrame() override;
inline uint flags() const
{
return m_flags;
}
Q_SIGNALS:
void ready(QImage image);
void failed();
protected:
void treeland_capture_frame_v1_buffer(uint32_t format,
uint32_t width,
uint32_t height,
uint32_t stride) override;
void treeland_capture_frame_v1_flags(uint32_t flags) override;
void treeland_capture_frame_v1_ready() override;
void treeland_capture_frame_v1_failed() override;
private:
QtWaylandClient::QWaylandShmBuffer *m_shmBuffer{ nullptr };
QtWaylandClient::QWaylandShmBuffer *m_pendingShmBuffer{ nullptr };
uint m_flags;
};
struct FrameObject
{
uint32_t index;
int32_t fd;
uint32_t size;
uint32_t offset;
uint32_t stride;
uint32_t planeIndex;
};
union ModifierUnion
{
struct
{
uint32_t modLow;
uint32_t modHigh;
};
uint64_t modifier;
};
class TreelandCaptureSession
: public QObject
, public QtWayland::treeland_capture_session_v1
{
Q_OBJECT
QML_ANONYMOUS
Q_PROPERTY(bool started READ started NOTIFY startedChanged FINAL)
public:
explicit TreelandCaptureSession(::treeland_capture_session_v1 *object,
QObject *parent = nullptr);
~TreelandCaptureSession() override;
inline uint bufferWidth() const
{
return m_bufferWidth;
}
inline uint bufferHeight() const
{
return m_bufferHeight;
}
inline uint bufferFormat() const
{
return m_bufferFormat;
}
inline uint bufferFlags() const
{
return m_bufferFlags;
}
inline const QList<FrameObject> &objects() const
{
return m_objects;
}
inline ModifierUnion modifierUnion() const
{
return m_modifierUnion;
}
inline bool started() const
{
return m_started;
}
void start();
void doneFrame();
inline bool frameValid() const
{
return m_frameValid;
}
Q_SIGNALS:
void invalid();
void ready();
void startedChanged();
protected:
void treeland_capture_session_v1_frame(int32_t offset_x,
int32_t offset_y,
uint32_t width,
uint32_t height,
uint32_t buffer_flags,
uint32_t flags,
uint32_t format,
uint32_t mod_high,
uint32_t mod_low,
uint32_t num_objects) override;
void treeland_capture_session_v1_object(uint32_t index,
int32_t fd,
uint32_t size,
uint32_t offset,
uint32_t stride,
uint32_t plane_index) override;
void treeland_capture_session_v1_ready(uint32_t tv_sec_hi,
uint32_t tv_sec_lo,
uint32_t tv_nsec) override;
void treeland_capture_session_v1_cancel(uint32_t reason) override;
private:
QPoint m_offset;
uint m_bufferWidth;
uint m_bufferHeight;
uint m_bufferFlags;
uint m_bufferFormat;
ModifierUnion m_modifierUnion;
QList<FrameObject> m_objects;
QtWayland::treeland_capture_session_v1::flags m_flags;
bool m_started{ false };
uint32_t m_tvSecHi;
uint32_t m_tvSecLo;
uint32_t m_tvUsec;
bool m_frameValid{ false };
};
class TreelandCaptureContext
: public QObject
, public QtWayland::treeland_capture_context_v1
{
Q_OBJECT
QML_ANONYMOUS
Q_PROPERTY(TreelandCaptureFrame* frame READ frame NOTIFY frameChanged FINAL)
Q_PROPERTY(TreelandCaptureSession* session READ session NOTIFY sessionChanged FINAL)
Q_PROPERTY(QRectF captureRegion READ captureRegion NOTIFY captureRegionChanged FINAL)
QML_UNCREATABLE("Managed by C++.")
public:
using QtWayland::treeland_capture_context_v1::source_type;
explicit TreelandCaptureContext(struct ::treeland_capture_context_v1 *object,
QObject *parent = nullptr);
~TreelandCaptureContext() override;
inline QRectF captureRegion() const
{
return m_captureRegion;
}
inline QtWayland::treeland_capture_context_v1::source_type sourceType() const
{
return m_sourceType;
}
inline TreelandCaptureFrame *frame() const
{
return m_frame;
}
inline TreelandCaptureSession *session() const
{
return m_session;
}
void selectSource(uint32_t sourceHint, bool freeze, bool withCursor, ::wl_surface *mask);
TreelandCaptureFrame *ensureFrame();
TreelandCaptureSession *ensureSession();
Q_SIGNALS:
void sourceReady(QRect region, uint32_t sourceType);
void sourceFailed(uint32_t reason);
void frameChanged();
void sessionChanged();
void captureRegionChanged();
protected:
void treeland_capture_context_v1_source_ready(int32_t region_x,
int32_t region_y,
uint32_t region_width,
uint32_t region_height,
uint32_t source_type) override;
void treeland_capture_context_v1_source_failed(uint32_t reason) override;
private:
QRect m_captureRegion;
QtWayland::treeland_capture_context_v1::source_type m_sourceType;
TreelandCaptureFrame *m_frame{ nullptr };
TreelandCaptureSession *m_session{ nullptr };
};
class TreelandCaptureManager
: public QWaylandClientExtensionTemplate<TreelandCaptureManager>
, public QtWayland::treeland_capture_manager_v1
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
QML_UNCREATABLE("Managed by C++.")
Q_PROPERTY(TreelandCaptureContext* context READ context NOTIFY contextChanged FINAL)
Q_PROPERTY(bool record READ record WRITE setRecord NOTIFY recordChanged FINAL)
Q_PROPERTY(bool recordStarted READ recordStarted NOTIFY recordStartedChanged FINAL)
public:
static TreelandCaptureManager *instance();
static TreelandCaptureManager *create(QQmlEngine *, QJSEngine *);
inline TreelandCaptureContext *context() const
{
return m_context;
}
TreelandCaptureContext *ensureContext();
inline bool record() const
{
return m_record;
}
void setRecord(bool newRecord);
bool recordStarted() const;
Q_SIGNALS:
void contextChanged();
void recordChanged();
void finishSelect();
void recordStartedChanged();
private:
TreelandCaptureManager();
TreelandCaptureContext *m_context{ nullptr };
bool m_record{ false };
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,109 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "capture.h"
#include <private/qwaylandwindow_p.h>
#include <QDir>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include <QQuickWindow>
#include <QStandardPaths>
#include <QTimer>
int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QQuickStyle::setStyle("Material");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
auto manager = TreelandCaptureManager::instance();
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() {
QCoreApplication::exit(-1);
},
Qt::QueuedConnection);
auto captureWithMask = [&app, manager](::wl_surface *mask) {
auto captureContext = manager->ensureContext();
if (!captureContext) {
app.exit(-1);
Q_UNREACHABLE();
}
captureContext->selectSource(TreelandCaptureContext::source_type_output
| TreelandCaptureContext::source_type_window
| TreelandCaptureContext::source_type_region,
true,
false,
mask);
QObject::connect(
manager,
&TreelandCaptureManager::finishSelect,
manager,
[&app, captureContext, manager] {
if (manager->record()) {
auto session = captureContext->ensureSession();
session->start();
QTimer::singleShot(1000, manager, [manager] {
Q_EMIT manager->recordStartedChanged();
});
} else {
auto frame = captureContext->ensureFrame();
QImage result;
QEventLoop loop;
QObject::connect(frame,
&TreelandCaptureFrame::ready,
&app,
[&result, &loop](QImage image) {
result = image;
loop.quit();
});
QObject::connect(frame, &TreelandCaptureFrame::failed, &app, [&loop] {
loop.quit();
});
loop.exec();
if (result.isNull())
app.exit(-1);
auto saveBasePath =
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
QDir saveBaseDir(saveBasePath);
if (!saveBaseDir.exists())
app.exit(-1);
QString picName =
"portal screenshot - " + QDateTime::currentDateTime().toString() + ".png";
if (result.save(saveBaseDir.absoluteFilePath(picName), "PNG")) {
qDebug() << saveBaseDir.absoluteFilePath(picName);
delete TreelandCaptureManager::instance()->context();
app.quit();
} else {
delete TreelandCaptureManager::instance()->context();
app.exit(-1);
}
}
});
};
QObject::connect(&engine,
&QQmlApplicationEngine::objectCreated,
manager,
[&app, manager, captureWithMask](QObject *object, const QUrl &) {
if (auto canvasWindow = qobject_cast<QQuickWindow *>(object)) {
auto waylandWindow = static_cast<QtWaylandClient::QWaylandWindow *>(
canvasWindow->handle());
auto mask = waylandWindow ? waylandWindow->surface() : nullptr;
if (manager->isActive()) {
captureWithMask(mask);
} else {
QObject::connect(manager,
&TreelandCaptureManager::activeChanged,
manager,
std::bind(captureWithMask, mask));
}
}
});
engine.loadFromModule("capture", "Main");
return app.exec();
}

View File

@ -0,0 +1,365 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "player.h"
#include "capture.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <libdrm/drm_fourcc.h>
#include <rhi/qrhi.h>
#include <QSGImageNode>
#include <QSGTexture>
#include <unistd.h>
Player::Player()
{
setFlag(QQuickItem::ItemHasContents);
}
TreelandCaptureContext *Player::captureContext() const
{
return m_captureContext;
}
void Player::setCaptureContext(TreelandCaptureContext *context)
{
if (context == m_captureContext)
return;
if (m_captureContext) {
m_captureContext->disconnect(this);
}
m_captureContext = context;
if (m_captureContext) {
connect(m_captureContext.data(),
&TreelandCaptureContext::destroyed,
this,
std::bind(&Player::setCaptureContext, this, nullptr));
if (m_captureContext->session()) {
connect(m_captureContext->session(),
&TreelandCaptureSession::ready,
this,
&Player::update);
} else {
connect(m_captureContext, &TreelandCaptureContext::sessionChanged, this, [this] {
if (m_captureContext->session())
connect(m_captureContext->session(),
&TreelandCaptureSession::ready,
this,
&Player::update);
});
}
connect(m_captureContext.data(),
&TreelandCaptureContext::sourceReady,
this,
&Player::updateGeometry);
}
Q_EMIT captureContextChanged();
}
QSGNode *Player::updatePaintNode(QSGNode *old, [[maybe_unused]] UpdatePaintNodeData *data)
{
ensureDebugLogger();
if (!m_captureContext || !m_captureContext->session()
|| !m_captureContext->session()->started())
return nullptr;
updateTexture();
auto node = static_cast<QSGImageNode *>(old);
if (Q_UNLIKELY(!node) && m_rhiTexture != nullptr) {
node = window()->createImageNode();
node->setOwnsTexture(false);
node->setTexture(&m_texture);
} else if (m_rhiTexture != nullptr) {
node->markDirty(QSGNode::DirtyMaterial);
} else {
return nullptr;
}
QRectF sourceRect;
if (m_captureContext->sourceType()
== QtWayland::treeland_capture_context_v1::source_type_window) {
sourceRect = QRectF({ 0, 0 }, m_texture.textureSize());
} else {
sourceRect = m_captureContext->captureRegion();
}
qInfo() << "sourceRect" << sourceRect << "textureSize" << m_texture.textureSize();
node->setSourceRect(sourceRect);
node->setRect(boundingRect());
node->setFiltering(QSGTexture::Linear);
node->setMipmapFiltering(QSGTexture::None);
return node;
}
#define CASE_STR(value) \
case value: \
return #value;
static const char *eglGetErrorString(EGLint error)
{
switch (error) {
CASE_STR(EGL_SUCCESS)
CASE_STR(EGL_NOT_INITIALIZED)
CASE_STR(EGL_BAD_ACCESS)
CASE_STR(EGL_BAD_ALLOC)
CASE_STR(EGL_BAD_ATTRIBUTE)
CASE_STR(EGL_BAD_CONTEXT)
CASE_STR(EGL_BAD_CONFIG)
CASE_STR(EGL_BAD_CURRENT_SURFACE)
CASE_STR(EGL_BAD_DISPLAY)
CASE_STR(EGL_BAD_SURFACE)
CASE_STR(EGL_BAD_MATCH)
CASE_STR(EGL_BAD_PARAMETER)
CASE_STR(EGL_BAD_NATIVE_PIXMAP)
CASE_STR(EGL_BAD_NATIVE_WINDOW)
CASE_STR(EGL_CONTEXT_LOST)
default:
return "Unknown";
}
}
[[maybe_unused]] static const char *drmFormatString(int fourcc)
{
switch (fourcc) {
CASE_STR(DRM_FORMAT_R8)
CASE_STR(DRM_FORMAT_RG88)
CASE_STR(DRM_FORMAT_GR88)
CASE_STR(DRM_FORMAT_R16)
CASE_STR(DRM_FORMAT_GR1616)
CASE_STR(DRM_FORMAT_RGB332)
CASE_STR(DRM_FORMAT_BGR233)
CASE_STR(DRM_FORMAT_XRGB4444)
CASE_STR(DRM_FORMAT_XBGR4444)
CASE_STR(DRM_FORMAT_RGBX4444)
CASE_STR(DRM_FORMAT_BGRX4444)
CASE_STR(DRM_FORMAT_ARGB4444)
CASE_STR(DRM_FORMAT_ABGR4444)
CASE_STR(DRM_FORMAT_RGBA4444)
CASE_STR(DRM_FORMAT_BGRA4444)
CASE_STR(DRM_FORMAT_XRGB1555)
CASE_STR(DRM_FORMAT_XBGR1555)
CASE_STR(DRM_FORMAT_RGBX5551)
CASE_STR(DRM_FORMAT_BGRX5551)
CASE_STR(DRM_FORMAT_ARGB1555)
CASE_STR(DRM_FORMAT_ABGR1555)
CASE_STR(DRM_FORMAT_RGBA5551)
CASE_STR(DRM_FORMAT_BGRA5551)
CASE_STR(DRM_FORMAT_RGB565)
CASE_STR(DRM_FORMAT_BGR565)
CASE_STR(DRM_FORMAT_RGB888)
CASE_STR(DRM_FORMAT_BGR888)
CASE_STR(DRM_FORMAT_XRGB8888)
CASE_STR(DRM_FORMAT_XBGR8888)
CASE_STR(DRM_FORMAT_RGBX8888)
CASE_STR(DRM_FORMAT_BGRX8888)
CASE_STR(DRM_FORMAT_ARGB8888)
CASE_STR(DRM_FORMAT_ABGR8888)
CASE_STR(DRM_FORMAT_RGBA8888)
CASE_STR(DRM_FORMAT_BGRA8888)
CASE_STR(DRM_FORMAT_XRGB2101010)
CASE_STR(DRM_FORMAT_XBGR2101010)
CASE_STR(DRM_FORMAT_RGBX1010102)
CASE_STR(DRM_FORMAT_BGRX1010102)
CASE_STR(DRM_FORMAT_ARGB2101010)
CASE_STR(DRM_FORMAT_ABGR2101010)
CASE_STR(DRM_FORMAT_RGBA1010102)
CASE_STR(DRM_FORMAT_BGRA1010102)
CASE_STR(DRM_FORMAT_ABGR16161616)
CASE_STR(DRM_FORMAT_XBGR16161616)
CASE_STR(DRM_FORMAT_XBGR16161616F)
CASE_STR(DRM_FORMAT_ABGR16161616F)
CASE_STR(DRM_FORMAT_YUYV)
CASE_STR(DRM_FORMAT_YVYU)
CASE_STR(DRM_FORMAT_UYVY)
CASE_STR(DRM_FORMAT_VYUY)
CASE_STR(DRM_FORMAT_AYUV)
CASE_STR(DRM_FORMAT_XYUV8888)
CASE_STR(DRM_FORMAT_Y210)
CASE_STR(DRM_FORMAT_Y212)
CASE_STR(DRM_FORMAT_Y216)
CASE_STR(DRM_FORMAT_Y410)
CASE_STR(DRM_FORMAT_Y412)
CASE_STR(DRM_FORMAT_Y416)
CASE_STR(DRM_FORMAT_NV12)
CASE_STR(DRM_FORMAT_NV21)
CASE_STR(DRM_FORMAT_NV16)
CASE_STR(DRM_FORMAT_NV61)
CASE_STR(DRM_FORMAT_P010)
CASE_STR(DRM_FORMAT_P012)
CASE_STR(DRM_FORMAT_P016)
CASE_STR(DRM_FORMAT_P030)
CASE_STR(DRM_FORMAT_YUV410)
CASE_STR(DRM_FORMAT_YVU410)
CASE_STR(DRM_FORMAT_YUV411)
CASE_STR(DRM_FORMAT_YVU411)
CASE_STR(DRM_FORMAT_YUV420)
CASE_STR(DRM_FORMAT_YVU420)
CASE_STR(DRM_FORMAT_YUV422)
CASE_STR(DRM_FORMAT_YVU422)
CASE_STR(DRM_FORMAT_YUV444)
CASE_STR(DRM_FORMAT_YVU444)
default:
return "Unknown";
}
}
#undef CASE_STR
void Player::updateTexture()
{
if (!m_captureContext->session()->frameValid())
return;
auto glContext = QOpenGLContext::currentContext();
Q_ASSERT(glContext);
auto eglContext = glContext->nativeInterface<QNativeInterface::QEGLContext>();
Q_ASSERT(eglContext);
EGLImage eglImage;
EGLAttrib attribs[47];
int atti = 0;
attribs[atti++] = EGL_WIDTH;
attribs[atti++] = m_captureContext->session()->bufferWidth();
attribs[atti++] = EGL_HEIGHT;
attribs[atti++] = m_captureContext->session()->bufferHeight();
attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
attribs[atti++] = m_captureContext->session()->bufferFormat();
auto objects = m_captureContext->session()->objects();
auto nPlanes = objects.size();
if (nPlanes > 0) {
attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
attribs[atti++] = objects[0].fd;
attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
attribs[atti++] = objects[0].offset;
attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
attribs[atti++] = objects[0].stride;
if (m_captureContext->session()->modifierUnion().modifier) {
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modLow;
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modHigh;
}
}
if (nPlanes > 1) {
attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT;
attribs[atti++] = objects[1].fd;
attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT;
attribs[atti++] = objects[1].offset;
attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT;
attribs[atti++] = objects[1].stride;
if (m_captureContext->session()->modifierUnion().modifier) {
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modLow;
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modHigh;
}
}
if (nPlanes > 2) {
attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT;
attribs[atti++] = objects[2].fd;
attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT;
attribs[atti++] = objects[2].offset;
attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT;
attribs[atti++] = objects[2].stride;
if (m_captureContext->session()->modifierUnion().modifier) {
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modLow;
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modHigh;
}
}
if (nPlanes > 3) {
attribs[atti++] = EGL_DMA_BUF_PLANE3_FD_EXT;
attribs[atti++] = objects[3].fd;
attribs[atti++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT;
attribs[atti++] = objects[3].offset;
attribs[atti++] = EGL_DMA_BUF_PLANE3_PITCH_EXT;
attribs[atti++] = objects[3].stride;
if (m_captureContext->session()->modifierUnion().modifier) {
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modLow;
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
attribs[atti++] = m_captureContext->session()->modifierUnion().modHigh;
}
}
attribs[atti++] = EGL_NONE;
eglImage =
eglCreateImage(eglContext->display(), EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, 0, attribs);
if (eglImage == EGL_NO_IMAGE) {
qWarning() << eglGetErrorString(eglGetError());
m_captureContext->session()->doneFrame();
return;
}
Q_ASSERT_X(window(), __func__, "Window should be ready for rhi.");
if (m_rhiTexture) {
m_texture.setTexture(nullptr);
delete m_rhiTexture;
}
m_rhiTexture =
window()->rhi()->newTexture(QRhiTexture::RGBA8,
QSize{ int(m_captureContext->session()->bufferWidth()),
int(m_captureContext->session()->bufferHeight()) },
1,
QRhiTexture::TextureArray);
glBindTexture(GL_TEXTURE_2D, m_rhiTexture->nativeTexture().object);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage);
m_texture.setTexture(m_rhiTexture);
m_texture.setTextureSize(QSize{ int(m_captureContext->session()->bufferWidth()),
int(m_captureContext->session()->bufferHeight()) });
m_texture.setOwnsTexture(false);
glBindTexture(GL_TEXTURE_2D, 0);
eglDestroyImage(eglContext->display(), eglImage);
m_captureContext->session()->doneFrame();
}
void Player::updateGeometry()
{
Q_ASSERT(m_captureContext);
setWidth(m_captureContext->captureRegion().width());
setHeight(m_captureContext->captureRegion().height());
}
static void EGLAPIENTRY debugCallback(EGLenum error,
[[maybe_unused]] const char *command,
[[maybe_unused]] EGLint messageType,
[[maybe_unused]] EGLLabelKHR threadLabel,
[[maybe_unused]] EGLLabelKHR objectLabel,
const char *message)
{
qInfo() << "EGL Debug:" << message << "(Error Code:" << error << ")";
}
void Player::ensureDebugLogger()
{
if (m_loggerInitialized)
return;
if (QOpenGLContext::currentContext()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
const EGLAttrib debugAttribs[] = {
EGL_DEBUG_MSG_CRITICAL_KHR,
EGL_TRUE,
EGL_DEBUG_MSG_ERROR_KHR,
EGL_TRUE,
EGL_DEBUG_MSG_WARN_KHR,
EGL_TRUE,
EGL_DEBUG_MSG_INFO_KHR,
EGL_TRUE,
EGL_NONE,
};
PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR =
(PFNEGLDEBUGMESSAGECONTROLKHRPROC)eglGetProcAddress("eglDebugMessageControlKHR");
if (eglDebugMessageControlKHR) {
eglDebugMessageControlKHR(debugCallback, debugAttribs);
} else {
qCritical() << "Failed to get eglDebugMessageControlKHR function.";
}
} else {
qCritical() << "GL_KHR_debug is not supported.";
}
m_loggerInitialized = true;
}

View File

@ -0,0 +1,38 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include <private/qsgplaintexture_p.h>
#include <QQuickItem>
class QSGPlainTexture;
class QRhiTexture;
class TreelandCaptureContext;
class Player : public QQuickItem
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(TreelandCaptureContext* captureContext READ captureContext WRITE setCaptureContext NOTIFY captureContextChanged FINAL)
public:
Player();
TreelandCaptureContext *captureContext() const;
void setCaptureContext(TreelandCaptureContext *context);
Q_SIGNALS:
void captureContextChanged();
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
private:
void updateTexture();
void updateGeometry();
void ensureDebugLogger();
QSGPlainTexture m_texture;
QRhiTexture *m_rhiTexture{ nullptr };
QPointer<TreelandCaptureContext> m_captureContext{};
bool m_loggerInitialized{ false };
};

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "subwindow.h"
SubWindow::SubWindow() { }
QQuickWindow *SubWindow::parent() const
{
return qobject_cast<QQuickWindow *>(QWindow::parent());
}
void SubWindow::setParent(QQuickWindow *w)
{
QWindow::setParent(w);
Q_EMIT parentChanged();
}

View File

@ -0,0 +1,21 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include <QObject>
#include <QQmlEngine>
#include <QQuickWindow>
class SubWindow : public QQuickWindow
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(QQuickWindow *parent READ parent WRITE setParent NOTIFY parentChanged FINAL)
Q_SIGNALS:
void parentChanged();
public:
SubWindow();
QQuickWindow *parent() const;
void setParent(QQuickWindow *w);
};

View File

@ -0,0 +1,28 @@
set(BIN_NAME test_data_control_manager)
find_package(Qt6 REQUIRED COMPONENTS Core Gui WaylandClient)
find_package(PkgConfig REQUIRED)
pkg_check_modules(WLR_PROTOCOLS REQUIRED IMPORTED_TARGET wlr-protocols)
pkg_get_variable(WLR_PROTOCOLS_DATADIR wlr-protocols pkgdatadir)
qt_add_executable(${BIN_NAME}
main.cpp
clipboard.h
clipboard.cpp
datacontrolmanagerv1.h
datacontrolmanagerv1.cpp
)
qt6_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${WLR_PROTOCOLS_DATADIR}/unstable/wlr-data-control-unstable-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Core
Qt6::Gui
Qt6::WaylandClient
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,79 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "clipboard.h"
#include <QBuffer>
#include <QGuiApplication>
Clipboard::Clipboard(QObject *parent)
: QObject{ parent }
{
m_manager.reset(new DataControlDeviceV1ManagerV1);
QObject::connect(m_manager.get(), &DataControlDeviceV1ManagerV1::activeChanged, this, [this]() {
if (m_manager->isActive()) {
auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
if (!waylandApp) {
return;
}
auto seat = waylandApp->seat();
if (!seat)
qFatal("Failed to get wl_seat frome QtWayland QPA!");
m_device.reset(new DataControlDeviceV1(m_manager->get_data_device(seat)));
connect(m_device.get(), &DataControlDeviceV1::receivedSelectionChanged, this, [this]() {
if (!m_device->selection()) {
Q_EMIT changed(QClipboard::Clipboard);
if (m_device->m_receivedSelection) {
DataControlOfferV1 *offer = m_device->m_receivedSelection.get();
for (auto type : offer->formats()) {
QVariant data = offer->retrieveData(type);
qWarning() << "----------"
"receivedSelectionChanged---"
<< "type:=" << type << "data:= " << data;
}
}
}
});
connect(m_device.get(), &DataControlDeviceV1::selectionChanged, this, [this]() {
Q_EMIT changed(QClipboard::Clipboard);
});
connect(m_device.get(),
&DataControlDeviceV1::receivedPrimarySelectionChanged,
this,
[this]() {
if (!m_device->primarySelection()) {
Q_EMIT changed(QClipboard::Selection);
if (m_device->m_receivedPrimarySelection) {
DataControlOfferV1 *offer =
m_device->m_receivedPrimarySelection.get();
for (auto type : offer->formats()) {
QVariant data = offer->retrieveData(type);
qWarning() << "----------"
"receivedPrimarySelectionChanged"
<< "type:=" << type << "data:= " << data;
}
}
}
});
connect(m_device.get(), &DataControlDeviceV1::primarySelectionChanged, this, [this]() {
Q_EMIT changed(QClipboard::Selection);
});
} else {
m_device.reset();
}
});
m_manager->instantiate();
}
bool Clipboard::isValid()
{
return m_manager && m_manager->isInitialized();
}

View File

@ -0,0 +1,25 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include "datacontrolmanagerv1.h"
#include <QClipboard>
#include <QObject>
class Clipboard : public QObject
{
Q_OBJECT
public:
explicit Clipboard(QObject *parent = nullptr);
~Clipboard() = default;
bool isValid();
Q_SIGNALS:
void changed(QClipboard::Mode mode);
private:
std::unique_ptr<DataControlDeviceV1ManagerV1> m_manager;
std::unique_ptr<DataControlDeviceV1> m_device;
};

View File

@ -0,0 +1,384 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "datacontrolmanagerv1.h"
#include <QBuffer>
#include <QFile>
#include <QGuiApplication>
#include <QImageReader>
#include <QImageWriter>
#include <errno.h>
#include <poll.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#define ZWLRDATACONTROLMANAGERV1VERSION 2
static const QString QtXImageLiteral QStringLiteral("application/x-qt-image");
static const QString utf8Text QStringLiteral("text/plain;charset=utf-8");
static const QString textPlain QStringLiteral("text/plain");
static QStringList imageMimeFormats(const QList<QByteArray> &imageFormats)
{
QStringList formats;
formats.reserve(imageFormats.size());
for (const auto &format : imageFormats)
formats.append(QLatin1String("image/") + QLatin1String(format.toLower()));
int pngIndex = formats.indexOf(QLatin1String("image/png"));
if (pngIndex != -1 && pngIndex != 0)
formats.move(pngIndex, 0);
return formats;
}
static inline QStringList imageReadMimeFormats()
{
return imageMimeFormats(QImageReader::supportedImageFormats());
}
static inline QStringList imageWriteMimeFormats()
{
return imageMimeFormats(QImageWriter::supportedImageFormats());
}
DataControlDeviceV1ManagerV1::DataControlDeviceV1ManagerV1()
: QWaylandClientExtensionTemplate<DataControlDeviceV1ManagerV1>(ZWLRDATACONTROLMANAGERV1VERSION)
{
}
DataControlDeviceV1ManagerV1::~DataControlDeviceV1ManagerV1()
{
if (isInitialized()) {
destroy();
}
}
void DataControlDeviceV1ManagerV1::instantiate()
{
initialize();
}
DataControlOfferV1::DataControlOfferV1(struct ::zwlr_data_control_offer_v1 *id)
: QtWayland::zwlr_data_control_offer_v1(id)
{
}
DataControlOfferV1::~DataControlOfferV1()
{
destroy();
}
QStringList DataControlOfferV1::formats() const
{
return m_receivedFormats;
}
bool DataControlOfferV1::containsImageData() const
{
if (m_receivedFormats.contains(QtXImageLiteral)) {
return true;
}
const auto formats = imageReadMimeFormats();
for (const auto &receivedFormat : m_receivedFormats) {
if (formats.contains(receivedFormat)) {
return true;
}
}
return false;
}
bool DataControlOfferV1::hasFormat(const QString &mimeType) const
{
if (mimeType == textPlain && m_receivedFormats.contains(utf8Text)) {
return true;
}
if (m_receivedFormats.contains(mimeType)) {
return true;
}
if (containsImageData()) {
const QStringList imageFormats = imageWriteMimeFormats();
for (const QString &imageFormat : imageFormats) {
if (imageFormat == mimeType) {
return true;
}
}
if (mimeType == QtXImageLiteral) {
return true;
}
}
return false;
}
void DataControlOfferV1::zwlr_data_control_offer_v1_offer(const QString &mime_type)
{
m_receivedFormats << mime_type;
QVariant data = retrieveData(mime_type);
qWarning() << "------------------- offer changed---"
<< "type:=" << mime_type << "data:= " << data;
}
QVariant DataControlOfferV1::retrieveData(const QString &mimeType) const
{
QString mime;
if (!m_receivedFormats.contains(mimeType)) {
if (mimeType == textPlain && m_receivedFormats.contains(utf8Text)) {
mime = utf8Text;
} else if (mimeType == QtXImageLiteral) {
const auto writeFormats = imageWriteMimeFormats();
for (const auto &receivedFormat : m_receivedFormats) {
if (writeFormats.contains(receivedFormat)) {
mime = receivedFormat;
break;
}
}
if (mime.isEmpty()) {
mime = QStringLiteral("image/png");
}
}
if (mime.isEmpty()) {
return QVariant();
}
} else {
mime = mimeType;
}
int pipeFds[2];
if (pipe(pipeFds) != 0) {
return QVariant();
}
auto t = const_cast<DataControlOfferV1 *>(this);
t->receive(mime, pipeFds[1]);
close(pipeFds[1]);
auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
auto display = waylandApp->display();
wl_display_flush(display);
QFile readPipe;
if (readPipe.open(pipeFds[0], QIODevice::ReadOnly)) {
QByteArray data;
if (readData(pipeFds[0], data)) {
close(pipeFds[0]);
if (mimeType == QtXImageLiteral) {
QImage img = QImage::fromData(
data,
mime.mid(mime.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper().data());
if (!img.isNull()) {
return img;
}
}
return data;
}
close(pipeFds[0]);
}
return QVariant();
}
bool DataControlOfferV1::readData(int fd, QByteArray &data)
{
pollfd pfds[1];
pfds[0].fd = fd;
pfds[0].events = POLLIN;
while (true) {
const int ready = poll(pfds, 1, 1000);
if (ready < 0) {
if (errno != EINTR) {
qWarning("DataControlOfferV1: poll() failed: %s", strerror(errno));
return false;
}
} else if (ready == 0) {
qWarning("DataControlOfferV1: timeout reading from pipe");
return false;
} else {
char buf[4096];
int n = read(fd, buf, sizeof buf);
if (n < 0) {
qWarning("DataControlOfferV1: read() failed: %s", strerror(errno));
return false;
} else if (n == 0) {
return true;
} else if (n > 0) {
data.append(buf, n);
}
}
}
}
DataControlSourceV1::DataControlSourceV1(struct ::zwlr_data_control_source_v1 *id,
QMimeData *mimeData)
: QtWayland::zwlr_data_control_source_v1(id)
, m_mimeData(mimeData)
{
const auto formats = mimeData->formats();
for (const QString &format : formats) {
offer(format);
}
if (mimeData->hasText()) {
offer(utf8Text);
}
if (mimeData->hasImage()) {
const QStringList imageFormats = imageWriteMimeFormats();
for (const QString &imageFormat : imageFormats) {
if (!formats.contains(imageFormat)) {
offer(imageFormat);
}
}
}
}
DataControlSourceV1::~DataControlSourceV1()
{
destroy();
}
QMimeData *DataControlSourceV1::mimeData()
{
return m_mimeData.get();
}
std::unique_ptr<QMimeData> DataControlSourceV1::releaseMimeData()
{
return std::move(m_mimeData);
}
void DataControlSourceV1::zwlr_data_control_source_v1_send(const QString &mime_type, int32_t fd)
{
QString send_mime_type = mime_type;
if (send_mime_type == utf8Text) {
send_mime_type = textPlain;
}
QByteArray ba;
if (m_mimeData->hasImage()) {
if (mime_type == QtXImageLiteral) {
QImage image = qvariant_cast<QImage>(m_mimeData->imageData());
QBuffer buf(&ba);
buf.open(QBuffer::WriteOnly);
image.save(&buf, "PNG");
} else if (mime_type.startsWith(QLatin1String("image/"))) {
QImage image = qvariant_cast<QImage>(m_mimeData->imageData());
QBuffer buf(&ba);
buf.open(QBuffer::WriteOnly);
image.save(
&buf,
mime_type.mid(mime_type.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper().data());
}
} else {
ba = m_mimeData->data(send_mime_type);
}
struct sigaction action, oldAction;
action.sa_handler = SIG_IGN;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGPIPE, &action, &oldAction);
write(fd, ba.constData(), ba.size());
sigaction(SIGPIPE, &oldAction, nullptr);
close(fd);
}
void DataControlSourceV1::zwlr_data_control_source_v1_cancelled()
{
qWarning() << "-------------------cancelled";
Q_EMIT cancelled();
}
DataControlDeviceV1::DataControlDeviceV1(struct ::zwlr_data_control_device_v1 *id)
: QtWayland::zwlr_data_control_device_v1(id)
{
}
DataControlDeviceV1::~DataControlDeviceV1()
{
destroy();
}
void DataControlDeviceV1::setSelection(std::unique_ptr<DataControlSourceV1> selection)
{
m_selection = std::move(selection);
connect(m_selection.get(), &DataControlSourceV1::cancelled, this, [this]() {
m_selection.reset();
});
set_selection(m_selection->object());
Q_EMIT selectionChanged();
}
QMimeData *DataControlDeviceV1::receivedSelection()
{
return m_receivedSelection.get();
}
QMimeData *DataControlDeviceV1::selection()
{
return m_selection ? m_selection->mimeData() : nullptr;
}
void DataControlDeviceV1::setPrimarySelection(std::unique_ptr<DataControlSourceV1> selection)
{
m_primarySelection = std::move(selection);
connect(m_primarySelection.get(), &DataControlSourceV1::cancelled, this, [this]() {
m_primarySelection.reset();
});
if (zwlr_data_control_device_v1_get_version(object())
>= ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION) {
set_primary_selection(m_primarySelection->object());
Q_EMIT primarySelectionChanged();
}
}
QMimeData *DataControlDeviceV1::receivedPrimarySelection()
{
return m_receivedPrimarySelection.get();
}
QMimeData *DataControlDeviceV1::primarySelection()
{
return m_primarySelection ? m_primarySelection->mimeData() : nullptr;
}
void DataControlDeviceV1::zwlr_data_control_device_v1_data_offer(zwlr_data_control_offer_v1 *id)
{
new DataControlOfferV1(id);
}
void DataControlDeviceV1::zwlr_data_control_device_v1_selection(zwlr_data_control_offer_v1 *id)
{
if (!id) {
m_receivedSelection.reset();
} else {
auto derivated = QtWayland::zwlr_data_control_offer_v1::fromObject(id);
auto offer = dynamic_cast<DataControlOfferV1 *>(derivated);
m_receivedSelection.reset(offer);
}
Q_EMIT receivedSelectionChanged();
}
void DataControlDeviceV1::zwlr_data_control_device_v1_primary_selection(
zwlr_data_control_offer_v1 *id)
{
if (!id) {
m_receivedPrimarySelection.reset();
} else {
auto derivated = QtWayland::zwlr_data_control_offer_v1::fromObject(id);
auto offer = dynamic_cast<DataControlOfferV1 *>(derivated);
m_receivedPrimarySelection.reset(offer);
}
Q_EMIT receivedPrimarySelectionChanged();
}

View File

@ -0,0 +1,111 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include "qwayland-wlr-data-control-unstable-v1.h"
#include <QMimeData>
#include <QObject>
#include <QWaylandClientExtension>
class Clipboard;
class DataControlDeviceV1ManagerV1
: public QWaylandClientExtensionTemplate<DataControlDeviceV1ManagerV1>
, public QtWayland::zwlr_data_control_manager_v1
{
Q_OBJECT
public:
DataControlDeviceV1ManagerV1();
~DataControlDeviceV1ManagerV1();
void instantiate();
};
class DataControlOfferV1
: public QMimeData
, public QtWayland::zwlr_data_control_offer_v1
{
Q_OBJECT
public:
DataControlOfferV1(struct ::zwlr_data_control_offer_v1 *id);
~DataControlOfferV1();
QStringList formats() const override;
bool containsImageData() const;
bool hasFormat(const QString &mimeType) const override;
QVariant retrieveData(const QString &mimeType) const;
protected:
void zwlr_data_control_offer_v1_offer(const QString &mime_type) override;
private:
static bool readData(int fd, QByteArray &data);
QStringList m_receivedFormats;
friend class DataControlDeviceV1;
};
class DataControlSourceV1
: public QObject
, public QtWayland::zwlr_data_control_source_v1
{
Q_OBJECT
public:
DataControlSourceV1(struct ::zwlr_data_control_source_v1 *id, QMimeData *mimeData);
DataControlSourceV1() = default;
~DataControlSourceV1();
QMimeData *mimeData();
std::unique_ptr<QMimeData> releaseMimeData();
Q_SIGNALS:
void cancelled();
protected:
void zwlr_data_control_source_v1_send(const QString &mime_type, int32_t fd) override;
void zwlr_data_control_source_v1_cancelled() override;
private:
std::unique_ptr<QMimeData> m_mimeData;
};
class DataControlDeviceV1
: public QObject
, public QtWayland::zwlr_data_control_device_v1
{
Q_OBJECT
public:
DataControlDeviceV1(struct ::zwlr_data_control_device_v1 *id);
~DataControlDeviceV1();
void setSelection(std::unique_ptr<DataControlSourceV1> selection);
QMimeData *receivedSelection();
QMimeData *selection();
void setPrimarySelection(std::unique_ptr<DataControlSourceV1> selection);
QMimeData *receivedPrimarySelection();
QMimeData *primarySelection();
Q_SIGNALS:
void receivedSelectionChanged();
void selectionChanged();
void receivedPrimarySelectionChanged();
void primarySelectionChanged();
protected:
void zwlr_data_control_device_v1_data_offer(struct ::zwlr_data_control_offer_v1 *id) override;
void zwlr_data_control_device_v1_selection(struct ::zwlr_data_control_offer_v1 *id) override;
void zwlr_data_control_device_v1_primary_selection(
struct ::zwlr_data_control_offer_v1 *id) override;
private:
std::unique_ptr<DataControlSourceV1> m_selection;
std::unique_ptr<DataControlOfferV1> m_receivedSelection;
std::unique_ptr<DataControlSourceV1> m_primarySelection;
std::unique_ptr<DataControlOfferV1> m_receivedPrimarySelection;
friend class Clipboard;
};

View File

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "clipboard.h"
#include <QGuiApplication>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
Clipboard board;
return app.exec();
}

View File

@ -0,0 +1,14 @@
find_package(Qt6 REQUIRED COMPONENTS Widgets)
set(BIN_NAME test-hide-window)
qt_add_executable(${BIN_NAME}
main.cpp
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Widgets
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,46 @@
// Copyright (C) 2024 groveer <guoyao@uniontech.com>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QTimer>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr)
: QMainWindow(parent)
{
QPushButton *button = new QPushButton("hide", this);
setCentralWidget(button);
connect(button, &QPushButton::clicked, this, &MainWindow::hideWindow);
}
private Q_SLOTS:
void hideWindow()
{
this->hide();
QTimer::singleShot(3000, this, &MainWindow::showWindow);
}
void showWindow()
{
this->show();
}
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MainWindow window;
window.show();
return app.exec();
}
#include "main.moc"

View File

@ -0,0 +1,23 @@
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Widgets)
find_package(TreelandProtocols REQUIRED)
set(BIN_NAME test-monitor-active_event)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-dde-shell-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::Widgets
Qt6::WaylandClient
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,108 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwayland-treeland-dde-shell-v1.h"
#include <QGuiApplication>
#include <QObject>
#include <QWaylandClientExtension>
#define TREELANDDDESHELLMANAGERV1VERSION 1
class TreelandDDEShellManageV1
: public QWaylandClientExtensionTemplate<TreelandDDEShellManageV1>
, public QtWayland::treeland_dde_shell_manager_v1
{
Q_OBJECT
public:
TreelandDDEShellManageV1();
~TreelandDDEShellManageV1() = default;
void instantiate();
};
class TreelandDDEActiveV1
: public QObject
, public QtWayland::treeland_dde_active_v1
{
Q_OBJECT
public:
TreelandDDEActiveV1(struct ::treeland_dde_active_v1 *id);
~TreelandDDEActiveV1();
protected:
void treeland_dde_active_v1_active_in(uint32_t reason) override;
void treeland_dde_active_v1_active_out(uint32_t reason) override;
void treeland_dde_active_v1_start_drag() override;
void treeland_dde_active_v1_drop() override;
};
TreelandDDEShellManageV1::TreelandDDEShellManageV1()
: QWaylandClientExtensionTemplate<TreelandDDEShellManageV1>(TREELANDDDESHELLMANAGERV1VERSION)
, QtWayland::treeland_dde_shell_manager_v1()
{
}
void TreelandDDEShellManageV1::instantiate()
{
initialize();
}
TreelandDDEActiveV1::TreelandDDEActiveV1(struct ::treeland_dde_active_v1 *id)
: QtWayland::treeland_dde_active_v1(id)
{
}
TreelandDDEActiveV1::~TreelandDDEActiveV1()
{
destroyed();
}
void TreelandDDEActiveV1::treeland_dde_active_v1_active_in(uint32_t reason)
{
qWarning() << "recvie button activeIn, reson:" << reason;
}
void TreelandDDEActiveV1::treeland_dde_active_v1_active_out(uint32_t reason)
{
qWarning() << "recvie button activeOut, reson:" << reason;
}
void TreelandDDEActiveV1::treeland_dde_active_v1_start_drag()
{
qWarning() << "------------start_drag";
}
void TreelandDDEActiveV1::treeland_dde_active_v1_drop()
{
qWarning() << "------------drop";
}
int main(int argc, char *argv[])
{
qputenv("QT_QPA_PLATFORM", "wayland");
QGuiApplication app(argc, argv);
TreelandDDEShellManageV1 *manager = new TreelandDDEShellManageV1;
QObject::connect(manager, &TreelandDDEShellManageV1::activeChanged, [manager] {
if (manager->isActive()) {
auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
if (!waylandApp) {
return;
}
auto seat = waylandApp->seat();
if (!seat)
qFatal("Failed to get wl_seat from QtWayland QPA!");
[[maybe_unused]] TreelandDDEActiveV1 *active =
new TreelandDDEActiveV1(manager->get_treeland_dde_active(seat));
}
});
manager->instantiate();
return app.exec();
}
#include "main.moc"

View File

@ -0,0 +1,35 @@
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Quick)
find_package(Qt6 COMPONENTS WaylandClientPrivate QUIET)
find_package(TreelandProtocols REQUIRED)
set(BIN_NAME test-multitaskview)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_add_qml_module(${BIN_NAME}
URI test.multitaskview
VERSION 1.0
QML_FILES
Main.qml
SOURCES
ddeshell.h
ddeshell.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-dde-shell-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Quick
Qt6::WaylandClient
Qt6::WaylandClientPrivate
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,43 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import test.multitaskview
Window {
width: 400
height: 200
visible: true
title: qsTr("test-multitaskview")
Multitaskview {
id: multitaskview
}
Timer {
id: timer
interval: 5000
onTriggered: {
multitaskview.toggle()
}
}
ColumnLayout {
anchors.fill: parent
Button {
text: "Show multitaskview with hide timer(5s)"
visible: multitaskview.ready
onClicked: {
multitaskview.toggle()
timer.restart()
}
Layout.alignment: Qt.AlignCenter
}
Button {
text: "Show multitaskview"
visible: multitaskview.ready
onClicked: {
multitaskview.toggle()
}
Layout.alignment: Qt.AlignCenter
}
}
}

View File

@ -0,0 +1,34 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "ddeshell.h"
void Multitaskview::toggle()
{
QtWayland::treeland_multitaskview_v1::toggle();
}
Multitaskview::Multitaskview()
: QWaylandClientExtensionTemplate<Multitaskview>(1)
, QtWayland::treeland_multitaskview_v1()
, m_manager(new DDEShell)
{
connect(
m_manager,
&DDEShell::activeChanged,
this,
[this]() {
if (m_manager->isActive()) {
auto object = m_manager->get_treeland_multitaskview();
Q_ASSERT(object);
init(object);
Q_EMIT readyChanged();
}
},
Qt::QueuedConnection);
}
Multitaskview::~Multitaskview()
{
m_manager->deleteLater();
}

View File

@ -0,0 +1,48 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include "qwayland-treeland-dde-shell-v1.h"
#include <qwaylandclientextension.h>
#include <qqmlintegration.h>
#include <qtmetamacros.h>
class DDEShell
: public QWaylandClientExtensionTemplate<DDEShell>
, public QtWayland::treeland_dde_shell_manager_v1
{
Q_OBJECT
public:
explicit DDEShell()
: QWaylandClientExtensionTemplate<DDEShell>(1)
{
}
};
class Multitaskview
: public QWaylandClientExtensionTemplate<Multitaskview>
, public QtWayland::treeland_multitaskview_v1
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(bool ready READ ready NOTIFY readyChanged FINAL)
bool ready()
{
return object() != nullptr;
}
Q_SIGNALS:
void readyChanged();
public:
explicit Multitaskview();
~Multitaskview();
Q_INVOKABLE void toggle();
private:
DDEShell *m_manager;
};

View File

@ -0,0 +1,22 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() {
QCoreApplication::exit(-1);
},
Qt::QueuedConnection);
engine.loadFromModule("test.multitaskview", "Main");
return app.exec();
}

View File

@ -0,0 +1,23 @@
set(BIN_NAME test-pinch-handler)
find_package(Qt6 REQUIRED COMPONENTS Quick)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_add_qml_module(${BIN_NAME}
URI pinchhandler
VERSION 1.0
QML_FILES Main.qml
SOURCES eventitem.cpp
)
target_link_libraries(${BIN_NAME}
PRIVATE Qt6::Quick
)
install(TARGETS ${BIN_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@ -0,0 +1,68 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import pinchhandler
Window {
width: 1000
height: 800
visible: true
title: handler.persistentRotation.toFixed(1) + "° " +
handler.persistentTranslation.x.toFixed(1) + ", " +
handler.persistentTranslation.y.toFixed(1) + " " +
(handler.persistentScale * 100).toFixed(1) + "%"
Flickable {
id: flickable
anchors.fill: parent
contentWidth: map.width * handler.persistentScale
contentHeight: map.height * handler.persistentScale
clip: true
Rectangle {
id: map
color: "aqua"
width: 1000
height: 1000
border.width: 1
border.color: "black"
gradient: Gradient {
GradientStop { position: 0.0; color: "blue" }
GradientStop { position: 1.0; color: "green" }
}
Text {
text: qsTr("This is a PinchHandler Demo!")
color: "white"
anchors.centerIn: parent
}
}
}
PinchHandler {
id: handler
target: map
onScaleChanged: {
flickable.contentWidth = map.width * handler.persistentScale
flickable.contentHeight = map.height * handler.persistentScale
}
onTranslationChanged: {
flickable.contentX = handler.persistentTranslation.x
flickable.contentY = handler.persistentTranslation.y
}
onActiveChanged: {
if (!active) {
flickable.returnToBounds()
}
}
}
EventItem {
id: eventItem
anchors.fill: parent
}
}

View File

@ -0,0 +1,68 @@
// Copyright (C) 2024 groveer <guoyao@uniontech.com>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "eventitem.h"
EventItem::EventItem(QQuickItem *parent)
: QQuickItem(parent)
{
setAcceptHoverEvents(true);
setAcceptTouchEvents(true);
setAcceptedMouseButtons(Qt::AllButtons);
setFlag(QQuickItem::ItemClipsChildrenToShape, true);
}
bool EventItem::event(QEvent *event)
{
qWarning() << "EventItem::event: " << event->type();
switch (event->type()) {
using enum QEvent::Type;
// Don't insert events before MouseButtonPress
case MouseButtonPress:
Q_FALLTHROUGH();
case MouseButtonRelease:
Q_FALLTHROUGH();
case MouseMove:
Q_FALLTHROUGH();
case HoverMove:
if (static_cast<QMouseEvent *>(event)->source() != Qt::MouseEventNotSynthesized)
return true; // The non-native events don't send to WSeat
Q_FALLTHROUGH();
case HoverEnter:
Q_FALLTHROUGH();
case HoverLeave:
Q_FALLTHROUGH();
case KeyPress:
Q_FALLTHROUGH();
case KeyRelease:
Q_FALLTHROUGH();
case Wheel:
Q_FALLTHROUGH();
case TouchBegin:
Q_FALLTHROUGH();
case TouchUpdate:
Q_FALLTHROUGH();
case TouchEnd:
Q_FALLTHROUGH();
case TouchCancel: {
auto e = static_cast<QInputEvent *>(event);
Q_ASSERT(e);
// We may receive HoverLeave when WSurfaceItem was destroying
break;
}
case NativeGesture: {
auto e = static_cast<QNativeGestureEvent *>(event);
Q_ASSERT(e);
// We may receive HoverLeave when WSurfaceItem was destroying
qWarning() << "received app type: " << e->gestureType() << " delta: " << e->delta()
<< "value:" << e->value();
break;
}
// No need to process focusOut, see [PR
// 282](https://github.com/vioken/waylib/pull/282)
default:
break;
}
return QQuickItem::event(event);
}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2024 groveer <guoyao@uniontech.com>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QQuickItem>
class Q_DECL_HIDDEN EventItem : public QQuickItem
{
Q_OBJECT
QML_NAMED_ELEMENT(EventItem)
public:
explicit EventItem(QQuickItem *parent = nullptr);
inline bool isValid() const
{
return parent();
}
private:
bool event(QEvent *event) override;
};

View File

@ -0,0 +1,31 @@
// Copyright (C) 2023 rewine <luhongxu@deepin.org>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
qputenv("QT_QPA_PLATFORM", "wayland");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
using namespace Qt::StringLiterals;
const QUrl url(u"qrc:/qt/qml/pinchhandler/Main.qml"_s);
#else
const QUrl url(u"qrc:/pinchhandler/Main.qml"_qs);
#endif
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() {
QCoreApplication::exit(-1);
},
Qt::QueuedConnection);
engine.load(url);
return app.exec();
}

View File

@ -0,0 +1,22 @@
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Widgets)
find_package(TreelandProtocols REQUIRED)
set(BIN_NAME test-primary-output)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}treeland-output-manager-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::Widgets
Qt6::WaylandClient
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,48 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwayland-treeland-output-manager-v1.h"
#include <QApplication>
#include <QObject>
#include <QWaylandClientExtension>
class PrimaryOutputV1
: public QWaylandClientExtensionTemplate<PrimaryOutputV1>
, public QtWayland::treeland_output_manager_v1
{
Q_OBJECT
public:
explicit PrimaryOutputV1();
void treeland_output_manager_v1_primary_output(const QString &output_name)
{
qInfo() << "-------Primary Output ----- " << output_name;
}
};
PrimaryOutputV1::PrimaryOutputV1()
: QWaylandClientExtensionTemplate<PrimaryOutputV1>(1)
{
}
// 设置主屏: ./test-primary-output HDMI-0
int main(int argc, char *argv[])
{
qputenv("QT_QPA_PLATFORM", "wayland");
QApplication app(argc, argv);
PrimaryOutputV1 manager;
QObject::connect(&manager, &PrimaryOutputV1::activeChanged, &manager, [&manager, argc, argv] {
if (manager.isActive()) {
if (argc == 2) {
const QString str(argv[1]);
manager.set_primary_output(str);
}
}
});
return app.exec();
}
#include "main.moc"

View File

@ -0,0 +1,52 @@
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Quick Core Gui)
find_package(Dtk6 REQUIRED COMPONENTS Declarative)
find_package(TreelandProtocols REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_get_variable(WAYLAND_PROTOCOLS wayland-protocols pkgdatadir)
# Include translation utilities
include(${CMAKE_SOURCE_DIR}/cmake/TranslationUtils.cmake)
set(BIN_NAME test-set-treeland-wallpaper)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-personalization-manager-v1.xml
)
set(QML_FILES
main.qml
Wallpaper.qml
WallpaperCard.qml
WallpaperSetting.qml
PropertyItemDelegate.qml
)
qt_add_qml_module(${BIN_NAME}
URI Wallpaper
VERSION "1.0"
SOURCES
personalizationmangerclient.cpp
personalizationmangerclient.h
wallpapercardmodel.cpp
wallpapercardmodel.h
QML_FILES ${QML_FILES}
SOURCES imagehelper.h imagehelper.cpp
)
# Use translation utilities to setup translations
setup_translations(${BIN_NAME} wallpaper)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::WaylandClient
Dtk6::Declarative
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -80,7 +80,8 @@ Item {
Component.onCompleted: {
img2x2.grabToImage(function(result) {
isDarktype = ImageHelper.isDarkType(result.image);
});
console.log("---isDarktype: ", isDarktype);
}, Qt.size(2, 2));
}
}
Image {

View File

@ -0,0 +1,25 @@
// Copyright (C) 2024 rewine <luhongxu@deepin.org>.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "imagehelper.h"
#include <QQmlInfo>
ImageHelper::ImageHelper(QObject *parent)
: QObject{ parent }
{
}
bool ImageHelper::isDarkType(const QImage &img)
{
int r = 0, g = 0, b = 0;
for (int i = 0; i < img.width(); i++)
for (int j = 0; j < img.height(); j++) {
r += qRed(img.pixel(i, j));
g += qGreen(img.pixel(i, j));
b += qBlue(img.pixel(i, j));
}
auto size = img.width() * img.height();
float luminance = 0.299 * r / size + 0.587 * g / size + 0.114 * b / size;
return qRound(luminance) <= 170;
}

View File

@ -10,7 +10,7 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine;
engine.addImportPath(":/qt/qml");
engine.load(QUrl(u"qrc:/qt/qml/Wallpaper/main.qml"_qs));
engine.load(QUrl(QStringLiteral(u"qrc:/qt/qml/Wallpaper/main.qml")));
return app.exec();
}

View File

@ -22,10 +22,7 @@
PersonalizationV1::PersonalizationV1()
: QWaylandClientExtensionTemplate<PersonalizationV1>(1)
{
connect(this,
&PersonalizationV1::activeChanged,
this,
&PersonalizationV1::onActiveChanged);
connect(this, &PersonalizationV1::activeChanged, this, &PersonalizationV1::onActiveChanged);
m_cacheDirectory =
QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/wallpaper/";
@ -107,11 +104,11 @@ void PersonalizationV1::removeWallpaper(const QString &path, const QString &grou
}
void PersonalizationV1::changeWallpaper(const QString &path,
const QString &output,
const QString &group,
int index,
quint32 op,
bool isdark)
const QString &output,
const QString &group,
int index,
quint32 op,
bool isdark)
{
if (!m_wallpaperContext)
return;
@ -145,9 +142,9 @@ void PersonalizationV1::changeWallpaper(const QString &path,
}
void PersonalizationV1::setBackground(const QString &path,
const QString &group,
int index,
bool isdark)
const QString &group,
int index,
bool isdark)
{
changeWallpaper(path,
m_currentOutput,
@ -158,9 +155,9 @@ void PersonalizationV1::setBackground(const QString &path,
}
void PersonalizationV1::setLockscreen(const QString &path,
const QString &group,
int index,
bool isdark)
const QString &group,
int index,
bool isdark)
{
changeWallpaper(path,
m_currentOutput,
@ -176,7 +173,7 @@ void PersonalizationV1::setBoth(const QString &path, const QString &group, int i
m_currentOutput,
group,
index,
PersonalizationWallpaper::options_lockscreen
PersonalizationWallpaper::options_background
| PersonalizationWallpaper::options_lockscreen);
}
@ -185,7 +182,7 @@ QString PersonalizationV1::currentGroup()
if (m_currentOutput.isEmpty())
return QString();
auto meta = m_screens[m_currentOutput];
const auto *meta = m_screens[m_currentOutput];
return meta->group;
}
@ -285,20 +282,21 @@ void PersonalizationV1::onMetadataChanged(const QString &metadata)
Q_EMIT wallpaperChanged(meta->imagePath);
}
PersonalizationWindow::PersonalizationWindow(struct ::personalization_window_context_v1 *object)
PersonalizationWindow::PersonalizationWindow(
struct ::treeland_personalization_window_context_v1 *object)
: QWaylandClientExtensionTemplate<PersonalizationWindow>(1)
, QtWayland::personalization_window_context_v1(object)
, QtWayland::treeland_personalization_window_context_v1(object)
{
}
PersonalizationWallpaper::PersonalizationWallpaper(
struct ::personalization_wallpaper_context_v1 *object)
struct ::treeland_personalization_wallpaper_context_v1 *object)
: QWaylandClientExtensionTemplate<PersonalizationWallpaper>(1)
, QtWayland::personalization_wallpaper_context_v1(object)
, QtWayland::treeland_personalization_wallpaper_context_v1(object)
{
}
void PersonalizationWallpaper::personalization_wallpaper_context_v1_metadata(
void PersonalizationWallpaper::treeland_personalization_wallpaper_context_v1_metadata(
const QString &metadata)
{
Q_EMIT metadataChanged(metadata);

View File

@ -13,8 +13,9 @@
class PersonalizationWindow;
class PersonalizationWallpaper;
class PersonalizationV1 : public QWaylandClientExtensionTemplate<PersonalizationV1>,
public QtWayland::treeland_personalization_manager_v1
class PersonalizationV1
: public QWaylandClientExtensionTemplate<PersonalizationV1>
, public QtWayland::treeland_personalization_manager_v1
{
Q_OBJECT
Q_PROPERTY(QString output READ output WRITE setOutput NOTIFY outputChanged FINAL)
@ -46,12 +47,12 @@ public:
QString output();
void setOutput(const QString &name);
signals:
Q_SIGNALS:
void wallpaperChanged(const QString &path);
void currentGroupChanged(const QString &path);
void outputChanged(const QString &name);
public slots:
public Q_SLOTS:
void addWallpaper(const QString &path);
void setBackground(const QString &path, const QString &group, int index, bool isdark);
void setLockscreen(const QString &path, const QString &group, int index, bool isdark);
@ -63,7 +64,7 @@ public slots:
private:
QString converToJson(QMap<QString, WallpaperMetaData *> screens);
void onMetadataChanged(const QString &meta);
void onMetadataChanged(const QString &metadata);
void changeWallpaper(const QString &path,
const QString &output,
const QString &group,
@ -79,24 +80,27 @@ private:
QString m_currentOutput;
};
class PersonalizationWindow : public QWaylandClientExtensionTemplate<PersonalizationWindow>,
public QtWayland::personalization_window_context_v1
class PersonalizationWindow
: public QWaylandClientExtensionTemplate<PersonalizationWindow>
, public QtWayland::treeland_personalization_window_context_v1
{
Q_OBJECT
public:
explicit PersonalizationWindow(struct ::personalization_window_context_v1 *object);
explicit PersonalizationWindow(struct ::treeland_personalization_window_context_v1 *object);
};
class PersonalizationWallpaper : public QWaylandClientExtensionTemplate<PersonalizationWallpaper>,
public QtWayland::personalization_wallpaper_context_v1
class PersonalizationWallpaper
: public QWaylandClientExtensionTemplate<PersonalizationWallpaper>
, public QtWayland::treeland_personalization_wallpaper_context_v1
{
Q_OBJECT
public:
explicit PersonalizationWallpaper(struct ::personalization_wallpaper_context_v1 *object);
explicit PersonalizationWallpaper(
struct ::treeland_personalization_wallpaper_context_v1 *object);
signals:
Q_SIGNALS:
void metadataChanged(const QString &meta);
protected:
void personalization_wallpaper_context_v1_metadata(const QString &metadata) override;
void treeland_personalization_wallpaper_context_v1_metadata(const QString &metadata) override;
};

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ca">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Imatge local</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Mostra-ho tot</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Imatge del sistema</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Fons de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Fons actual</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Mètode de visualització del fons de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Estira</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Preserva&apos;n l&apos;aspecte</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Si us plau, trieu un fitxer</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Afegiu-hi un fons de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Afegiu-hi un directori</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Paràmetres del fons de pantalla</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="es">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Imagen local</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Mostrar todo</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Imagen del sistema</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Fondo de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Fondo de pantalla actual</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Modo de visualización de fondo de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Estirar</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Conservar aspecto</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Seleccione un archivo</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Agregar fondo de pantalla</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Agregar directorio</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Configuración del fondo de pantalla</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="fi">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Valokuva</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Näytä kaikki</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Valokuva</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Taustakuva</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Nykyinen taustakuva</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Taustakuvan näyttötapa</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Venytetty</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Säilytä kuvasuhde</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Valitse tiedosto</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Lisää taustakuva</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Lisää kansio</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Taustakuvan asetukset</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="fr">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Image locale</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Afficher tout</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Image système</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Fond d&apos;écran</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Fond d&apos;écran actuel</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Méthode d&apos;affichage du fond d&apos;écran</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Étirement</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Conserver l&apos;aspect</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Veuillez choisir un fichier</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Ajouter un fond d&apos;écran</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Ajouter un répertoire</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Paramètres du fond d&apos;écran</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ja">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation></translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation></translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation></translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="pl">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Zdjęcie lokalne</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Pokaż wszystkie</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Zdjęcie systemowe</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Tapeta</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Bieżąca tapeta</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Wyświetlanie tapety</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Rozciągnij</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Dopasuj</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Wybierz plik</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Dodaj tapetę</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Dodaj katalog</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Ustawienia tapety</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="pt_BR">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Imagem local</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Mostrar tudo</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Imagem do sistema</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Papel de parede</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Papel de parede atual</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Método de exibição de papel de parede</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Esticado</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Preservar o ajuste do aspecto</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Por favor escolha um arquivo</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Adicionar papel de parede</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Adicionar diretório</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Configurações de papel de parede</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ru">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Показать все</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Обои</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Текущие обои</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Метод отображения обоев</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Пожалуйста, выберите файл</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Добавить обои</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Добавить папку</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Настройки обоев</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="sq">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Foto Vendore</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Shfaqi Krejt</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Foto Sistemi</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Sfond</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Sfond i Tanishëm</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Metodë Shfaqjeje Sfondi</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Shformoje</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Ju lutemi, zgjidhni një kartelë</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Shtoni Sfond</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Shtoni Drejtori</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Rregullime Sfondi</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="uk">
<context>
<name>Wallpaper</name>
<message>
<location filename="../Wallpaper.qml" line="48"/>
<source>Local Picture</source>
<translation>Локальне зображення</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="49"/>
<location filename="../Wallpaper.qml" line="62"/>
<source>Show All</source>
<translation>Показати все</translation>
</message>
<message>
<location filename="../Wallpaper.qml" line="61"/>
<source>System Picture</source>
<translation>Загальносистемне зображення</translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
<message>
<location filename="../WallpaperSetting.qml" line="29"/>
<source>Wallpaper</source>
<translation>Фонове зображення</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="83"/>
<source>Current Wallpaepr</source>
<translation>Поточне фонове зображення</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="93"/>
<source>Wallpaper Display Method</source>
<translation>Спосіб показу фонового зображення</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="100"/>
<source>Stretch</source>
<translation>Розтягнути</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="101"/>
<source>Preserve Aspect Fit</source>
<translation>Зберегти співвідношення розмірів</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation>Будь ласка, виберіть файл</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
<source>Add Wallpaper</source>
<translation>Додати фонове зображення</translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation>Додати каталог</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.qml" line="14"/>
<source>Wallpaper Settings</source>
<translation>Параметри фонових зображень</translation>
</message>
</context>
</TS>

View File

@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="zh_CN">
<context>
<name>Wallpaper</name>
<message>
@ -19,10 +17,6 @@
<source>System Picture</source>
<translation></translation>
</message>
<message>
<source>Show All </source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>WallpaperSetting</name>
@ -54,7 +48,7 @@
<message>
<location filename="../WallpaperSetting.qml" line="111"/>
<source>Please choose a file</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../WallpaperSetting.qml" line="126"/>
@ -64,7 +58,7 @@
<message>
<location filename="../WallpaperSetting.qml" line="135"/>
<source>Add Directory</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
</context>
<context>
@ -75,4 +69,4 @@
<translation></translation>
</message>
</context>
</TS>
</TS>

View File

@ -68,9 +68,8 @@ int WallpaperCardModel::dataCount() const
return static_cast<int>(d->wallpapers.length());
}
int WallpaperCardModel::rowCount(const QModelIndex &parent) const
int WallpaperCardModel::rowCount([[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
if (!d->m_toggleShowAll && dataCount() > 10) {
return 10;
}

View File

@ -19,7 +19,10 @@ class WallpaperCardModel : public QAbstractListModel
Q_PROPERTY(int count READ dataCount NOTIFY dataCountChanged FINAL)
QML_ELEMENT
public:
enum WallpaperCardRoles { ImageSourceRole = Qt::UserRole + 1 };
enum WallpaperCardRoles
{
ImageSourceRole = Qt::UserRole + 1
};
Q_ENUM(WallpaperCardRoles)
WallpaperCardModel(const WallpaperCardModel &) = delete;
@ -36,7 +39,8 @@ public:
[[nodiscard]] bool showAll() const;
void setShowAll(bool enable);
[[nodiscard]] int dataCount() const;
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
[[nodiscard]] int rowCount(
[[maybe_unused]] const QModelIndex &parent = QModelIndex()) const override;
[[nodiscard]] QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole) const override;
Q_INVOKABLE void append(const QString &path);

View File

@ -0,0 +1,24 @@
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Widgets)
find_package(TreelandProtocols REQUIRED)
set(BIN_NAME test-show-desktop)
qt_add_executable(${BIN_NAME}
main.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-window-management-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::Widgets
Qt6::WaylandClient
Qt6::GuiPrivate
Qt6::WaylandClientPrivate
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -6,8 +6,9 @@
#include <QApplication>
#include <QtWaylandClient/QWaylandClientExtension>
class WindowManager : public QWaylandClientExtensionTemplate<WindowManager>,
public QtWayland::window_management_v1
class WindowManager
: public QWaylandClientExtensionTemplate<WindowManager>
, public QtWayland::treeland_window_management_v1
{
Q_OBJECT
public:
@ -24,11 +25,11 @@ WindowManager::WindowManager()
{
}
//显示桌面: ./test-show-desktop 1
// 显示桌面: ./test-show-desktop 1
//预览桌面: ./test-show-desktop 2
// 预览桌面: ./test-show-desktop 2
//恢复显示: ./test-show-desktop 0
// 恢复显示: ./test-show-desktop 0
int main(int argc, char *argv[])
{

View File

@ -0,0 +1,26 @@
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Widgets)
find_package(TreelandProtocols REQUIRED)
set(BIN_NAME test-super-overlay-surface)
qt_add_executable(${BIN_NAME}
main.cpp
ddeshellwayland.h ddeshellwayland.cpp
ddeshelsurfacewindow.h ddeshelsurfacewindow.cpp
)
qt_generate_wayland_protocol_client_sources(${BIN_NAME}
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-dde-shell-v1.xml
)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::Widgets
Qt6::WaylandClient
Qt6::WaylandClientPrivate
)
install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -0,0 +1,247 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "ddeshellwayland.h"
#include <private/qwaylandwindow_p.h>
#include <QHash>
#include <QPlatformSurfaceEvent>
#include <QWaylandClientExtension>
#define TREELANDDDESHELLMANAGERV1VERSION 1
class DDEShellManageV1
: public QWaylandClientExtensionTemplate<DDEShellManageV1>
, public QtWayland::treeland_dde_shell_manager_v1
{
public:
DDEShellManageV1()
: QWaylandClientExtensionTemplate<DDEShellManageV1>(TREELANDDDESHELLMANAGERV1VERSION)
{
initialize();
}
};
class DDEShellSurface : public QtWayland::treeland_dde_shell_surface_v1
{
public:
DDEShellSurface(struct ::treeland_dde_shell_surface_v1 *id)
: QtWayland::treeland_dde_shell_surface_v1(id)
{
}
~DDEShellSurface()
{
destroy();
}
};
class ShellIntegrationSingleton
{
public:
ShellIntegrationSingleton();
std::unique_ptr<DDEShellManageV1> shellManager;
QHash<QWindow *, DDEShellWayland *> windows;
};
ShellIntegrationSingleton::ShellIntegrationSingleton()
{
shellManager = std::make_unique<DDEShellManageV1>();
}
Q_GLOBAL_STATIC(ShellIntegrationSingleton, s_waylandIntegration)
DDEShellWayland *DDEShellWayland::get(QWindow *window)
{
DDEShellWayland *&it = s_waylandIntegration->windows[window];
if (!it) {
it = new DDEShellWayland(window);
}
return it;
}
DDEShellWayland::~DDEShellWayland()
{
s_waylandIntegration->windows.remove(m_window);
}
DDEShellWayland::DDEShellWayland(QWindow *window)
: QObject(window)
, m_window(window)
{
m_window->installEventFilter(this);
platformSurfaceCreated(window);
}
bool DDEShellWayland::eventFilter(QObject *watched, QEvent *event)
{
auto window = qobject_cast<QWindow *>(watched);
if (!window) {
return false;
}
if (event->type() == QEvent::PlatformSurface) {
auto surfaceEvent = static_cast<QPlatformSurfaceEvent *>(event);
if (surfaceEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
platformSurfaceCreated(window);
}
}
return false;
}
void DDEShellWayland::setPosition(const QPoint &position)
{
if (position == m_position) {
return;
}
m_position = position;
if (m_shellSurface) {
m_shellSurface->set_surface_position(m_position->x(), m_position->y());
}
}
void DDEShellWayland::setRole(QtWayland::treeland_dde_shell_surface_v1::role role)
{
if (role == m_role) {
return;
}
m_role = role;
if (m_shellSurface) {
m_shellSurface->set_role(role);
}
}
void DDEShellWayland::setAutoPlacement(int32_t yOffset)
{
if (yOffset == m_yOffset) {
return;
}
m_yOffset = yOffset;
if (m_shellSurface) {
m_shellSurface->set_auto_placement(yOffset);
}
}
void DDEShellWayland::setSkipSwitcher(uint32_t skip)
{
if (skip == m_skipSwitcher) {
return;
}
m_skipSwitcher = skip;
if (m_shellSurface) {
m_shellSurface->set_skip_switcher(skip);
}
}
void DDEShellWayland::setSkipDockPreview(uint32_t skip)
{
if (skip == m_skipDockPreview) {
return;
}
m_skipDockPreview = skip;
if (m_shellSurface) {
m_shellSurface->set_skip_dock_preview(skip);
}
}
void DDEShellWayland::setSkipMutiTaskView(uint32_t skip)
{
if (skip == m_skipMutiTaskView) {
return;
}
m_skipMutiTaskView = skip;
if (m_shellSurface) {
m_shellSurface->set_skip_muti_task_view(skip);
}
}
void DDEShellWayland::setAcceptKeyboardFocus(uint32_t accept)
{
if (accept == m_acceptKeyboardFocus) {
return;
}
m_acceptKeyboardFocus = accept;
if (m_shellSurface) {
m_shellSurface->set_accept_keyboard_focus(accept);
}
}
void DDEShellWayland::platformSurfaceCreated(QWindow *window)
{
auto waylandWindow = window->nativeInterface<QNativeInterface::Private::QWaylandWindow>();
if (!waylandWindow) {
return;
}
connect(waylandWindow,
&QNativeInterface::Private::QWaylandWindow::surfaceCreated,
this,
&DDEShellWayland::surfaceCreated);
connect(waylandWindow,
&QNativeInterface::Private::QWaylandWindow::surfaceDestroyed,
this,
&DDEShellWayland::surfaceDestroyed);
if (waylandWindow->surface()) {
surfaceCreated();
}
}
void DDEShellWayland::surfaceCreated()
{
struct wl_surface *surface = nullptr;
if (!s_waylandIntegration->shellManager || !s_waylandIntegration->shellManager->isActive()) {
return;
}
if (auto waylandWindow =
m_window->nativeInterface<QNativeInterface::Private::QWaylandWindow>()) {
surface = waylandWindow->surface();
}
if (!surface) {
return;
}
m_shellSurface = std::make_unique<DDEShellSurface>(
s_waylandIntegration->shellManager->get_shell_surface(surface));
if (m_shellSurface) {
if (m_role) {
m_shellSurface->set_role(m_role.value());
}
if (m_position) {
m_shellSurface->set_surface_position(m_position->x(), m_position->y());
}
if (m_yOffset) {
m_shellSurface->set_auto_placement(m_yOffset.value());
}
if (m_skipDockPreview) {
m_shellSurface->set_skip_dock_preview(m_skipDockPreview.value());
}
if (m_skipMutiTaskView) {
m_shellSurface->set_skip_muti_task_view(m_skipMutiTaskView.value());
}
if (m_skipSwitcher) {
m_shellSurface->set_skip_switcher(m_skipSwitcher.value());
}
if (!m_acceptKeyboardFocus) {
m_shellSurface->set_accept_keyboard_focus(m_acceptKeyboardFocus);
}
}
}
void DDEShellWayland::surfaceDestroyed()
{
m_shellSurface.reset();
}

View File

@ -0,0 +1,45 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#pragma once
#include "qwayland-treeland-dde-shell-v1.h"
#include <QObject>
#include <QWindow>
class DDEShellSurface;
class DDEShellWayland : public QObject
{
Q_OBJECT
public:
static DDEShellWayland *get(QWindow *window);
~DDEShellWayland();
void setPosition(const QPoint &position);
void setRole(QtWayland::treeland_dde_shell_surface_v1::role role);
void setAutoPlacement(int32_t yOffset);
void setSkipSwitcher(uint32_t skip);
void setSkipDockPreview(uint32_t skip);
void setSkipMutiTaskView(uint32_t skip);
void setAcceptKeyboardFocus(uint32_t accept);
bool eventFilter(QObject *watched, QEvent *event) override;
private:
DDEShellWayland(QWindow *window);
void platformSurfaceCreated(QWindow *window);
void surfaceCreated();
void surfaceDestroyed();
QWindow *m_window = nullptr;
std::optional<QPoint> m_position;
std::optional<QtWayland::treeland_dde_shell_surface_v1::role> m_role;
std::optional<int32_t> m_yOffset;
std::optional<bool> m_skipSwitcher;
std::optional<bool> m_skipDockPreview;
std::optional<bool> m_skipMutiTaskView;
bool m_acceptKeyboardFocus = true;
std::unique_ptr<DDEShellSurface> m_shellSurface;
};

View File

@ -0,0 +1,51 @@
// Copyright (C) 2024 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "ddeshelsurfacewindow.h"
#include "ddeshellwayland.h"
#include <QLineEdit>
DDEShelSurfaceWindow::DDEShelSurfaceWindow(TestMode mode, QWidget *parent)
: QWidget{ parent }
, m_mode(mode)
{
[[maybe_unused]] QLineEdit *l = new QLineEdit(this);
}
void DDEShelSurfaceWindow::showEvent([[maybe_unused]] QShowEvent *event)
{
if (isVisible()) {
apply();
}
}
void DDEShelSurfaceWindow::apply()
{
if (TestSetPosition == m_mode) {
// 1 ----Convenient for the client to set the position of the surface
DDEShellWayland::get(windowHandle())->setPosition(QPoint(100, 100));
// ----------------------------------------------------------------
}
if (TestSetAutoPlace == m_mode) {
// 2. Set the vertical alignment of the surface within the cursor width,
// y offset is 30 relative to the cursor bottom.-------------------
DDEShellWayland::get(windowHandle())->setAutoPlacement(30);
// Setting this bit will indicate that the window prefers not to be
// listed in a switcher/dock-preview/mutitask-view
DDEShellWayland::get(windowHandle())->setSkipDockPreview(true);
DDEShellWayland::get(windowHandle())->setSkipMutiTaskView(true);
DDEShellWayland::get(windowHandle())->setSkipSwitcher(true);
DDEShellWayland::get(windowHandle())->setAcceptKeyboardFocus(false);
// ---------------------------------------------------------------
}
// Do not use setPosition and setAutoPlacement at the same time, there will
// be conflicts !!!
DDEShellWayland::get(windowHandle())
->setRole(QtWayland::treeland_dde_shell_surface_v1::role_overlay);
}

Some files were not shown because too many files have changed in this diff Show More