Monitor detection when using multiple displays

Asked by huajie

I am trying to use Sikuli to test an application opening windows on four screens on GNU/Linux.
As the computer where I run the test has only one monitor, I have started Xephyr (http://freedesktop.org/wiki/Software/Xephyr) to simulate another displays.
However, while the documentation (http://sikuli.org/trac/wiki/reference-0.10#MultiMonitorEnvironments) says that the monitor detection is done when the script starts, when I am using print(getNumberScreens()), it returns 1 when my display simulator runs (the command I run: Xephyr -screen 960:1200 -ac -reset -terminate 2> /dev/null :3 &).

Which method is using Sikuli to "get the relevant information from the operating system" about the monitors on GNU/linux?
How come it keeps detecting only one display while I can send any application to be displayed on the simulated monitor ?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

The multi screen management is based on the physical monitor configuration as maintained by the system.

Since in a multiscreen environment you have to qualify find/act on other screens with the screen object, its rather easy, to fix your situation (example for 1 additional screen)

if getNumberScreens() == 1:
  scr1 = selectRegion("pls. select the simulator window for Screen(1)")
else:
  scr1 = Screen(1)

and then:

scr1.find()
scr1.click()

or

with scr1:
   find()
   click()

this works, if the pixel resolution (screen size does not matter) is the same in the simulated windows and the real screen.

Can you help with this problem?

Provide an answer of your own, or ask huajie for more information if necessary.

To post a message you must log in.