SCRYMAMEReferenceSessionwindowAlso in DOSBox-X
window
Find where the session's window is on your displays and whether another window covers it, or bring it in front.
window(front=false)
Try it
shared=true so that it has a window to report.Where is the emulator's window, and can I see it?
window(){
"status": "ok"
}The run hides the window block and the summary here, because where the window is differs on every host. status is ok: the host listed the window.
The whole reply
{
"summary": "<volatile>",
"status": "ok",
"window": {
"display": "<volatile>",
"bounds": "<volatile>",
"onscreen": true,
"front": "<volatile>",
"fullscreen": false
}
}Arguments
- front boolean, default
false truebrings the window in front of whatever covers it and reads the result back. Left out, the window is reported where it is and nothing moves.
What comes back
- window
- Where it is:
display,bounds,onscreen,fullscreenandfront.frontistruewhen no other application's window covers its centre; it does not mean the window has the keyboard focus. - size
- Only when
startnamed asize: what wasasked, what isseen, and whether itmatcheswithintolerance_px.
All 5 reply fields
activation(string)asked_display(integer)seen(object)size(object)window(object)
What it refuses
- No session is open (
no_session). - The session's emulator died (
session_broken). - The session was started without
shared, so there is no watched window to report (no_channel). - The window never appears, or with
frontis still covered after it was activated.seensays what the host listed (window_not_visible).
Why it works this way
front answers one question: can a person see the picture? It is true when the window is on screen and no other application's window covers its centre. It is not the keyboard focus, which a window nothing covers can be without.
window answers at any time, a running machine included. Without front it moves nothing and reports the window wherever you put it. With front, a session started with background=true may stay behind, and the refusal names that as the likely cause.
A size given to start is checked here, at any moment, a start still stopped included, because MAME sizes its window when it creates it. The size the server chose by itself is never checked.
More on why
comparedsays which rectangle was measured:client, the area inside the frame, on Windows;outeron macOS, which has no client area, so a title bar's height is allowed.height_freeistruewhen the emulator fits the height to the picture's aspect by itself, so only the width is checked. MAME does this on Windows.displayis the operating system's index, andfullscreenistruewhen the window's bounds are the display's.- On a
window_not_visiblerefusal,asked_displayis the displaystartasked for andactivationwhat bringing it forward answered.
Related tools
The contract your client receives
Where the watched window is on the host, at any time, a running machine included. `front`
brings it in front of whatever covers it and reads that back.
Reply: `window` (`display`, the OS's index; `bounds`; `onscreen`; `front`, on screen with no other application's window covering its centre; `fullscreen`); `size` when the session was started with a stated `size`: `asked`, `seen`, which rectangle was `compared` (`client` or `outer`), `tolerance_px`, `height_free` and `matches`.
Refused: no session (`no_session`), one that died (`session_broken`), a session started without `shared` (`no_channel`), a window that never appears or, with `front`, is still covered after the activation (`window_not_visible`, naming what was seen; on a `background=true` session it names that as what may keep it behind). Without `front` the window is answered wherever the owner put it.
Reference: REFERENCE.md, The session.