app.dhover×370 error×112all
// F13 — CSD & decoration modes (see ../../f13-decorations.md and
// ../../../features/f13-decorations.md). One binary, three behaviours:
//
//   Mode A (default)      bind zxdg_decoration_manager_v1 when offered, request
//                         server-side, log the compositor's configure mode=…
//                         answer, honor runtime mode switches (the auto storm
//                         flips set_mode(client_side) → unset_mode mid-run).
//   Mode B (CSD)          WSI_FORCE_CSD=1, or whenever SSD is denied or the
//                         protocol is absent (the source= is logged): draw a
//                         minimal title bar (solid rect + block-glyph title +
//                         close box) and a fake-shadow margin ring whose outer
//                         band is 8 resize zones. Pointer-down on the bar →
//                         xdg_toplevel.move(seat, serial); on a band zone →
//                         xdg_toplevel.resize(seat, serial, edge); on the close
//                         box → client shutdown. xdg_surface.set_window_geometry
//                         excludes the margin; every commit logs buffer size vs
//                         geometry so the contract is visible in the trace.
//   WSI_NO_GEOMETRY=1     keep the margin but never call set_window_geometry —
//                         the auto storm's set_maximized then commits a buffer
//                         larger than the configured size, and the compositor's
//                         reaction (weston: fatal invalid_surface_state) is the
//                         "what breaks without it" deliverable.
//
// The libdecor comparison variant lives in ./libdecor-variant/. Headless-safe:
// no compositor → SKIP, exit 0; no seat (headless weston) → the pointer paths
// are unarmed and only the negotiation + geometry story runs.
module 
(module) app
app
;
import c; // ImportC: wayland-client + xdg-shell + xdg-decoration 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
;
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
;
// ----------------------------------------------------------------- tunables enum int
(constant) int app.defaultWidth = 640
defaultWidth
= 640; // window *geometry* size (content + title bar)
enum int
(constant) int app.defaultHeight = 480
defaultHeight
= 480;
enum int
(constant) int app.margin = 12
margin
= 12; // fake-shadow ring around the geometry (CSD only)
enum int
(constant) int app.bandExtra = 4
bandExtra
= 4; // resize band reaches this far inside the geometry
enum int
(constant) int app.titleH = 28
titleH
= 28; // title-bar height, inside the geometry
enum int
(constant) int app.maximizeAtFrame = 30
maximizeAtFrame
= 30,
(constant) int app.unmaximizeAtFrame = 55
unmaximizeAtFrame
= 55;
enum int
(constant) int app.csdModeAtFrame = 80
csdModeAtFrame
= 80,
(constant) int app.unsetModeAtFrame = 105
unsetModeAtFrame
= 105; // decoration mode storm
enum uint
(constant) uint app.BTN_LEFT = 272u
BTN_LEFT
= 0x110;
// -------------------------------------------------------------------- state 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`?
wl_seat*
_error_ app.g_seat
g_seat
;
undefined identifier `wl_seat`, did you mean variable `g_seat`?
wl_pointer*
_error_ app.g_pointer
g_pointer
;
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
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`?
zxdg_decoration_manager_v1*
_error_ app.g_decoMgr
g_decoMgr
;
undefined identifier `zxdg_decoration_manager_v1`
zxdg_toplevel_decoration_v1*
_error_ app.g_deco
g_deco
;
undefined identifier `zxdg_toplevel_decoration_v1`
wl_callback*
_error_ app.g_frameCb
g_frameCb
;
undefined identifier `wl_callback`
(struct) app.Buffer
Buffer
[2]
_error_ app.g_buffers
g_buffers
;
int
(__gshared global) int app.g_geoW
g_geoW
= defaultWidth,
(__gshared global) int app.g_geoH
g_geoH
= defaultHeight; // acked geometry size
int
(__gshared global) int app.g_pendingWidth
g_pendingWidth
,
(__gshared global) int app.g_pendingHeight
g_pendingHeight
;
bool
(__gshared global) bool app.g_maximized
g_maximized
,
(__gshared global) bool app.g_fullscreen
g_fullscreen
,
(__gshared global) bool app.g_activated
g_activated
;
uint
(__gshared global) uint app.g_decoMode
g_decoMode
; // 0 = no answer yet / protocol absent
bool
(__gshared global) bool app.g_forceCsd
g_forceCsd
,
(__gshared global) bool app.g_noGeometry
g_noGeometry
,
(__gshared global) bool app.g_noStorm
g_noStorm
;
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
= 2_500_000;
int
(__gshared global) int app.g_frames
g_frames
,
(__gshared global) int app.g_commits
g_commits
;
int
(__gshared global) int app.g_lastLoggedBw
g_lastLoggedBw
,
(__gshared global) int app.g_lastLoggedBh
g_lastLoggedBh
; // commit-log dedup
int
(__gshared global) int app.g_ptrX
g_ptrX
,
(__gshared global) int app.g_ptrY
g_ptrY
; // surface-local pointer position
int
(__gshared global) int app.g_zone
g_zone
= -99; // last logged csd_hit zone
} // ------------------------------------------------------------ CSD geometry bool
bool app.csdActive() nothrow @nogc
csdActive
() nothrow @nogc
{ return
(__gshared global) bool app.g_forceCsd
g_forceCsd
||
(__gshared global) uint app.g_decoMode
g_decoMode
!= ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
undefined identifier `ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE`
} /// Fake-shadow margin currently in effect. Real CSD drops its shadow when /// maximized/fullscreen (the geometry must exactly match the configured size /// anyway); the WSI_NO_GEOMETRY probe keeps it to arm the violation. int
int app.marginNow() nothrow @nogc

Fake-shadow margin currently in effect. Real CSD drops its shadow when maximized/fullscreen (the geometry must exactly match the configured size anyway); the WSI_NO_GEOMETRY probe keeps it to arm the violation.

marginNow
() nothrow @nogc
{ if (!
bool app.csdActive() nothrow @nogc
csdActive
())
return 0; if (
(__gshared global) bool app.g_noGeometry
g_noGeometry
)
return
(constant) int app.margin = 12
margin
;
return (
(__gshared global) bool app.g_maximized
g_maximized
||
(__gshared global) bool app.g_fullscreen
g_fullscreen
) ? 0 :
(constant) int app.margin = 12
margin
;
} bool
bool app.titleBarNow() nothrow @nogc
titleBarNow
() nothrow @nogc
{ return
bool app.csdActive() nothrow @nogc
csdActive
() && !
(__gshared global) bool app.g_fullscreen
g_fullscreen
;
} // Zone codes: 1..10 = xdg_toplevel resize_edge enum, 100 = title bar, // 101 = close box, 0 = content. int
int app.zoneAt(int x, int y, int bw, int bh) nothrow @nogc
zoneAt
(int
(parameter) int x
x
, int
(parameter) int y
y
, int
(parameter) int bw
bw
, int
(parameter) int bh
bh
) nothrow @nogc
{ immutable
(local variable) immutable(int) m
m
=
int app.marginNow() nothrow @nogc

Fake-shadow margin currently in effect. Real CSD drops its shadow when maximized/fullscreen (the geometry must exactly match the configured size anyway); the WSI_NO_GEOMETRY probe keeps it to arm the violation.

marginNow
();
if (
(local variable) immutable(int) m
m
> 0)
{ immutable
(local variable) immutable(int) band
band
=
(local variable) immutable(int) m
m
+
(constant) int app.bandExtra = 4
bandExtra
;
uint
(local variable) uint e
e
= 0;
if (
(parameter) int y
y
<
(local variable) immutable(int) band
band
)
(local variable) uint e
e
|= XDG_TOPLEVEL_RESIZE_EDGE_TOP;
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_TOP`
else if (
(parameter) int y
y
>=
(parameter) int bh
bh
-
(local variable) immutable(int) band
band
)
(local variable) uint e
e
|= XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM`
if (
(parameter) int x
x
<
(local variable) immutable(int) band
band
)
(local variable) uint e
e
|= XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_LEFT`
else if (
(parameter) int x
x
>=
(parameter) int bw
bw
-
(local variable) immutable(int) band
band
)
(local variable) uint e
e
|= XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_RIGHT`
if (
(local variable) uint e
e
!= 0)
return cast(int)
(local variable) uint e
e
;
} if (
bool app.titleBarNow() nothrow @nogc
titleBarNow
() &&
(parameter) int y
y
>=
(local variable) immutable(int) m
m
&&
(parameter) int y
y
<
(local variable) immutable(int) m
m
+
(constant) int app.titleH = 28
titleH
&&
(parameter) int x
x
>=
(local variable) immutable(int) m
m
&&
(parameter) int x
x
<
(parameter) int bw
bw
-
(local variable) immutable(int) m
m
)
return
(parameter) int x
x
>=
(parameter) int bw
bw
-
(local variable) immutable(int) m
m
-
(constant) int app.titleH = 28
titleH
? 101 : 100;
return 0; } const(char)*
const(char)* app.zoneName(int z) nothrow @nogc
zoneName
(int
(parameter) int z
z
) nothrow @nogc
{ switch (
(parameter) int z
z
)
{ case 100: return "title"; case 101: return "close"; case XDG_TOPLEVEL_RESIZE_EDGE_TOP: return "top";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_TOP`
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM: return "bottom";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM`
case XDG_TOPLEVEL_RESIZE_EDGE_LEFT: return "left";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_LEFT`
case XDG_TOPLEVEL_RESIZE_EDGE_RIGHT: return "right";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_RIGHT`
case XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT: return "top_left";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT`
case XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT: return "top_right";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT`
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT: return "bottom_left";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT`
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT: return "bottom_right";
undefined identifier `XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT`
default: return "content"; } } // ----------------------------------------------------------------- painting // 3×5 block glyphs for the title "WSI-F13 CSD"; each row is 3 bits, msb left. struct
(struct) app.Glyph
Glyph
{ char
(field) char app.Glyph.c
c
;
ubyte[5]
(field) ubyte[5] app.Glyph.rows
rows
;
} __gshared immutable
(struct) app.Glyph
Glyph
[10]
(immutable global) immutable(app.Glyph[10]) app.g_font
g_font
= [
{'W', [0b101, 0b101, 0b101, 0b111, 0b101]}, {'S', [0b111, 0b100, 0b111, 0b001, 0b111]}, {'I', [0b111, 0b010, 0b010, 0b010, 0b111]}, {'-', [0b000, 0b000, 0b111, 0b000, 0b000]}, {'F', [0b111, 0b100, 0b110, 0b100, 0b100]}, {'1', [0b010, 0b110, 0b010, 0b010, 0b111]}, {'3', [0b111, 0b001, 0b011, 0b001, 0b111]}, {'C', [0b111, 0b100, 0b100, 0b100, 0b111]}, {'D', [0b110, 0b101, 0b101, 0b101, 0b110]}, {' ', [0b000, 0b000, 0b000, 0b000, 0b000]}, ]; void
app.fillRect
fillRect
(ref
(struct) app.Buffer
Buffer
(parameter) Buffer b
b
, int
(parameter) int x0
x0
, int
(parameter) int y0
y0
, int
(parameter) int w
w
, int
(parameter) int h
h
, uint argb) nothrow @nogc
{ foreach (
(parameter) y
y
; y0 .. y0 + h)
{ if (y < 0 || y >= b.
b.height
height
)
continue; uint*
_error_ row
row
= b.
b.pixels
pixels
+ cast(
(unresolved type) size_t
size_t
) y * b.
b.width
width
;
foreach (
(parameter) x
x
; x0 .. x0 + w)
if (x >= 0 && x < b.
b.width
width
)
row[x] = argb; } } void
app.drawTitle
drawTitle
(ref
(struct) app.Buffer
Buffer
(parameter) Buffer b
b
, int
(parameter) int x
x
, int
(parameter) int y
y
) nothrow @nogc
{ enum
(constant) scale = 3
scale
= 3;
static immutable
(unresolved type) string
string
string text
text
= "WSI-F13 CSD";
foreach (
(parameter) ch
ch
; text)
{ foreach (ref
(parameter) g
g
; g_font)
if (g.
g.c
c
== ch)
{ foreach (
(parameter) ry
ry
; 0 .. 5)
foreach (
(parameter) rx
rx
; 0 .. 3)
if (g.
g.rows
rows
[ry] & (0b100 >> rx))
fillRect(b, x + rx * scale, y + ry * scale, scale, scale, 0xffe5_e9f0); break; } x += 4 * scale; } } /// Paint the whole buffer: margin ring (fake shadow), title bar + glyphs + /// close box, content gradient — or just the gradient when SSD is active. void
app.paint

Paint the whole buffer: margin ring (fake shadow), title bar + glyphs + close box, content gradient — or just the gradient when SSD is active.

paint
(ref
(struct) app.Buffer
Buffer
(parameter) Buffer b
b
) nothrow @nogc
{ immutable
_error_ m
m
= marginNow();
immutable
_error_ tb
tb
= titleBarNow() ? titleH : 0;
if (m > 0) // semi-transparent "shadow" — ARGB8888 has real alpha fillRect(b, 0, 0, b.
b.width
width
, b.
b.height
height
, 0x4010_1010);
if (tb > 0) { fillRect(b, m, m, b.
b.width
width
- 2 * m, tb, 0xff2e_3440);
drawTitle(b, m + 10, m + 6); // close box: rightmost titleH×titleH square of the bar, with an X immutable
_error_ cx
cx
= b.
b.width
width
- m - titleH;
fillRect(b, cx, m, titleH, titleH, 0xff8b_2e2e); foreach (
(parameter) i
i
; 6 .. titleH - 6)
{ fillRect(b, cx + i, m + i, 2, 2, 0xffff_ffff); fillRect(b, cx + titleH - i - 2, m + i, 2, 2, 0xffff_ffff); } } // content gradient (scaffold pattern), below the title bar immutable
_error_ x0
x0
= m,
_error_ y0
y0
= m + tb,
_error_ cw
cw
= b.
b.width
width
- 2 * m,
_error_ chh
chh
= b.
b.height
height
- 2 * m - tb;
foreach (
(parameter) y
y
; 0 .. chh)
{ uint*
_error_ row
row
= b.
b.pixels
pixels
+ cast(
(unresolved type) size_t
size_t
)(y0 + y) * b.
b.width
width
+ x0;
immutable uint
_error_ g
g
= cast(uint)(y * 255 / (chh > 1 ? chh - 1 : 1)) << 8;
foreach (
(parameter) x
x
; 0 .. cw)
row[x] = 0xff00_0000 | (cast(uint)(x * 255 / (cw > 1 ? cw - 1 : 1)) << 16) | g; } } // ---------------------------------------------------------- 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-f13", 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_ARGB8888);
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; } /// Paint + commit. Buffer = geometry + 2×margin; set_window_geometry tells the /// compositor which part of it is "the window" — unless WSI_NO_GEOMETRY=1. void
void app.render() nothrow @nogc

Paint + commit. Buffer = geometry + 2×margin; set_window_geometry tells the compositor which part of it is "the window" — unless WSI_NO_GEOMETRY=1.

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 immutable
(local variable) immutable(int) m
m
=
int app.marginNow() nothrow @nogc

Fake-shadow margin currently in effect. Real CSD drops its shadow when maximized/fullscreen (the geometry must exactly match the configured size anyway); the WSI_NO_GEOMETRY probe keeps it to arm the violation.

marginNow
();
immutable
(local variable) immutable(int) bw
bw
=
(__gshared global) int app.g_geoW
g_geoW
+ 2 *
(local variable) immutable(int) m
m
,
(local variable) immutable(int) bh
bh
=
(__gshared global) int app.g_geoH
g_geoH
+ 2 *
(local variable) immutable(int) m
m
;
if (!ensureBuffer(*buf, bw, bh)) {
(__gshared global) bool app.g_running
g_running
= false;
return; } paint(*buf); if (
bool app.csdActive() nothrow @nogc
csdActive
() && !
(__gshared global) bool app.g_noGeometry
g_noGeometry
)
wsi_xdg_surface_set_window_geometry(g_xdgSurface, m, m, g_geoW, g_geoH);
undefined identifier `wsi_xdg_surface_set_window_geometry`
if (
(local variable) immutable(int) bw
bw
!=
(__gshared global) int app.g_lastLoggedBw
g_lastLoggedBw
||
(local variable) immutable(int) bh
bh
!=
(__gshared global) int app.g_lastLoggedBh
g_lastLoggedBh
)
{ instrEvent("commit", "buffer=%dx%d geometry=%dx%d@%d,%d geometry_set=%d csd=%d",
undefined identifier `instrEvent`, did you mean import `instrument`?
bw, bh, g_geoW, g_geoH, m, m, (csdActive() && !g_noGeometry) ? 1 : 0, csdActive() ? 1 : 0);
(__gshared global) int app.g_lastLoggedBw
g_lastLoggedBw
=
(local variable) immutable(int) bw
bw
;
(__gshared global) int app.g_lastLoggedBh
g_lastLoggedBh
=
(local variable) immutable(int) bh
bh
;
} wsi_surface_attach(g_surface, buf.
buf.handle
handle
, 0, 0);
undefined identifier `wsi_surface_attach`
wsi_surface_damage_buffer(g_surface, 0, 0, bw, bh);
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;
(__gshared global) int app.g_commits
g_commits
++;
if (
(__gshared global) int app.g_commits
g_commits
== 1)
instrEvent("first_commit", "buffer=%dx%d", bw, bh);
undefined identifier `instrEvent`, did you mean import `instrument`?
} // ---------------------------------------------------------------- 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)*
(parameter) const(char)* iface
iface
, uint ver) nothrow @nogc
{ static uint
uint capped(uint a, uint w) nothrow @nogc
capped
(uint
(parameter) uint a
a
, uint
(parameter) uint w
w
) nothrow @nogc
{ return a < w ? a : w; } if (strcmp(iface, wl_compositor_interface.name) == 0) g_compositor = cast(wl_compositor*) wsi_registry_bind(reg, name, &wl_compositor_interface, capped(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) g_wmBase = cast(xdg_wm_base*) wsi_registry_bind(reg, name, &xdg_wm_base_interface, 1); else if (strcmp(iface, wl_seat_interface.name) == 0 && g_seat is null) { g_seat = cast(wl_seat*) wsi_registry_bind(reg, name, &wl_seat_interface, capped(ver, 5)); wsi_seat_add_listener(g_seat, &g_seatListener, null); } else if (strcmp(iface, zxdg_decoration_manager_v1_interface.name) == 0) g_decoMgr = cast(zxdg_decoration_manager_v1*) wsi_registry_bind(reg, name, &zxdg_decoration_manager_v1_interface, 1); else return; instrEvent("step", "name=wl_registry_bind iface=%s version=%u", iface, ver); } 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); } /// zxdg_toplevel_decoration_v1.configure: the compositor's decoration answer. /// "The specified mode must be obeyed by the client." extern (C) void
app.onDecorationConfigure

zxdg_toplevel_decoration_v1.configure: the compositor's decoration answer. "The specified mode must be obeyed by the client."

onDecorationConfigure
(void* data, zxdg_toplevel_decoration_v1* d,
undefined identifier `zxdg_toplevel_decoration_v1`
uint mode) nothrow @nogc { immutable
_error_ prev
prev
= g_decoMode;
g_decoMode = mode; instrEvent("decoration", "mode=%s source=protocol raw=%u", mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE ? "ssd".
"ssd".ptr
ptr
: "csd".
"csd".ptr
ptr
, mode);
if (g_configured && prev != mode) render(); // honor the runtime switch: redraw with/without the frame } 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; g_maximized = g_fullscreen = g_activated = false; const
_error_ start
start
= cast(const(uint)*) states.data;
foreach (
(parameter) i
i
; 0 .. states.
states.size
size
/ uint.sizeof)
{ if (start[i] == XDG_TOPLEVEL_STATE_MAXIMIZED) g_maximized = true; if (start[i] == XDG_TOPLEVEL_STATE_FULLSCREEN) g_fullscreen = true; if (start[i] == XDG_TOPLEVEL_STATE_ACTIVATED) g_activated = true; } instrEvent("xdg_toplevel_configure", "size=%dx%d maximized=%d fullscreen=%d activated=%d", w, h, g_maximized ? 1 : 0, g_fullscreen ? 1 : 0, g_activated ? 1 : 0); } 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`?
{ // The configured size is the *window geometry* size — the buffer adds the // margin back on top of it (the heart of the set_window_geometry contract). immutable
_error_ w
w
= g_pendingWidth > 0 ? g_pendingWidth : defaultWidth;
immutable
_error_ h
h
= g_pendingHeight > 0 ? g_pendingHeight : defaultHeight;
instrEvent("configure", "serial=%u size=%dx%d", serial, w, h); wsi_xdg_surface_ack_configure(s, serial); immutable
_error_ resized
resized
= w != g_geoW || h != g_geoH;
g_geoW = w; g_geoH = h; if (!g_configured) { g_configured = true; instrFirstConfigure(); render(); } else if (resized) render(); } extern (C) void
app.onToplevelClose
onToplevelClose
(void* data, xdg_toplevel* t) nothrow @nogc
undefined identifier `xdg_toplevel`, did you mean variable `g_toplevel`?
{ 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`
{ } 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;
if (g_running && g_configured && g_frameCb is null) render(); } 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_autoExit) { if (!g_noStorm) { if (g_frames == maximizeAtFrame) { instrEvent("state_request", "kind=set_maximized"); wsi_toplevel_set_maximized(g_toplevel); } else if (g_frames == unmaximizeAtFrame) { instrEvent("state_request", "kind=unset_maximized"); wsi_toplevel_unset_maximized(g_toplevel); } else if (g_frames == csdModeAtFrame && g_deco !is null) { instrEvent("decoration_request", "mode=client_side"); wsi_decoration_set_mode(g_deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE); } else if (g_frames == unsetModeAtFrame && g_deco !is null) { instrEvent("decoration_request", "mode=unset"); wsi_decoration_unset_mode(g_deco); } } if (instrNowUs() > g_runUsCap) // time-based: sway runs need the injection window { g_running = false; return; } } render(); } // ------------------------------------------------------- pointer (CSD input) extern (C) void
app.onPointerEnter
onPointerEnter
(void* data, wl_pointer* p, uint serial,
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
wl_surface* surf, int sx, int sy) nothrow @nogc
undefined identifier `wl_surface`, did you mean variable `g_surface`?
{ g_ptrX = sx / 256; g_ptrY = sy / 256; instrEvent("pointer_enter", "serial=%u pos=%d,%d", serial, g_ptrX, g_ptrY); } extern (C) void
app.onPointerLeave
onPointerLeave
(void* data, wl_pointer* p, uint serial, wl_surface* surf) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
undefined identifier `wl_surface`, did you mean variable `g_surface`?
{ g_zone = -99; } extern (C) void
app.onPointerMotion
onPointerMotion
(void* data, wl_pointer* p, uint time, int sx, int sy) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ g_ptrX = sx / 256; g_ptrY = sy / 256; immutable
_error_ m
m
= marginNow();
immutable
_error_ z
z
= zoneAt(g_ptrX, g_ptrY, g_geoW + 2 * m, g_geoH + 2 * m);
if (z != g_zone) { g_zone = z; instrEvent("csd_hit", "zone=%s pos=%d,%d", zoneName(z), g_ptrX, g_ptrY); } } extern (C) void
app.onPointerButton
onPointerButton
(void* data, wl_pointer* p, uint serial, uint time,
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
uint button, uint state) nothrow @nogc { instrEvent("pointer_button", "serial=%u button=0x%x state=%u", serial, button, state); if (button != BTN_LEFT || state != WL_POINTER_BUTTON_STATE_PRESSED || !csdActive()) return; immutable
_error_ m
m
= marginNow();
immutable
_error_ z
z
= zoneAt(g_ptrX, g_ptrY, g_geoW + 2 * m, g_geoH + 2 * m);
if (z == 100) { instrEvent("move_start", "serial=%u", serial); wsi_toplevel_move(g_toplevel, g_seat, serial); } else if (z >= 1 && z <= 10) { instrEvent("resize_start", "edge=%u name=%s serial=%u", cast(uint) z, zoneName(z), serial); wsi_toplevel_resize(g_toplevel, g_seat, serial, cast(uint) z); } else if (z == 101) { // The close box sends *nothing* on the wire — CSD close is a pure // client-side decision (F14 owns the vetoable-close choreography). instrEvent("csd_close", "note=client shutdown, no protocol request"); g_running = false; } } extern (C) void
app.onPointerAxis
onPointerAxis
(void* data, wl_pointer* p, uint t, uint
(parameter) uint a
a
, int
(parameter) int v
v
) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerFrame
onPointerFrame
(void* data, wl_pointer* p) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerAxisSource
onPointerAxisSource
(void* data, wl_pointer* p, uint s) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerAxisStop
onPointerAxisStop
(void* data, wl_pointer* p, uint t, uint
(parameter) uint a
a
) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerAxisDiscrete
onPointerAxisDiscrete
(void* data, wl_pointer* p, uint
(parameter) uint a
a
, int d) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerAxisValue120
onPointerAxisValue120
(void* data, wl_pointer* p, uint
(parameter) uint a
a
, int
(parameter) int v
v
) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onPointerAxisRelDir
onPointerAxisRelDir
(void* data, wl_pointer* p, uint
(parameter) uint a
a
, uint dir) nothrow @nogc
undefined identifier `wl_pointer`, did you mean variable `g_pointer`?
{ } extern (C) void
app.onSeatCapabilities
onSeatCapabilities
(void* data, wl_seat* s, uint caps) nothrow @nogc
undefined identifier `wl_seat`, did you mean variable `g_seat`?
{ immutable
_error_ hasPointer
hasPointer
= (caps & WL_SEAT_CAPABILITY_POINTER) != 0;
instrEvent("seat_capabilities", "caps=%u pointer=%d", caps, hasPointer ? 1 : 0); if (hasPointer && g_pointer is null) { g_pointer = wsi_seat_get_pointer(g_seat); wsi_pointer_add_listener(g_pointer, &g_pointerListener, null); } else if (!hasPointer && g_pointer !is null) { wsi_pointer_destroy(g_pointer); // capability flap (wlrctl unplug) g_pointer = null; } } extern (C) void
app.onSeatName
onSeatName
(void* data, wl_seat* s, const(char)* name) nothrow @nogc
undefined identifier `wl_seat`, did you mean variable `g_seat`?
{ } __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 wl_seat_listener
_error_ app.g_seatListener
g_seatListener
= {&onSeatCapabilities, &onSeatName};
undefined identifier `wl_seat_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 zxdg_toplevel_decoration_v1_listener
_error_ app.g_decoListener
g_decoListener
= {&onDecorationConfigure};
undefined identifier `zxdg_toplevel_decoration_v1_listener`
__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`
__gshared wl_pointer_listener
_error_ app.g_pointerListener
g_pointerListener
= {
undefined identifier `wl_pointer_listener`
&onPointerEnter, &onPointerLeave, &onPointerMotion, &onPointerButton, &onPointerAxis, &onPointerFrame, &onPointerAxisSource, &onPointerAxisStop, &onPointerAxisDiscrete, &onPointerAxisValue120, &onPointerAxisRelDir }; // ----------------------------------------------------------------- teardown void
void app.teardown() nothrow @nogc
teardown
() nothrow @nogc
{ 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`
if (g_deco !is null) // spec: "must be destroyed before its xdg_toplevel" wsi_decoration_destroy(g_deco);
undefined identifier `wsi_decoration_destroy`
if (g_pointer !is null) wsi_pointer_destroy(g_pointer);
undefined identifier `wsi_pointer_destroy`
if (g_toplevel !is null) wsi_toplevel_destroy(g_toplevel);
undefined identifier `wsi_toplevel_destroy`
if (g_xdgSurface !is null) wsi_xdg_surface_destroy(g_xdgSurface);
undefined identifier `wsi_xdg_surface_destroy`
if (g_surface !is null) wsi_surface_destroy(g_surface);
undefined identifier `wsi_surface_destroy`
if (g_decoMgr !is null) wsi_decoration_manager_destroy(g_decoMgr);
undefined identifier `wsi_decoration_manager_destroy`
if (g_wmBase !is null) wsi_wm_base_destroy(g_wmBase);
undefined identifier `wsi_wm_base_destroy`
if (g_seat !is null) wl_proxy_destroy(cast(wl_proxy*) g_seat);
undefined identifier `wl_proxy_destroy`
if (g_shm !is null) wl_proxy_destroy(cast(wl_proxy*) g_shm);
undefined identifier `wl_proxy_destroy`
if (g_compositor !is null) wl_proxy_destroy(cast(wl_proxy*) g_compositor);
undefined identifier `wl_proxy_destroy`
if (g_registry !is null) wl_proxy_destroy(cast(wl_proxy*) g_registry);
undefined identifier `wl_proxy_destroy`
wl_display_disconnect(g_display);
undefined identifier `wl_display_disconnect`
} // --------------------------------------------------------------------- main int
int D main(string[] args)
main
(
(alias) object.string = string
string
[]
(parameter) string[] args
args
)
{ if (
(parameter) string[] args
args
.
(field) ulong string[].length
length
>= 2 &&
(parameter) string[] args
args
[1] == "inject")
{ import inject : injectMain;
unable to read module `inject` Expected 'inject.d' or 'inject/package.d' in one of the following import paths:
import
(package) std
std
.
(module) std.conv

A one-stop shop for converting values from one type to another.

Category Functions
Generic asOriginalType castFrom parse to toChars bitCast
Strings text wtext dtext writeText writeWText writeDText hexString
Numeric octal roundTo signed unsigned
Exceptions ConvException ConvOverflowException

Source

std/conv.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Shin Fujishiro, Adam D. Ruppe, Kenji Hara
conv
:
(alias template) to = std.conv.to(T)

The to template converts a value from one type _to another. The source type is deduced and the target type must be specified, for example the expression to!int(42.0) converts the number 42 from double _to int. The conversion is "safe", i.e., it checks for overflow; to!int(4.2e10) would throw the ConvOverflowException exception. Overflow checks are only inserted when necessary, e.g., to!double(42) does not do any checking because any int fits in a double.

Conversions from string _to numeric types differ from the C equivalents atoi() and atol() by checking for overflow and not allowing whitespace.

For conversion of strings _to signed types, the grammar recognized is: $(PRE $(I Integer): $(I Sign UnsignedInteger) $(I UnsignedInteger) $(I Sign): $(B +) $(B -))

For conversion _to unsigned types, the grammar recognized is: $(PRE $(I UnsignedInteger): $(I DecimalDigit) $(I DecimalDigit) $(I UnsignedInteger))

to
;
return injectMain(args.
args.length
length
> 2 ? args[2].to!int : 500,
undefined identifier `injectMain`
args.
args.length
length
> 3 ? args[3].to!int : 400);
} instrInit("f13-deco");
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");
(__gshared global) bool app.g_forceCsd
g_forceCsd
=
bool app.main.env(const(char)* n) nothrow @nogc @system
env
("WSI_FORCE_CSD");
(__gshared global) bool app.g_noGeometry
g_noGeometry
=
bool app.main.env(const(char)* n) nothrow @nogc @system
env
("WSI_NO_GEOMETRY");
(__gshared global) bool app.g_noStorm
g_noStorm
=
bool app.main.env(const(char)* n) nothrow @nogc @system
env
("WSI_NO_STORM");
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;
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");
void app.teardown() nothrow @nogc
teardown
();
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-f13-decorations");
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-f13-decorations");
undefined identifier `wsi_toplevel_set_app_id`
// Decoration negotiation MUST precede any buffer attach ("creating an // xdg_toplevel_decoration from an xdg_toplevel which has a buffer attached // or committed is a client error"). if (g_decoMgr !is null) { g_deco = wsi_decoration_manager_get_toplevel_decoration(g_decoMgr, g_toplevel); wsi_decoration_add_listener(g_deco, &g_decoListener, null);
undefined identifier `wsi_decoration_add_listener`
immutable
(local variable) immutable(_error_) want
want
=
(__gshared global) bool app.g_forceCsd
g_forceCsd
? ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE
undefined identifier `ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE`
: ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
undefined identifier `ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE`
wsi_decoration_set_mode(g_deco, want);
undefined identifier `wsi_decoration_set_mode`
instrEvent("decoration_request", "mode=%s",
undefined identifier `instrEvent`, did you mean import `instrument`?
want == ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE ? "server_side".
"server_side".ptr
ptr
: "client_side".
"client_side".ptr
ptr
);
} else instrEvent("decoration", "mode=csd source=absent"); // no global at all
undefined identifier `instrEvent`, did you mean import `instrument`?
instrWindowCreated();
undefined identifier `instrWindowCreated`
wsi_surface_commit(g_surface); // mandatory no-buffer commit
undefined identifier `wsi_surface_commit`
while (
(__gshared global) bool app.g_running
g_running
&& wl_display_dispatch(g_display) != -1)
undefined identifier `wl_display_dispatch`
{ if (
(__gshared global) bool app.g_autoExit
g_autoExit
&& instrNowUs() >
(__gshared global) long app.g_runUsCap
g_runUsCap
+ 2_000_000)
undefined identifier `instrNowUs`
(__gshared global) bool app.g_running
g_running
= false;
} // Error path: a fatal protocol error (the WSI_NO_GEOMETRY probe earns one) // kills the connection; recover the (interface, code, id) triple. immutable
(local variable) immutable(_error_) err
err
= wl_display_get_error(g_display);
undefined identifier `wl_display_get_error`
if (err != 0) { wl_interface*
(local variable) _error_ iface
iface
;
undefined identifier `wl_interface`
uint
(local variable) uint id
id
;
immutable
(local variable) immutable(_error_) code
code
= wl_display_get_protocol_error(g_display, &iface, &id);
undefined identifier `wl_display_get_protocol_error`
instrEvent("protocol_error", "errno=%d interface=%s code=%u object_id=%u",
undefined identifier `instrEvent`, did you mean import `instrument`?
err, iface !is null ? iface.name : "none".
"none".ptr
ptr
, code, id);
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("outcome: protocol error — interface=%s code=%u (connection killed)\n",
iface !is null ? iface.name : "none".ptr, code);
void app.teardown() nothrow @nogc
teardown
();
return 0; // the probe *expects* this; the evidence is the log }
void app.teardown() nothrow @nogc
teardown
();
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("ok: %d frames, %d commits, final mode=%s geometry=%dx%d\n",
(__gshared global) int app.g_frames
g_frames
,
(__gshared global) int app.g_commits
g_commits
,
bool app.csdActive() nothrow @nogc
csdActive
() ? "csd".
(constant) immutable(char)* "csd".ptr = "csd"
ptr
: "ssd".
(constant) immutable(char)* "ssd".ptr = "ssd"
ptr
,
(__gshared global) int app.g_geoW
g_geoW
,
(__gshared global) int app.g_geoH
g_geoH
);
return 0; }