-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text drag and drop in SDL 3 under Ubuntu 24.04 LTS in VirtualBox not working #12467
Comments
Following an advice from @Kontrabant, I retried with But the problems persist unchanged - with |
That's odd, when dragging the selected text 'Testing' from gedit into testdropfile on Fedora 41, I get:
|
It works on Fedora 41 indeed. Unless, strangely, a VirtualBox Ubuntu is open in the desktop and then it does not work anymore. Did you try with both But this is Ubuntu 24.04, and this is a VirtualBox guest. Sorry I cannot get my hands on a native Ubuntu. |
I think that I found the root issue, which is related to not flushing the queue when requesting the offered clipboard data. I should have tentative fix ready tomorrow. |
Sorry, didn't mean to close this as it happened automatically when merging the referenced pull. I pushed some clipboard fixes to the main branch, can you test and see if this fixed your issue? |
Sorry, little change.
On the other hand I have mounted a Fedora 41 in VirtualBox, and it displays the same problems as Ubuntu 14.04. I should actually retry with a native - non VM - Ubuntu, but this is a harder endeavor. Meanwhile, I think I should close the issue, sorry for the disturbance. |
Ubuntu 24.04 on bare metal here; FWIW, I've had a multitude of issues with VirtualBox and drag-and-dropping, and rarely got it to work. It's possible the issue lies with VirtualBox. |
I have 24.04 setup in Boxes, which is QEMU under the hood, and am still seeing random text-drop failures. The changes that I made yesterday to round trip when receiving data seemed to fix it at the time, but apparently the problem is sporadic, because it's back to randomly failing today. I dug a little further and found the true cause: sometimes the compositor is sending a drag leave event instead of a drop event when the text is dropped, so SDL isn't causing the problem here. On top of that, while repeatedly dragging text trying to trigger the bug, I've had the compositor sporadically close the connection to the Wayland server after a drop operation a couple of times, killing the app in the process, so it definitely seems like drag & drop on 24.04 (maybe certain versions of GNOME?) has bugs when running in a VM for some reason. |
After some cleanup, I have only one remaining case of In Fedora 41 Gnome over Wayland, and likewise in Ubuntu over Wayland, the SDL 3 X11 receiver
whereas all the following work OK :
I am not sure whether the spurious sequence
|
What I am seeing on QEMU when dropping dragged text into the window fails is:
In your first example, I suspect the compositor sent a spurious drag leave+enter event combo for whatever reason. Ultimately, the root causes for the drop failures are incorrect events coming from the compositor, which are telling SDL to do the wrong thing. KDE works perfectly for me in a VM as well, so I'm guessing that it's some kind of race condition in GNOME, which seems to become noticeable when running in a VM. |
SDL 3 at
main
commit 113eb6f of March 3rd 2025, Ubuntu 24.04.2 LTS updated, as VirtualBox guest.Source Text : some text content of any page in Firefox,
Target 1 :
SDL_VIDEO_DRIVER=x11 testdropfile
Symptom : The cross follows correctly the pointer, but the actual drop does not produce the text at all or produces it at the wrong place.
The few last lines of logging by
testdropfile
read :where the
Text dropped on window
lines may or may not occur,but always a spurious
Drop complete
shows up followed by aDrop beginning
at the wrong place,making the
Text dropped on window
, when they occur, at the wrong place too.Source Text : some text content of any page in Firefox,
Target 2 :
SDL_VIDEO_DRIVER=wayland SDL_LOGGING=input=trace testdropfile
Symptom : The cross follows correctly the pointer, but the actual drop does not produce the text at all.
The few last lines of logging by SDL 3 and
testdropfile
read :where the Wayland data_offer_receive fails to return the data.
This occurs when the data is instead in the Wayland Primary Selection, see the comment in
src/video/wayland/SDL_waylandevents.c
around line 2444.I had that very same symptom by mid last year in native Fedora Linux, but the problem does not show anymore.
I do not recall whether and how I configured the Drag and Drop to prevent the data to fall into the Primary Selection, or whether it was silently fixed by some change in Wayland in between.
The text was updated successfully, but these errors were encountered: