fix: xwayland apps dialog popup (部分Xwayland应用弹窗问题)#1173
Conversation
XWayland Qt applications may create transient utility/tooltip/menu windows with different ICCCM input models and override-redirect states. Previously treeland treated some of them like normal toplevels, so mouse events could pass through to the parent window, popup focus could be stolen/restored at the wrong time, and destroying a short-lived child popup could emit a fake parent change that moved it into Workspace and triggered an assert. Fix this by: - tracking XWayland popup-like transient policy on SurfaceWrapper - routing bypass/override-redirect child popups to PopupContainer while keeping managed transients with their parent container - redirecting pointer events to the real popup target and tracking the popup pointer owner during press/release - using XWayland native focus/WM_TAKE_FOCUS according to the input model and restoring parent focus after popup teardown - cleaning cached XWayland parent/children relations before destroy with QPointer, without reporting a destroy-time reparent as a real parent change - dropping stale async property replies and container updates for dissociated XWayland surfaces - adding focused XWayland diagnostics for popup routing, focus, pointer delivery, size ratio and tree cleanup This fixes XWayland Qt5/Qt6 search dialogs that closed immediately, lost focus, received no mouse input, or crashed treeland when short-lived popup children were destroyed. Tested with: - cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr - ninja -C build - ctest --test-dir build --output-on-failure
Some Qt Xwayland applications create popup-like windows as managed NET_WM_WINDOW_TYPE_NORMAL/UTILITY transients instead of override-redirect menus. These windows need to stay visually and logically attached to their parent, otherwise pointer events may be delivered to the parent window while the popup is still rendered above it. Handle these popup-like Xwayland transients more explicitly: - classify managed Xwayland transient utility/normal windows as popup-like surfaces and keep their size/animation policy separate from normal windows - route managed popup-like transients through their parent container when a real parent wrapper is available, and synchronize QtQuick/X11 stacking above the parent instead of always using the global popup container - resolve transient parents through the native X11 parent tree when WM_TRANSIENT_FOR points to an intermediate unmanaged X window - track per-seat popup pointer ownership, opening guards and button sequences so press/move/release events stay with the popup that owns the interaction - add explicit pointer redirection support in WSeat for Xwayland popup recovery paths - keep popup mouse activation pointer-only and restore/keep parent focus when the popup should not steal normal keyboard focus - add categorized Xwayland diagnostics for parent resolution, hit testing, pointer ownership, focus decisions and redirect paths
Some Qt XWayland applications use managed NORMAL or UTILITY transients for popup dialogs. Treat these surfaces as popup-like windows, resolve their native transient parents, and keep scene and X11 stacking synchronized with the parent. Use request geometry for surface-sized popups while preserving compositor-managed toplevel geometry. Track popup pointer ownership per seat and keep each button sequence bound to its originating XWayland client. If a popup unmaps during a press, deliver the balancing release through a mapped surface of that client and synchronize Waylib's cached event target with the wlroots pointer focus. Extend XWM focus bookkeeping so Treeland can offer or force native focus when a transient closes. Defer the parent focus refresh until the popup has unmapped and the button sequence has completed, coalesce repeated activation requests, and validate the seat and parent before refreshing. This restores subsequent popup activation without allowing focus feedback to spin the compositor.
There was a problem hiding this comment.
Sorry @LFRon, your pull request is larger than the review limit of 150000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LFRon 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 |
|
Hi @LFRon. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
该PR修复了三个问题:
该PR我力竭了修不好的问题:
东方财富按开设置页面再关闭后,搜索框弹出的对话框只能用键盘选中,无法用鼠标选中,且再按关闭键也是一样的问题(关闭界面弹出的对话框鼠标光标点击是穿透的只能用键盘控制)
该PR为了修好应用此PR导致微信表情框穿透的问题, 因而改动了wlroots, 恳请大佬们改进(