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 644379 - Drag and drop on dual screen does not work
Drag and drop on dual screen does not work
Status: RESOLVED INCOMPLETE
Product: gtk+
Classification: Platform
Component: Backend: X11
2.24.x
Other Linux
: Normal blocker
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-03-10 09:29 UTC by Nicolas SOUBEIRAN
Modified: 2017-07-30 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to copy the screen of source event (if any) (729 bytes, patch)
2011-03-10 14:53 UTC, Nicolas SOUBEIRAN
none Details | Review
correct XError BadMatch when a DnD with preview is made between 2 screens (120.19 KB, text/plain)
2011-03-11 11:52 UTC, Nicolas SOUBEIRAN
  Details
correct XError BadMatch when a DnD with preview is made between 2 screens (1.38 KB, patch)
2011-03-11 11:54 UTC, Nicolas SOUBEIRAN
none Details | Review

Description Nicolas SOUBEIRAN 2011-03-10 09:29:53 UTC
I have a Dual screen (separate X screen) computer. 
When I try to drag and drop a data from a screen to another, the drop occurs in the source screen.
Because my application works with 2 screens with completely different properties, I could not use the drag and drop for my application.
Comment 1 André Klapper 2011-03-10 11:21:09 UTC
Thanks for taking the time to report this bug.
However, you are using version 2.18 that is too old and not supported anymore. GNOME developers are no longer working on that version, so unfortunately there will not be any bug fixes for the version that you use.

By upgrading to a newer version of GNOME you could receive bug fixes and new functionality. You may need to upgrade your Linux distribution to obtain a newer version of GNOME.
Please feel free to reopen this bug if the problem still occurs with a newer version of GNOME.
Comment 2 Nicolas SOUBEIRAN 2011-03-10 13:13:32 UTC
I've track this bug and fall into _gdk_make_event (in gdkwindow.c:9889 for GTK+2.24.1) function that seems to make a dirty copy of event. In my case the private field "screen" of structure GdkEvent is lost.
I want to know the purpose of this function why don't you use gdk_event_copy ?
The code has not moved since 2.18. So I think the bug always exists in the latest GTK+ 2.

Also note that GTK+2.18 is the version used by the latest  RedHat (v.6) for professional use.
Comment 3 Nicolas SOUBEIRAN 2011-03-10 14:53:57 UTC
Created attachment 183063 [details] [review]
Patch to copy the screen of source event (if any)

patch on _gdk_make_event function
This patch just copies the screen of event_in_queue (if both exists) to the newly created event.
I quickly test this patch with gtk-demo (clipboard) it solves the bug.
The version of source file was GTK+2.18.9. (see patch header)


Since I do not understand the meaning of _gdk_make_event function I have done minimum change for my case but I think it would be better to use gdk_event_copy rather than copy field manually (because private field will not be copied) when event_in_queue exists.
Comment 4 Nicolas SOUBEIRAN 2011-03-10 17:48:13 UTC
Well, the previous patch goes to XErrors : my test was only with stocks id image, this test works. But when I tried to drag and drop a text when the preview drag icon changed screen the apps crashes with an XError.
Both error are send when the drag and drop try to create the "fallback" DnD icon  set_icon_stock_pixbuf in gtk_drag_get_icon.

But there is 2 cases : 
- if the drag widget screen is the default screen : the app crash occurs in the XShapeGetRectangles function
- if the drag widget screen is not the default screen : the app crash occurs in the _gdk_windowing_get_shape_for_mask (the mask is get from the default screen)


Am I wrong or GTK+ was never tested with this kind of configuration (separate X screen).
Comment 5 Matthias Clasen 2011-03-11 03:00:23 UTC
> Am I wrong or GTK+ was never tested with this kind of configuration (separate X
> screen).

Multi-screen setups are pretty rare these days. Normally, people use their monitors combined into a single protocol screen via xinerama/xrandr.

Anyway, thanks for your analysis so far !
Comment 6 Nicolas SOUBEIRAN 2011-03-11 11:52:30 UTC
Created attachment 183128 [details]
correct XError BadMatch when a DnD with preview is made between 2 screens

This correction is not THE optimal one. But at least it works.Now the effect of DnD when changing screen disable the preview and set the GTK_STOCK_DND icon.
Comment 7 Nicolas SOUBEIRAN 2011-03-11 11:54:45 UTC
Created attachment 183129 [details] [review]
correct XError BadMatch when a DnD with preview is made between 2 screens

The correction is miminal. When the Drag preview window changes screen, the default GTK_STOCK_DND is set.
Comment 8 Nicolas SOUBEIRAN 2011-03-11 11:58:22 UTC
My analysis is that when creating a shape window, the mask (Pixmap) is not set to the same screen than the Window. So X server send the BadMatch (SigABRT), because the documentation of shape extension is inexistant, I will stop here my investigation.
Comment 9 Emmanuele Bassi (:ebassi) 2016-04-10 16:21:06 UTC
Is this still an issue?
Comment 10 André Klapper 2017-07-30 16:03:14 UTC
(In reply to Emmanuele Bassi (:ebassi) from comment #9)
> Is this still an issue?

Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!