dismissal-policy.dhover×1243all
#!/usr/bin/env dub
/+ dub.sdl:
    name "anchored_overlays_dismissal_policy"
    targetPath "build"
    dependency "sparkles:ui" path="../../../.."
    dflags "-preview=in" "-preview=dip1000"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * Dismissal as **one value**: a flags word ANDed with a router-offered cause.
 *
 * The survey found dismissal decomposed into three separable things that most
 * implementations tangle — a POLICY (which causes may close this surface), a
 * CAUSE detector (how each cause is recognised), and a CASCADE (how far down a
 * nested stack one close propagates). Only Qt Quick Controls has all three as
 * data: `QQuickPopup::ClosePolicy` is a flags enum and `tryClose(pos, phase)`
 * is one boolean expression, `closePolicy & (phase & outsideFlags)`. Uno/WinUI
 * reached the same shape independently and it rotted into dead code for want of
 * a default. This program is that value form, written the way
 * [8-dismissal](../index.md) and the [proposal](../proposal.md) § 3.6
 * (`DismissPolicy` / `DismissReason`, item `P4`) recommend it for sparkles:
 *
 *   1. **The router names the cause in the policy's own vocabulary** and the
 *      surface answers `dismisses(policy, event, hit)`. Nobody else decides.
 *   2. **A separate class of MANDATORY causes bypasses the word entirely** —
 *      anchor removed, unplaceable, parent closing. An orphan cannot survive.
 *   3. **The two hard parts are pairing and cascade**, and both are shown here
 *      failing as well as working: § 4 pairs press with release (Qt's
 *      `outsidePressed` latch, HTML's two-phase light dismiss), § 5 exempts the
 *      frame an overlay opened on (Slint's `had_popup_on_press`, Turbo Vision's
 *      `firstEvent`), and § 6 truncates a nested chain to an endpoint index
 *      (Blink's `HideAllPopoversUntil`).
 *
 * Companion to docs/research/anchored-overlays/index.md § "Dismissal" and to
 * proposal.md § 3.6.
 *
 * Run with: dub run --single dismissal-policy.d
 *
 * Portability: pure computation over integer cells — no OS, no clock, no
 * display, no input device. Every decision here is assertable on the recording
 * canvas, which is the point of making dismissal a value.
 */
module 
(module) anchored_overlays_dismissal_policy

Dismissal as one value: a flags word ANDed with a router-offered cause.

The survey found dismissal decomposed into three separable things that most implementations tangle — a POLICY (which causes may close this surface), a CAUSE detector (how each cause is recognised), and a CASCADE (how far down a nested stack one close propagates). Only Qt Quick Controls has all three as data: QQuickPopup::ClosePolicy is a flags enum and tryClose(pos, phase) is one boolean expression, closePolicy & (phase & outsideFlags). Uno/WinUI reached the same shape independently and it rotted into dead code for want of a default. This program is that value form, written the way 8-dismissal and the proposal § 3.6 (DismissPolicy / DismissReason, item P4) recommend it for sparkles:

  1. The router names the cause in the policy's own vocabulary and the surface answers dismisses(policy, event, hit). Nobody else decides.

  2. A separate class of MANDATORY causes bypasses the word entirely — anchor removed, unplaceable, parent closing. An orphan cannot survive.

  3. The two hard parts are pairing and cascade, and both are shown here failing as well as working: § 4 pairs press with release (Qt's outsidePressed latch, HTML's two-phase light dismiss), § 5 exempts the frame an overlay opened on (Slint's had_popup_on_press, Turbo Vision's firstEvent), and § 6 truncates a nested chain to an endpoint index (Blink's HideAllPopoversUntil).

Companion to docs/research/anchored-overlays/index.md § "Dismissal" and to proposal.md § 3.6.

Run with: dub run --single dismissal-policy.d

Portability

pure computation over integer cells — no OS, no clock, no display, no input device. Every decision here is assertable on the recording canvas, which is the point of making dismissal a value.

anchored_overlays_dismissal_policy
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio is publically imported when importing std.stdio.

There are three layers of I/O:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) anchored_overlays_dismissal_policy.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

Equivalent to writef(fmt, args, '\n').

writefln
,
(alias template) anchored_overlays_dismissal_policy.writeln = std.stdio.writeln(T...)(T args)

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
;
import
(package) sparkles
sparkles
.
(package) sparkles.base
base
.
(module) sparkles.base.smallbuffer

A @nogc container with Small Buffer Optimization (SBO).

Provides an append-only buffer that stores small amounts of data inline (avoiding heap allocation) and automatically switches to heap storage when capacity is exceeded.

Primary use case: appending elements in a temporary scope where GC allocation is not desired.

smallbuffer
:
(alias struct) anchored_overlays_dismissal_policy.SmallBuffer = sparkles.base.smallbuffer.SmallBuffer(T, ulong N = max(size_t(1), (T[]).sizeof / T.sizeof), bool unique = false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
;
import
(package) sparkles
sparkles
.
(package) sparkles.input
input
.
(module) sparkles.input.events

The shared input vocabulary of sparkles:input (INP1INP4): input is values — one Event sum type over KeyEvent, PointerEvent, WheelEvent, FocusEvent and ResizeEvent — not callbacks registered on widgets. A sum type rather than a kind + dead fields record, so an illegal combination (a key event with a mouse button) is unrepresentable and == compares only what is live.

Every event is a Regular value — copyable, comparable — so interaction tests record byte streams, decode them, and assert on plain equality with no live terminal or window in sight.

Positions are Point — the same sparkles:math instantiation the toolkit's geometry uses (INP3) — in the toolkit's 0-based cell convention, so no conversion happens at the widget boundary. Producers convert their native coordinates (the SGR mouse wire is 1-based; a pixel backend divides by the cell size) when they construct the event.

events
:
(enum) sparkles.input.events.Key

A decoded key. char_ carries a printable code point in KeyEvent.ch; the rest are named keys.

Key
,
(enum) sparkles.input.events.KeyAction

What a key did (INP15).

A terminal cannot report release at all, so a consumer that needs the level of a held key must ask InputCapabilities.keyRelease and offer another route where it is absent — the TGT5 rule, applied to keys. press is the default, so a producer that has not thought about this reports what it always did.

KeyAction
,
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
,
(alias) anchored_overlays_dismissal_policy.isDismiss = bool sparkles.input.events.isDismiss(in sparkles.input.events.KeyEvent k) pure nothrow @nogc @safe

true for the platform spellings of "go back / dismiss" (INP13): Escape on desktop and in the terminal, the system back key on Android.

The framework owns the equivalence; the application owns the chain. hue dismisses a hover popup, then the explorer, then quits — that ordering is hue's, and a different app would nest differently. q is deliberately not here: "q quits" is a keybinding, not a platform spelling of dismiss.

isDismiss
;
import
(package) sparkles
sparkles
.
(package) sparkles.ui
ui
.
(module) sparkles.ui.geometry

Abstract geometry for sparkles.ui: points, sizes, rectangles, and insets measured in abstract cells — the monospace column/row grid every backend shares. An interpreter scales cells to pixels (GUI), keeps them 1:1 (TUI cell grid), or maps them to ch/em (HTML). Nothing here knows about a specific backend.

Also the sizing vocabulary (SizeSpec: fit / grow / fixed / percent with min/max) the layout pass (sparkles.ui.layout) resolves, and cellsOf — the one width authority: the display-column width of a string, counting one column per codepoint to match the grid advance the GUI painter (drawText) and the terminal both use. (Proper wide/combining width is the deferred grapheme-width upgrade; see the hue FNT6/DEF7 roadmap item.)

The 2-D types specialize sparkles.math.vector's numeric Vector, the same way TermSize/TermPosition do for the terminal — one vector implementation and one field vocabulary across the stack.

geometry
:
(alias) anchored_overlays_dismissal_policy.cellsOf = ulong sparkles.ui.geometry.cellsOf(scope const(char)[] s) pure nothrow @nogc @safe

The display-column width of s — the one width authority for the whole library, so the GUI painter, the TUI cell grid, and the layout pass never drift sub-cell.

Counts one column per codepoint (a UTF-8 lead byte, i.e. every byte whose top two bits are not 10), matching the grid advance drawText and the terminal use today. @safe pure nothrow @nogc; invalid UTF-8 degrades to a lead-byte count rather than throwing.

cellsOf
,
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
,
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
;
// --------------------------------------------------------------------------- // The policy value // --------------------------------------------------------------------------- /** Every cause a surface can be closed by, one bit each — the shape of `QQuickPopup::ClosePolicyFlag` and of Uno's `DismissalTriggerFlags`. The router offers a cause in exactly this vocabulary, so the evaluation is an AND. `anchorClipped` is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (`position-visibility: anchor-visible` is the initial value), and the proposal keeps that distinction. */ enum
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
: ushort
{
(enum value) anchored_overlays_dismissal_policy.DismissOn.nothing = cast(ushort)0u
nothing
= 0,
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
= 1 << 0, /// `isDismiss` — Escape and the Android back key (INP13)
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
= 1 << 1,
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
= 1 << 2,
(enum value) anchored_overlays_dismissal_policy.DismissOn.outsideAnchor = cast(ushort)8u

the anchor's own cells count as OUTSIDE, not inside

outsideAnchor
= 1 << 3, /// the anchor's own cells count as OUTSIDE, not inside
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
= 1 << 4,
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
= 1 << 5,
(enum value) anchored_overlays_dismissal_policy.DismissOn.surfaceBlur = cast(ushort)64u

window/app deactivation — not detectable on the TUI

surfaceBlur
= 1 << 6, /// window/app deactivation — not detectable on the TUI
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorGone = cast(ushort)128u

mandatory: bypasses the policy word

anchorGone
= 1 << 7, /// mandatory: bypasses the policy word
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorClipped = cast(ushort)256u

HIDES, does not close

anchorClipped
= 1 << 8, /// HIDES, does not close
(enum value) anchored_overlays_dismissal_policy.DismissOn.unplaceable = cast(ushort)512u

mandatory: the placement solver returned nothing

unplaceable
= 1 << 9, /// mandatory: the placement solver returned nothing
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
= 1 << 10,
(enum value) anchored_overlays_dismissal_policy.DismissOn.scroll = cast(ushort)2048u
scroll
= 1 << 11,
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
= 1 << 12,
(enum value) anchored_overlays_dismissal_policy.DismissOn.cascade = cast(ushort)8192u

mandatory: an ancestor is closing

cascade
= 1 << 13, /// mandatory: an ancestor is closing
(enum value) anchored_overlays_dismissal_policy.DismissOn.timeout = cast(ushort)16384u

the notify band's clock

timeout
= 1 << 14, /// the notify band's clock
} /// Why a surface closed. `xdg-shell`'s argument-less `popup_done` is the named /// anti-pattern: a client that cannot tell Escape from a click outside cannot /// implement "restore focus only when dismissed by keyboard". enum
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
: ubyte
{
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.programmatic = 1
programmatic
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.closeRequest = 2
closeRequest
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.pressOutside = 3
pressOutside
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.releaseOutside = 4
releaseOutside
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.outsideAnchor = 5
outsideAnchor
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.triggerReactivate = 6
triggerReactivate
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.focusOutside = 7
focusOutside
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.surfaceBlur = 8
surfaceBlur
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.unplaceable = 10
unplaceable
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.resize = 11
resize
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.scroll = 12
scroll
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.siblingOpened = 13
siblingOpened
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
,
(enum value) anchored_overlays_dismissal_policy.DismissReason.timeout = 15
timeout
,
} /// The whole dimension, per surface. `group` is Flutter's `groupId`: a menu /// chain is ONE dismiss target, so "inside" is group membership rather than /// geometric descent of a widget tree. struct
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
{
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissPolicy.on
on
;
(alias) object.size_t = ulong
size_t
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
; /// 0 is the bare page — never a surface's own group
bool
(field) bool anchored_overlays_dismissal_policy.DismissPolicy.passThrough

does the dismissing press also reach what it hit?

passThrough
; /// does the dismissing press also reach what it hit?
} /// What the router says happened, in the policy's vocabulary. Exactly one cause /// bit per call — the router owns "what happened", the surface owns "do I care". struct
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
{
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
;
uint
(field) uint anchored_overlays_dismissal_policy.DismissEvent.frame

the frame this event is being routed on

frame
; /// the frame this event is being routed on
bool
(field) bool anchored_overlays_dismissal_policy.DismissEvent.openGuard

honour the one-frame open exemption (§ 5)

openGuard
= true; /// honour the one-frame open exemption (§ 5)
} /// What the router resolved about this event with respect to THIS surface. All /// of it comes from the last painted frame's hit list; none of it needs a grab, /// a capture, a scrim or a platform popup. struct
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
{
(alias) object.size_t = ulong
size_t
(field) ulong anchored_overlays_dismissal_policy.OverlayHit.group

group the CURRENT pointer phase resolved to (0 = bare page)

group
; /// group the CURRENT pointer phase resolved to (0 = bare page)
(alias) object.size_t = ulong
size_t
(field) ulong anchored_overlays_dismissal_policy.OverlayHit.pressGroup

group the PRESS phase resolved to — Qt's latch, Blink's t0

pressGroup
; /// group the PRESS phase resolved to — Qt's latch, Blink's `t0`
bool
(field) bool anchored_overlays_dismissal_policy.OverlayHit.insideAnchor

the point lies in this surface's anchor cells

insideAnchor
; /// the point lies in this surface's anchor cells
uint
(field) uint anchored_overlays_dismissal_policy.OverlayHit.openedFrame

the frame this surface opened on

openedFrame
; /// the frame this surface opened on
} /// The causes the policy word does not get a vote on. An orphaned surface, a /// surface whose anchor is gone, and a surface the solver cannot place are all /// unreachable by any dismissal path — ImGui's sticky-orphan bug is what /// happens when they are not mandatory. enum
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.mandatoryCauses = cast(DismissOn)cast(ushort)8832u

The causes the policy word does not get a vote on. An orphaned surface, a surface whose anchor is gone, and a surface the solver cannot place are all unreachable by any dismissal path — ImGui's sticky-orphan bug is what happens when they are not mandatory.

mandatoryCauses
=
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorGone = cast(ushort)128u

mandatory: bypasses the policy word

anchorGone
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.unplaceable = cast(ushort)512u

mandatory: the placement solver returned nothing

unplaceable
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.cascade = cast(ushort)8192u

mandatory: an ancestor is closing

cascade
);
/// The causes that must be tested against the hit list before they count. enum
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.outsideCauses = cast(DismissOn)cast(ushort)14u

The causes that must be tested against the hit list before they count.

outsideCauses
=
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.outsideAnchor = cast(ushort)8u

the anchor's own cells count as OUTSIDE, not inside

outsideAnchor
);
/// The causes a surface opened this very frame is exempt from. enum
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.guardedCauses = cast(DismissOn)cast(ushort)30u

The causes a surface opened this very frame is exempt from.

guardedCauses
=
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.outsideCauses = cast(DismissOn)cast(ushort)14u

The causes that must be tested against the hit list before they count.

outsideCauses
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
);
/** The whole decision, as one expression per clause. This is `tryClose` with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (`D8.C1`). */
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(in
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
, in
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
, in
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
) @safe pure nothrow @nogc
in (
bool anchored_overlays_dismissal_policy.isSingleCause(in anchored_overlays_dismissal_policy.DismissOn c) pure nothrow @nogc @safe
isSingleCause
(
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
), "the router offers exactly one cause per call")
{ // 1. Mandatory causes bypass the word. if (
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.mandatoryCauses = cast(DismissOn)cast(ushort)8832u

The causes the policy word does not get a vote on. An orphaned surface, a surface whose anchor is gone, and a surface the solver cannot place are all unreachable by any dismissal path — ImGui's sticky-orphan bug is what happens when they are not mandatory.

mandatoryCauses
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
))
return
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.reasonOf(in anchored_overlays_dismissal_policy.DismissOn cause) pure nothrow @nogc @safe
reasonOf
(
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
);
// 2. Qt's `tryClose`: the policy word ANDed with the offered cause. if (!
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissPolicy.on
on
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
))
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
// 3. A surface opened by the very press being routed is exempt from it // (Slint's `had_popup_on_press`, Turbo Vision's `firstEvent` guard). if (
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) bool anchored_overlays_dismissal_policy.DismissEvent.openGuard

honour the one-frame open exemption (§ 5)

openGuard
&&
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.guardedCauses = cast(DismissOn)cast(ushort)30u

The causes a surface opened this very frame is exempt from.

guardedCauses
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
) &&
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
.
(field) uint anchored_overlays_dismissal_policy.OverlayHit.openedFrame

the frame this surface opened on

openedFrame
==
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) uint anchored_overlays_dismissal_policy.DismissEvent.frame

the frame this event is being routed on

frame
)
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
// 4. "Outside" is group membership. The anchor's cells are inside the group // unless the surface opted into the wider scope (the inverse spelling of // Qt's `CloseOnPressOutsideParent`) — which is why pressing an open // popover's own trigger is `triggerReactivate` and never `pressOutside`. if (
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(constant) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.outsideCauses = cast(DismissOn)cast(ushort)14u

The causes that must be tested against the hit list before they count.

outsideCauses
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
))
{ if (
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
.
(field) ulong anchored_overlays_dismissal_policy.OverlayHit.group

group the CURRENT pointer phase resolved to (0 = bare page)

group
==
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
)
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
if (
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
.
(field) bool anchored_overlays_dismissal_policy.OverlayHit.insideAnchor

the point lies in this surface's anchor cells

insideAnchor
&& !
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissPolicy.on
on
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.outsideAnchor = cast(ushort)8u

the anchor's own cells count as OUTSIDE, not inside

outsideAnchor
))
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
// 5. The pairing: a release only dismisses if the press was outside too // (Blink's `t0 == t1`, Qt's `!contains(pressPoint)`). if (
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
==
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
&&
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
.
(field) ulong anchored_overlays_dismissal_policy.OverlayHit.pressGroup

group the PRESS phase resolved to — Qt's latch, Blink's t0

pressGroup
==
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
)
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
} return
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.reasonOf(in anchored_overlays_dismissal_policy.DismissOn cause) pure nothrow @nogc @safe
reasonOf
(
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissEvent.cause
cause
);
} /// The boolean face of $(LREF dismissedBy) — the predicate the router calls when /// it only needs to know whether to plan a close. bool
bool anchored_overlays_dismissal_policy.dismisses(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The boolean face of dismissedBy — the predicate the router calls when it only needs to know whether to plan a close.

dismisses
(in
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
, in
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
, in
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
) @safe pure nothrow @nogc
=>
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) policy
policy
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) event
event
,
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) hit
hit
) !=
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
// --------------------------------------------------------------------------- // Flag plumbing (an enum's `|` promotes to `int`, so combining needs a helper) // ---------------------------------------------------------------------------
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(scope const
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
[]
(parameter) const(anchored_overlays_dismissal_policy.DismissOn[]) flags
flags
...) @safe pure nothrow @nogc
{ ushort
(local variable) ushort acc
acc
;
foreach (
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) f
f
;
(parameter) const(anchored_overlays_dismissal_policy.DismissOn[]) flags
flags
)
(local variable) ushort acc
acc
|= cast(ushort)
(local variable) const(anchored_overlays_dismissal_policy.DismissOn) f
f
;
return cast(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
)
(local variable) ushort acc
acc
;
} bool
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(in
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) set
set
, in
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) bit
bit
) @safe pure nothrow @nogc
=> (cast(ushort)
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) set
set
& cast(ushort)
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) bit
bit
) != 0;
bool
bool anchored_overlays_dismissal_policy.isSingleCause(in anchored_overlays_dismissal_policy.DismissOn c) pure nothrow @nogc @safe
isSingleCause
(in
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) c
c
) @safe pure nothrow @nogc
{ const
(local variable) const(ushort) v
v
= cast(ushort)
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) c
c
;
return
(local variable) const(ushort) v
v
!= 0 && (
(local variable) const(ushort) v
v
& (
(local variable) const(ushort) v
v
- 1)) == 0;
}
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.reasonOf(in anchored_overlays_dismissal_policy.DismissOn cause) pure nothrow @nogc @safe
reasonOf
(in
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) cause
cause
) @safe pure nothrow @nogc
{ switch (
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) cause
cause
)
{ case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.closeRequest = 2
closeRequest
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.pressOutside = 3
pressOutside
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.releaseOutside = 4
releaseOutside
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.outsideAnchor = cast(ushort)8u

the anchor's own cells count as OUTSIDE, not inside

outsideAnchor
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.outsideAnchor = 5
outsideAnchor
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.triggerReactivate = 6
triggerReactivate
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.focusOutside = 7
focusOutside
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.surfaceBlur = cast(ushort)64u

window/app deactivation — not detectable on the TUI

surfaceBlur
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.surfaceBlur = 8
surfaceBlur
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorGone = cast(ushort)128u

mandatory: bypasses the policy word

anchorGone
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.unplaceable = cast(ushort)512u

mandatory: the placement solver returned nothing

unplaceable
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.unplaceable = 10
unplaceable
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.resize = 11
resize
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.scroll = cast(ushort)2048u
scroll
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.scroll = 12
scroll
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.siblingOpened = 13
siblingOpened
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.cascade = cast(ushort)8192u

mandatory: an ancestor is closing

cascade
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
;
case
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.timeout = cast(ushort)16384u

the notify band's clock

timeout
:
return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.timeout = 15
timeout
;
// `anchorClipped` hides the surface; it never closes it. default: return
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
;
} } /// The short label a matrix cell prints for a reason.
(alias) object.string = string
string
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(in
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
(parameter) const(anchored_overlays_dismissal_policy.DismissReason) r
r
) @safe pure nothrow @nogc
{ final switch (
(parameter) const(anchored_overlays_dismissal_policy.DismissReason) r
r
)
{ case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.none = cast(ubyte)0u
none
:
return "·"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.programmatic = 1
programmatic
:
return "prog"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.closeRequest = 2
closeRequest
:
return "esc"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.pressOutside = 3
pressOutside
:
return "press"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.releaseOutside = 4
releaseOutside
:
return "rel"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.outsideAnchor = 5
outsideAnchor
:
return "outanc"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.triggerReactivate = 6
triggerReactivate
:
return "trig"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.focusOutside = 7
focusOutside
:
return "focus"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.surfaceBlur = 8
surfaceBlur
:
return "blur"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
:
return "GONE"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.unplaceable = 10
unplaceable
:
return "NOFIT"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.resize = 11
resize
:
return "resize"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.scroll = 12
scroll
:
return "scroll"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.siblingOpened = 13
siblingOpened
:
return "sib"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
:
return "PARENT"; case
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.timeout = 15
timeout
:
return "time"; } } private struct
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
{
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.FlagName.bit
bit
;
(alias) object.string = string
string
(field) string anchored_overlays_dismissal_policy.FlagName.name
name
;
} private immutable
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
[]
(immutable global) immutable(anchored_overlays_dismissal_policy.FlagName[]) anchored_overlays_dismissal_policy.flagNames
flagNames
= [
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
, "closeRequest"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
, "pressOutside"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
, "releaseOutside"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.outsideAnchor = cast(ushort)8u

the anchor's own cells count as OUTSIDE, not inside

outsideAnchor
, "outsideAnchor"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
, "triggerReactivate"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
, "focusOutside"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.surfaceBlur = cast(ushort)64u

window/app deactivation — not detectable on the TUI

surfaceBlur
, "surfaceBlur"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorGone = cast(ushort)128u

mandatory: bypasses the policy word

anchorGone
, "anchorGone"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorClipped = cast(ushort)256u

HIDES, does not close

anchorClipped
, "anchorClipped"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.unplaceable = cast(ushort)512u

mandatory: the placement solver returned nothing

unplaceable
, "unplaceable"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
, "resize"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.scroll = cast(ushort)2048u
scroll
, "scroll"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
, "siblingOpened"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.cascade = cast(ushort)8192u

mandatory: an ancestor is closing

cascade
, "cascade"),
(struct) anchored_overlays_dismissal_policy.FlagName
FlagName
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.timeout = cast(ushort)16384u

the notify band's clock

timeout
, "timeout"),
]; /// Render a flags word as `a|b|c`. A template, so the writer's attributes infer. void
void anchored_overlays_dismissal_policy.writeFlags!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(in anchored_overlays_dismissal_policy.DismissOn on, ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w) pure nothrow @nogc @safe

Render a flags word as a|b|c. A template, so the writer's attributes infer.

writeFlags
(Writer)(in
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) on
on
, ref
(alias) Writer = sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)
Writer
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
)
{ bool
(local variable) bool first
first
= true;
foreach (
(parameter) immutable(anchored_overlays_dismissal_policy.FlagName) fn
fn
;
(immutable global) immutable(anchored_overlays_dismissal_policy.FlagName[]) anchored_overlays_dismissal_policy.flagNames
flagNames
)
if (
bool anchored_overlays_dismissal_policy.has(in anchored_overlays_dismissal_policy.DismissOn set, in anchored_overlays_dismissal_policy.DismissOn bit) pure nothrow @nogc @safe
has
(
(parameter) const(anchored_overlays_dismissal_policy.DismissOn) on
on
,
(local variable) immutable(anchored_overlays_dismissal_policy.FlagName) fn
fn
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.FlagName.bit
bit
))
{ if (!
(local variable) bool first
first
)
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~= '|';
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~=
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

fn
.
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

name
;
(local variable) bool first
first
= false;
} if (
(local variable) bool first
first
)
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~= "nothing";
} // --------------------------------------------------------------------------- // The presets — five roles, one type // --------------------------------------------------------------------------- /// The band a surface lives in. Only `popup` participates in the dismissal /// stack: `hint` is HTML's separate hint list (tooltips, never a dismissal /// parent) and `notify` is out of the stack entirely. enum
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
: ubyte
{
(enum value) anchored_overlays_dismissal_policy.OverlayBand.hint = cast(ubyte)0u
hint
,
(enum value) anchored_overlays_dismissal_policy.OverlayBand.popup = 1
popup
,
(enum value) anchored_overlays_dismissal_policy.OverlayBand.notify = 2
notify
,
} immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.tooltipDismiss
tooltipDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.scroll = cast(ushort)2048u
scroll
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
),
group: 1, ); immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
),
group: 2, ); immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
),
group: 7, ); /// Qt's modal dialog: `CloseOnEscape` and nothing else — light dismiss off. immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.modalDismiss

Qt's modal dialog: CloseOnEscape and nothing else — light dismiss off.

modalDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
,
group: 4, ); /// A notification toast is not in the dismissal stack and does not answer to the /// pointer; it answers to its own clock. immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.notifierDismiss

A notification toast is not in the dismissal stack and does not answer to the pointer; it answers to its own clock.

notifierDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.timeout = cast(ushort)16384u

the notify band's clock

timeout
,
group: 9, ); /// The touch / WCAG-pointer-cancellation resolution of the same policy: act on /// the release, never on the press (base-ui's per-pointer-type mode). immutable
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.touchPopoverDismiss

The touch / WCAG-pointer-cancellation resolution of the same policy: act on the release, never on the press (base-ui's per-pointer-type mode).

touchPopoverDismiss
=
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(
on:
anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.combine(const(anchored_overlays_dismissal_policy.DismissOn[]) flags...) pure nothrow @nogc @safe
combine
(
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
,
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
),
group: 2, ); // --------------------------------------------------------------------------- // A nested chain, for the cascade // --------------------------------------------------------------------------- enum
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
=
(ulong) ulong
size_t
.
(constant) ulong ulong.max = 18446744073709551615LU
max
;
struct
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
{
(alias) object.string = string
string
(field) string anchored_overlays_dismissal_policy.OverlayRecord.name
name
;
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
(field) anchored_overlays_dismissal_policy.OverlayBand anchored_overlays_dismissal_policy.OverlayRecord.band
band
;
(alias) object.size_t = ulong
size_t
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
=
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
; /// index into the open array
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(field) sparkles.ui.geometry.Rect anchored_overlays_dismissal_policy.OverlayRecord.surface
surface
;
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.OverlayRecord.policy
policy
;
uint
(field) uint anchored_overlays_dismissal_policy.OverlayRecord.openedFrame
openedFrame
;
} /// Strict ancestry over the open array — Avalonia's `IsChildOrThis` climb, on a /// flat arena instead of a visual tree. bool
bool anchored_overlays_dismissal_policy.isDescendant(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong candidate, ulong ancestor) pure nothrow @nogc @safe

Strict ancestry over the open array — Avalonia's IsChildOrThis climb, on a flat arena instead of a visual tree.

isDescendant
(scope const
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
[]
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
,
(alias) object.size_t = ulong
size_t
(parameter) ulong candidate
candidate
,
(alias) object.size_t = ulong
size_t
(parameter) ulong ancestor
ancestor
) @safe pure nothrow @nogc
{ if (
(parameter) ulong candidate
candidate
==
(parameter) ulong ancestor
ancestor
||
(parameter) ulong ancestor
ancestor
==
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
)
return false; for (
(alias) object.size_t = ulong
size_t
(local variable) ulong i
i
=
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
[
(parameter) ulong candidate
candidate
].
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
; i != noParent; i = open[i].parent)
if (
(local variable) ulong i
i
==
(parameter) ulong ancestor
ancestor
)
return true; return false; } /// Reverse paint order is reverse hit order: the last-opened surface wins a cell /// it shares with anything beneath it (HoverState's "later target wins" rule, /// which is also what keeps an overlay and its anchor from both answering true).
(alias) object.size_t = ulong
size_t
ulong anchored_overlays_dismissal_policy.hitIndex(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) pure nothrow @nogc @safe

Reverse paint order is reverse hit order: the last-opened surface wins a cell it shares with anything beneath it (HoverState's "later target wins" rule, which is also what keeps an overlay and its anchor from both answering true).

hitIndex
(scope const
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
[]
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
, in
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) p
p
) @safe pure nothrow @nogc
{ foreach_reverse (
(parameter) ulong i
i
, const
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
;
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
)
if (
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) sparkles.ui.geometry.Rect anchored_overlays_dismissal_policy.OverlayRecord.surface
surface
.
bool sparkles.ui.geometry.Rect.contains(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) const pure nothrow @nogc @safe

true iff p lies inside the half-open rectangle.

contains
(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) p
p
))
return
(local variable) ulong i
i
;
return
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
;
} /// The result of one truncation: what closes, in leaf-to-root order, and why. struct
(struct) anchored_overlays_dismissal_policy.CloseList

The result of one truncation: what closes, in leaf-to-root order, and why.

CloseList
{
(alias) object.size_t = ulong
size_t
[8]
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
;
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
[8]
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
;
(alias) object.size_t = ulong
size_t
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
;
void
void anchored_overlays_dismissal_policy.CloseList.add(ulong i, anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe
add
(
(alias) object.size_t = ulong
size_t
(parameter) ulong i
i
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
(parameter) anchored_overlays_dismissal_policy.DismissReason r
r
) @safe pure nothrow @nogc
in (
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
<
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
.
(constant) ulong ulong[8].length = 8LU
length
, "the demo chain never exceeds 8 open surfaces")
{
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
[
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
] =
(parameter) ulong i
i
;
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
[
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
] =
(parameter) anchored_overlays_dismissal_policy.DismissReason r
r
;
++
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
;
} } /** Blink's `HideAllPopoversUntil`, in a flat arena: compute an ENDPOINT and close everything above it, leaf to root. The endpoint itself stays open; `noParent` means "the bare page", which closes the whole group. The shallowest surface closed is the one the cause actually named; everything above it closes because its parent did — which is the `parentClosed` reason, mandatory and unvetoable. */
(struct) anchored_overlays_dismissal_policy.CloseList

The result of one truncation: what closes, in leaf-to-root order, and why.

CloseList
anchored_overlays_dismissal_policy.CloseList anchored_overlays_dismissal_policy.truncateTo(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong endpoint, ulong group, anchored_overlays_dismissal_policy.DismissReason cause) pure nothrow @nogc @safe

Blink's HideAllPopoversUntil, in a flat arena: compute an ENDPOINT and close everything above it, leaf to root. The endpoint itself stays open; noParent means "the bare page", which closes the whole group.

The shallowest surface closed is the one the cause actually named; everything above it closes because its parent did — which is the parentClosed reason, mandatory and unvetoable.

truncateTo
(scope const
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
[]
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
,
(alias) object.size_t = ulong
size_t
(parameter) ulong endpoint
endpoint
,
(alias) object.size_t = ulong
size_t
(parameter) ulong group
group
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
(parameter) anchored_overlays_dismissal_policy.DismissReason cause
cause
) @safe pure nothrow @nogc
{
(struct) anchored_overlays_dismissal_policy.CloseList

The result of one truncation: what closes, in leaf-to-root order, and why.

CloseList
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
;
(alias) object.size_t = ulong
size_t
(local variable) ulong shallowest
shallowest
=
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
;
foreach_reverse (
(parameter) ulong i
i
, const
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
;
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
)
{ const
(local variable) const(bool) closes
closes
=
(parameter) ulong endpoint
endpoint
==
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
?
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.OverlayRecord.policy
policy
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
==
(parameter) ulong group
group
:
bool anchored_overlays_dismissal_policy.isDescendant(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong candidate, ulong ancestor) pure nothrow @nogc @safe

Strict ancestry over the open array — Avalonia's IsChildOrThis climb, on a flat arena instead of a visual tree.

isDescendant
(
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord[]) open
open
,
(local variable) ulong i
i
,
(parameter) ulong endpoint
endpoint
);
if (!
(local variable) const(bool) closes
closes
)
continue;
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
.
void anchored_overlays_dismissal_policy.CloseList.add(ulong i, anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe
add
(
(local variable) ulong i
i
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
);
(local variable) ulong shallowest
shallowest
=
(local variable) ulong i
i
;
} foreach (
(local variable) ulong k
k
; 0 ..
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
.
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
)
if (
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
.
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
[
(local variable) ulong k
k
] ==
(local variable) ulong shallowest
shallowest
)
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
.
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
[
(local variable) ulong k
k
] =
(parameter) anchored_overlays_dismissal_policy.DismissReason cause
cause
;
return
(local variable) anchored_overlays_dismissal_policy.CloseList closing
closing
;
} // --------------------------------------------------------------------------- /// The hit facts for a single-surface overlay, resolved from the last frame.
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(in
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(parameter) const(sparkles.ui.geometry.Rect) surface
surface
, in
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(parameter) const(sparkles.ui.geometry.Rect) anchor
anchor
, in
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
, in
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) now
now
,
in
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) pressed
pressed
, uint
(parameter) uint openedFrame
openedFrame
) @safe pure nothrow @nogc
=>
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(
group:
(parameter) const(sparkles.ui.geometry.Rect) surface
surface
.
bool sparkles.ui.geometry.Rect.contains(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) const pure nothrow @nogc @safe

true iff p lies inside the half-open rectangle.

contains
(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) now
now
) ?
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
: 0,
pressGroup:
(parameter) const(sparkles.ui.geometry.Rect) surface
surface
.
bool sparkles.ui.geometry.Rect.contains(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) const pure nothrow @nogc @safe

true iff p lies inside the half-open rectangle.

contains
(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) pressed
pressed
) ||
(parameter) const(sparkles.ui.geometry.Rect) anchor
anchor
.
bool sparkles.ui.geometry.Rect.contains(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) const pure nothrow @nogc @safe

true iff p lies inside the half-open rectangle.

contains
(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) pressed
pressed
) ?
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
: 0,
insideAnchor:
(parameter) const(sparkles.ui.geometry.Rect) anchor
anchor
.
bool sparkles.ui.geometry.Rect.contains(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) const pure nothrow @nogc @safe

true iff p lies inside the half-open rectangle.

contains
(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) now
now
),
openedFrame:
(parameter) uint openedFrame
openedFrame
,
);
(alias) object.string = string
string
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(in
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) p
p
) @safe
{ import
(package) std
std
.
(module) std.format

This package provides string formatting functionality using printf style format strings.

Submodule Function Name Description
package
format
Converts its arguments according to a format string into a string.

| package | sformat | Converts its arguments according to a format string into a buffer. |

| package | FormatException | Signals a problem while formatting. |

| write | formattedWrite | Converts its arguments according to a format string and writes the result to an output range. |

| write | formatValue | Formats a value of any type according to a format specifier and writes the result to an output range. |

| read | formattedRead | Reads an input range according to a format string and stores the read values into its arguments. |

| read | unformatValue | Reads a value from the given input range and converts it according to a format specifier. |

| spec | FormatSpec | A general handler for format strings. |

| spec | singleSpec | Helper function that returns a FormatSpec for a single format specifier. |

Limitation

This package does not support localization, but adheres to the rounding mode of the floating point unit, if available.

Format Strings

The functions contained in this package use format strings. A format string describes the layout of another string for reading or writing purposes. A format string is composed of normal text interspersed with format specifiers. A format specifier starts with a percentage sign '%', optionally followed by one or more parameters and ends with a format indicator. A format indicator may be a simple format character or a compound indicator.

Format strings are composed according to the following grammar:

FormatString: FormatStringItem FormatString FormatStringItem: Character FormatSpecifier FormatSpecifier: '%' Parameters FormatIndicator

FormatIndicator: FormatCharacter CompoundIndicator FormatCharacter: see remark below CompoundIndicator: '(' FormatString '%)' '(' FormatString '%|' Delimiter '%)' Delimiter empty Character Delimiter

Parameters: Position Flags Width Precision Separator Position: empty Integer '$'** *Integer* **':'** *Integer* **'$' Integer ':' '$'** *Flags*: *empty* *Flag* *Flags* *Flag*: **'-'**|**'+'**|**'&nbsp;'**|**'0'**|**'#'**|**'='** *Width*: *OptionalPositionalInteger* *Precision*: *empty* **'.'** *OptionalPositionalInteger* *Separator*: *empty* **','** *OptionalInteger* **','** *OptionalInteger* **'?'** *OptionalInteger*: *empty* *Integer* **'*'** *OptionalPositionalInteger*: *OptionalInteger* **'*'** *Integer* **'$'

Character '%%' AnyCharacterExceptPercent Integer: NonZeroDigit Digits Digits: empty Digit Digits NonZeroDigit: '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' Digit: '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'

Note

FormatCharacter is unspecified. It can be any character that has no other purpose in this grammar, but it is recommended to assign (lower- and uppercase) letters.

Note

The Parameters of a CompoundIndicator are currently limited to a '-' flag.

Format Indicator

The format indicator can either be a single character or an expression surrounded by '%(' and '%)'. It specifies the basic manner in which a value will be formatted and is the minimum requirement to format a value.

The following characters can be used as format characters:

FormatCharacter Semantics
's'
To be formatted in a human readable format.
Can be used with all types.
'c'
To be formatted as a character.
'd'
To be formatted as a signed decimal integer.
'u'
To be formatted as a decimal image of the underlying bit representation.
'b'
To be formatted as a binary image of the underlying bit representation.
'o'
To be formatted as an octal image of the underlying bit representation.
'x' / 'X'
To be formatted as a hexadecimal image of the underlying bit representation.
'e' / 'E'
To be formatted as a real number in decimal scientific notation.
'f' / 'F'
To be formatted as a real number in decimal natural notation.
'g' / 'G'
To be formatted as a real number in decimal short notation.
Depending on the number, a scientific notation or
a natural notation is used.
'a' / 'A'
To be formatted as a real number in hexadecimal scientific notation.
'r'
To be formatted as raw bytes.
The output may not be printable and depends on endianness.

The compound indicator can be used to describe compound types like arrays or structs in more detail. A compound type is enclosed within '%(' and '%)'. The enclosed sub-format string is applied to individual elements. The trailing portion of the sub-format string following the specifier for the element is interpreted as the delimiter, and is therefore omitted following the last element. The '%|' specifier may be used to explicitly indicate the start of the delimiter, so that the preceding portion of the string will be included following the last element.

The format string inside of the compound indicator should contain exactly one format specifier (two in case of associative arrays), which specifies the formatting mode of the elements of the compound type. This format specifier can be a compound indicator itself.

Note

Inside a compound indicator, strings and characters are escaped automatically. To avoid this behavior, use "%-(" instead of "%(".

Flags

There are several flags that affect the outcome of the formatting.

Flag Semantics
'-'
When the formatted result is shorter than the value
given by the width parameter, the output is left
justified. Without the '-' flag, the output remains
right justified.

There are two exceptions where the '-' flag has a different meaning: (1) with 'r' it denotes to use little endian and (2) in case of a compound indicator it means that no special handling of the members is applied. | | '=' | When the formatted result is shorter than the value given by the width parameter, the output is centered. If the central position is not possible it is moved slightly to the right. In this case, if '-' flag is present in addition to the '=' flag, it is moved slightly to the left. | | '+'&nbsp;/&nbsp;*'&nbsp;'* | Applies to numerical values. By default, positive numbers are not formatted to include the + sign. With one of these two flags present, positive numbers are preceded by a plus sign or a space. When both flags are present, a plus sign is used.

In case of 'r', a big endian format is used. | | '0' | Is applied to numerical values that are printed right justified. If the zero flag is present, the space left to the number is filled with zeros instead of spaces. | | '#' | Denotes that an alternative output must be used. This depends on the type to be formatted and the format character used. See the sections below for more information. |

Width, Precision and Separator

The width parameter specifies the minimum width of the result.

The meaning of precision depends on the format indicator. For integers it denotes the minimum number of digits printed, for real numbers it denotes the number of fractional digits and for strings and compound types it denotes the maximum number of elements that are included in the output.

A separator is used for formatting numbers. If it is specified, the output is divided into chunks of three digits, separated by a ','. The number of digits in a chunk can be given explicitly by providing a number or a ''* after the ','.

In all three cases the number of digits can be replaced by a ''*. In this scenario, the next argument is used as the number of digits. If the argument is a negative number, the precision and separator parameters are considered unspecified. For width, the absolute value is used and the '-' flag is set.

The separator can also be followed by a '?'. In that case, an additional argument is used to specify the symbol that should be used to separate the chunks.

Position

By default, the arguments are processed in the provided order. With the position parameter it is possible to address arguments directly. It is also possible to denote a series of arguments with two numbers separated by ':', that are all processed in the same way. The second number can be omitted. In that case the series ends with the last argument.

It's also possible to use positional arguments for width, precision and separator by adding a number and a '$' after the ''*.

Types

This section describes the result of combining types with format characters. It is organized in 2 subsections: a list of general information regarding the formatting of types in the presence of format characters and a table that contains details for every available combination of type and format character.

When formatting types, the following rules apply:

  • If the format character is upper case, the resulting string will be formatted using upper case letters.

  • The default precision for floating point numbers is 6 digits.

  • Rounding of floating point numbers adheres to the rounding mode of the floating point unit, if available.

  • The floating point values NaN and Infinity are formatted as nan and inf, possibly preceded by '+' or '-' sign.

  • Formatting reals is only supported for 64 bit reals and 80 bit reals. All other reals are cast to double before they are formatted. This will cause the result to be inf for very large numbers.

  • Characters and strings formatted with the 's' format character inside of compound types are surrounded by single and double quotes and unprintable characters are escaped. To avoid this, a '-' flag can be specified for the compound specifier (e.g. "%-(%s%)" instead of "%(%s%)" ).

  • Structs, unions, classes and interfaces are formatted by calling a toString method if available. See module std.format.write for more details.

  • Only part of these combinations can be used for reading. See module std.format.read for more detailed information.

This table contains descriptions for every possible combination of type and format character:

<th scope="col" width="20%">Type</th> <th scope="col" width="20%">Format Character</th> Formatted as...
<td rowspan="1">null</td> 's'
null

|<td rowspan="3">bool</td> 's' | false or true |

| 'b', 'd', 'o', 'u', 'x', 'X' | As the integrals 0 or 1 with the same format character.

Please note, that 'o' and 'x' with '#' flag might produce unexpected results due to special handling of the value 0. |

| 'r' | \0 or \1 |

|<td rowspan="4">Integral</td> 's', 'd' | A signed decimal number. The '#' flag is ignored. |

| 'b', 'o', 'u', 'x', 'X' | An unsigned binary, decimal, octal or hexadecimal number.

In case of 'o' and 'x', the '#' flag denotes that the number must be preceded by 0 and 0x, with the exception of the value 0, where this does not apply. For 'b' and 'u' the '#' flag has no effect. |

| 'e', 'E', 'f', 'F', 'g', 'G', 'a', 'A' | As a floating point value with the same specifier.

Default precision is large enough to add all digits of the integral value.

In case of 'a' and 'A', the integral digit can be any hexadecimal digit. |

| 'r' | Characters taken directly from the binary representation. |

|<td rowspan="5">Floating Point</td> 'e', 'E' | Scientific notation: Exactly one integral digit followed by a dot and fractional digits, followed by the exponent. The exponent is formatted as 'e' followed by a '+' or '-' sign, followed by at least two digits.

When there are no fractional digits and the '#' flag is not present, the dot is omitted. |

| 'f', 'F' | Natural notation: Integral digits followed by a dot and fractional digits.

When there are no fractional digits and the '#' flag is not present, the dot is omitted.

Please note: the difference between 'f' and 'F' is only visible for NaN and Infinity. |

| 's', 'g', 'G' | Short notation: If the absolute value is larger than 10 ^^ precision or smaller than 0.0001, the scientific notation is used. If not, the natural notation is applied.

In both cases precision denotes the count of all digits, including the integral digits. Trailing zeros (including a trailing dot) are removed.

If '#' flag is present, trailing zeros are not removed. |

| 'a', 'A' | Hexadecimal scientific notation: 0x followed by 1 (or 0 in case of value zero or denormalized number) followed by a dot, fractional digits in hexadecimal notation and an exponent. The exponent is build by p, followed by a sign and the exponent in decimal notation.

When there are no fractional digits and the '#' flag is not present, the dot is omitted. |

| 'r' | Characters taken directly from the binary representation. |

|<td rowspan="3">Character</td> 's', 'c' | As the character.

Inside of a compound indicator 's' is treated differently: The character is surrounded by single quotes and non printable characters are escaped. This can be avoided by preceding the compound indicator with a '-' flag (e.g. "%-(%s%)"). |

| 'b', 'd', 'o', 'u', 'x', 'X' | As the integral that represents the character. |

| 'r' | Characters taken directly from the binary representation. |

|<td rowspan="3">String</td> 's' | The sequence of characters that form the string.

Inside of a compound indicator the string is surrounded by double quotes and non printable characters are escaped. This can be avoided by preceding the compound indicator with a '-' flag (e.g. "%-(%s%)"). |

| 'r' | The sequence of characters, each formatted with 'r'. |

| compound | As an array of characters. |

|<td rowspan="3">Array</td> 's' | When the elements are characters, the array is formatted as a string. In all other cases the array is surrounded by square brackets and the elements are separated by a comma and a space. If the elements are strings, they are surrounded by double quotes and non printable characters are escaped. |

| 'r' | The sequence of the elements, each formatted with 'r'. |

| compound | The sequence of the elements, each formatted according to the specifications given inside of the compound specifier. |

|<td rowspan="2">Associative Array</td> 's' | As a sequence of the elements in unpredictable order. The output is surrounded by square brackets. The elements are separated by a comma and a space. The elements are formatted as key:value. |

| compound | As a sequence of the elements in unpredictable order. Each element is formatted according to the specifications given inside of the compound specifier. The first specifier is used for formatting the key and the second specifier is used for formatting the value. The order can be changed with positional arguments. For example "%(%2$s (%1$s), %)" will write the value, followed by the key in parenthesis. |

|<td rowspan="2">Enum</td> 's' | The name of the value. If the name is not available, the base value is used, preceeded by a cast. |

| All, but 's' | Enums can be formatted with all format characters that can be used with the base value. In that case they are formatted like the base value. |

|<td rowspan="3">Input Range</td> 's' | When the elements of the range are characters, they are written like a string. In all other cases, the elements are enclosed by square brackets and separated by a comma and a space. |

| 'r' | The sequence of the elements, each formatted with 'r'. |

| compound | The sequence of the elements, each formatted according to the specifications given inside of the compound specifier. |

|<td rowspan="1">Struct</td> 's' | When the struct has neither an applicable toString nor is an input range, it is formatted as follows: StructType(field1, field2, ...). |

|<td rowspan="1">Class</td> 's' | When the class has neither an applicable toString nor is an input range, it is formatted as the fully qualified name of the class. |

|<td rowspan="1">Union</td> 's' | When the union has neither an applicable toString nor is an input range, it is formatted as its base name. |

|<td rowspan="2">Pointer</td> 's' | A null pointer is formatted as 'null'. All other pointers are formatted as hexadecimal numbers with the format character 'X'. |

| 'x', 'X' | Formatted as a hexadecimal number. |

|<td rowspan="3">SIMD vector</td> 's' | The array is surrounded by square brackets and the elements are separated by a comma and a space. |

| 'r' | The sequence of the elements, each formatted with 'r'. |

| compound | The sequence of the elements, each formatted according to the specifications given inside of the compound specifier. |

|<td rowspan="1">Delegate</td> 's', 'r', compound | As the .stringof of this delegate treated as a string.

Please note: The implementation is currently buggy and its use is discouraged. |

Source

std/format/package.d

Examples

Simple use:

// Easiest way is to use `%s` everywhere:
assert(format("I got %s %s for %s euros.", 30, "eggs", 5.27) == "I got 30 eggs for 5.27 euros.");

// Other format characters provide more control:
assert(format("I got %b %(%X%) for %f euros.", 30, "eggs", 5.27) == "I got 11110 65676773 for 5.270000 euros.");

Compound specifiers allow formatting arrays and other compound types:

/*
The trailing end of the sub-format string following the specifier for
each item is interpreted as the array delimiter, and is therefore
omitted following the last array item:
 */
    assert(format("My items are %(%s %).", [1,2,3]) == "My items are 1 2 3.");
    assert(format("My items are %(%s, %).", [1,2,3]) == "My items are 1, 2, 3.");

/*
The "%|" delimiter specifier may be used to indicate where the
delimiter begins, so that the portion of the format string prior to
it will be retained in the last array element:
 */
    assert(format("My items are %(-%s-%|, %).", [1,2,3]) == "My items are -1-, -2-, -3-.");

/*
These compound format specifiers may be nested in the case of a
nested array argument:
 */
    auto mat = [[1, 2, 3],
                [4, 5, 6],
                [7, 8, 9]];

    assert(format("%(%(%d %) - %)", mat), "1 2 3 - 4 5 6 - 7 8 9");
    assert(format("[%(%(%d %) - %)]", mat), "[1 2 3 - 4 5 6 - 7 8 9]");
    assert(format("[%([%(%d %)]%| - %)]", mat), "[1 2 3] - [4 5 6] - [7 8 9]");

/*
Strings and characters are escaped automatically inside compound
format specifiers. To avoid this behavior, use "%-(" instead of "%(":
 */
    assert(format("My friends are %s.", ["John", "Nancy"]) == `My friends are ["John", "Nancy"].`);
    assert(format("My friends are %(%s, %).", ["John", "Nancy"]) == `My friends are "John", "Nancy".`);
    assert(format("My friends are %-(%s, %).", ["John", "Nancy"]) == `My friends are John, Nancy.`);

Using parameters:

// Flags can be used to influence to outcome:
assert(format("%g != %+#g", 3.14, 3.14) == "3.14 != +3.14000");

// Width and precision help to arrange the formatted result:
assert(format(">%10.2f<", 1234.56789) == ">   1234.57<");

// Numbers can be grouped:
assert(format("%,4d", int.max) == "21,4748,3647");

// It's possible to specify the position of an argument:
assert(format("%3$s %1$s", 3, 17, 5) == "5 3");

Providing parameters as arguments:

// Width as argument
assert(format(">%*s<", 10, "abc") == ">       abc<");

// Precision as argument
assert(format(">%.*f<", 5, 123.2) == ">123.20000<");

// Grouping as argument
assert(format("%,*d", 1, int.max) == "2,1,4,7,4,8,3,6,4,7");

// Grouping separator as argument
assert(format("%,3?d", '_', int.max) == "2_147_483_647");

// All at once
assert(format("%*.*,*?d", 20, 15, 6, '/', int.max) == "   000/002147/483647");
@copyrightCopyright The D Language Foundation 2000-2021.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, and Kenji Hara
format
:
(alias template) format = std.format.format(Char, Args...)(in Char[] fmt, Args args) if (isSomeChar!Char)

Converts its arguments according to a format string into a string.

The second version of format takes the format string as template argument. In this case, it is checked for consistency at compile-time and produces slightly faster code, because the length of the output buffer can be estimated in advance.

Params: fmt = a $(MREF_ALTTEXT format string, std,format) args = a variadic list of arguments to be formatted Char = character type of fmt Args = a variadic list of types of the arguments

Returns: The formatted string.

Throws: A $(LREF FormatException) if formatting did not succeed.

See_Also: $(LREF sformat) for a variant, that tries to avoid garbage collection.

format
;
return
string std.format.format!("(%d,%d)", const(int), const(int))(const(int) __param_0, const(int) __param_1) pure @safe

Examples

The format string can be checked at compile-time:

auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");

// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format
!"(%d,%d)"(
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) p
p
.
(field) int sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).x
x
,
(parameter) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) p
p
.
(field) int sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).y
y
);
} /// Pad a table cell to `width` display columns. `cellsOf` is the toolkit's one /// width authority — `%-7s` would pad by BYTES and skew every column holding a /// multi-byte `·`. void
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(Writer)(ref
(alias) Writer = sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)
Writer
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
, scope const(char)[]
(parameter) const(char)[] s
s
,
(alias) object.size_t = ulong
size_t
(parameter) ulong width
width
, bool
(parameter) bool leftAlign
leftAlign
= false)
{ const
(local variable) const(ulong) used
used
=
ulong sparkles.ui.geometry.cellsOf(scope const(char)[] s) pure nothrow @nogc @safe

The display-column width of s — the one width authority for the whole library, so the GUI painter, the TUI cell grid, and the layout pass never drift sub-cell.

Counts one column per codepoint (a UTF-8 lead byte, i.e. every byte whose top two bits are not 10), matching the grid advance drawText and the terminal use today. @safe pure nothrow @nogc; invalid UTF-8 degrades to a lead-byte count rather than throwing.

cellsOf
(
(parameter) const(char)[] s
s
);
const
(local variable) const(ulong) pad
pad
=
(parameter) ulong width
width
>
(local variable) const(ulong) used
used
?
(parameter) ulong width
width
-
(local variable) const(ulong) used
used
: 0;
if (
(parameter) bool leftAlign
leftAlign
)
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~=
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

s
;
foreach (
(local variable) ulong _
_
; 0 ..
(local variable) const(ulong) pad
pad
)
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~= ' ';
if (!
(parameter) bool leftAlign
leftAlign
)
(parameter) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w
w
~=
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

s
;
} void
void D main() @safe
main
() @safe
{ // -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("=== 1. Five roles, one type ===");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("Dismissal is not five behaviours; it is one evaluator and five values.");
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
static struct
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
{
(alias) object.string = string
string
(field) string anchored_overlays_dismissal_policy.main.Preset.name
name
;
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.main.Preset.policy
policy
;
} const
(local variable) const(anchored_overlays_dismissal_policy.main.Preset[]) presets
presets
= [
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
("tooltip",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.tooltipDismiss
tooltipDismiss
),
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
("popover",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
),
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
("menu",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
),
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
("modal",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.modalDismiss

Qt's modal dialog: CloseOnEscape and nothing else — light dismiss off.

modalDismiss
),
(struct) anchored_overlays_dismissal_policy.main.Preset
Preset
("notifier",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.notifierDismiss

A notification toast is not in the dismissal stack and does not answer to the pointer; it answers to its own clock.

notifierDismiss
),
]; foreach (
(parameter) const(anchored_overlays_dismissal_policy.main.Preset) p
p
;
(local variable) const(anchored_overlays_dismissal_policy.main.Preset[]) presets
presets
)
{
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 256)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
;
void anchored_overlays_dismissal_policy.writeFlags!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(in anchored_overlays_dismissal_policy.DismissOn on, ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w) pure nothrow @nogc @safe

Render a flags word as a|b|c. A template, so the writer's attributes infer.

writeFlags
(
(local variable) const(anchored_overlays_dismissal_policy.main.Preset) p
p
.
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.main.Preset.policy
policy
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.DismissPolicy.on
on
,
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
);
void std.stdio.writefln!(" %-9s group %d on = %s", string, const(ulong), char[])(string __param_0, const(ulong) __param_1, char[] __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" %-9s group %d on = %s"(
(local variable) const(anchored_overlays_dismissal_policy.main.Preset) p
p
.
(field) string anchored_overlays_dismissal_policy.main.Preset.name
name
,
(local variable) const(anchored_overlays_dismissal_policy.main.Preset) p
p
.
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.main.Preset.policy
policy
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
,
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
[]);
} // -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n=== 2. The decision matrix: policy word AND router-offered cause ===");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("Cell = the DismissReason the surface returns. `·` = the cause was offered");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("and declined. UPPERCASE = a MANDATORY cause that bypassed the policy word.");
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
static struct
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
{
(alias) object.string = string
string
(field) string anchored_overlays_dismissal_policy.main.Cause.label
label
;
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.main.Cause.bit
bit
;
} const
(local variable) const(anchored_overlays_dismissal_policy.main.Cause[]) causes
causes
= [
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("esc",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("press",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("rel",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("trig",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("focus",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.focusOutside = cast(ushort)32u
focusOutside
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("gone",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.anchorGone = cast(ushort)128u

mandatory: bypasses the policy word

anchorGone
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("sib",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.siblingOpened = cast(ushort)4096u
siblingOpened
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("parent",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.cascade = cast(ushort)8192u

mandatory: an ancestor is closing

cascade
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("time",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.timeout = cast(ushort)16384u

the notify band's clock

timeout
),
(struct) anchored_overlays_dismissal_policy.main.Cause
Cause
("resize",
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.resize = cast(ushort)1024u
resize
),
]; // The canonical matrix hit: the bare page, pressed and released there, with // the surface long since opened — so nothing but the policy word decides. const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) outsideHit
outsideHit
=
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(group: 0, pressGroup: 0, insideAnchor: false, openedFrame: 0);
const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) frame
frame
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.nothing = cast(ushort)0u
nothing
, frame: 42);
{
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 256)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) head
head
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) head
head
~= " ";
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) head
head
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
("policy", 9, true);
foreach (
(parameter) const(anchored_overlays_dismissal_policy.main.Cause) c
c
;
(local variable) const(anchored_overlays_dismissal_policy.main.Cause[]) causes
causes
)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) head
head
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
(local variable) const(anchored_overlays_dismissal_policy.main.Cause) c
c
.
(field) string anchored_overlays_dismissal_policy.main.Cause.label
label
, 7);
void std.stdio.writeln!(char[])(char[] __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) head
head
[]);
} foreach (
(parameter) const(anchored_overlays_dismissal_policy.main.Preset) p
p
;
(local variable) const(anchored_overlays_dismissal_policy.main.Preset[]) presets
presets
)
{
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 256)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) row
row
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) row
row
~= " ";
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
(local variable) const(anchored_overlays_dismissal_policy.main.Preset) p
p
.
(field) string anchored_overlays_dismissal_policy.main.Preset.name
name
, 9, true);
foreach (
(parameter) const(anchored_overlays_dismissal_policy.main.Cause) c
c
;
(local variable) const(anchored_overlays_dismissal_policy.main.Cause[]) causes
causes
)
{ const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(local variable) const(anchored_overlays_dismissal_policy.main.Cause) c
c
.
(field) anchored_overlays_dismissal_policy.DismissOn anchored_overlays_dismissal_policy.main.Cause.bit
bit
, frame:
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) frame
frame
.
(field) uint anchored_overlays_dismissal_policy.DismissEvent.frame

the frame this event is being routed on

frame
);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(local variable) const(anchored_overlays_dismissal_policy.main.Preset) p
p
.
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.main.Preset.policy
policy
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) outsideHit
outsideHit
)), 7);
}
void std.stdio.writeln!(char[])(char[] __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) row
row
[]);
}
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" A modal dialog declines every light-dismiss cause and still closes on");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" GONE/PARENT; a notifier declines the pointer entirely and answers only");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" its clock. No branch anywhere selected that — the value did.");
// -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n=== 3. The close request is one input, and it is a key DOWN ===");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("`isDismiss` (INP13) already unifies Escape and the Android back key, and");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("already excludes releases — the HTML spec makes down-only normative.");
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
(local variable) sparkles.input.events.KeyEvent escUp
escUp
=
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
(
(enum) sparkles.input.events.Key

A decoded key. char_ carries a printable code point in KeyEvent.ch; the rest are named keys.

Key
.
(enum value) sparkles.input.events.Key.escape = 15
escape
);
(local variable) sparkles.input.events.KeyEvent escUp
escUp
.
(field) sparkles.input.events.KeyAction sparkles.input.events.KeyEvent.action

press (the default), auto-repeat, or release

action
=
(enum) sparkles.input.events.KeyAction

What a key did (INP15).

A terminal cannot report release at all, so a consumer that needs the level of a held key must ask InputCapabilities.keyRelease and offer another route where it is absent — the TGT5 rule, applied to keys. press is the default, so a producer that has not thought about this reports what it always did.

KeyAction
.
(enum value) sparkles.input.events.KeyAction.release = 2

the key came up

release
;
const
(local variable) const(sparkles.input.events.KeyEvent[]) strokes
strokes
= [
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
(
(enum) sparkles.input.events.Key

A decoded key. char_ carries a printable code point in KeyEvent.ch; the rest are named keys.

Key
.
(enum value) sparkles.input.events.Key.escape = 15
escape
),
(local variable) sparkles.input.events.KeyEvent escUp
escUp
,
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
(
(enum) sparkles.input.events.Key

A decoded key. char_ carries a printable code point in KeyEvent.ch; the rest are named keys.

Key
.
(enum value) sparkles.input.events.Key.back = 28
back
),
(struct) sparkles.input.events.KeyEvent

A key event: a named key, or a printable code point (key == Key.char_, code point in ch) — which is also how text input arrives.

unshifted and text exist for the one consumer that cannot work without them: a terminal emulator's key encoder, which reports the layout-independent key that was struck and the characters it produced, together. Delivering the text as a separate event cannot express that pairing — which keystroke produced which text — so it rides here.

The three fields are appended, so every existing construction and helper keeps its meaning; KeyAction.press and a zero unshifted describe what producers reported before.

KeyEvent
(
(enum) sparkles.input.events.Key

A decoded key. char_ carries a printable code point in KeyEvent.ch; the rest are named keys.

Key
.
(enum value) sparkles.input.events.Key.char_ = 1
char_
, 'q')];
const
(local variable) const(string[]) strokeNames
strokeNames
= ["Escape down", "Escape up", "Back down", "'q' down"];
foreach (
(parameter) ulong i
i
,
(parameter) const(sparkles.input.events.KeyEvent) k
k
;
(local variable) const(sparkles.input.events.KeyEvent[]) strokes
strokes
)
{ const
(local variable) const(anchored_overlays_dismissal_policy.DismissOn) cause
cause
=
bool sparkles.input.events.isDismiss(in sparkles.input.events.KeyEvent k) pure nothrow @nogc @safe

true for the platform spellings of "go back / dismiss" (INP13): Escape on desktop and in the terminal, the system back key on Android.

The framework owns the equivalence; the application owns the chain. hue dismisses a hover popup, then the explorer, then quits — that ordering is hue's, and a different app would nest differently. q is deliberately not here: "q quits" is a keybinding, not a platform spelling of dismiss.

isDismiss
(
(local variable) const(sparkles.input.events.KeyEvent) k
k
) ?
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.closeRequest = cast(ushort)1u

isDismiss — Escape and the Android back key (INP13)

closeRequest
:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.nothing = cast(ushort)0u
nothing
;
if (
(local variable) const(anchored_overlays_dismissal_policy.DismissOn) cause
cause
==
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.nothing = cast(ushort)0u
nothing
)
{
void std.stdio.writefln!(" %-12s -> no cause offered popover: \xc2\xb7", string)(string __param_0) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" %-12s -> no cause offered popover: ·"(
(local variable) const(string[]) strokeNames
strokeNames
[
(local variable) ulong i
i
]);
continue; } const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(local variable) const(anchored_overlays_dismissal_policy.DismissOn) cause
cause
, frame: 42);
void std.stdio.writefln!(" %-12s -> DismissOn.closeRequest popover: %s", string, string)(string __param_0, string __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" %-12s -> DismissOn.closeRequest popover: %s"(
(local variable) const(string[]) strokeNames
strokeNames
[
(local variable) ulong i
i
],
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) outsideHit
outsideHit
)));
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" (An Escape release must not dismiss a second time — an app that closed a");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" popup on the press would otherwise close the popup AND quit per stroke.)");
// -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n=== 4. The press/release pairing ===");
// A popover on a trigger, both rectangles in abstract cells. Coordinates may // legitimately be negative: content scrolled left of the viewport still // hit-tests, and the pairing must survive it. const
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
=
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(20, 6, 24, 5);
const
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
=
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(18, 4, 6, 1);
const
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
=
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(30, 8);
const
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
=
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(4, 12);
const
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside2
outside2
=
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(7, 13);
const
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) scrolledOff
scrolledOff
=
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(-3, 2); // left of the viewport origin — not clamped
void std.stdio.writefln!(" surface %s..%s anchor %s..%s", string, string, string, string)(string __param_0, string __param_1, string __param_2, string __param_3) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" surface %s..%s anchor %s..%s"(
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.ui.geometry.Rect.origin

the top-left corner

origin
),
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(
sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).this(int[2] values...) pure nothrow @nogc ref @safe

Initializes the first i components from constructor arguments.

surface
.
int sparkles.ui.geometry.Rect.right() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

right
,
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
.
int sparkles.ui.geometry.Rect.bottom() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

bottom
)),
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.ui.geometry.Rect.origin

the top-left corner

origin
),
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(
sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).this(int[2] values...) pure nothrow @nogc ref @safe

Initializes the first i components from constructor arguments.

anchor
.
int sparkles.ui.geometry.Rect.right() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

right
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
.
int sparkles.ui.geometry.Rect.bottom() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

bottom
)));
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" press at release at press phase release phase release-only policy");
static struct
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
{
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
,
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.release
release
;
} const
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing[]) pairings
pairings
= [
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
(
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside2
outside2
),
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
(
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
),
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
(
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
),
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
(
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
),
(struct) anchored_overlays_dismissal_policy.main.Pairing
Pairing
(
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) scrolledOff
scrolledOff
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) scrolledOff
scrolledOff
),
]; foreach (
(parameter) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
;
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing[]) pairings
pairings
)
{ const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) pressHit
pressHit
=
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
, 0);
const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) relHit
relHit
=
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.release
release
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
, 0);
const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) pressEv
pressEv
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
, frame: 42);
const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
, frame: 42);
const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) touchHit
touchHit
=
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.touchPopoverDismiss

The touch / WCAG-pointer-cancellation resolution of the same policy: act on the release, never on the press (base-ui's per-pointer-type mode).

touchPopoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.release
release
,
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
, 0);
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 128)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
~= " ";
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.press
press
), 11, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(local variable) const(anchored_overlays_dismissal_policy.main.Pairing) pr
pr
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) anchored_overlays_dismissal_policy.main.Pairing.release
release
), 14, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) pressEv
pressEv
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) pressHit
pressHit
)), 14, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) relHit
relHit
)), 16, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.touchPopoverDismiss

The touch / WCAG-pointer-cancellation resolution of the same policy: act on the release, never on the press (base-ui's per-pointer-type mode).

touchPopoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) touchHit
touchHit
)), 1, true);
void std.stdio.writeln!(char[])(char[] __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
[]);
}
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" Row 2: pressed outside, released INSIDE — the release declines (a drag");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" that ends on the surface is not a dismissal).");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" Row 3: pressed INSIDE, released outside — the release declines too, on");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" the latched press group. This is the drag-to-select-text case the");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" WCAG pointer-cancellation comment in Blink exists for.");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" Row 5: negative cell coordinates hit-test like any other — the point is");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" outside the surface, not clamped onto its edge.");
// The two behaviours, pinned. `checked` keeps assertions live. { const
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
=
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.releaseOutside = cast(ushort)4u
releaseOutside
, frame: 42);
assert(!
bool anchored_overlays_dismissal_policy.dismisses(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The boolean face of dismissedBy — the predicate the router calls when it only needs to know whether to plan a close.

dismisses
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
,
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
, 0)),
"press inside / release outside must not dismiss"); assert(!
bool anchored_overlays_dismissal_policy.dismisses(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The boolean face of dismissedBy — the predicate the router calls when it only needs to know whether to plan a close.

dismisses
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
,
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) inside
inside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
, 0)),
"press outside / release inside must not dismiss"); assert(
bool anchored_overlays_dismissal_policy.dismisses(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The boolean face of dismissedBy — the predicate the router calls when it only needs to know whether to plan a close.

dismisses
(
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(anchored_overlays_dismissal_policy.DismissEvent) relEv
relEv
,
anchored_overlays_dismissal_policy.OverlayHit anchored_overlays_dismissal_policy.hitFor(in sparkles.ui.geometry.Rect surface, in sparkles.ui.geometry.Rect anchor, in anchored_overlays_dismissal_policy.DismissPolicy p, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) now, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) pressed, uint openedFrame) pure nothrow @nogc @safe

The hit facts for a single-surface overlay, resolved from the last frame.

hitFor
(
(local variable) const(sparkles.ui.geometry.Rect) surface
surface
,
(local variable) const(sparkles.ui.geometry.Rect) anchor
anchor
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside
outside
,
(local variable) const(sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])) outside2
outside2
, 0)),
"outside press paired with an outside release must dismiss"); } // -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n=== 5. The one-frame open guard ===");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("A surface opened by the very press being routed must not be dismissed by");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("that same press. Two shapes of the bug, with the guard on and off:");
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
{
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 128)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
~= " ";
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
("case", 50, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
("guard on", 11, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
("guard off", 1, true);
void std.stdio.writeln!(char[])(char[] __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) head
head
[]);
} void
void anchored_overlays_dismissal_policy.main.guardRow(string label, in anchored_overlays_dismissal_policy.DismissPolicy p, in anchored_overlays_dismissal_policy.DismissEvent e, in anchored_overlays_dismissal_policy.OverlayHit h) @safe
guardRow
(
(alias) object.string = string
string
(parameter) string label
label
, in
(struct) anchored_overlays_dismissal_policy.DismissPolicy

The whole dimension, per surface. group is Flutter's groupId: a menu chain is ONE dismiss target, so "inside" is group membership rather than geometric descent of a widget tree.

DismissPolicy
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
, in
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
, in
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) h
h
) @safe
{
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(local variable) anchored_overlays_dismissal_policy.DismissEvent off
off
=
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
;
(local variable) anchored_overlays_dismissal_policy.DismissEvent off
off
.
(field) bool anchored_overlays_dismissal_policy.DismissEvent.openGuard

honour the one-frame open exemption (§ 5)

openGuard
= false;
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 128)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
~= " ";
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
(parameter) string label
label
, 50, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
,
(parameter) const(anchored_overlays_dismissal_policy.DismissEvent) e
e
,
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) h
h
)), 11, true);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
.
void anchored_overlays_dismissal_policy.writeCell!(sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false))(ref sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) w, scope const(char)[] s, ulong width, bool leftAlign = false) pure nothrow @nogc @safe

Pad a table cell to width display columns. cellsOf is the toolkit's one width authority — %-7s`` would pad by BYTES and skew every column holding a multi-byte ·.

writeCell
(
string anchored_overlays_dismissal_policy.shortName(in anchored_overlays_dismissal_policy.DismissReason r) pure nothrow @nogc @safe

The short label a matrix cell prints for a reason.

shortName
(
anchored_overlays_dismissal_policy.DismissReason anchored_overlays_dismissal_policy.dismissedBy(in anchored_overlays_dismissal_policy.DismissPolicy policy, in anchored_overlays_dismissal_policy.DismissEvent event, in anchored_overlays_dismissal_policy.OverlayHit hit) pure nothrow @nogc @safe

The whole decision, as one expression per clause.

This is tryClose with the phase latch and the open guard folded in — the two narrowings the survey forced on the naive "AND the flags" form (D8.C1).

dismissedBy
(
(parameter) const(anchored_overlays_dismissal_policy.DismissPolicy) p
p
,
(local variable) anchored_overlays_dismissal_policy.DismissEvent off
off
,
(parameter) const(anchored_overlays_dismissal_policy.OverlayHit) h
h
)), 1, true);
void std.stdio.writeln!(char[])(char[] __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 128LU, false) row
row
[]);
} // (a) a context menu opened at frame 100 by a press on the bare document — // there is no registered trigger widget, so the opening press resolves // outside the new surface's group. const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedNow
openedNow
=
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(group: 0, pressGroup: 0, insideAnchor: false, openedFrame: 100);
void anchored_overlays_dismissal_policy.main.guardRow(string label, in anchored_overlays_dismissal_policy.DismissPolicy p, in anchored_overlays_dismissal_policy.DismissEvent e, in anchored_overlays_dismissal_policy.OverlayHit h) @safe
guardRow
("context menu, the press that opened it (f100)",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
,
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
, frame: 100),
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedNow
openedNow
);
void anchored_overlays_dismissal_policy.main.guardRow(string label, in anchored_overlays_dismissal_policy.DismissPolicy p, in anchored_overlays_dismissal_policy.DismissEvent e, in anchored_overlays_dismissal_policy.OverlayHit h) @safe
guardRow
("...the next outside press (f101)",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
,
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.pressOutside = cast(ushort)2u
pressOutside
, frame: 101),
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedNow
openedNow
);
// (b) the toggle: the press on a popover's own trigger both opens it and is // a `triggerReactivate` for it. const
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedByTrigger
openedByTrigger
=
(struct) anchored_overlays_dismissal_policy.OverlayHit

What the router resolved about this event with respect to THIS surface. All of it comes from the last painted frame's hit list; none of it needs a grab, a capture, a scrim or a platform popup.

OverlayHit
(group: 0, pressGroup: 0, insideAnchor: true, openedFrame: 200);
void anchored_overlays_dismissal_policy.main.guardRow(string label, in anchored_overlays_dismissal_policy.DismissPolicy p, in anchored_overlays_dismissal_policy.DismissEvent e, in anchored_overlays_dismissal_policy.OverlayHit h) @safe
guardRow
("popover, the trigger press that opened it (f200)",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
, frame: 200),
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedByTrigger
openedByTrigger
);
void anchored_overlays_dismissal_policy.main.guardRow(string label, in anchored_overlays_dismissal_policy.DismissPolicy p, in anchored_overlays_dismissal_policy.DismissEvent e, in anchored_overlays_dismissal_policy.OverlayHit h) @safe
guardRow
("...pressing that trigger again later (f260)",
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.popoverDismiss
popoverDismiss
,
(struct) anchored_overlays_dismissal_policy.DismissEvent

What the router says happened, in the policy's vocabulary. Exactly one cause bit per call — the router owns "what happened", the surface owns "do I care".

DismissEvent
(cause:
(enum) anchored_overlays_dismissal_policy.DismissOn

Every cause a surface can be closed by, one bit each — the shape of QQuickPopup::ClosePolicyFlag and of Uno's DismissalTriggerFlags. The router offers a cause in exactly this vocabulary, so the evaluation is an AND.

anchorClipped is deliberately present and deliberately never dismisses here: CSS anchor positioning HIDES a box whose anchor scrolled out of view rather than closing it (position-visibility: anchor-visible is the initial value), and the proposal keeps that distinction.

DismissOn
.
(enum value) anchored_overlays_dismissal_policy.DismissOn.triggerReactivate = cast(ushort)16u
triggerReactivate
, frame: 260),
(local variable) const(anchored_overlays_dismissal_policy.OverlayHit) openedByTrigger
openedByTrigger
);
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" Without the guard the surface closes on the frame it opened — visibly");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" never opening at all. GTK gave up and disabled release-based autohide");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" outright over this; Slint, Turbo Vision, WPF, tippy and Qt each carry a");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" bespoke latch. One integer field on the record replaces all of them.");
// -----------------------------------------------------------------------
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\n=== 6. The cascade ===");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("Dismissal never closes \"this one\": it computes an ENDPOINT index and closes");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("everything ABOVE it, leaf to root. Ancestors survive; so does anything that");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("is not a descendant — the toast below is open the whole time and never");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("closes, because truncation is by ancestry, not by stack position.");
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
const
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
= [
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
("File",
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
.
(enum value) anchored_overlays_dismissal_policy.OverlayBand.popup = 1
popup
,
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
,
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(2, 3, 14, 6),
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
, 10),
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
("Recent",
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
.
(enum value) anchored_overlays_dismissal_policy.OverlayBand.popup = 1
popup
, 0,
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(16, 5, 16, 5),
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
, 12),
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
("Projects",
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
.
(enum value) anchored_overlays_dismissal_policy.OverlayBand.popup = 1
popup
, 1,
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(32, 7, 18, 4),
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
, 14),
(struct) anchored_overlays_dismissal_policy.OverlayRecord
OverlayRecord
("toast",
(enum) anchored_overlays_dismissal_policy.OverlayBand

The band a surface lives in. Only popup participates in the dismissal stack: hint is HTML's separate hint list (tooltips, never a dismissal parent) and notify is out of the stack entirely.

OverlayBand
.
(enum value) anchored_overlays_dismissal_policy.OverlayBand.notify = 2
notify
,
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
,
(struct) sparkles.ui.geometry.Rect

A rectangle on the cell grid, [x, x+width) × [y, y+height) — a Point origin plus a Size extent.

Rect
(50, 1, 20, 3),
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.notifierDismiss

A notification toast is not in the dismissal stack and does not answer to the pointer; it answers to its own clock.

notifierDismiss
, 9),
];
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" idx name band rect parent group");
foreach (
(parameter) ulong i
i
, const
(parameter) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
;
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
)
void std.stdio.writefln!(" [%d] %-10s %-7s %-20s %-7s %d", ulong, string, const(anchored_overlays_dismissal_policy.OverlayBand), string, string, const(ulong))(ulong __param_0, string __param_1, const(anchored_overlays_dismissal_policy.OverlayBand) __param_2, string __param_3, string __param_4, const(ulong) __param_5) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" [%d] %-10s %-7s %-20s %-7s %d"(
(local variable) ulong i
i
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) string anchored_overlays_dismissal_policy.OverlayRecord.name
name
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) anchored_overlays_dismissal_policy.OverlayBand anchored_overlays_dismissal_policy.OverlayRecord.band
band
,
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) sparkles.ui.geometry.Rect anchored_overlays_dismissal_policy.OverlayRecord.surface
surface
.
(field) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.ui.geometry.Rect.origin

the top-left corner

origin
) ~ ".." ~
string anchored_overlays_dismissal_policy.pt(in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) @safe
pt
(
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(
sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).this(int[2] values...) pure nothrow @nogc ref @safe

Initializes the first i components from constructor arguments.

r
.
sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]).this(int[2] values...) pure nothrow @nogc ref @safe

Initializes the first i components from constructor arguments.

surface
.
int sparkles.ui.geometry.Rect.right() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

right
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) sparkles.ui.geometry.Rect anchored_overlays_dismissal_policy.OverlayRecord.surface
surface
.
int sparkles.ui.geometry.Rect.bottom() const pure nothrow @nogc @safe

Right edge (exclusive) and bottom edge (exclusive).

bottom
)),
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
==
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
? "-" :
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
].
(field) string anchored_overlays_dismissal_policy.OverlayRecord.name
name
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord) r
r
.
(field) anchored_overlays_dismissal_policy.DismissPolicy anchored_overlays_dismissal_policy.OverlayRecord.policy
policy
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
);
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" cause endpoint closes (leaf -> root)");
void
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
(
(alias) object.string = string
string
(parameter) string label
label
,
(alias) object.size_t = ulong
size_t
(parameter) ulong endpoint
endpoint
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
(parameter) anchored_overlays_dismissal_policy.DismissReason cause
cause
) @safe
{ const
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
=
anchored_overlays_dismissal_policy.CloseList anchored_overlays_dismissal_policy.truncateTo(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong endpoint, ulong group, anchored_overlays_dismissal_policy.DismissReason cause) pure nothrow @nogc @safe

Blink's HideAllPopoversUntil, in a flat arena: compute an ENDPOINT and close everything above it, leaf to root. The endpoint itself stays open; noParent means "the bare page", which closes the whole group.

The shallowest surface closed is the one the cause actually named; everything above it closes because its parent did — which is the parentClosed reason, mandatory and unvetoable.

truncateTo
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(parameter) ulong endpoint
endpoint
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
,
(parameter) anchored_overlays_dismissal_policy.DismissReason cause
cause
);
(struct) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false)

A @nogc container with Small Buffer Optimization and copy-on-write.

Elements are stored inline up to N elements, then automatically allocated on the heap (via AffixAllocator!(Mallocator, ControlBlock), which keeps the reference count in an allocation prefix; the element capacity is the heap slice length) when capacity is exceeded. Heap blocks are managed with the std.experimental.allocator makeArray/expandArray/dispose helpers.

The buffer is copyable. Copying an inline buffer duplicates its elements (independent copies). Copying a heap buffer shares the allocation and bumps a reference count; the shared block is cloned copy-on-write the first time a mutable copy is written. This suits the common pattern of one producer building a buffer mutably, then handing out many const reader copies — read via const (e.g. through borrow) never clones. Mutating accessors on a shared mutable copy clone first, so a mutable slice/reference taken from a shared buffer and held across a later mutation may be invalidated (the usual copy-on-write caveat) — read through const to share without that risk.

Note

storage location is tied to length (data is inline whenever length <= N), so reserve pre-grows only once on the heap, and clear/popBack that drop the length back to <= N revert to inline storage.

@paramT Element type@paramN Number of elements stored inline. The default fills the slice-sized union exactly (max(1, (T[]).sizeof / T.sizeof)), so the struct stays three words (3 * size_t.sizeof) regardless of T — e.g. 16 for char, 4 for int, 2 for long.@paramunique When true, opt out of the copy-on-write machinery: the buffer becomes move-only (copy construction/assignment are @disabled), so it is a sole owner by construction. Mutation then never reads or bumps a reference count — the append/grow hot path skips the uniqueness check entirely. Hand a finished unique buffer to the shareable copy-on-write world with SmallBuffer`.toShared`, which consumes it and returns a SmallBuffer!(T, N) (heap storage transfers without a reallocation). The default, false, is the ordinary copy-on-write buffer described above.
SmallBuffer
!(char, 256)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
;
foreach (
(local variable) ulong k
k
; 0 ..
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
)
{ if (
(local variable) ulong k
k
)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~= ' ';
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~=
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

chain
[
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

closing
.
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
[
(local variable) ulong k
k
]].
(field) string anchored_overlays_dismissal_policy.OverlayRecord.name
name
;
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~= '[';
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~=
void sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false).opOpAssign!"~"(in char[] elements) pure nothrow @nogc @safe

Appends elements from a slice using ~= operator.

shortName
(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
[
(local variable) ulong k
k
]);
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~= ']';
} if (
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
== 0)
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
~= "(nothing)";
void std.stdio.writefln!(" %-41s %-10s %s", string, string, char[])(string __param_0, string __param_1, char[] __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
!" %-41s %-10s %s"(
(parameter) string label
label
,
(parameter) ulong endpoint
endpoint
==
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
? "-" :
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[
(parameter) ulong endpoint
endpoint
].
(field) string anchored_overlays_dismissal_policy.OverlayRecord.name
name
,
(local variable) sparkles.base.smallbuffer.SmallBuffer!(char, 256LU, false) buf
buf
[]);
} // (1) A close request goes to the topmost open surface in the popup band — // so the endpoint is that surface's parent.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("close request (topmost popup only)",
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[2].
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.closeRequest = 2
closeRequest
);
// (2) Press on the bare page: nothing in the group survives.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("press outside every surface (60,20)",
ulong anchored_overlays_dismissal_policy.hitIndex(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) pure nothrow @nogc @safe

Reverse paint order is reverse hit order: the last-opened surface wins a cell it shares with anything beneath it (HoverState's "later target wins" rule, which is also what keeps an overlay and its anchor from both answering true).

hitIndex
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(60, 20)),
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.pressOutside = 3
pressOutside
);
// (3) Press inside the root menu: it becomes the endpoint and stays open.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("press inside File (6,5)",
ulong anchored_overlays_dismissal_policy.hitIndex(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) pure nothrow @nogc @safe

Reverse paint order is reverse hit order: the last-opened surface wins a cell it shares with anything beneath it (HoverState's "later target wins" rule, which is also what keeps an overlay and its anchor from both answering true).

hitIndex
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(6, 5)),
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
);
// (4) Press mid-chain.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("press inside Recent (20,7)",
ulong anchored_overlays_dismissal_policy.hitIndex(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, in sparkles.math.vector.Vector!(int, 2LU, ["x", "y"]) p) pure nothrow @nogc @safe

Reverse paint order is reverse hit order: the last-opened surface wins a cell it shares with anything beneath it (HoverState's "later target wins" rule, which is also what keeps an overlay and its anchor from both answering true).

hitIndex
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(struct) sparkles.math.vector.Vector!(int, 2LU, ["x", "y"])
Point
(20, 7)),
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
);
// (5) A mandatory cause, applied to a surface in the middle of the chain.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("anchor of Recent removed",
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[1].
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
);
// (6) A sibling submenu opens at depth 1.
void anchored_overlays_dismissal_policy.main.cascadeRow(string label, ulong endpoint, anchored_overlays_dismissal_policy.DismissReason cause) @safe
cascadeRow
("sibling submenu opened at depth 1",
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[1].
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.siblingOpened = 13
siblingOpened
);
void std.stdio.writeln!()() @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
();
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" Every row is the same truncation with a different endpoint and a different");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" named reason; only the shallowest closed surface carries the cause, the");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" rest carry PARENT. Nothing above an endpoint survives and nothing below it");
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
(" is touched — which is exactly `HideAllPopoversUntil(endpoint)`.");
// Pinned: a mid-chain close takes its descendants and leaves its ancestors. { const
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
=
anchored_overlays_dismissal_policy.CloseList anchored_overlays_dismissal_policy.truncateTo(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong endpoint, ulong group, anchored_overlays_dismissal_policy.DismissReason cause) pure nothrow @nogc @safe

Blink's HideAllPopoversUntil, in a flat arena: compute an ENDPOINT and close everything above it, leaf to root. The endpoint itself stays open; noParent means "the bare page", which closes the whole group.

The shallowest surface closed is the one the cause actually named; everything above it closes because its parent did — which is the parentClosed reason, mandatory and unvetoable.

truncateTo
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
[1].
(field) ulong anchored_overlays_dismissal_policy.OverlayRecord.parent

index into the open array

parent
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
);
assert(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
== 2, "closing Recent must take exactly Recent and Projects");
assert(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
[0] == 2 &&
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) ulong[8] anchored_overlays_dismissal_policy.CloseList.index
index
[1] == 1, "leaf-to-root order");
assert(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
[0] ==
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.parentClosed = 14
parentClosed
);
assert(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) closing
closing
.
(field) anchored_overlays_dismissal_policy.DismissReason[8] anchored_overlays_dismissal_policy.CloseList.reason
reason
[1] ==
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.anchorGone = 9
anchorGone
);
const
(local variable) const(anchored_overlays_dismissal_policy.CloseList) all
all
=
anchored_overlays_dismissal_policy.CloseList anchored_overlays_dismissal_policy.truncateTo(scope const(anchored_overlays_dismissal_policy.OverlayRecord[]) open, ulong endpoint, ulong group, anchored_overlays_dismissal_policy.DismissReason cause) pure nothrow @nogc @safe

Blink's HideAllPopoversUntil, in a flat arena: compute an ENDPOINT and close everything above it, leaf to root. The endpoint itself stays open; noParent means "the bare page", which closes the whole group.

The shallowest surface closed is the one the cause actually named; everything above it closes because its parent did — which is the parentClosed reason, mandatory and unvetoable.

truncateTo
(
(local variable) const(anchored_overlays_dismissal_policy.OverlayRecord[]) chain
chain
,
(constant) ulong anchored_overlays_dismissal_policy.noParent = 18446744073709551615LU
noParent
,
(immutable global) immutable(anchored_overlays_dismissal_policy.DismissPolicy) anchored_overlays_dismissal_policy.menuDismiss
menuDismiss
.
(field) ulong anchored_overlays_dismissal_policy.DismissPolicy.group

0 is the bare page — never a surface's own group

group
,
(enum) anchored_overlays_dismissal_policy.DismissReason

Why a surface closed. xdg-shell's argument-less popup_done is the named anti-pattern: a client that cannot tell Escape from a click outside cannot implement "restore focus only when dismissed by keyboard".

DismissReason
.
(enum value) anchored_overlays_dismissal_policy.DismissReason.pressOutside = 3
pressOutside
);
assert(
(local variable) const(anchored_overlays_dismissal_policy.CloseList) all
all
.
(field) ulong anchored_overlays_dismissal_policy.CloseList.length
length
== 3, "the toast is not in the menu's dismiss group");
} }