[Sikuli-driver] [Question #682295]: Status of bug #1840689 changed to 'Confirmed' in SikuliX

2021-08-25 Thread RaiMan
Bug #1840689 status changed in SikuliX:

In Progress => Confirmed

https://bugs.launchpad.net/sikuli/+bug/1840689
"[1.1.4] macOS: Java 9+: multi-monitor with 1st Retina and 2nd non-Retina does 
not work --- workaround: use Java 8"

This bug is linked to #682295.
[1.1.4] macOS 10.14.5 - Taking a screenshot with SikuliIDE on an external 
monitor with a Retina primary display
https://answers.launchpad.net/sikuli/+question/682295

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698511]: Capture/find Sikuli API fails with one Retina screen and one non-Retina screen

2021-08-25 Thread RaiMan
Question #698511 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698511

Description changed to:
The issue will be tracked on GitHub: 
https://github.com/RaiMan/SikuliX1/issues/474
--

Java Version: 11
Sikuli API Version: 2.0.5
Computers Tested: 13" M1 2020 MacBook Pro and 13" 2017 MacBook Pro
OS Version: macOS Big Sur 11.4

I have a MacbookPro with a Retina screen connected to an external
display. The external display has a resolution of 2560x1440 but is not
treated as Retina by MacOS (Big Sur). I have the external display
configured to be the primary via macOS Display settings, making it
Screen 0 for Sikuli . Sikuli sees Screen 1 as the native screen of the
MacBook Pro (Retina) positioned to the left through MacOS Display
configuration. Here is Screen.showMonitors() from Java using Sikuli API:

*** monitor configuration [ 2 Screen(s)] ***
*** Primary is Screen 0
Screen 0: R[0,0 2560x1440]@S(0)
Screen 1: R[-1680,284 1680x1050]@S(1)
*** end monitor configuration ***

With the configuration this way, I can reliably capture/find images on
Screen 0, but the pixel dimensions are so far off on Screen 1 (the
Retina screen) captures and finds fail. Sikuli API doesn't seem to be
capturing things correctly on the Retina screen in this configuration.

See https://github.com/harmonjeff/sikuli-retina-
bug/tree/master/FailedCaptureImages

To illustrate the issue I created a test Java application that uses the
Sikuli API to capture the screens. I opened up two windows of TextEdit,
placing one on each screen. I sized the TextEdit window to cover the
entire screen (except the dock on Screen 0). You can see the source
here:

https://github.com/harmonjeff/sikuli-retina-bug

If I switch the primary window to being the Retina screen using the
MacOS Display settings and re-run the test then the Retina screen
captures correctly and the external display does not.  It seems the mix
of Retina with non-Retina causes the non-primary screen to not
capture/find correctly.

In researching what could be going on I discovered a system property
that seems to make things function correctly as far as Siklui API
capturing and finding images using Java. If I set the
"sun.java2d.uiScale" property to be "1.0" then the captures in the
sample application function correctly on both screens.

https://github.com/harmonjeff/sikuli-retina-
bug/tree/master/SuccessCaptureImages

Setting that system parameter in the launch of the JVM or in a static
that executes before any Java code tries to use AWT seems to fix Siklui
API capture/find methods on both screens.  This solution works for me
with one significant exception.  I need to be able to tell if the
application I am testing using Sikuli is running on a Retina screen.
Images captured using Siklui on the Retina display do not match well
when the application is on the non-Retina screen and vice-versa. I am
solving this problem by capturing reference images from both Retina and
non-Retina, but I need to know if the application is running on a Retina
screen to use the correct reference images.

The best way I have seen to detect if an application window is on a
Retina screen in Java 9+ is in the same application code shared above,
the isRetina method. The method only works if the system property is not
defined. It seems that if you use the system property to set the UI
scaling to 1.0 then it applies to all screens and the AffineTransform no
longer has an accurate result on the isIdentity method.  I tried
detecting the Retina screens just before setting that system property,
but it seems that as soon as I access the AWT objects to do that test
setting the system property doesn't do anything.

I don't have a way to both detect the application is running in a Retina
screen and have the capture/find Sikuli API functions work properly on
both screens when one is Retina and the other is not.

This issue seems very closely related to this question: 
https://answers.launchpad.net/sikuli/+question/682295 
Which resulted in the creation of this bug: 
https://bugs.launchpad.net/bugs/1840689

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698511]: Capture/find Sikuli API fails with one Retina screen and one non-Retina screen

2021-08-25 Thread RaiMan
Question #698511 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698511

Status: Open => Solved

RaiMan changed the question status:
Great thanks for your effort and the findings.

The issue will be tracked on GitHub:
https://github.com/RaiMan/SikuliX1/issues/474

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698490]: Using custom c++ dll in Sikulix

2021-08-25 Thread RaiMan
Question #698490 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698490

Status: Open => Answered

RaiMan proposed the following answer:
I am rather sure, that it is not such easy, to access native libraries
from Jython based on Java.

A native library either needs a Java API (usually based on a JNI/JNA
usage) or you have to use JNA yourself (sun.jna) to access the C++
API.

An example for the first way is bytedeco's javacpp and for the second
way you have to get familiar with JNA.

When you have the Java solution, then you can use it directly from
within Jython/SikuliX scripts having your stuff on the Java class path.

Another option of course is to look for available libraries compatible
with Jython, that have the features you need.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #698511]: Capture/find Sikuli API fails with one Retina screen and one non-Retina screen

2021-08-25 Thread Jeff Harmon
New question #698511 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698511

Java Version: 11
Sikuli API Version: 2.0.5
Computers Tested: 13" M1 2020 MacBook Pro and 13" 2017 MacBook Pro
OS Version: macOS Big Sur 11.4

I have a MacbookPro with a Retina screen connected to an external display. The 
external display has a resolution of 2560x1440 but is not treated as Retina by 
MacOS (Big Sur). I have the external display configured to be the primary via 
macOS Display settings, making it Screen 0 for Sikuli . Sikuli sees Screen 1 as 
the native screen of the MacBook Pro (Retina) positioned to the left through 
MacOS Display configuration. Here is Screen.showMonitors() from Java using 
Sikuli API:

*** monitor configuration [ 2 Screen(s)] ***
*** Primary is Screen 0
Screen 0: R[0,0 2560x1440]@S(0)
Screen 1: R[-1680,284 1680x1050]@S(1)
*** end monitor configuration ***

With the configuration this way, I can reliably capture/find images on Screen 
0, but the pixel dimensions are so far off on Screen 1 (the Retina screen) 
captures and finds fail. Sikuli API doesn't seem to be capturing things 
correctly on the Retina screen in this configuration.

See 
https://github.com/harmonjeff/sikuli-retina-bug/tree/master/FailedCaptureImages

To illustrate the issue I created a test Java application that uses the Sikuli 
API to capture the screens. I opened up two windows of TextEdit, placing one on 
each screen. I sized the TextEdit window to cover the entire screen (except the 
dock on Screen 0). You can see the source here:

https://github.com/harmonjeff/sikuli-retina-bug

If I switch the primary window to being the Retina screen using the MacOS 
Display settings and re-run the test then the Retina screen captures correctly 
and the external display does not.  It seems the mix of Retina with non-Retina 
causes the non-primary screen to not capture/find correctly.

In researching what could be going on I discovered a system property that seems 
to make things function correctly as far as Siklui API capturing and finding 
images using Java. If I set the "sun.java2d.uiScale" property to be "1.0" then 
the captures in the sample application function correctly on both screens.

https://github.com/harmonjeff/sikuli-retina-bug/tree/master/SuccessCaptureImages

Setting that system parameter in the launch of the JVM or in a static that 
executes before any Java code tries to use AWT seems to fix Siklui API 
capture/find methods on both screens.  This solution works for me with one 
significant exception.  I need to be able to tell if the application I am 
testing using Sikuli is running on a Retina screen.  Images captured using 
Siklui on the Retina display do not match well when the application is on the 
non-Retina screen and vice-versa. I am solving this problem by capturing 
reference images from both Retina and non-Retina, but I need to know if the 
application is running on a Retina screen to use the correct reference images.

The best way I have seen to detect if an application window is on a Retina 
screen in Java 9+ is in the same application code shared above, the isRetina 
method. The method only works if the system property is not defined. It seems 
that if you use the system property to set the UI scaling to 1.0 then it 
applies to all screens and the AffineTransform no longer has an accurate result 
on the isIdentity method.  I tried detecting the Retina screens just before 
setting that system property, but it seems that as soon as I access the AWT 
objects to do that test setting the system property doesn't do anything.

I don't have a way to both detect the application is running in a Retina screen 
and have the capture/find Sikuli API functions work properly on both screens 
when one is Retina and the other is not.

This issue seems very closely related to this question: 
https://answers.launchpad.net/sikuli/+question/682295 
Which resulted in the creation of this bug: 
https://bugs.launchpad.net/bugs/1840689

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #682295]: [1.1.4] macOS 10.14.5 - Taking a screenshot with SikuliIDE on an external monitor with a Retina primary display

2021-08-25 Thread Jeff Harmon
Question #682295 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/682295

Jeff Harmon posted a new comment:
I have a similar issue to the original reporter, though my primary
display is the external monitor.

I have a Retina MacbookPro connected to an external display.  The
external display has a resolution of 2560x1440 but is not treated as
Retina by MacOS (Big Sur).  I have the dock on the external display,
which for Sikuli I believe means it is Screen 0.  Sikuli sees Screen 1
as the native screen of the MacBook Pro (Retina) positioned to the left
through Display configuration.  Here is Screen.showMonitors() from Java
using Sikuli API:

*** monitor configuration [ 2 Screen(s)] ***
*** Primary is Screen 0
Screen 0: R[0,0 2560x1440]@S(0)
Screen 1: R[-1680,284 1680x1050]@S(1)
*** end monitor configuration ***

With the configuration this way, I can reliably find images on Screen 0,
but the pixel dimensions are so far off on Screen 1 (the Retina screen)
I can't reliably do finds.  Sikuli API doesn't seem to be capturing
things correctly on the Retina screen in this configuration.

See https://github.com/harmonjeff/sikuli-retina-
bug/tree/master/FailedCaptureImages

To illustrate the issue I created a test Java application that uses the
Sikuli API to capture the screens.  I opened up two windows of TextEdit,
placing one on each screen.  I sized the TextEdit window to cover the
entire screen (except the dock on Screen 0).  You can see the source
here:

https://github.com/harmonjeff/sikuli-retina-bug

In researching what could be going on I discovered a system property
that seems to make things function correctly as far as Siklui API
capturing and finding images using Java.  If I set the
"sun.java2d.uiScale" property to be "1.0" then the captures in the
sample application function correctly.

https://github.com/harmonjeff/sikuli-retina-
bug/tree/master/SuccessCaptureImages

This solution works for me with everything except that my use case for
Sikuli API is to drive an application using reference images I capture
using Siklui beforehand.  Images captured using Siklui on the Retina
display do not match well when the application is on the non-Retina
screen and vice-versa. I can capture the reference images to be used by
the UI automated testing from both but I need to detect if the
application is on the Retina screen or the non-Retina screen to know
which reference images to use.

The best way I have seen to detect if an application window is on a
Retina screen in Java 9+ is in the same code, the isRetina method.  The
method only works if the system property is not defined.  I don't have a
way to both detect the application is running in a Retina screen and
have the capture/find Sikuli API functions work properly.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #235193]: [1.0.x] Script hangs after extended test runs

2021-08-25 Thread gtreshtg hgtrf
Question #235193 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/235193

gtreshtg hgtrf posted a new comment:
If you are facing hang issue with the script I will suggest you to
reinstall this software because I remember when I faced the same issue
and I done the same thing that I am asking to you here also you can
visit here https://proremovalsyork.co.uk/house-removals-york/ to learn
about it.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp