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.
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:
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.