File: upstream_48ddfb59_wayland-Send-wl-data-source-cancelled-if-wl-data-device-start-drag-is-rejected.patch

package info (click to toggle)
kwin 4%3A6.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 56,600 kB
  • sloc: cpp: 241,670; xml: 3,228; javascript: 2,214; ansic: 775; sh: 67; python: 15; makefile: 8
file content (38 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 48ddfb592d1c84000936857a8a752fc2efec4c54 Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Wed, 4 Jun 2025 20:25:49 +0000
Subject: [PATCH] wayland: Send wl_data_source.cancelled if
 wl_data_device.start_drag is rejected

If a dnd operation is rejected by the start_drag request, currently, the
client has no any feedback about it.

This change makes kwin send a wl_data_source.cancelled similar to what
weston does. Note that with internal drags, no feedback will still be
provided though.


(cherry picked from commit d9249be845b788b1e22e9944468c26612d37730b)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
---
 src/wayland/datadevice.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/wayland/datadevice.cpp b/src/wayland/datadevice.cpp
index 1becb8290df..eb514528752 100644
--- a/src/wayland/datadevice.cpp
+++ b/src/wayland/datadevice.cpp
@@ -96,6 +96,9 @@ void DataDeviceInterfacePrivate::data_device_start_drag(Resource *resource,
         const bool touchGrab = seat->hasImplicitTouchGrab(serial) && seat->isSurfaceTouched(focusSurface);
         if (!touchGrab) {
             // Client neither has pointer nor touch grab. No drag start allowed.
+            if (dataSource) {
+                dataSource->dndCancelled();
+            }
             return;
         }
     }
-- 
GitLab