app.dhover×229 error×79all
// F14 — window state & vetoable close (see ../../f14-window-state.md and
// ../../../features/f14-window-state.md). One binary, two stories:
//
//   State storm (WSI_AUTO_EXIT=1)   a timed choreography issues the full
//       request quartet plus the asymmetric fifth —
//           set_maximized → unset_maximized → set_fullscreen →
//           unset_fullscreen → set_minimized
//       — and decodes the *complete* states array of every
//       xdg_toplevel.configure (maximized/fullscreen/resizing/activated/
//       tiled_*/suspended/constrained_*). xdg_wm_base is bound at
//       min(advertised, 6) so the v6 `suspended` state is delivered when the
//       compositor has it; advertised vs bound is logged. After
//       set_minimized the demo keeps polling (frame callbacks may stop —
//       F04's occlusion finding) and reports how many frame callbacks
//       arrived in the post-minimize window.
//
//   Vetoable close (always armed)   the document is permanently "dirty":
//       the first WSI_VETO_CLOSE (default 1) xdg_toplevel.close events are
//       *ignored* — that is the entire veto mechanism, close is an event,
//       not a question, and there is nothing to return — and the next one
//       exits. A dispatch error (compositor died while we lingered) is
//       captured as errno (EPIPE).
//
// Headless-safe: no compositor → SKIP, exit 0.
module 
(module) app
app
;
import c; // ImportC: wayland-client + xdg-shell glue (wsi_*)
unable to read module `c` Expected 'c.d' or 'c/package.d' in one of the following import paths:
unable to read module `c` Expected 'c.d' or 'c/package.d' in one of the following import paths:
import instrument;
unable to read module `instrument` Expected 'instrument.d' or 'instrument/package.d' in one of the following import paths:
unable to read module `instrument` Expected 'instrument.d' or 'instrument/package.d' in one of the following import paths:
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdio

D header file for C99 <stdio.h>

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdio.h.html, stdio.h

Source

core/stdc/stdio.d

@copyrightCopyright Sean Kelly 2005 - 2009.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly, Alex Rønne Petersen@standardsISO/IEC 9899:1999 (E)
stdio
:
(alias) app.printf = int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
,
(alias) app.snprintf = int core.stdc.stdio.snprintf(scope char* s, ulong n, scope const(char*) format, scope const ...) nothrow @nogc
snprintf
;
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdlib

D header file for C99.

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html, stdlib.h

Source

core/stdc/stdlib.d

@copyrightCopyright Sean Kelly 2005 - 2014.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly@standardsISO/IEC 9899:1999 (E)
stdlib
:
(alias) app.getenv = char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
,
(alias) app.atoi = int core.stdc.stdlib.atoi(scope const(char*) nptr) nothrow @nogc
atoi
;
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.string

D header file for C99.

pubs.opengroup.org/onlinepubs/009695399/basedefs/string.h.html, string.h

Source

core/stdc/string.d

@copyrightCopyright Sean Kelly 2005 - 2009.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly@standardsISO/IEC 9899:1999 (E)
string
:
(alias) app.strcmp = int core.stdc.string.strcmp(scope const(char*) s1, scope const(char*) s2) pure nothrow @nogc
strcmp
;
enum int
(constant) int app.defaultWidth = 640
defaultWidth
= 640,
(constant) int app.defaultHeight = 480
defaultHeight
= 480;
// The timed choreography (µs since init). Time-based, not frame-based: after // set_minimized there may be no frame callbacks left to count with. enum long
(constant) long app.tMaximize = 700000L
tMaximize
= 700_000;
enum long
(constant) long app.tUnmaximize = 1400000L
tUnmaximize
= 1_400_000;
enum long
(constant) long app.tFullscreen = 2100000L
tFullscreen
= 2_100_000;
enum long
(constant) long app.tUnfullscreen = 2800000L
tUnfullscreen
= 2_800_000;
enum long
(constant) long app.tMinimize = 3500000L
tMinimize
= 3_500_000;
enum long
(constant) long app.tReport = 4700000L
tReport
= 4_700_000; // frame-callback census for the minimized span
struct
(struct) app.Buffer
Buffer
{ wl_buffer*
(field) _error_ app.Buffer.handle
handle
;
undefined identifier `wl_buffer`
uint*
(field) uint* app.Buffer.pixels
pixels
;
(alias) object.size_t = ulong
size_t
(field) ulong app.Buffer.byteSize
byteSize
;
int
(field) int app.Buffer.width
width
,
(field) int app.Buffer.height
height
;
bool
(field) bool app.Buffer.busy
busy
;
} __gshared { wl_display*
_error_ app.g_display
g_display
;
undefined identifier `wl_display`, did you mean variable `g_display`?
wl_registry*
_error_ app.g_registry
g_registry
;
undefined identifier `wl_registry`, did you mean variable `g_registry`?
wl_compositor*
_error_ app.g_compositor
g_compositor
;
undefined identifier `wl_compositor`, did you mean variable `g_compositor`?
wl_shm*
_error_ app.g_shm
g_shm
;
undefined identifier `wl_shm`, did you mean variable `g_shm`?
xdg_wm_base*
_error_ app.g_wmBase
g_wmBase
;
undefined identifier `xdg_wm_base`
wl_surface*
_error_ app.g_surface
g_surface
;
undefined identifier `wl_surface`, did you mean variable `g_surface`?
xdg_surface*
_error_ app.g_xdgSurface
g_xdgSurface
;
undefined identifier `xdg_surface`, did you mean variable `g_surface`?
xdg_toplevel*
_error_ app.g_toplevel
g_toplevel
;
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
wl_callback*
_error_ app.g_frameCb
g_frameCb
;
undefined identifier `wl_callback`
(struct) app.Buffer
Buffer
[2]
_error_ app.g_buffers
g_buffers
;
uint
(__gshared global) uint app.g_wmBaseAdvertised
g_wmBaseAdvertised
,
(__gshared global) uint app.g_wmBaseBound
g_wmBaseBound
;
int
(__gshared global) int app.g_width
g_width
= defaultWidth,
(__gshared global) int app.g_height
g_height
= defaultHeight;
int
(__gshared global) int app.g_pendingWidth
g_pendingWidth
,
(__gshared global) int app.g_pendingHeight
g_pendingHeight
;
char[160]
(__gshared global) char[160] app.g_pendingStates
g_pendingStates
; // decoded states array of the latest configure
bool
(__gshared global) bool app.g_configured
g_configured
,
(__gshared global) bool app.g_running
g_running
= true,
(__gshared global) bool app.g_autoExit
g_autoExit
;
long
(__gshared global) long app.g_runUsCap
g_runUsCap
= 5_200_000;
int
(__gshared global) int app.g_frames
g_frames
,
(__gshared global) int app.g_configures
g_configures
;
int
(__gshared global) int app.g_phase
g_phase
; // next choreography step to fire (0..5)
int
(__gshared global) int app.g_framesAtMinimize
g_framesAtMinimize
= -1;
bool
(__gshared global) bool app.g_reported
g_reported
;
int
(__gshared global) int app.g_vetoesLeft
g_vetoesLeft
= 1; // the "dirty document": ignore this many closes
int
(__gshared global) int app.g_closesSeen
g_closesSeen
;
} // ------------------------------------------------------------ states decode /// Decode a configure states wl_array into "[a,b,c]" — every value the v6 /// protocol can deliver, plus raw numbers for anything newer. void
app.decodeStates

Decode a configure states wl_array into "a,b,c" — every value the v6 protocol can deliver, plus raw numbers for anything newer.

decodeStates
(const(wl_array)* states, char[] outBuf) nothrow @nogc
undefined identifier `wl_array`
{ static immutable
(unresolved type) string
string
[10]
string[10] names
names
= [
"?0", "maximized", "fullscreen", "resizing", "activated", "tiled_left", "tiled_right", "tiled_top", "tiled_bottom", "suspended", ];
(unresolved type) size_t
size_t
_error_ pos
pos
= 0;
void
void putc(char c) nothrow @nogc
putc
(char
(parameter) char c
c
) nothrow @nogc
{ if (pos + 1 < outBuf.
outBuf.length
length
)
outBuf[pos++] = c; } putc('['); const
_error_ vals
vals
= cast(const(uint)*) states.data;
foreach (
(parameter) i
i
; 0 .. states.
states.size
size
/ uint.sizeof)
{ if (i > 0) putc(','); immutable
_error_ v
v
= vals[i];
if (v < names.
names.length
length
)
foreach (
(parameter) ch
ch
; names[v])
putc(ch); else // constrained_* (v7) or future states { char[12]
_error_ num
num
= void;
immutable
_error_ n
n
= snprintf(num.ptr, num.
num.length
length
, "%u", v);
foreach (
(parameter) ch
ch
; num[0 .. n])
putc(ch); } } putc(']'); outBuf[pos] = '\0'; } // ---------------------------------------------------------- shm buffer pool bool
app.ensureBuffer
ensureBuffer
(ref
(struct) app.Buffer
Buffer
(parameter) Buffer b
b
, int
(parameter) int w
w
, int
(parameter) int h
h
) nothrow @nogc
{ if (b.
b.handle
handle
!is null && (b.
b.width
width
!= w || b.
b.height
height
!= h))
{ wsi_buffer_destroy(b.
b.handle
handle
);
munmap(b.
b.pixels
pixels
, b.
b.byteSize
byteSize
);
b = Buffer.init; } if (b.
b.handle
handle
!is null)
return true; immutable
_error_ stride
stride
= w * 4;
immutable
_error_ size
size
= cast(
(unresolved type) size_t
size_t
) stride * h;
immutable
_error_ fd
fd
= memfd_create("wsi-f14", MFD_CLOEXEC);
if (fd < 0 || ftruncate(fd, cast(long) size) != 0) return false; void*
_error_ mem
mem
= mmap(null, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (mem is cast(void*)-1) { close(fd); return false; } wl_shm_pool*
_error_ pool
pool
= wsi_shm_create_pool(g_shm, fd, cast(int) size);
b.
b.handle
handle
= wsi_shm_pool_create_buffer(pool, 0, w, h, stride, WL_SHM_FORMAT_XRGB8888);
wsi_shm_pool_destroy(pool); close(fd); wsi_buffer_add_listener(b.
b.handle
handle
, &g_bufferListener, &b);
b.
b.pixels
pixels
= cast(uint*) mem;
b.
b.byteSize
byteSize
= size;
b.
b.width
width
= w;
b.
b.height
height
= h;
return true; } void
void app.render() nothrow @nogc
render
() nothrow @nogc
{
(struct) app.Buffer
Buffer
*
(local variable) _error_ buf
buf
= null;
foreach (ref
(parameter) b
b
; g_buffers)
if (!b.
b.busy
busy
)
{ buf = &b; break; } if (buf is null) return; // both held; wl_buffer.release re-renders if (!ensureBuffer(*buf, g_width, g_height)) {
(__gshared global) bool app.g_running
g_running
= false;
return; } foreach (
(parameter) y
y
; 0 .. buf.
(field) _error_ buf.height
height
) // gradient (scaffold pattern)
{ uint*
_error_ row
row
= buf.
buf.pixels
pixels
+ cast(
(unresolved type) size_t
size_t
) y * buf.
buf.width
width
;
immutable uint
_error_ g
g
= cast(uint)(y * 255 / (buf.
buf.height
height
> 1 ? buf.
buf.height
height
- 1 : 1)) << 8;
foreach (
(parameter) x
x
; 0 .. buf.
buf.width
width
)
row[x] = 0xff00_0000 | (cast(uint)(x * 255 / (buf.
buf.width
width
> 1 ? buf.
buf.width
width
- 1 : 1)) << 16) | g;
} wsi_surface_attach(g_surface, buf.
buf.handle
handle
, 0, 0);
undefined identifier `wsi_surface_attach`
wsi_surface_damage_buffer(g_surface, 0, 0, buf.
buf.width
width
, buf.
buf.height
height
);
undefined identifier `wsi_surface_damage_buffer`
if (g_frameCb is null) { g_frameCb = wsi_surface_frame(g_surface); wsi_callback_add_listener(g_frameCb, &g_frameListener, null);
undefined identifier `wsi_callback_add_listener`
} wsi_surface_commit(g_surface);
undefined identifier `wsi_surface_commit`
buf.
buf.busy
busy
= true;
} // ---------------------------------------------------------------- listeners extern (C) void
app.onGlobal
onGlobal
(void* data, wl_registry* reg, uint name,
undefined identifier `wl_registry`, did you mean variable `g_registry`?
const(char)* iface, uint ver) nothrow @nogc { if (strcmp(iface, wl_compositor_interface.name) == 0) g_compositor = cast(wl_compositor*) wsi_registry_bind(reg, name, &wl_compositor_interface, ver < 4 ? ver : 4); else if (strcmp(iface, wl_shm_interface.name) == 0) g_shm = cast(wl_shm*) wsi_registry_bind(reg, name, &wl_shm_interface, 1); else if (strcmp(iface, xdg_wm_base_interface.name) == 0) { // Bind up to v6: the `suspended` state exists "since 6" — at v1..5 the // compositor is *forbidden* from sending it, whatever it knows. g_wmBaseAdvertised = ver; g_wmBaseBound = ver < 6 ? ver : 6; g_wmBase = cast(xdg_wm_base*) wsi_registry_bind(reg, name, &xdg_wm_base_interface, g_wmBaseBound); instrEvent("wm_base", "advertised=%u bound=%u suspended_possible=%d", g_wmBaseAdvertised, g_wmBaseBound, g_wmBaseBound >= 6 ? 1 : 0); } } extern (C) void
app.onGlobalRemove
onGlobalRemove
(void* data, wl_registry* reg, uint name) nothrow @nogc
undefined identifier `wl_registry`, did you mean variable `g_registry`?
{ } extern (C) void
app.onWmBasePing
onWmBasePing
(void* data, xdg_wm_base*
(parameter) xdg_wm_base* b
b
, uint serial) nothrow @nogc
undefined identifier `xdg_wm_base`
{ wsi_wm_base_pong(b, serial); } extern (C) void
app.onToplevelConfigure
onToplevelConfigure
(void* data, xdg_toplevel* t, int
(parameter) int w
w
, int
(parameter) int h
h
,
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
wl_array* states) nothrow @nogc
undefined identifier `wl_array`
{ g_pendingWidth = w; g_pendingHeight = h; decodeStates(states, g_pendingStates[]); } extern (C) void
app.onXdgSurfaceConfigure
onXdgSurfaceConfigure
(void* data, xdg_surface* s, uint serial) nothrow @nogc
undefined identifier `xdg_surface`, did you mean variable `g_surface`?
{ immutable
_error_ w
w
= g_pendingWidth > 0 ? g_pendingWidth : defaultWidth;
immutable
_error_ h
h
= g_pendingHeight > 0 ? g_pendingHeight : defaultHeight;
g_configures++; instrEvent("configure", "serial=%u size=%dx%d states=%s", serial, w, h, g_pendingStates.ptr); wsi_xdg_surface_ack_configure(s, serial); immutable
_error_ resized
resized
= w != g_width || h != g_height;
g_width = w; g_height = h; if (!g_configured) { g_configured = true; instrFirstConfigure(); render(); } else if (resized) render(); } /// xdg_toplevel.close — "a one-way *event*, not a request/response pair. The /// client decides; ignoring it IS the veto" (no reply exists to send). extern (C) void
app.onToplevelClose

xdg_toplevel.close — "a one-way event, not a request/response pair. The client decides; ignoring it IS the veto" (no reply exists to send).

onToplevelClose
(void* data, xdg_toplevel* t) nothrow @nogc
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
{ g_closesSeen++; if (g_vetoesLeft > 0) { g_vetoesLeft--; instrEvent("close_requested", "n=%d verdict=vetoed dirty=1 note=event ignored, no reply sent", g_closesSeen); return; // the whole veto: do nothing } instrEvent("close_requested", "n=%d verdict=accepted", g_closesSeen); instrCloseRequested(); g_running = false; } extern (C) void
app.onToplevelConfigureBounds
onToplevelConfigureBounds
(void* data, xdg_toplevel* t, int
(parameter) int w
w
, int
(parameter) int h
h
) nothrow @nogc
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
{ } extern (C) void
app.onToplevelWmCapabilities
onToplevelWmCapabilities
(void* data, xdg_toplevel* t, wl_array* caps) nothrow @nogc
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
undefined identifier `wl_array`
{ char[160]
_error_ buf
buf
= void;
decodeCaps(caps, buf[]); instrEvent("wm_capabilities", "caps=%s", buf.ptr); } /// xdg_toplevel.wm_capabilities (v5): does the compositor even *do* minimize? void
app.decodeCaps

xdg_toplevel.wm_capabilities (v5): does the compositor even do minimize?

decodeCaps
(const(wl_array)* caps, char[] outBuf) nothrow @nogc
undefined identifier `wl_array`
{ static immutable
(unresolved type) string
string
[5]
string[5] names
names
= ["?0", "window_menu", "maximize", "fullscreen", "minimize"];
(unresolved type) size_t
size_t
_error_ pos
pos
= 0;
const
_error_ vals
vals
= cast(const(uint)*) caps.data;
outBuf[pos++] = '['; foreach (
(parameter) i
i
; 0 .. caps.
caps.size
size
/ uint.sizeof)
{ if (i > 0) outBuf[pos++] = ','; immutable
_error_ v
v
= vals[i];
foreach (
(parameter) ch
ch
; v < names.
names.length
length
? names[v] : "?")
if (pos + 2 < outBuf.
outBuf.length
length
)
outBuf[pos++] = ch; } outBuf[pos++] = ']'; outBuf[pos] = '\0'; } extern (C) void
app.onBufferRelease
onBufferRelease
(void* data, wl_buffer*
(parameter) wl_buffer* b
b
) nothrow @nogc
undefined identifier `wl_buffer`
{ (cast(
(unresolved type) Buffer
Buffer
*) data).
(cast(Buffer*)data).busy
busy
= false;
} extern (C) void
app.onFrameDone
onFrameDone
(void* data, wl_callback* cb, uint timeMs) nothrow @nogc
undefined identifier `wl_callback`
{ wsi_callback_destroy(cb); g_frameCb = null; g_frames++; if (g_frames == 1) instrFirstPixelPresented(); if (g_running && g_configured) render(); } __gshared wl_registry_listener
_error_ app.g_registryListener
g_registryListener
= {&onGlobal, &onGlobalRemove};
undefined identifier `wl_registry_listener`
__gshared xdg_wm_base_listener
_error_ app.g_wmBaseListener
g_wmBaseListener
= {&onWmBasePing};
undefined identifier `xdg_wm_base_listener`
__gshared xdg_surface_listener
_error_ app.g_xdgSurfaceListener
g_xdgSurfaceListener
= {&onXdgSurfaceConfigure};
undefined identifier `xdg_surface_listener`
__gshared xdg_toplevel_listener
_error_ app.g_toplevelListener
g_toplevelListener
= {
undefined identifier `xdg_toplevel_listener`
&onToplevelConfigure, &onToplevelClose, &onToplevelConfigureBounds, &onToplevelWmCapabilities }; __gshared wl_buffer_listener
_error_ app.g_bufferListener
g_bufferListener
= {&onBufferRelease};
undefined identifier `wl_buffer_listener`
__gshared wl_callback_listener
_error_ app.g_frameListener
g_frameListener
= {&onFrameDone};
undefined identifier `wl_callback_listener`
// -------------------------------------------------------------- choreography void
void app.step(int phase) nothrow @nogc
step
(int
(parameter) int phase
phase
) nothrow @nogc
{ final switch (
(parameter) int phase
phase
)
{ case 0: instrEvent("state_request", "kind=set_maximized frames=%d", g_frames);
undefined identifier `instrEvent`, did you mean import `instrument`?
wsi_toplevel_set_maximized(g_toplevel);
undefined identifier `wsi_toplevel_set_maximized`
break; case 1: instrEvent("state_request", "kind=unset_maximized frames=%d", g_frames);
undefined identifier `instrEvent`, did you mean import `instrument`?
wsi_toplevel_unset_maximized(g_toplevel);
undefined identifier `wsi_toplevel_unset_maximized`
break; case 2: instrEvent("state_request", "kind=set_fullscreen frames=%d", g_frames);
undefined identifier `instrEvent`, did you mean import `instrument`?
wsi_toplevel_set_fullscreen(g_toplevel);
undefined identifier `wsi_toplevel_set_fullscreen`
break; case 3: instrEvent("state_request", "kind=unset_fullscreen frames=%d", g_frames);
undefined identifier `instrEvent`, did you mean import `instrument`?
wsi_toplevel_unset_fullscreen(g_toplevel);
undefined identifier `wsi_toplevel_unset_fullscreen`
break; case 4: // No unset_minimized exists, no `minimized` state will ever appear in // a configure — only the user (or compositor IPC) can bring it back. instrEvent("state_request", "kind=set_minimized frames=%d note=no unset twin, no state feedback", g_frames);
undefined identifier `instrEvent`, did you mean import `instrument`?
wsi_toplevel_set_minimized(g_toplevel);
undefined identifier `wsi_toplevel_set_minimized`
(__gshared global) int app.g_framesAtMinimize
g_framesAtMinimize
=
(__gshared global) int app.g_frames
g_frames
;
break; } } __gshared immutable long[5]
(immutable global) immutable(long[5]) app.g_stepAt
g_stepAt
= [
(constant) long app.tMaximize = 700000L
tMaximize
,
(constant) long app.tUnmaximize = 1400000L
tUnmaximize
,
(constant) long app.tFullscreen = 2100000L
tFullscreen
,
(constant) long app.tUnfullscreen = 2800000L
tUnfullscreen
,
(constant) long app.tMinimize = 3500000L
tMinimize
,
]; // --------------------------------------------------------------------- main int
int D main()
main
()
{ instrInit("f14-state");
undefined identifier `instrInit`
bool
bool app.main.env(const(char)* n) nothrow @nogc @system
env
(const(char)*
(parameter) const(char)* n
n
)
{ const
(local variable) const(char*) v
v
=
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
(
(parameter) const(char)* n
n
);
return
(local variable) const(char*) v
v
!is null && *
(local variable) const(char*) v
v
== '1';
}
(__gshared global) bool app.g_autoExit
g_autoExit
=
bool app.main.env(const(char)* n) nothrow @nogc @system
env
("WSI_AUTO_EXIT");
if (const
(local variable) const(char*) ms
ms
=
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
("WSI_RUN_MS"))
(__gshared global) long app.g_runUsCap
g_runUsCap
=
int core.stdc.stdlib.atoi(scope const(char*) nptr) nothrow @nogc
atoi
(
(local variable) const(char*) ms
ms
) * 1000L;
if (const
(local variable) const(char*) v
v
=
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
("WSI_VETO_CLOSE"))
(__gshared global) int app.g_vetoesLeft
g_vetoesLeft
=
int core.stdc.stdlib.atoi(scope const(char*) nptr) nothrow @nogc
atoi
(
(local variable) const(char*) v
v
);
g_display = wl_display_connect(null); if (g_display is null) {
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("SKIP: no Wayland compositor (wl_display_connect returned null)\n");
return 0; } g_registry = wsi_display_get_registry(g_display); wsi_registry_add_listener(g_registry, &g_registryListener, null);
undefined identifier `wsi_registry_add_listener`
wl_display_roundtrip(g_display);
undefined identifier `wl_display_roundtrip`
if (g_compositor is null || g_shm is null || g_wmBase is null) {
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("SKIP: compositor lacks a required global\n");
wl_display_disconnect(g_display);
undefined identifier `wl_display_disconnect`
return 0; } wsi_wm_base_add_listener(g_wmBase, &g_wmBaseListener, null);
undefined identifier `wsi_wm_base_add_listener`
g_surface = wsi_compositor_create_surface(g_compositor); g_xdgSurface = wsi_wm_base_get_xdg_surface(g_wmBase, g_surface); wsi_xdg_surface_add_listener(g_xdgSurface, &g_xdgSurfaceListener, null);
undefined identifier `wsi_xdg_surface_add_listener`
g_toplevel = wsi_xdg_surface_get_toplevel(g_xdgSurface); wsi_toplevel_add_listener(g_toplevel, &g_toplevelListener, null);
undefined identifier `wsi_toplevel_add_listener`
wsi_toplevel_set_title(g_toplevel, "wsi-f14-window-state");
undefined identifier `wsi_toplevel_set_title`
const
(local variable) const(char*) appId
appId
=
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
("WSI_APP_ID");
wsi_toplevel_set_app_id(g_toplevel, appId !is null ? appId : "wsi-f14-window-state");
undefined identifier `wsi_toplevel_set_app_id`
instrWindowCreated();
undefined identifier `instrWindowCreated`
wsi_surface_commit(g_surface); // mandatory no-buffer commit
undefined identifier `wsi_surface_commit`
// Poll-driven loop: dispatch when the fd is readable, otherwise tick the // clock. Blocking in wl_display_dispatch would hang the choreography the // moment frame callbacks stop (minimized/occluded — F04). immutable
(local variable) immutable(_error_) fd
fd
= wl_display_get_fd(g_display);
undefined identifier `wl_display_get_fd`
while (
(__gshared global) bool app.g_running
g_running
)
{ if (wl_display_dispatch_pending(g_display) == -1)
undefined identifier `wl_display_dispatch_pending`
break; wl_display_flush(g_display);
undefined identifier `wl_display_flush`
pollfd
(local variable) _error_ pfd
pfd
= {fd: fd, events: POLLIN};
undefined identifier `pollfd`
if (poll(&pfd, 1, 50) > 0 && (pfd.revents & POLLIN))
undefined identifier `poll`
undefined identifier `POLLIN`
{ if (wl_display_dispatch(g_display) == -1)
undefined identifier `wl_display_dispatch`
break; } immutable
(local variable) immutable(_error_) now
now
= instrNowUs();
undefined identifier `instrNowUs`
if (
(__gshared global) bool app.g_autoExit
g_autoExit
&&
(__gshared global) bool app.g_configured
g_configured
)
{ while (
(__gshared global) int app.g_phase
g_phase
<
(immutable global) immutable(long[5]) app.g_stepAt
g_stepAt
.
(constant) ulong immutable(long[5]).length = 5LU
length
&& now >
(immutable global) immutable(long[5]) app.g_stepAt
g_stepAt
[
(__gshared global) int app.g_phase
g_phase
])
void app.step(int phase) nothrow @nogc
step
(
(__gshared global) int app.g_phase
g_phase
++);
if (!
(__gshared global) bool app.g_reported
g_reported
&&
(__gshared global) int app.g_framesAtMinimize
g_framesAtMinimize
>= 0 && now > tReport)
{
(__gshared global) bool app.g_reported
g_reported
= true;
instrEvent("minimize_census",
undefined identifier `instrEvent`, did you mean import `instrument`?
"frames_in_%dms_after_set_minimized=%d total_frames=%d", cast(int)((tReport - tMinimize) / 1000), g_frames - g_framesAtMinimize, g_frames); } if (now >
(__gshared global) long app.g_runUsCap
g_runUsCap
)
(__gshared global) bool app.g_running
g_running
= false;
} } immutable
(local variable) immutable(_error_) err
err
= wl_display_get_error(g_display);
undefined identifier `wl_display_get_error`
if (err != 0) // the compositor died while we lingered (the EPIPE capture) instrEvent("dispatch_error", "errno=%d note=%s", err,
undefined identifier `instrEvent`, did you mean import `instrument`?
err == 32 ? "EPIPE - compositor gone, veto moot".ptr : "connection error".ptr); foreach (ref
(parameter) b
b
; g_buffers)
if (b.
b.handle
handle
!is null)
{ wsi_buffer_destroy(b.
b.handle
handle
);
munmap(b.
b.pixels
pixels
, b.
b.byteSize
byteSize
);
} if (g_frameCb !is null) wsi_callback_destroy(g_frameCb);
undefined identifier `wsi_callback_destroy`
wsi_toplevel_destroy(g_toplevel);
undefined identifier `wsi_toplevel_destroy`
wsi_xdg_surface_destroy(g_xdgSurface);
undefined identifier `wsi_xdg_surface_destroy`
wsi_surface_destroy(g_surface);
undefined identifier `wsi_surface_destroy`
wsi_wm_base_destroy(g_wmBase);
undefined identifier `wsi_wm_base_destroy`
wl_proxy_destroy(cast(wl_proxy*) g_shm);
undefined identifier `wl_proxy_destroy`
wl_proxy_destroy(cast(wl_proxy*) g_compositor);
undefined identifier `wl_proxy_destroy`
wl_proxy_destroy(cast(wl_proxy*) g_registry);
undefined identifier `wl_proxy_destroy`
wl_display_disconnect(g_display);
undefined identifier `wl_display_disconnect`
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("ok: %d frames, %d configures, closes_seen=%d vetoes_left=%d\n",
(__gshared global) int app.g_frames
g_frames
,
(__gshared global) int app.g_configures
g_configures
,
(__gshared global) int app.g_closesSeen
g_closesSeen
,
(__gshared global) int app.g_vetoesLeft
g_vetoesLeft
);
return 0; }