Widget drag and drop without button press on Wayland


I’m currently porting GTK3 code that runs on X11 to Wayland, and I’d like to know if the following use case has a chance of continuing to work or not:

  • the user brings up a context menu on a widget;
  • he activates a menu entry that triggers a delayed drag and drop of the widget (to allow time for the menu to be hidden);
  • the drag and drop is done without holding down any mouse button (using gtk_drag_begin_with_coordinates()).

This works very well on X11, but on Wayland I immediately get a crash of the application with this message:

Gdk-Message: 19:57:20.309: Error 22 (Invalid argument) dispatching to Wayland display.

It appears that if I not only delay the drag and drop via g_idle_add() but via g_timeout_add(), by the time I can click a button again and hold it down this time, then the application does not crash anymore and the drag and drop can take place.

If I don’t hold down the button and the pointer is above the application window when the timeout ends, nothing happens. If the pointer is outside the window, crash as above.

So my question is: is it possible to drag and drop on Wayland without holding down a button? Thanks :slight_smile:

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