[1.0.1 ok] "Location: outside any screen" error on dual-screen configuration

Bug #1213439 reported by Camill on 2013-08-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
Critical
RaiMan

Bug Description

--- fixed in 1.0.1 per August 20 at 2 pm gmt+1
run setup again after that time to get fix
----------------------------------------------

Sikuli IDE 1.0.1
Windows 7 x64

1. Dual-screen configuration where the right screen is primary (thus, coordinates on the left screen is negative).
2. Sikuli window on the left screen.
3. Move mouse ower any thumbnail in the script.
4. Sequence error in message pane like "[error] Location: outside any screen (32, -3) - subsequent actions might not work as expected". See attached screenshot.

or

2. Run script: click(<any_picture_on_left_screen>)
3. Script return: [error] FindFailed ( can not find 1376853223841.png on the screen. )

Camill (g-mail-5) wrote :
Camill (g-mail-5) on 2013-08-17
description: updated
Camill (g-mail-5) on 2013-08-18
description: updated
description: updated
summary: - "Location: outside any screen" error on dual-screen configuration
+ "FindFailed" or "Location: outside any screen" error on dual-screen
+ configuration

--- FindFailed for image on left monitor
It is still so, that you have to tell Sikuli, on which screen to look for images (version 1.1 will have more support for multi-screen-search).

click(<any_picture_on_left_screen>) per definition looks on Screen(0) (which is set as a pseudo-constant SCREEN, that is used for all undotted Region functions like click, find, type, ...)
So this FindFailed is a "feature" ;-)

if you want to work on screen 1 use e.g.
S1 = Screen(1)
S1.click(<any_picture_on_left_screen>)

... means all Region/Screen functions using images located on screen 1 need to be written as S1.function

(this is in fact the approach, to "restrict" a search operation to a specific region)

All functions using Regions or Locations as parameters need not be qualified, even if the region or location is on another monitor.

*** [error] Location: outside any screen ...
I am working on that

summary: - "FindFailed" or "Location: outside any screen" error on dual-screen
+ [1.0.1] "Location: outside any screen" error on dual-screen
configuration
description: updated

So, I need to use construction like this:

if s1.exists(<picture>):
   s1.click(<picture>)
else:
  s2.click(<picture>)

Looks a little strange, do not you think?

RaiMan (raimund-hocke) wrote :

Principally yes, but usually this is a one time decision some where in the beginning of the script.

Most people solve this currently (since mostly you are working in some kind of app window), by asking the window() of the app(), on what screen it is on and set the screen one time for the rest of the script for subsequent sx.click().

I have on the list, to switch the default screen on the fly, so you could make a script for the default screen (no sx.function, but only function) and then say something like switchDefault(1) abd from now on all functions work on screen 1.

Camill (g-mail-5) wrote :

May be not "switchDefault(<screen_number>) " but "setDefaultSearchRegion(<Region>)"?
Then I can switch active region between some app window, one screen or entire screens space.
I definetly can't know on which screen my window appears, but I know process name and window appearance sample.
If I have a method that will allow to define a window region (or it already possible?), and set the region as search area for future script operations, this will be the best solution.

RaiMan (raimund-hocke) on 2013-08-20
description: updated
summary: - [1.0.1] "Location: outside any screen" error on dual-screen
+ [1.0.1 ok] "Location: outside any screen" error on dual-screen
configuration
RaiMan (raimund-hocke) on 2013-08-20
Changed in sikuli:
status: New → Fix Committed
importance: Undecided → Critical
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments