diff --git a/WINGs/WINGs/WINGsP.h.in b/WINGs/WINGs/WINGsP.h.in index 810eeef..25de23c 100644 --- a/WINGs/WINGs/WINGsP.h.in +++ b/WINGs/WINGs/WINGsP.h.in @@ -633,6 +633,9 @@ typedef struct W_ViewBackend { /* Clipboard (cut buffer) */ void (*clipboard_store)(void *vctx, const char *text, int len); char *(*clipboard_fetch)(void *vctx, int *len_out); + + /* Drag and drop */ + void (*drag_begin)(void *vctx, struct W_View *view, WMEvent *event); } W_ViewBackend; extern const W_ViewBackend W_ViewBackendX11; diff --git a/WINGs/dragsource.c b/WINGs/dragsource.c index c4345de..c843616 100644 --- a/WINGs/dragsource.c +++ b/WINGs/dragsource.c @@ -860,6 +860,12 @@ Bool WMIsDraggingFromView(WMView * view) void WMDragImageFromView(WMView * view, WMEvent * event) { + const W_ViewBackend *vb = W_VIEW_SCREEN(view)->viewBackend; + if (vb && vb->drag_begin) { + vb->drag_begin(W_VIEW_SCREEN(view)->viewBackendCtx, view, event); + return; + } + WMDraggingInfo *info = &W_VIEW_SCREEN(view)->dragInfo; WMPoint mouseLocation; diff --git a/WINGs/wview_wl.c b/WINGs/wview_wl.c index c15adfa..a1770fe 100644 --- a/WINGs/wview_wl.c +++ b/WINGs/wview_wl.c @@ -531,6 +531,11 @@ static char *wl_clipboard_fetch(void *vctx, int *len_out) return NULL; } +static void wl_drag_begin(void *vctx, W_View *view, WMEvent *event) +{ + (void)vctx; (void)view; (void)event; +} + static void wl_flush(void *vctx) { (void)vctx; @@ -561,4 +566,5 @@ const W_ViewBackend W_ViewBackendWL = { .flush = wl_flush, .clipboard_store = wl_clipboard_store, .clipboard_fetch = wl_clipboard_fetch, + .drag_begin = wl_drag_begin, }; diff --git a/WINGs/wview_x11.c b/WINGs/wview_x11.c index a85efce..1152de6 100644 --- a/WINGs/wview_x11.c +++ b/WINGs/wview_x11.c @@ -253,4 +253,5 @@ const W_ViewBackend W_ViewBackendX11 = { .flush = x11_flush, .clipboard_store = x11_clipboard_store, .clipboard_fetch = x11_clipboard_fetch, + .drag_begin = NULL, };