This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 346009 - [DND] [Compatibility] Can't DND editors to an editor area in another window
Summary: [DND] [Compatibility] Can't DND editors to an editor area in another window
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 384308 (view as bug list)
Depends on:
Blocks: 445305 461180
  Show dependency tree
 
Reported: 2011-05-16 17:45 EDT by Brian de Alwis CLA
Modified: 2021-05-26 16:01 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2011-05-16 17:45:48 EDT
Bug 123620 introduced support for dragging editors between windows.  This functionality no longer seems to work.  

On the bright side, you can drag an editor as a detached window, which is pretty good too.
Comment 1 Konstantin Komissarchik CLA 2011-09-02 21:31:09 EDT
Saw this on Eclipse 4.2 M1 on Windows 7 as well. Adjusting the bug accordingly.
Comment 2 Eric Moffatt CLA 2011-10-11 15:44:37 EDT
Yep, I need to adjust the DnDAddon to accommodate this behavior...
Comment 3 Jan-Raphael Chua CLA 2013-05-02 22:35:38 EDT
Hi, everyone. I tried out Eclipse 4.3 M6 for Linux and still managed to observe the behaviour. Heard that this bug was going to be address in version 4.3, so I had to try it out purely out of excitement.

It'd be great though if this functionality was restored back into the software
Comment 4 Eric Moffatt CLA 2013-05-03 14:06:01 EDT
I just took a look into this and while it's fairly simple to implement the DnD behavior (just make the check in DnDInfo's 'getModelElement' check that it's the same *app* rather than the same top level window) there are are few subtle details to be worked out.

1) In order to avoid confusion we should be limiting this to 'editors' only. Otherwise you can make strange perspectives that, for example, have two Outline views...this is likely doable without too much difficulty.

2) We'd need to trap and adjust the EditorRef for the editor that's been moved since moving it from one window to another means that it has effectively changed form one WorkbenchPage to a different one. This is a bit more problematic, we're already looking into this code however since we have other defects relating specifically to EditorReference management, perhaps we can blend the logic required for this defect into the fix for that one...
Comment 5 Jan-Raphael Chua CLA 2013-05-13 22:48:28 EDT
I see thanks for taking a look at it. Hope the feature returns soon. At any rate, I'll just go back to 3.8.2 for the meantime as I frequently drag around open editors in one window to another
Comment 6 Eric Moffatt CLA 2013-11-27 13:32:30 EST
I've pushed the following to Gerrit:

  https://git.eclipse.org/r/18991

This is a change set against R4_3_maintenance...
Comment 7 Eric Moffatt CLA 2013-11-27 14:15:06 EST
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=92735f56139b74c532931eb26ab6a98017a1aec9

This is a good first cut but there are two remaining corner cases:

1) Our current drag strategy is to drag the whole stack if the element being dragged is the only visible element and it's *not* the last editor stack. This means that dragging the only editor from a stack in the *split* editor doesn't work. Should be easy to fix by never dragging the while stack if the initial element is an MPart rather than a MPlaceholder.

2) Dragging the editor to the new window doesn't fix up the EditorRef's of the two WorkbenchPages. We expect this to be managed by a new approach to handling both view / editor refs by listening to model additions / removals.
Comment 8 Eric Moffatt CLA 2013-11-27 14:27:39 EST
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=76c0a2c25682ae4da4c19146309faff7c8c80440

Which fixes corner case 1) from above
Comment 9 Eric Moffatt CLA 2013-11-27 14:40:59 EST
BTW, we likely won't be able to back port this whole fix but at least the change in the DnDManager should go back to 4.3.2 since it's likely broken in multi-window cases...
Comment 10 Eric Moffatt CLA 2013-12-10 15:37:41 EST
M4 is done...
Comment 11 Eric Moffatt CLA 2014-02-18 15:26:13 EST
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=57da556a74d6ef26a492a5e92ab61ef0e9ab2b63

This fixes scenario 2) by adding a listener in the workbench page that detects new parts being added and ensuring that any ones with EditorReferences get their page updated...
Comment 12 Eric Moffatt CLA 2014-02-18 15:26:54 EST
Marking FIXED...
Comment 13 Eric Moffatt CLA 2014-03-04 14:36:22 EST
Verified in 4.4.0.I20140303-2000.
Comment 14 Dani Megert CLA 2015-05-12 10:27:20 EDT
This feature got pulled out due to too many issues. See bug 445305 and duplicates.
Comment 15 Dani Megert CLA 2015-05-12 10:28:49 EDT
(In reply to Dani Megert from comment #14)
> This feature got pulled out due to too many issues. See bug 445305 and
> duplicates.

Reverting the following commit will enable it again:
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b29fc6b1033e97e1d7babe4e5b917106f1c17b8c
Comment 16 Lars Vogel CLA 2016-04-20 12:15:06 EDT
Mass move to 4.7 as M7 is approaching. Please move back in case you are planning to fix it for Neon.
Comment 17 Rolf Theunissen CLA 2019-06-02 16:29:07 EDT
Bug 445305 suggests that the editor has a incorrect parent (shell), but that is not the case.

At least the following issues exist:
1. CompatibilityPart does not emit firePartClosed when the editor is moved. This is fixable by also listening to UIEvents.UIElement.TOPIC_PARENT
2. KeyBindingService#registerAction adds a LegacyHandlerSubmissionExpression which binds the keys to the current shell. All key bindings will not work if the editor is moved to another another window. Setting shell to 'null' makes key binding work in the Java editor. The Manifest editor remains broken probably caused by a WorkbenchWindowExpression.
Comment 18 Rolf Theunissen CLA 2019-06-02 16:33:45 EDT
*** Bug 384308 has been marked as a duplicate of this bug. ***
Comment 19 Rolf Theunissen CLA 2019-06-05 15:30:05 EDT
More issues:

3. ActionBars are hard wired to the window in which an editor is opened, they are not moved to the other window when an editor is moved.
4. Anything implementing the IPartListener cannot be notified that a part is hidden in the current window. It might be needed to send partClosed events if a part is hidden. Related to issue 1.

The easiest work-around is to close the editor in the first window and re-create it in the second window. This means that dirty editors cannot be moved.
This can be realized by calling EPartService#hidePart, EPartService#showPart in StackDropAgent.
Comment 20 Eclipse Genie CLA 2021-05-26 03:59:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 21 Arend v. Reinersdorff CLA 2021-05-26 16:01:56 EDT
Bug still occurs. Still very annoying with multiple Eclipse windows.