Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 500694

Summary: [HiDPI][GTK] Drag and Drop not working properly on high resolution displays with scaling factor
Product: [Eclipse Project] Platform Reporter: Lorenzo Bettini <lorenzo.bettini>
Component: SWTAssignee: Niraj Modi <niraj.modi>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: alhashash, arunkumar.thondapu, isahmedcevizci, lufimtse, niraj.modi, papaioannou.giannis, peter, psuzzi, werwurm
Version: 4.6Flags: arunkumar.thondapu: review+
Target Milestone: 4.6.2   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/83336
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a03291e0159f92b9c708b24c20ea125f02b88412
Whiteboard:
Bug Depends on:    
Bug Blocks: 492861, 495269, 506326    

Description Lorenzo Bettini CLA 2016-09-01 12:46:15 EDT
On Linux (but I haven't tried that on Windows) with a high resolution display (3200x1800) with a scaling factor of 2, drag and drop is completely broken: starting dragging an element in a tree view shows that an element a few positions below is actually dragged (and dropped in the wrong position).

The same happens if you try to drag a tab of any view or editor.

This happens both with GTK2 and GTK3, but only with a scaling factor (which is of course crucial to be able to see correctly with such a high resolution).

This has been reported also here (I think that's related): https://bugzilla.redhat.com/show_bug.cgi?id=1232092
Comment 1 Lorenzo Bettini CLA 2016-09-01 13:26:18 EDT
I've uploaded a video that shows this problem:

https://youtu.be/GRv5qyEqArQ

Note how no feedback is given in the package explorer (and no dragging is executed) and later in a tree editor, the dragging is completely wrong
Comment 2 Leo Ufimtsev CLA 2016-09-02 11:02:35 EDT
Might be a lack of hiDpi support in DnD logic.

I've added this to my todo list. (Currently investigating broken DnD in eclipse parts : Bug 498217).
But if someone has time to work on this sooner, by all means feel free to hack away on it.
Comment 3 Niraj Modi CLA 2016-10-04 05:27:09 EDT
(In reply to Lorenzo Bettini from comment #0)
> On Linux (but I haven't tried that on Windows) with a high resolution
> display (3200x1800) with a scaling factor of 2, drag and drop is completely
> broken: starting dragging an element in a tree view shows that an element a
> few positions below is actually dragged (and dropped in the wrong position).
> 
> The same happens if you try to drag a tab of any view or editor.

I have a fix for CTabFolder views will share/submit a patch shortly.
Then will look into Tree DnD problem.
Comment 4 Lorenzo Bettini CLA 2016-10-04 07:27:58 EDT
I forgot to add that I think it's not strictly related to HiDPI, but only to scaling factor, thus it should be reproducible also on a non HiDPI display, as long as you change the scaling factor...
Comment 5 Eclipse Genie CLA 2016-10-17 09:12:48 EDT
New Gerrit change created: https://git.eclipse.org/r/83336
Comment 6 Niraj Modi CLA 2016-10-18 05:23:56 EDT
(In reply to Eclipse Genie from comment #5)
> New Gerrit change created: https://git.eclipse.org/r/83336

Apart from Tree, similar problem exits in Table code as well, fixed by above patch.
Comment 8 Lorenzo Bettini CLA 2016-10-18 05:27:26 EDT
(In reply to Niraj Modi from comment #6)
> (In reply to Eclipse Genie from comment #5)
> > New Gerrit change created: https://git.eclipse.org/r/83336
> 
> Apart from Tree, similar problem exits in Table code as well, fixed by above
> patch.

Thanks!
Will this fix be available in the next integration builds?
Comment 9 Niraj Modi CLA 2016-10-18 06:16:11 EDT
(In reply to Lorenzo Bettini from comment #8)
> (In reply to Niraj Modi from comment #6)
> > (In reply to Eclipse Genie from comment #5)
> > > New Gerrit change created: https://git.eclipse.org/r/83336
> > 
> > Apart from Tree, similar problem exits in Table code as well, fixed by above
> > patch.
> 
> Thanks!
> Will this fix be available in the next integration builds?

Yes, next integration build will be later today.
Comment 10 Niraj Modi CLA 2016-10-21 07:14:17 EDT
Verified the fix in Eclipse Build id: I20161018-0800
DnD problem for Tree is completely fixed.

But DnD only works partially for CTabFolder view/editor at HiDPI settings on Linux. What works:
- Try to DnD a CTabFolder view/editor from upper part of the CTab Header area it works otherwise it doesn't.

Possible reason for above DnD issue in CTabFolder on Linux(also seen on non-HiDPI settings) is mouse enter is slightly miss-placed by few pixels:
- CTabFolder view doesn't gets selected if you mouse-enter from bottom of the header, it gets selected only after you move in few pixels.
- Similarly, when you try to mouse-enter from top of the header and even before you actually enter the CTab header area the mouse-hover selection is enabled.

Will resolve this bug now and created a separate bug 506326 for CTabFolder investigation.
Comment 11 Niraj Modi CLA 2016-10-25 07:56:15 EDT
Verified the fix in Eclipse Build id: I20161018-0800 on Ubuntu 16.04
Comment 12 Mohammad Alhashash CLA 2016-11-04 13:40:54 EDT
Still not fixed in Oxygen M3. Dragging tab does not work properly. Either the wrong tab get moved or none.
Comment 13 Niraj Modi CLA 2016-11-07 01:01:42 EST
(In reply to Mohammad Alhashash from comment #12)
> Still not fixed in Oxygen M3. Dragging tab does not work properly. Either
> the wrong tab get moved or none.

Please Note: created a separate bug 506326 for CTabFolder investigation.
Comment 14 Niraj Modi CLA 2016-11-08 02:24:21 EST
Targeting for 4.6.2
Comment 16 Niraj Modi CLA 2016-11-17 07:03:00 EST
Verified the Tree DND fix in 4.6.2 MBuild: M20161116-1100 on Ubuntu16.04
Comment 17 Janis Danisevskis CLA 2017-08-01 19:33:30 EDT
I am experiencing the same issue on Linux Ubuntu 14.04 with scaling factor of 2. Possible regression?

Version: Neon.3 Release (4.6.3)
Build id: 20170314-1500
Comment 18 Ahmed Cevizci CLA 2017-10-17 10:16:13 EDT
I have the same issue with Eclipse Oxygen 1a, Antergos (Arch) Gnome 3.26. I have UHD 4K monitor (Dell XPS 15) and scaling set to 2. I have tried using Wayland and Xorg, unfortunately issue didn't get resolved.
Comment 19 Ioannis Papaioannou CLA 2017-12-11 17:12:57 EST
Experiencing the same (or very similar) issue in Ubuntu 17.10, Gnome 3.26, with either Wayland or Xorg in HiDPI (4k) with scaling factor 2. The SWT_GTK3 value doesn't seem to matter.

Symptoms:
1) Sometimes I can drag a view to another location, but all the views from the same panel move together, messing up completely the perspective setup.

2) Sometimes I can drag a view/editor in the same panel, trying to reorder them, but the wrong view is moved, resulting in an unpredictable order.

3) Most often, the Tab title is underlined but the mouse icon is unchanged and no drop squares appear. When letting the mouse button nothing happens, everything stays where it is.

4) Rarely, the location squares appear fine and the mouse changes to a hand a the view moves where I want it to move and everything else stays where it is (ie. rarely, it works fine).

Exactly the same behaviour with (and Neon in the past):
   Version: Photon Milestone 3 (4.8.0M3)
   Build id: 20171102-1036

   Version: Oxygen.1a Release (4.7.1a)
   Build id: 20171005-1200

Same eclipse versions in another system (Fedora27) with HD resolution (1920x1080), work fine.