I'm trying to port my application on SWT to Ubuntu , and I ran into a problem with the so-called. "overlay scrollbars" . When the program runs from under Eclipse , everything is fine, but when it starts from the JAR , the scrollbars become "overlay scrollbars" - they turn into thin orange bars. At the same time, the events from the scrollbars also change (apparently, some other values in stateMask or in detail ), and the program stops processing them (ignores). For my program, such scrollbars are absolutely not suitable (even if I figured out the events), I need traditional scrollbars and I need to handle their events in a special way.
It is easy to correct this behavior - it’s enough to add export LIBOVERLAY_SCROLLBAR=0 to ~/.profile , but this is not a good option - I need to let any user start the program by simply sticking the JAR file without needing any special settings on the system , so I'm looking for a way to do the same from my code. I am new to Linux programming, and apparently I don’t understand how to solve such problems programmatically. Tried to run SWT before loading
System.setProperty("LIBOVERLAY_SCROLLBAR", "0"); and
new ProcessBuilder("export LIBOVERLAY_SCROLLBAR=0").start(); but neither one nor the other does not. In this case, setting the variable SWT_GTK3=0 in this way
System.setProperty("SWT_GTK3","0"); obviously triggered, i.e. gives the expected effect. Perhaps the fact is that LIBOVERLAY_SCROLLBAR works only when the user logs in, and SWT_GTK3 - at any time, if only it was already installed by the time SWT was loaded.
How can I overcome these "overlay scrollbars" from the program code? PS Working solutions for other languages may help to find a solution for JAVA as well - the problem is not JAVA-specific.