-
Notifications
You must be signed in to change notification settings - Fork 34
fix: fix timing issue in Workspace::addSurface #671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed a timing issue in Workspace::addSurface where surface initialization could occur before the container was properly set up. The issue was caused by calling model->addSurface(surface) before setting up the container, which could lead to layout operations on uninitialized surfaces. Changes made: 1. Reordered operations in Workspace::addSurface to set up SurfaceContainer before adding to model 2. Added hasInitializeContainer() getter method and corresponding changed signal 3. Added safety check in Output::addSurface to skip layout operations if container is not initialized 4. Added connection to hasInitializeContainerChanged signal to trigger layout when container becomes available Log: Fixed surface initialization timing issue Influence: 1. Test surface creation and initialization in various scenarios 2. Verify that surfaces are properly laid out after container initialization 3. Test with different surface types (layer surfaces, non-layer surfaces) 4. Verify that prelaunch splash animations work correctly 5. Test workspace switching with surfaces in different initialization states fix: 修复 Workspace::addSurface 中的时序问题 修复了 Workspace::addSurface 中的时序问题,该问题导致表面初始 化可能在容器正确设置之前发生。问题是由于在设置容器之前调用了 model->addSurface(surface),可能导致对未初始化表面进行布局操作。 具体修改: 1. 重新排序 Workspace::addSurface 中的操作,先设置 SurfaceContainer 再添 加到模型 2. 添加 hasInitializeContainer() 获取方法和相应的变更信号 3. 在 Output::addSurface 中添加安全检查,如果容器未初始化则跳过布局操作 4. 添加对 hasInitializeContainerChanged 信号的连接,在容器可用时触发布局 Log: 修复表面初始化时序问题 Influence: 1. 测试各种场景下的表面创建和初始化 2. 验证表面在容器初始化后是否正确布局 3. 测试不同类型的表面(层表面、非层表面) 4. 验证预启动闪屏动画正常工作 5. 测试工作区切换时不同初始化状态的表面 Issue: linuxdeepin#670
The previous implementation was calling arrangeAllSurfaces when a layer surface was added or its properties changed, which was inefficient. Since arrangeLayerSurfaces already handles arranging non-layer surfaces when the exclusive zone changes, there's no need to call the more expensive arrangeAllSurfaces function. Changed the signal connection from layer properties changed to call arrangeLayerSurfaces instead of arrangeAllSurfaces. Also updated the immediate arrangement call after adding a layer surface to use arrangeLayerSurfaces. This improves performance by avoiding unnecessary arrangement of all surfaces when only layer surfaces need to be rearranged. Influence: 1. Test adding layer surfaces to ensure they are properly arranged 2. Verify that layer surface property changes trigger correct rearrangement 3. Confirm that non-layer surfaces are still arranged when exclusive zones change 4. Test overall surface arrangement behavior remains consistent 5. Monitor performance improvements in surface management fix: 优化表面排列调用 之前的实现在添加层表面或其属性改变时调用arrangeAllSurfaces,这种做法效率 较低。由于arrangeLayerSurfaces在专属区域变化时已经会主动安排非层表面,因 此没有必要调用更昂贵的arrangeAllSurfaces函数。 将层属性改变的信号连接从调用arrangeAllSurfaces改为调用 arrangeLayerSurfaces。同时更新了添加层表面后的立即排列调用,使用 arrangeLayerSurfaces代替arrangeAllSurfaces。这通过避免在只需要重新排列层 表面时安排所有表面,提高了性能。 Influence: 1. 测试添加层表面以确保它们被正确排列 2. 验证层表面属性变化是否触发正确的重新排列 3. 确认当专属区域变化时非层表面仍然会被排列 4. 测试整体表面排列行为保持一致性 5. 监控表面管理中的性能改进
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixed a timing issue in Workspace::addSurface where surface initialization could occur before the container was properly set up. The issue was caused by calling model->addSurface(surface) before setting up the container, which could lead to layout operations on uninitialized surfaces.
Changes made:
Log: Fixed surface initialization timing issue
Influence:
fix: 修复 Workspace::addSurface 中的时序问题
修复了 Workspace::addSurface 中的时序问题,该问题导致表面初始
化可能在容器正确设置之前发生。问题是由于在设置容器之前调用了
model->addSurface(surface),可能导致对未初始化表面进行布局操作。
具体修改:
Log: 修复表面初始化时序问题
Influence:
Issue: #670