[PATCH weston 2/2] dnd: Abort with an error message if compositor doesn't support drag and drop

Derek Foreman derekf at osg.samsung.com
Thu Apr 20 19:31:37 UTC 2017


This test isn't particularly useful when the compositor doesn't support
drag and drop - so bail if we fail to create a data source.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 clients/dnd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clients/dnd.c b/clients/dnd.c
index 41e532ef..ec706bff 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -534,6 +534,10 @@ create_drag_source(struct dnd *dnd,
 		} else {
 			dnd_drag->data_source =
 				display_create_data_source(dnd->display);
+			if (!dnd_drag->data_source) {
+				fprintf(stderr, "No data device manager\n");
+				abort();
+			}
 			wl_data_source_add_listener(dnd_drag->data_source,
 						    &data_source_listener,
 						    dnd_drag);
-- 
2.11.0



More information about the wayland-devel mailing list