|
Description
Alexander Kurtakov
Reimplementing around GdkAtom and gdk_property_change looks promising path. New Gerrit change created: https://git.eclipse.org/r/113159 Heh, and now gdk_property* and gdk_atom* APIs are gone for gtk4 so we should think of some forward viable solution. See https://git.gnome.org/browse/gtk+/commit/?id=f2bb2024c87dae1ce655154fb5bea0eb07cef48c Based on comment 3 the approach taken is not viable. So here is a new proposal how to do it: * SWT registers dbus interface on the session bus (if not registered already) - smth like org.eclipse.swt with single method openFile taking file name as a parameter. When it receives such a message it fires SWT.OpenDocument event. This could be done first and independently of launcher changes and easily tested with smth like d-feet. Ideally the dbus interface registration should happen in separate thread to not slow down swt startup. * Launcher if passed openFile checks whether the interface exists and if does calls it. If not it should give time of SWT to initialize and calls the method. If it's possible to listen for interface creation somehow (to not do polling) that should be preferred otherwise some timeout period like the one in the launcher currently should be used. What I like about this proposal is that it will open the possibility for opening files to be delivered by other means not just launcher but anything that does dbus. Created attachment 271968 [details]
Proof of concept: Open file from command line via gdbus.
With some hacks, as proof of concept, I can open a file (/tmp/test) from the command line via gdbus call and it opens in Eclipse.
The full implementation however will take me a 1-3 weeks probably as I have to do some research and move a fair bit of code around.
But tentativley, looks doable.
New Gerrit change created: https://git.eclipse.org/r/114519 One thing that I was concerned about is that if it's permissible for one application to have multiple gdbus names. (One for webextension, which needs to be unique, and one that is well-known and always the same for opening files). I've just tried it with a proof-of-concept, it works: https://git.eclipse.org/r/#/c/114519/ So I'll work on implementing a general purpose GDBus interface now for fileOpen mechanism. New Gerrit change created: https://git.eclipse.org/r/114524 Need to move GDBus native calls out of Webkit into common code. Reason: GDBus can be used without webkit being initialized. -> Bug 529151 (In reply to Leo Ufimtsev from comment #10) > Need to move GDBus native calls out of Webkit into common code. > Reason: GDBus can be used without webkit being initialized. > -> Bug 529151 It's an actual bug that the gdbus bindings are not in OS. As GTK 2.24 requires glib 2.28+ there is no need for these g_* bindinds to be dynamic so this bug is not really a dependency AFAICT and the binding can be moved directly. (In reply to Alexander Kurtakov from comment #11) > (In reply to Leo Ufimtsev from comment #10) > > Need to move GDBus native calls out of Webkit into common code. > > Reason: GDBus can be used without webkit being initialized. > > -> Bug 529151 > > It's an actual bug that the gdbus bindings are not in OS. As GTK 2.24 > requires glib 2.28+ there is no need for these g_* bindinds to be dynamic so > this bug is not really a dependency AFAICT and the binding can be moved > directly. It would be time consuming to move things to OS.java and then to GTK.java. (In reply to Leo Ufimtsev from comment #12) > (In reply to Alexander Kurtakov from comment #11) > > (In reply to Leo Ufimtsev from comment #10) > > > Need to move GDBus native calls out of Webkit into common code. > > > Reason: GDBus can be used without webkit being initialized. > > > -> Bug 529151 > > > > It's an actual bug that the gdbus bindings are not in OS. As GTK 2.24 > > requires glib 2.28+ there is no need for these g_* bindinds to be dynamic so > > this bug is not really a dependency AFAICT and the binding can be moved > > directly. > > It would be time consuming to move things to OS.java and then to GTK.java. As long as there is a crasher and unsolved question(verifying lib*.so loading) for moving to GTK.java I would go with time consuming and not crashing app. (In reply to Alexander Kurtakov from comment #13) > (In reply to Leo Ufimtsev from comment #12) > > (In reply to Alexander Kurtakov from comment #11) > > > (In reply to Leo Ufimtsev from comment #10) > > > > Need to move GDBus native calls out of Webkit into common code. > > > > Reason: GDBus can be used without webkit being initialized. > > > > -> Bug 529151 > > > > > > It's an actual bug that the gdbus bindings are not in OS. As GTK 2.24 > > > requires glib 2.28+ there is no need for these g_* bindinds to be dynamic so > > > this bug is not really a dependency AFAICT and the binding can be moved > > > directly. > > > > It would be time consuming to move things to OS.java and then to GTK.java. > > As long as there is a crasher and unsolved question(verifying lib*.so > loading) for moving to GTK.java I would go with time consuming and not > crashing app. Yes, I agree, fixing crasher is top priority. I think if there is time I can make the gdbus calls static afterwards. For now the fastest thing to do is just leave them dynamic and move them over. See WIP: https://git.eclipse.org/r/#/c/114524/ It depends on the previous two patches to be merged first. New Gerrit change created: https://git.eclipse.org/r/115203 Gerrit change https://git.eclipse.org/r/114524 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=70bc724bdc4e8386426bb111135ed74b336c4fae New Gerrit change created: https://git.eclipse.org/r/115336 *** Bug 316821 has been marked as a duplicate of this bug. *** Gerrit change https://git.eclipse.org/r/115336 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d20833d611fabe3f4a3379e7f84c5548311c7aa2 New Gerrit change created: https://git.eclipse.org/r/115481 Gerrit change https://git.eclipse.org/r/115481 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=c335e1d1f3363d6b3668013e0b9897acb09559d1 Gerrit change https://git.eclipse.org/r/115203 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=5282e51a49c640f347e112faa9b2305ff5ed4111 Verified GDBus implementation with /I20180119-0110/ on Fedora27 (gtk3.22) and RHEL 7.4 (gtk3.22). 1) Open file when eclipse is already running: ./eclipse .... ./eclipse testFile 2) Open eclipse with file. ./eclipse testFile Also tested on Gtk.2.24.31 (with SWT_GTK3=0). Works on gtk2 as well. Works well. There is a still a bit of clean-up work to do on this bug, but major functionality is in place. Fixed and verified with today's build on Gtk3.22, Cocoa, Win10. Build #339 (Jan 23, 2018 10:14:17 AM) *** Bug 441818 has been marked as a duplicate of this bug. *** |