eclipse.platform.swt
eclipse.platform.swt copied to clipboard
[GTK] Get rid of SWT use of $HOME/.swt/trims.prefs
While investigating https://github.com/eclipse-platform/eclipse.platform.swt/issues/1161 and the fix, we've noticed (once again) that SWT does some really unexpected things - in this case it always reads/writes $HOME/.swt/trims.prefs file.
https://github.com/eclipse-platform/eclipse.platform.swt/blob/5b437ee2bd8cdda7083a9f2ceeadb172a583ed37/bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Display.java#L551
https://github.com/eclipse-platform/eclipse.platform.swt/blob/5b437ee2bd8cdda7083a9f2ceeadb172a583ed37/bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Display.java#L4855
This was introduced via 1efa844f5448fd981224ed57c5cc069ec4754711 to fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=445900.
There are few issues with this approach because the value is not versioned/annotated in any way so we will have issues with:
- users changing their desktops (KDE -> Gnome etc)
- users changing the window managers
- users changing visuals / GTK themes
- users changing GTK / OS versions
This above can easily happen if users are working in a multi - OS environment, running VNC sessions connected to different hosts but using same account.
Just using some values written by an unknown SWT application at unknown point in time with unknown desktop/window manager from unknown OS seem to be totally wrong.
The code was written for GTK2, we should see if we can get rid of reading/writing to $HOME/.swt/trims.prefs on GTK3 and cleanup code around it.
Conments / help is welcome.
@SyntevoAlex : is this interesting for you may be?
I investigated it for a while, but it wasn't trivial, and I was told to forget it, because the problem isn't so important. See #568
Oh so your project is the culprit for $HOME/.swt/trims.prefs...
Aren't you also responsible for $HOME/.eclipse?
Please refrain from making any folders or directories directly in the home. I am obsessively trying to reduce creation of new stuff in unexpected places as my home is version controlled and I do not want application clutter interfering with navigation through important files I have there. There are appropriate places to put this kind of files as specified by XDG Base Directory Specification
I have just found this in my home dir and had to look up what it is. I assume it is fine to delete it?
While I am here, looks like we have: eclipse-workspace, .eclipse, .p2 and.swt in the home dir.