Drag source icon from an off-window widget

hello

i would like to have a custom GtkDragSource icon while dragging

for that i have a custom widget, so that the idea is that i initialize that widget and then create a paintable from it
my issue is that i can’t understand how to actually make it work
my widget is not in the window hierarchy
so seems like i have to create a surface, somehow make this widget render into that surface and then get a paintable from it

could you please help me with this or maybe suggest a proper solution to what i want to achieve

thanks

gtk4, c

i found it
here it is for some one in the future:

// inside drag-begin signal handler
GtkDragIcon *drag_icon = GTK_DRAG_ICON(gtk_drag_icon_get_for_drag(drag));
GtkWidget *draggable = GTK_WIDGET(custom_draggable_new());
gtk_drag_icon_set_child(drag_icon, draggable);
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.