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

Bug 316821

Summary: GTK File Open Atom can be lost to second eclipse
Product: [Eclipse Project] Platform Reporter: Andrew Niefer <aniefer>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, jed, pwebster, remy.suen, rjenster, Silenio_Quarti, tjwatson
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Andrew Niefer CLA 2010-06-14 16:07:06 EDT
To support opening files from the command line on gtk, SWT attaches a "SWT_Window_ + APP_NAME" atom to a hidden window and listens for the
"org.eclipse.swt.filePath.message" property.

If a second eclipse instance is started, this second instance "steals" the atom from the previously running eclipse.  Then, if that second instance is closed, there is no loner any window with the "SWT_Window + APP_NAME" atom attached to it.

Launching a self-hosted eclipse session will cause this, and once that debug session is terminated, any future open file attempts will result in a new eclipse instance instead of reusing the original eclipse.

I would suggest that we should first check to see if there is any existing window with the atom, and if so, leave it and not set the atom on our own shell.  This means the first eclipse always keeps receive the open file messages regardless of other instances starting and stopping.
Comment 1 Andrew Niefer CLA 2010-06-14 16:07:52 EDT
Created attachment 171870 [details]
proposed patch
Comment 2 Oleg Besedin CLA 2010-09-27 13:32:19 EDT
*** Bug 326262 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Niefer CLA 2011-04-25 11:23:07 EDT
*** Bug 343664 has been marked as a duplicate of this bug. ***
Comment 4 Alexander Kurtakov CLA 2018-01-16 02:23:05 EST
X atoms are no longer suitable. Migration to dbus is ongoing and dbus ownership is passed back to the previous window.

*** This bug has been marked as a duplicate of bug 528414 ***