After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781737 - Drag icon is always postioned in the top left corner
Drag icon is always postioned in the top left corner
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-04-25 19:31 UTC by peterbudai
Modified: 2017-05-05 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkdnd: restore drag window movement for the unmanaged case (3.33 KB, patch)
2017-04-26 11:03 UTC, Christoph Reiter (lazka)
none Details | Review
gtkdnd: restore drag window movement for the unmanaged case (3.41 KB, patch)
2017-05-05 16:02 UTC, Christoph Reiter (lazka)
committed Details | Review

Description peterbudai 2017-04-25 19:31:20 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
Comment 1 Christoph Reiter (lazka) 2017-04-26 11:03:36 UTC
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.
Comment 2 peterbudai 2017-04-26 11:16:24 UTC
Thanks lazka, this looks promising
Comment 3 LRN 2017-04-26 14:47:13 UTC
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).
Comment 4 Matthias Clasen 2017-04-27 23:12:24 UTC
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.
Comment 5 Christoph Reiter (lazka) 2017-05-04 15:08:15 UTC
Any objections to my fix? I'd consider porting the win32 dnd code to the new interface a separate issue.
Comment 6 LRN 2017-05-04 16:14:25 UTC
Ask nacho for a round of nitpicking, then push.
Comment 7 Ignacio Casal Quinteiro (nacho) 2017-05-04 21:43:43 UTC
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
Comment 8 Carlos Garnacho 2017-05-05 14:48:53 UTC
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.
Comment 9 Christoph Reiter (lazka) 2017-05-05 16:02:56 UTC
Created attachment 351209 [details] [review]
gtkdnd: restore drag window movement for the unmanaged case

Adjusted the patch according to the reviews. Thanks everyone!
Comment 10 Christoph Reiter (lazka) 2017-05-05 16:04:58 UTC
Comment on attachment 351209 [details] [review]
gtkdnd: restore drag window movement for the unmanaged case

Pushed to master and gtk-3-22