GNOME Bugzilla – Bug 781737
Drag icon is always postioned in the top left corner
Last modified: 2017-05-05 16:05:07 UTC
Repro: 1. Start gtk3-demo 2. Navigate to Text View/Hypertext 3. Click on the Run button 4. On the new window with the text, select a word and try to drag In the top left corner of the _screen_ you will see the drag icon which is the actually selected word. Make sure your background/wallpaper is light colored, otherwise you won't see the black text. GTK version: 3.22.10
Created attachment 350450 [details] [review] gtkdnd: restore drag window movement for the unmanaged case 5bb12474d975ee4b790c5 removed the dnd window movement code to let the gdk backends handle the window movement instead. While this works for X11/wayland the win32 backend still uses the unmanaged interface and expects the window movement to be handled on the gtk side. This restores the functionality in case the dnd is unmanaged. This fixes the drag window on Windows being stuck in the top left corner instead of following the drag position.
Thanks lazka, this looks promising
So the managed updates are, basically, GTK (or GDK?) doing some desktop/system API calls, and the DE just draws this stuff up? Or what? That is, does this have to be "managed" by the W32 GDK backend (in which case we might be able to do something) or by the W32 DE itself (in which case we can only do something if W32 API has the right functionality; or we end up re-implementing it ourselves anyway, in which case it might as well just stay in GTK layer)? If the former, then that would be the "right" (for some definitions of "right") way of fixing this. In this case attachment 350450 [details] [review], a partial reverse of the commit 5bb12474d975ee4b790c5 (as noted above), would work as a stop-gap measure (especially if no one is willing to implement the "right" fix).
I can certainly be managed by the gdk backend. Look at how the X11 backend does it. We basically just moved the code that did the management from gtk down into gdk.
Any objections to my fix? I'd consider porting the win32 dnd code to the new interface a separate issue.
Ask nacho for a round of nitpicking, then push.
Review of attachment 350450 [details] [review]: Patch is fine for me. Get an ack from a gtk dev though since this touches the main code and not only the gtk backend. FWIW I'd really like to the see the win32 backend ported to the new interface... ::: gtk/gtkdnd.c @@ +1715,2 @@ GdkAtom selection; gboolean managed = FALSE; you can remove this assign to FALSE
Review of attachment 350450 [details] [review]: Generally looks correct to me. Although IMO would be better to move all GDK backends to managed DnD in the longer term. Keeping the 2 modes in gtkdnd.c was meant to be scaffolding code while the remaining backends are ported. ::: gtk/gtkdnd.c @@ +1679,3 @@ +gtk_drag_is_managed (GtkWidget *source_widget) +{ + return this line is not indented properly, should be at 2 spaces.
Created attachment 351209 [details] [review] gtkdnd: restore drag window movement for the unmanaged case Adjusted the patch according to the reviews. Thanks everyone!
Comment on attachment 351209 [details] [review] gtkdnd: restore drag window movement for the unmanaged case Pushed to master and gtk-3-22