aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-10-07 18:24:53 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2022-10-07 19:49:28 +0000
commit5b0719b17c9adb63d0220d4584e3bab53b16911a (patch)
treea036f38ff13571634bc016f8036b4a54df926fa8
parent11d073ab099e4ee5a80c399385650d315d453e3e (diff)
drm-lease-v1: reject the lease request by default
If the compositor didn't call wlr_drm_lease_request_v1_grant() nor wlr_drm_lease_request_v1_reject(), then reject the lease.
-rw-r--r--types/wlr_drm_lease_v1.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/types/wlr_drm_lease_v1.c b/types/wlr_drm_lease_v1.c
index b9eb373c..4ac59e18 100644
--- a/types/wlr_drm_lease_v1.c
+++ b/types/wlr_drm_lease_v1.c
@@ -350,10 +350,14 @@ static void drm_lease_request_v1_handle_submit(
request->lease_resource = lease_resource;
- /* TODO: reject the request if the user does not grant it */
wl_signal_emit_mutable(&request->device->manager->events.request,
request);
+ /* If the compositor didn't act upon the request, reject it */
+ if (!request->invalid && wl_resource_get_user_data(lease_resource) == NULL) {
+ wlr_drm_lease_request_v1_reject(request);
+ }
+
/* Request is done */
wl_resource_destroy(resource);
}