Community
Participate
Working Groups
Without 'SWT.PaintItem', rows are shown correctly when dragging. With 'SWT.PaintItem' however, a "file" icon is shown instead. I have debugged; 'TreeDragSourceEffect.getDragSourceImage()' and 'TableDragSourceEffect.getDragSourceImage()' have this code written 13 years ago //TEMPORARY CODE if (table.isListening(SWT.EraseItem) || table.isListening (SWT.PaintItem)) return null; It was added in commit: 5a8028d0 by Steve Northover at 2008-04-29 07:56:43 disable drag images in table and tree for custom draw I have tried removing this early return, but found that only the first item shows correctly and others merely show empty rectangle when dragging. I'll try to make a patch.
Created attachment 287706 [details] Reproducer snippet
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188983
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188983 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b324b57ca1e55a287e2900604c974402a6ed337b
Created attachment 288270 [details] Content assist broken after the patch (In reply to Eclipse Genie from comment #3) > Gerrit change > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188983 was > merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=b324b57ca1e55a287e2900604c974402a6ed337b This broke content assist proposals, they don't have icons anymore.
Please provide a fix or revert.
(In reply to Andrey Loskutov from comment #4) > This broke content assist proposals, they don't have icons anymore. Also "Open Type" / "Open Resource" tables miss icons.
Alexandr, please let us know whether you plan to work on it or to revert.
I'll investigate today.
I confirm that problem is seen with my patch and not seen without it.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192203
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192203 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3d77f621a5b9a8675a132b51512d7fc19b50ee59
Verified in I20220324-1800
I've found another regression. While dragging elements in the tree, before the patches here we had some system "copy" icon shown next to the cursor. Now we have a light lengthy rectangle shown.
Created attachment 288296 [details] screenshot of broken "drag" effect
(In reply to Andrey Loskutov from comment #13) > Now we have a light lengthy rectangle shown. Is this a row rectangle we drag now??? I'm on RHEL 7.9 / gtk3-3.22.30-5.el7.x86_64
I see two problems: 1) Drag image is too wide On Windows, SWT drag images seem to be limited to width/height of 301px. I'm still trying to find where exactly it happens. In Thunderbird on Windows, drag image seems to be limited by Control's width, and it always looked fine to me (I actually drag a lot to put incoming emails into various folders). I think that it would make sense to limit to 301px or Control's width on GTK. What do you think? Also note that Table/Tree without SWT.Paint is not affected by the patch; you can use snippet to make column very wide (wider than Control) and you'll see the same there. So this isn't exactly a regression, rather, it fixes SWT.Paint case to behave the same as standard painting. 2) Drag image has no contents Now this is unexpected and needs to be debugged. I wouldn't be too surprised if it's an Eclipse bug where it paints item contents at wrong coords. I'm investigating it already.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192263
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192264
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192265
Indeed, it was Eclipse's bug where it painted at wrong coordinates. I added workaround for it (similar to already existing workaround on macOS) and also limited drag image's width to Control's size.
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192263 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8ec33a2fc1f2e31f36772a77d5aebc2431c9402a
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/192264 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3c61f331b65b6eb2193fd8ef37791e6b2f89ac2b
Fixed via gerrits here and https://github.com/eclipse-platform/eclipse.platform.swt/pull/3