Skip to content

Conversation

@njdom24
Copy link
Contributor

@njdom24 njdom24 commented Oct 25, 2025

Describe your PR, what does it fix/add?

Gets DS working with Gamescope. gamescope --mangoapp disables DS for subsurfaces, and toggling it on/off with Shift_R+F12 works as expected.
Note: Gamescope doesn't do hardware cursors with its Wayland backend, so moving the cursor will go in/out of DS. This outcome is the same as Sway, and works fine for games with captured cursors, so I think it's okay. Given that toggling mangoapp doesn't cause this stutter, it's probably a Gamescope issue.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

My knowledge of subsurfaces is lacking. If this is stupid, please say so.

Is it ready for merging, or does it need work?

Ready

@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from 0d50e08 to 8c6f6b9 Compare October 26, 2025 01:08
@njdom24 njdom24 marked this pull request as draft October 26, 2025 01:21
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from 8c6f6b9 to 84d6c9e Compare October 26, 2025 01:25
@njdom24 njdom24 marked this pull request as ready for review October 26, 2025 01:36
@vaxerski
Copy link
Member

My knowledge of subsurfaces is lacking. If this is stupid, please say so.

idea aint stupid, code sux tho

@njdom24 njdom24 marked this pull request as draft October 27, 2025 17:38
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from 84d6c9e to a5dae7c Compare October 28, 2025 04:43
@njdom24 njdom24 marked this pull request as ready for review October 28, 2025 05:13
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from a5dae7c to ff44af9 Compare October 28, 2025 05:54
@njdom24 njdom24 marked this pull request as draft October 29, 2025 12:44
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from ff44af9 to 4eff4de Compare October 30, 2025 01:16
@njdom24 njdom24 marked this pull request as ready for review October 30, 2025 01:18
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch 2 times, most recently from bd7e476 to 62cdfe0 Compare October 30, 2025 02:32
if (subsurface.expired() || subsurface->m_surface.expired())
return true;

auto surf = subsurface->m_surface.lock();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locking is redundant. Check operator bool on WP and deref a weak

bool CWLSurfaceResource::hasVisibleSubsurface() {
for (auto const& subsurface : m_subsurfaces) {
if (subsurface) {
if (subsurface.expired() || subsurface->m_surface.expired())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer operator bool which is the inverse of expired

@njdom24 njdom24 marked this pull request as draft November 1, 2025 17:23
@njdom24 njdom24 changed the title Allow DS for surface with inert subsurfaces Allow DS for surfaces with inert subsurfaces Nov 1, 2025
@njdom24 njdom24 force-pushed the ds-empty-subsurfaces branch from 62cdfe0 to 91045b6 Compare November 1, 2025 21:51
@njdom24 njdom24 marked this pull request as ready for review November 1, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants