Conversation
The launcher tried to see WM_DROPFILES on QEMU's SDL window with DragAcceptFiles plus SetWindowSubclass. QEMU runs in another process, and Windows does not allow subclassing a window across processes (the subclass procedure pointer would only be valid in the caller's address space), so the subclass never fired and drops were silently lost. DragAcceptFiles only set WS_EX_ACCEPTFILES, which is why it looked registered. The WINQ-EMU runtime already reports drops as the DISPLAY_FILE_DROP QMP event, which main.go consumes. Drop the dead subclass path, and map the reported drop point (or, when the runtime does not send one, the cursor that is still on the release point) from display-window coordinates to the guest display so the guest can deliver into the window under the cursor.
Collaborator
Author
|
Thanks. The QMP drop path landed in #137, including the drop-point handling. Closing as superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Direct file drops onto the VM window never reached the launcher.
app/file_drop_qemu_windows.goaccepted drops withDragAcceptFilesand then triedSetWindowSubclasson QEMU's SDL window to seeWM_DROPFILES. QEMU runs in another process, and Windows does not allow subclassing a window across processes:SetWindowSubclassrewritesGWLP_WNDPROC, and a window-procedure pointer is only valid in the process that owns the window. The subclass therefore never ran, andWM_DROPFILESwent to SDL, which turns it intoSDL_DROPFILE, which QEMU ignored.DragAcceptFilesonly setsWS_EX_ACCEPTFILES(a style bit that can be set across processes), which is why it looked enabled and logged success.The runtime already covers this:
runtime-build/patches/qemu/0007-report-native-file-drops.patchemits aDISPLAY_FILE_DROPQMP event thatmain.goalready consumes. This change makes that the only path.Changes
enableVMWindowDrops,vmDropWindowProc,handleVMDrop,dragQueryPoint) and its calls inwinapi.goandcloseguard.go.droppedFilesEventnow also reads an optional drop point (x,y) from the event.guestDropPointscales a display-window point to the guest display; when the event carries no point it uses the cursor, which is still over the release point while QEMU reports the completed drop.main.gohands the mapped point tosendDroppedFilesAt, so the guest can deliver into the window under the cursor (guest-side targeting isguest-build/0073).Notes
0007. The shippedwinq-emu-alpha10-portable.ziphas it; the olderC:\WINQ-EMUruntime used in the last laptop pass did not, which is why drops did nothing there.0007include SDL'sdrop.x/drop.yin the event so the point is authoritative rather than taken from the cursor.SDL_DropEventhas carriedx/ysince SDL 2.0.14 and the runtime ships 2.32.Test plan
go test ./...(CI: Linux and Windows)0007; the guest should receive it in the window under the cursor andshell.logshould stay free of the olddrops:lines.