| Summary: | SWT/AWT Bridge : Problems with drop target on EditorPart using bridge (Linux Only) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Tom Porcaro <tporcaro> | ||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | bsd, ericwill, gsmith, joekhan10, ncasas, nicolas.richeton, snorthov, yves.pasche | ||||||
| Version: | 3.1.2 | Keywords: | triaged | ||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux-GTK | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
Tom Porcaro
This still happens in the latest. SSQ, a snippet is attached in the next comment. Just drag from somewhere (eg.- an eclipse navigator) into the visible editor, and you'll see that all "drop" messages get written to editor #1 regardless of whether editor #1 or #2 is visible. Created attachment 41772 [details]
snippet
Seems like a problem in the AWT code. Did anyone enter a bug report against them? This bug has been accepted by Sun. You can monitor the bug on the Java Bug Database at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6640765 Please vote for it! :-) The example in attachment 41772 [details] now seems to work properly on JDK 7 -- at least, I see the dropped text appearing in the correct editor. But I see the original problem in my app using SWT_AWT.
I have provided a workable solution where I'm working right now. This Linux bug only happens when editors are stacking in CTabFolder, the drop target is always the editor which was opened first and not the one which is on the top (selected in CTabFolder). Everything is fine if editors are not stacking together.
The solution is to use java reflection to remove dropTarget if an editor is not on the top of the stacking group of editors(grouped by cTabFolder).
I'm not extending XEmbeddedFramePeer or XEmbeddedFrame, because that's not a simple change maintainability wise, instead achieving the same purpose via reflection. This workaround also takes care of the inconsistent drop target count in the Window peer class.
To use this solution
(1)modify your plugin.xml
<extension
point="org.eclipse.ui.startup">
<startup class="com.lgc.dsp.ui.swtbridge.util.LinuxDndControllerStartup"></startup>
</extension>
(2)whenever you create an embedded swing component use LinuxDndCopntroller#register
Created attachment 237878 [details]
source attachement
source code for the solution I was talking about in my last comment.
Problem still exists in Eclipse Neon + jdk 7/8 We have to remove our Part from the part stack which contains other parts using SWT_AWT bridge to make DND work. Putting back the pack in the stack disables DND. Still reproducible with SWT master from today, GTK3.24, and Fedora 29. 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. |