SikuliX1
SikuliX1 copied to clipboard
Linux: Lubuntu 18: highlight rectangle is black - should be transparent
noticed that in the old versions highlight rectangle was 100% transparent, but now on Windows 10 and Ubuntu 18 rectangle has red-ish filling. I believe this is the reason on Lubuntu18 highlight is showing as a black rectangle. I know that this is not a critical problem and I can use Ubuntu, but reason for me to use Lubuntu is that it is very light on system resources in comparison with Ubuntu. So is there a way to configure Sikuli 2.0 to use the old way of highlighting?
This is also happening for me in Windows 10 with version 2.0.1 We use SikuliX for demo automation and screen recording. The red-ish background is a no-go for us at the moment.
@MiguelDomingues
What exactlyx do you mean by This is also happening for me in Windows 10
?
Sorry for not being specific. What I have is this "noticed that in the old versions highlight rectangle was 100% transparent, but now on Windows 10 and Ubuntu 18 rectangle has red-ish filling"
See picture below:
The script is this
pattern = find(Pattern("1575322297453.png").similar(0.70))
pattern.highlightOn()
wait(2)
pattern.highlightOff()
I just tested this with the master branch code.
I did a bit of digging, and submitted a Pull Request: https://github.com/RaiMan/SikuliX1/pull/250 That fixed for me.
@MiguelDomingues As mentioned with the PR: not the colored fill-in is the original problem, but the solid black background only on Lubuntu.
I asked the original complainant on Launchpad, to test the new feature (switch off color fill-in): https://github.com/RaiMan/SikuliX1/commit/0e5a5786d7a5ee134586da9a5957928c0018902f
I done the test on build 466 from 5 Dec 2019
Settings.HighlightTransparent=True
find(someimage.jpg).highlight(2)
On Windows10: PASS - highlight box is 100% transparent On Lubuntu18: FAIL - highlight box is still black
Note: I noticed that default value of Settings.HighlightTransparen is False for Windows and True for Lubuntu
In version 1.1.4 I had a different behavior. In that version the background was always transparent. That's why I believed it was a bug. I was unaware of that setting also.
@ndinev
thanks for the feedback.
So it seems the reddish fill-in is not the problem (but the intended new behaviour ;-).
I will go back and use the complete implementation of 1.1.4 in case of Settings.HighlightTransparent=true
I will report here, when it is ready to test.
Since I am testing new Sikuli 2.04 on different OSes I found what is causing this problem. It happens on system that does not have enabled/installed composition manager. It can be easily reproduced-fixed on latest Lubuntu 20 LTS. You just need to go to Preferences->LXQt Settings->Session settings. In the Basic settings you can see that Compton(Composition manager) is off by default. If you turn it on Sikuli highlight will work as expected. However the UI will become slower and this is not desirable. Despite this findings I believe that highlight should be able to work without the need of heavy composition manager because this will require more resources for test machines.
@ndinev
Is this also the case, if you have
Settings.HighlightTransparent=true
???
which will only put a simple bordered JFrame with transparent background on the screen.
IMHO there is no simpler solution at the Java level (system independent) .
On Ubuntu 20.04 LTS, I can confirm that using
Settings.HighlightTransparent = True
somewhere in a script with SikluliX 2.04, does render the highlight as an outline only, and removes the black fill bug.
To keep the gradient fill on Linux, you must set Settings.HighlightTransparent
to False
once, and then set it to True
again, which should remove the black fill bug. This does not seem to be affected by Compton (at least, not consistently anyways).