mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
fix(gamescope): release cursor SHM buffers during long sessions (#1189)
* fix(gamescope): avoid retaining pointer cursor SHM commits * test(gamescope): verify cursor release and pending window control * test(gamescope): keep live probe inert during test discovery * test: match Gamescope process name in cursor probe * test: clarify cursor-role probe serial behavior --------- Co-authored-by: siyuan.qsy <siyuan.qsy@alibaba-inc.com> Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
This commit is contained in:
1 parent
4513940717
commit
d60f683b62
3 files changed
+178
No files matched your search
@@ -66,3 +66,22 @@ library list, before anything is published.
|
||||
|
||||
Sixteen more of Armada's patches are DRM/lease/HDR-on-KMS work for a native display, which this
|
||||
app's Wayland-hosted gamescope never reaches, or need a newer gamescope than the runtime has.
|
||||
|
||||
- `0116-release-cursor-shm-buffers.patch` - this app: pointer cursor surfaces have no
|
||||
X11/xdg window association, so routing their commits through `g_PendingCommits`
|
||||
retained every old SHM buffer until the surface was destroyed. Ignore cursor-role
|
||||
commits before taking the buffer lock; X11 cursor images still follow the existing
|
||||
MouseCursor path. Window commits awaiting association are unchanged.
|
||||
|
||||
The live regression probe is `tools/tests/test_gamescope_cursor_shm.py`. Run it
|
||||
inside an active Gamescope session with access to that process's `/proc` fd
|
||||
directory. It submits 20 distinct SHM cursor buffers and requires at most the
|
||||
current buffer to remain open, then none after surface destruction. The
|
||||
`--unassigned-control` variant omits the cursor role and verifies that all 20
|
||||
commits awaiting a window association remain queued until surface destruction.
|
||||
|
||||
Device validation (2026-10-20): the stock component retained 20/20 cursor buffers;
|
||||
the patched component retained 1/20, then 0 after destruction. The unassigned
|
||||
control retained 20/20 and then 0. In Backpack Battles, two batches of ten touch
|
||||
drags leaked 188 and 197 SHM descriptors before the fix; the same batches added
|
||||
zero after the fix (112 total descriptors before and after each batch).
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/src/wlserver.cpp
|
||||
+++ b/src/wlserver.cpp
|
||||
@@ -203,6 +203,12 @@
|
||||
}
|
||||
|
||||
void xwayland_surface_commit(struct wlr_surface *wlr_surface) {
|
||||
+ // Cursor surfaces never acquire an X11/xdg window association. Keeping their
|
||||
+ // commits in g_PendingCommits pins every old SHM buffer until the cursor
|
||||
+ // surface is destroyed. X11 cursor images are handled by MouseCursor.
|
||||
+ if ( wlr_surface->role && strcmp( wlr_surface->role->name, "wl_pointer-cursor" ) == 0 )
|
||||
+ return;
|
||||
+
|
||||
wlr_surface->current.committed = 0;
|
||||
|
||||
wlserver_x11_surface_info *wlserver_x11_surface_info = get_wl_surface_info(wlr_surface)->x11_surface;
|
||||
Reference in new issue
Block a user