Bug 566559 - Invisible tab after drag and drop the window
Summary: Invisible tab after drag and drop the window
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.18 RC1   Edit
Assignee: Rolf Theunissen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-01 09:58 EDT by Lap Lau CLA
Modified: 2020-12-14 06:39 EST (History)
3 users (show)

See Also:
Lars.Vogel: pmc_approved+


Attachments
show the drop areas of e3 vs e4 (522.35 KB, application/pdf)
2020-09-01 09:58 EDT, Lap Lau CLA
no flags Details
The tab was re-docked successfully from outside window. (17.93 KB, image/png)
2020-09-01 12:05 EDT, Lap Lau CLA
no flags Details
workbench - before (386.66 KB, application/octet-stream)
2020-09-14 17:11 EDT, Lap Lau CLA
no flags Details
workbench - after application exit (100.96 KB, application/octet-stream)
2020-09-14 17:12 EDT, Lap Lau CLA
no flags Details
pic no. 1 (57.10 KB, image/png)
2020-09-17 13:37 EDT, Lap Lau CLA
no flags Details
pic no. 2 (85.85 KB, image/png)
2020-09-17 13:38 EDT, Lap Lau CLA
no flags Details
pic no. 3 (1.06 MB, image/jpeg)
2020-09-17 13:38 EDT, Lap Lau CLA
no flags Details
pic no. 4 (1.08 MB, image/jpeg)
2020-09-17 13:39 EDT, Lap Lau CLA
no flags Details
pic no. 5 (856.41 KB, image/jpeg)
2020-09-17 13:39 EDT, Lap Lau CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lap Lau CLA 2020-09-01 09:58:38 EDT
Created attachment 284012 [details]
show the drop areas of e3 vs e4

We are upgrading our application from e3 to e4 (4.15). Our current application creates tabs inside the application main area. A problem occurs when there is only one tab.  We can drag the tab outside the main application and turn into a standalone window. We can drag and drop the same window back the main application area and turn back to a tab.

However, we have an issue after upgraded to e4.15. When we try to redock the window back to the main application area, we can only drop it on the right, top or the bottom of the main application area. Once we drop the window, the tab is active but invisible. Any additional new tabs are not visible until all open tabs are closed first.

The behaviors of e3 and e4 are different.  When I drop the window in e3, it offers one choice which is the main area of the application.  However, the application running with e4 offers two areas (large and small).  I can only allow to drop on the smaller area.  I speculate the smaller drop area is the minimize view.

I attached 4 screenshots.  One for e3 (one drop area), and three for e4 (two drop areas).
Comment 1 Rolf Theunissen CLA 2020-09-01 11:29:45 EDT
I see similar behavior in the Eclipse IDE. 
- Dragged an editor out of the main window
- Ensure that no other editors are open
- Drag the editor back into the main window
Observer that the editor can only be dropped on the tabs of the area. If the editor is dropped in the main area, the area will be split. Resulting in an empty area and a new stack with the editor.

I assume that you are using an Area for the main part of your application. Is that true? I see green borders in your screenshots, are you using the control key while dragging? That might things even worse.
Comment 2 Lap Lau CLA 2020-09-01 12:03:49 EDT
Rolf, what you described was actually what I saw in e4.15 IDE.  I don't understand why the IDE offered two drop areas on an empty editor.  The IDE should let me drop the outside window to fully occupy the entire editor area.

I did not use any keys from the keyboard to perform the window drop.
Comment 3 Lap Lau CLA 2020-09-01 12:05:17 EDT
Created attachment 284015 [details]
The tab was re-docked successfully from outside window.
Comment 4 Lap Lau CLA 2020-09-01 12:05:41 EDT
I attached a picture on a successful re-docking in e3.
Comment 5 Lap Lau CLA 2020-09-01 12:56:35 EDT
"I assume that you are using an Area for the main part of your application. Is that true?" That is correct.  Please see the png image.
Comment 6 Rolf Theunissen CLA 2020-09-03 10:19:13 EDT
The behavior is caused by StackDropAgent and SplitDropAgent2 in the DnDAddon/DnDManager. The StackDropAgent is only used when dropping a part on the tab-bar of the stack. The SplitDropAgent2 is used when dropping in the control-area of the tabfolder.

Not only when the area is empty this results in undesired behavior. Also when there are already editors in the area and a editor is dragged in, a new partstack outside the area is created. This is inconsistent with when a editor is dragged out of the area, then a partstack is created inside the area.

You might consider to have a custom DnDAddon in your RPC that has different behavior, e.g. doesn't include the SplitDropAgent2 and has an StackDropAgent that always drops in the stack.
Comment 7 Lap Lau CLA 2020-09-03 11:50:12 EDT
Rolf, thank you for looking into the problem.  Will this issue be fixed?  If so, what version of Eclipse will be in?
Comment 8 Rolf Theunissen CLA 2020-09-04 03:29:21 EDT
(In reply to Lap Lau from comment #7)
> Rolf, thank you for looking into the problem.  Will this issue be fixed?  If
> so, what version of Eclipse will be in?

I am looking into the issue, at least I try to make the Eclipse IDE behavior more consistent. I learned now that you need to hold CTRL to drag an element into the area, otherwise it will be outside. This behavior I will not change. I will change that in case you drag in and there is no editor, the area will not be split. That would be part of eclipse 4.18.

I expect that this is not completely covering your use-case. That is, you want to drag in without holding the CTRL modifier, that behavior I am not going to change.
Comment 9 Rolf Theunissen CLA 2020-09-12 06:18:35 EDT
Been looking to make the dropping more consistent, however I still have some questions to further analyze what is going on in your case. That is, I am not sure that I am indeed solving your issue.
- do you see any errors in the log file? (<workspace>/.log), i.e. I expect a Error in the drop code.
- Does the drop feedback disappear after you dropped? i.e. do the green lines disappear?
- Could you provide a minimal example in which the issue can be reproduced? If not, could you attach the workbench.xmi file (after auto-save or after closing the app), before and after you dropped the item?
Comment 10 Lap Lau CLA 2020-09-14 17:11:13 EDT
Created attachment 284127 [details]
workbench - before
Comment 11 Lap Lau CLA 2020-09-14 17:12:06 EDT
Created attachment 284128 [details]
workbench - after application exit
Comment 12 Lap Lau CLA 2020-09-14 17:12:30 EDT
- Our application did not hit any error after the drag/drop.  Here is the .log file:

!SESSION 2020-09-14 15:47:07.388 -----------------------------------------------
eclipse.buildId=unknown
java.fullversion=8.0.6.6 - pwa6480sr6fp6-20200303_01(SR6 FP6)
JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20200124_438197 (JIT enabled, AOT enabled)
OpenJ9   - 6754bf2
OMR      - dca2cde
IBM      - 5cc5f54
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product com.ibm.tpf.tos64.console
Command-line arguments:  -product com.ibm.tpf.tos64.console -data C:\Users\GarrettHalstein\tos 082020/../runtime-TOSConsole64.product(1) -dev file:C:/Users/GarrettHalstein/tos 082020/.metadata/.plugins/org.eclipse.pde.core/TOSConsole64.product (1)/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog
!ENTRY org.eclipse.core.jobs 2 2 2020-09-14 15:47:21.880
!MESSAGE Job found still running after platform shutdown.  Jobs should be canceled by the plugin that scheduled them during shutdown: com.ibm.tpf.tos.ConsoleSession$19


- If the green lines represent the drop feedback, once I dragged the outside window into the main application area, there was no green line or any lines.  The cursor changed to forbidden (red circle with a diagram line across).  I moved close to the left, right or bottom, it allowed me to drop (cursor turned to a right hand with thumb/index finger out).  Once I dropped the window on the edge of the main application area, the window was invisible.

- I uploaded the workbench.xml before/after.
Comment 13 Lap Lau CLA 2020-09-17 13:36:51 EDT
This problem can be recreated in the Eclipse v4.15 IDE.

1. Minimize all the opening tabs except one.
2. Put all the minimize bars on the left side (see pic No. 1)
3. Drag and drop the only open tab outside the Eclipse IDE and create a separated window (see pic No. 2).  The IDE main area is empty.
4. Drag and drop the outside window back to the main area.
5. Putting the mouse cursor in the middle of the IDE is forbidden (see pic no. 3)
6. Moving the mouse cursor close to the right side is allowed (see pic no. 4)
7. After dropping the window, the tab is gone (see pic no. 5)
Comment 14 Lap Lau CLA 2020-09-17 13:37:44 EDT
Created attachment 284158 [details]
pic no. 1
Comment 15 Lap Lau CLA 2020-09-17 13:38:17 EDT
Created attachment 284159 [details]
pic no. 2
Comment 16 Lap Lau CLA 2020-09-17 13:38:47 EDT
Created attachment 284160 [details]
pic no. 3
Comment 17 Lap Lau CLA 2020-09-17 13:39:24 EDT
Created attachment 284161 [details]
pic no. 4
Comment 18 Lap Lau CLA 2020-09-17 13:39:53 EDT
Created attachment 284162 [details]
pic no. 5
Comment 19 Lap Lau CLA 2020-10-14 10:18:07 EDT
Hi, any updates?
Comment 20 Eclipse Genie CLA 2020-11-15 13:53:39 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/172269
Comment 21 Rolf Theunissen CLA 2020-11-15 13:58:26 EST
Thanks for the reproducer case, that made it easier to debug.

All the comments on incorrect location of the dropped parts is a unrelated bug.

The real issue was that the newly dropped part was still attached to the invisible limbo-shell. The parent composite needs to be set explicitly in the SashRenderer, see the Gerrit.
Comment 22 Lap Lau CLA 2020-11-24 13:30:31 EST
Thank you for the update.  Sounds like the fix is in the Eclipse 4.18.0 Integration Build: I20201124-0600?  If so, we can verify the fix.
Comment 24 Lap Lau CLA 2020-12-03 11:10:59 EST
The testcase for the Eclipse IDE is fixed.  The fix does not address all the issue, we still lose a tab in our application.  I investigate and try to provide for information soon.
Comment 25 Niraj Modi CLA 2020-12-07 04:10:45 EST
Mass move out of 4.18
Comment 26 Lap Lau CLA 2020-12-08 11:26:59 EST
We can not recreate this invisible tab issue in the v4.18 because we can not remove all the windows in the IDE.  The "shared area" (this panel only has min/restore button, no close button) is always in the main IDE, drag and drop will always work. 

However, when we drag and drop the only tab outside our application, the our main application area is empty (no toolbar, min view bar, no "shared area
").  Dragging/dropping the tab in/out a few times and the tab will be invisible.

I need this fix, so this fix should not be held up.  I will open a separated bug.
Comment 27 Eclipse Genie CLA 2020-12-09 15:48:26 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/173628