Skip to content

Commit

Permalink
wlserver: Fix removal of gamescope_control resources
Browse files Browse the repository at this point in the history
Needs proper destroy listener, not destroy interface. Bleh.
  • Loading branch information
misyltoad committed Nov 15, 2023
1 parent add96e3 commit 31ad691
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,6 @@ static void gamescope_control_set_app_target_refresh_cycle( struct wl_client *cl

static void gamescope_control_handle_destroy( struct wl_client *client, struct wl_resource *resource )
{
std::erase_if(wlserver.gamescope_controls, [=](auto control) { return control == resource; });
wl_resource_destroy( resource );
}

Expand All @@ -884,7 +883,11 @@ static const struct gamescope_control_interface gamescope_control_impl = {
static void gamescope_control_bind( struct wl_client *client, void *data, uint32_t version, uint32_t id )
{
struct wl_resource *resource = wl_resource_create( client, &gamescope_control_interface, version, id );
wl_resource_set_implementation( resource, &gamescope_control_impl, NULL, NULL );
wl_resource_set_implementation( resource, &gamescope_control_impl, NULL,
[](struct wl_resource *resource)
{
std::erase_if(wlserver.gamescope_controls, [=](struct wl_resource *control) { return control == resource; });
});

// Send feature support
gamescope_control_send_feature_support( resource, GAMESCOPE_CONTROL_FEATURE_RESHADE_SHADERS, 1, 0 );
Expand Down

0 comments on commit 31ad691

Please sign in to comment.