GNOME Bugzilla – Bug 608615
DnD events sent to wrong window
Last modified: 2010-03-11 14:18:47 UTC
Created attachment 152689 [details] [review] Patch fixing the problem For quite some time DnD on X11 doesn't take any regard on the window input shape mask and therefore when using RGBA windows with masked input shape, DnD events are being sent to incorrect window, which might look as an invisible barrier to the user. This bug is especially known to people using docks, but it can be observed for example also on ubuntu's notify-osd. Attached is patch for the issue, the only thing that was added is check for toplevel windows' input shape.
Created attachment 152695 [details] [review] Version 2 of the patch I enhanced the patch, now it listens for ShapeNotify events, so if the input mask is changed during the DnD operation, the cached input mask region is invalidated.
Review of attachment 152695 [details] [review]: Do you have an example shaped dnd client to test this with ? ::: gdk/x11/gdkdnd-x11.c @@ +600,3 @@ +static GdkRegion * +xwindow_get_shape (Display *xdisplay, Shouldn't duplicate this function from gdkwindow-x11.c here. Instead, change it to GdkRegion *_xwindow_get_shape (...) over there and add a declaration to gdkprivate-x11.h
Created attachment 152918 [details] [review] Fixed patch As I said you can see the problem on for example notify-osd (blocks DnD even though it's not clickable), avant-window-navigator, MacSlow's Cairo Clock... any input shaped app.
I've committed a version of your patch that also pays attention to bounding shapes.
It appears this change causes Chromium to crash. We have tracked it to GTK 2.18.7 which includes this change. Repro is easy: (1) start (2) click and hold on a tab, drag it an inch up or down (3) drop -- crash. I don't fully understand the change yet, but it seems from xtrace that a window is destroyed and then we attempt to call more X functions on it. From the GTK code it appears the child->xid used in free_cache_child() is no longer valid. It could very well be a Chromium bug, but if the above text and the below stack trace mean anything to you, I'd appreciate the advice. :) xtrace: 000:>:3dde: Event DestroyNotify(17) event=0x002002cc window=0x002002cc ... 000:<:3e0e: 12: SHAPE-Request(129,6): ShapeSelectInput destination window=0x002002cc enable=false(0x00) ... 000:>:3e0e:Error 3=Window: major=6, minor=129, bad=2097868 backtrace (note I've compiled my own GTK 2.18.7 since my Jaunty desktop only has .3, which doesn't have the problem):
+ Trace 220914
...Repro is easy:... It would be easy if chromium were in Fedora...but anyway, I fixed one crasher bug later that sounds exactly like this later on. I don't know if that has made it to the 2.18 branch yet. The commit is 325cbef27edd58b801509a2016aee6ab6e49d2f1 Protect against X errors when clearing the DND cache This was reported as a problem in bug 609952. Can you see if that fixes your crashes ?
Yes, cherry-picking that change atop 2.18.7 works around the problem. Thanks for the quick response!
PS: it appears that the 2.18 branch only has one other (non-translation) change in it since 2.18.7, so no, it's not in 2.18.