primaryDisplay
- Returns:
- the primary
Display, ornullwhen headless. Default: the display that reportsDisplay.isPrimary(), else the first ofdisplays(). UI thread only.
AutoCloseableBackendPeerHeadlessBackend, LwjglBackendlimn-backend-lwjgl (GLFW + OpenGL 3.3 core); the abstraction
exists so ANGLE/Vulkan (or SDL) backends can replace it without touching
any module above.
Lifecycle: construct on the process main thread (which becomes the UI
thread), create windows, then runEventLoop() until the last window
closes, an agreed requestQuit() or stop(), as the
lifetime says. The loop is event-driven: it sleeps in
the native event wait and is woken by input, window damage or
Ui.post(java.lang.Runnable).
This is the application's view of a backend, which the 1.0 contract freezes. What the toolkit
asks of it below that (the modal stack) is BackendPeer's, in the incubating layer; every
backend is one, which is why this interface is sealed.
voidclose()default booleancreateWindow(WindowConfig config) displays()default GraphicsInfodefault @Nullable Displaydefault Render3DStatsdefault RenderStatsvoiddefault voidsetApplicationName(String name) voidsetLoopLifetime(LoopLifetime lifetime) runEventLoop() runs: until the last window closes (the default) or
until the application ends it, which lets an application live with no window open.voidsetQuitHandler(@Nullable QuitHandler handler) requestQuit() asks before any window, for what belongs to no window.voidstop()On Linux, AT-SPI2 shows one application object per process with every window beneath it, and a screen reader says that name when the user moves into the application; left unset, a backend uses the title of the first window it created, which is right for a one-window program and wrong for one whose first window is a splash or a login. Windows names an application from the process itself and reads nothing here. Call it before the first window for the name to be there from the start; a later call renames the application for the next client that asks.
On macOS the name is also what the toolkit writes in the items of the application's menu (About, Hide, Quit). It is not what the system writes in bold at the head of its menu bar: the system reads that once, as the windowing library starts, from the application's package, and for an application that is not packaged from the name the backend was made with. A backend that takes a name at its construction says so there.
name - what the desktop should call this application; never nullNullPointerException - if name is nullLoopLifetime.UNTIL_LAST_WINDOW), when a
requestQuit() was agreed to and every window has closed, or when
stop() is invoked.runEventLoop() runs: until the last window closes (the default) or
until the application ends it, which lets an application live with no window open. UI thread
only.lifetime - the lifetime; never nullNullPointerException - if lifetime is nullrunEventLoop() runs; LoopLifetime.UNTIL_LAST_WINDOW unless setquit handler is asked first, then
every open top-level window's handler, front to
back (the window used last first), one at a time; a window with no handler agrees. A refusal
anywhere ends the request and every window stays open. When all have agreed, every window
closes, owned ones included, and runEventLoop() returns LoopEnd.QUIT.
A request made while one is being answered joins it. On macOS the system's Quit command for the application (Cmd-Q, the application menu, the Dock) makes this request. UI thread only.
requestQuit() asks before any window, for what belongs to no window.
null clears. UI thread only.handler - the handler, or null for noneRenderStats.EMPTY.
UI thread only.Render3DStats.EMPTY.
UI thread only.createWindow(limn.backend.WindowConfig) has succeeded at least once; before that,
and on a machine where it never does, the result carries the
windowing platform and a GraphicsInfo.failure() instead.
Default: GraphicsInfo.NONE. UI thread only.true (the default) where the compositor casts it, and for a backend with
no desktop under it, which then draws nothing extraDisplay, in the platform's order (index 0
is usually the primary). Empty when headless/embedded. UI thread only.Display, or null when headless.
Default: the display that reports Display.isPrimary(), else
the first of displays(). UI thread only.close in interface AutoCloseable