Skip to content

Commit 251c73e

Browse files
committed
fix: fix touchscreen mapping after display switching
Add explicit touchscreen remapping after display configuration changes to resolve touchscreen failure issues when switching between dual displays. The fix ensures that touchscreen mapping is properly updated after the display configuration is securely applied and the X server is ungrabbed, preventing deadlocks during the apply phase. Previously, touchscreen mapping events were skipped during the 'inApply' phase to avoid deadlocks, but this could lead to touchscreen mapping not being updated after display changes. Now we explicitly trigger touchscreen remapping after the configuration is complete. Log: Fixed touchscreen mapping issues when switching between dual displays Influence: 1. Test dual display switching scenarios to verify touchscreen functionality remains intact 2. Verify touchscreen mapping updates correctly after display configuration changes 3. Test various display configurations to ensure no regression in touchscreen behavior 4. Check that touchscreen dialog still shows correctly when needed 5. Verify no deadlocks occur during display configuration changes fix: 修复双屏切换后触控屏映射失效问题 在显示配置更改后显式触发触控屏重新映射,解决双屏切换时触控屏失效的问题。 该修复确保在显示配置安全应用且X服务器解除抓取后,触控屏映射能够正确更 新,防止在应用阶段发生死锁。 之前为避免死锁,在'inApply'阶段跳过了触控屏映射事件,但这可能导致显示更 改后触控屏映射无法更新。现在我们在配置完成后显式触发触控屏重新映射。 Log: 修复双屏切换时触控屏映射失效问题 Influence: 1. 测试双屏切换场景,验证触控屏功能保持正常 2. 验证显示配置更改后触控屏映射正确更新 3. 测试各种显示配置,确保触控屏行为没有回归问题 4. 检查触控屏对话框在需要时仍能正确显示 5. 验证显示配置更改期间不会发生死锁
1 parent 8d83115 commit 251c73e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

display1/manager.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -1638,6 +1638,11 @@ func (m *Manager) apply(monitorsId monitorsId, monitorMap map[uint32]*Monitor, o
16381638
m.applyMu.Unlock()
16391639

16401640
m.setInApply(false)
1641+
1642+
// Since we skip mapping events during the 'inApply' phase to prevent deadlocks,
1643+
// we must explicitly trigger a touchscreen remap after the display configuration has been securely applied and the X server ungrabbed.
1644+
go m.handleTouchscreenChanged()
1645+
16411646
return err
16421647
}
16431648

@@ -2865,6 +2870,11 @@ func (m *Manager) showTouchscreenDialog(touchScreenUUID string) error {
28652870
}
28662871

28672872
func (m *Manager) handleTouchscreenChanged() {
2873+
if m.getInApply() {
2874+
logger.Debugf("handleTouchscreenChanged: skipped because Manager is in inApply state")
2875+
return
2876+
}
2877+
28682878
logger.Debugf("touchscreens changed %#v", m.Touchscreens)
28692879

28702880
monitors := m.getConnectedMonitors()

0 commit comments

Comments
 (0)