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. 添加详细的日志记录用于调试复制操作
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.
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.
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;
* [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>
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.
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 置空。
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 被正确锁定和解锁,并且没有发生内存
泄漏。
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
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. 修改多个源文件以使用标准化日志分类
这些更改提供了统一的日志框架,改进了整个代码库的日志管理能力。集中化的系
统提高了可维护性,并确保不同组件之间日志格式的一致性。
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:
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
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
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
- 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.
- 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:
- 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.
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:
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。这提供了更好的错误提示信息,并在编译时提供了更强的类型安
全保证。
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 版本的兼容性
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,以反映最近的实现更
改,并确保组件间的协议版本一致性。
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. 清理未使用的代码可提高代码可维护性并减少技术债务
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]] 属性。
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. 解决其他次要的代码风格和结构问题
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:
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:
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
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.
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.
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编译时
出现构建失败的情况。
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. 这确保了在状态改变前正确激活窗口
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. 提升可访问性并防止焦点相关的界面故障
* 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 已被按下时发生,防止意外映射其他键。