react-x11 2.52.0 → 2.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/docs/README.md +160 -314
- package/docs/accessibility.md +176 -229
- package/docs/appearance.md +77 -176
- package/docs/click-to-component.md +18 -51
- package/docs/clipboard.md +40 -59
- package/docs/components.md +518 -1036
- package/docs/dbus.md +61 -133
- package/docs/debugging.md +152 -245
- package/docs/desktop-calendar.md +51 -88
- package/docs/desktop.md +222 -347
- package/docs/devtools.md +50 -167
- package/docs/drag-and-drop.md +126 -204
- package/docs/ecosystem/animation.md +91 -125
- package/docs/ecosystem/data-fetching.md +38 -53
- package/docs/ecosystem/dev-tooling.md +159 -202
- package/docs/ecosystem/forms.md +61 -97
- package/docs/ecosystem/headless.md +64 -89
- package/docs/ecosystem/i18n.md +18 -21
- package/docs/ecosystem/icons.md +93 -126
- package/docs/ecosystem/layout.md +42 -52
- package/docs/ecosystem/routing.md +18 -29
- package/docs/ecosystem/state.md +71 -88
- package/docs/ecosystem/testing.md +131 -157
- package/docs/ecosystem/theming.md +119 -165
- package/docs/ecosystem.md +145 -179
- package/docs/elements.md +1096 -1774
- package/docs/embedding.md +83 -132
- package/docs/events.md +412 -695
- package/docs/extending.md +784 -1326
- package/docs/eyedropper.md +63 -122
- package/docs/filedialog.md +71 -107
- package/docs/frame.md +195 -339
- package/docs/gl.md +65 -62
- package/docs/globalmenu.md +63 -146
- package/docs/macos.md +531 -3234
- package/docs/notifications.md +33 -47
- package/docs/packaging.md +166 -309
- package/docs/permissions.md +9 -14
- package/docs/react-features.md +81 -106
- package/docs/remote.md +32 -76
- package/docs/scale.md +72 -186
- package/docs/styling.md +329 -547
- package/docs/system.md +200 -280
- package/docs/testing.md +63 -83
- package/docs/typescript.md +6 -48
- package/docs/uri-schemes.md +67 -107
- package/docs/wayland-backend.md +200 -459
- package/docs/windows-integrations.md +75 -131
- package/docs/windows.md +343 -1367
- package/package.json +3 -2
- package/src/Reconciler.js +2 -2
- package/src/a11y.js +1 -1
- package/src/backend/context2d.js +3 -3
- package/src/bootstrap.js +1 -1
- package/src/cocoa/app.js +6 -6
- package/src/cocoa/bezels.js +1 -1
- package/src/cocoa/fonts.js +1 -1
- package/src/cocoa/globalmenu.js +1 -1
- package/src/cocoa/keymap.js +1 -1
- package/src/cocoa/panewindow.js +1 -1
- package/src/cocoa/player.js +1 -1
- package/src/cocoa/presenter.js +2 -2
- package/src/cocoa/promotion.js +1 -1
- package/src/cocoa/relaunch.js +1 -1
- package/src/cocoa/threaded.js +1 -1
- package/src/cocoa/video.js +1 -1
- package/src/cocoa/window.js +4 -4
- package/src/components/Menu.js +7 -2
- package/src/components/Switch.js +1 -1
- package/src/components/native.js +1 -1
- package/src/dnd.js +2 -2
- package/src/glnodes.js +1 -1
- package/src/grid.js +1 -1
- package/src/imagedecode-worker.js +32 -0
- package/src/imagedecode.js +140 -2
- package/src/layouts.js +1 -1
- package/src/nodes/animation.js +1 -1
- package/src/nodes/invalidate.js +1 -1
- package/src/nodes/layouthost.js +1 -1
- package/src/nodes/video.js +19 -8
- package/src/nodes/window/droptarget.js +1 -1
- package/src/ntk.d.ts +12 -0
- package/src/pacing.js +1 -1
- package/src/refresh/index.js +2 -1
- package/src/types/video.d.ts +5 -2
- package/src/videobackend.js +28 -0
- package/src/videoframes.js +29 -16
- package/src/wayland/app.js +27 -0
- package/src/wayland/video.js +376 -0
- package/src/win32/a11y.js +1 -1
- package/src/win32/app.js +2 -2
- package/src/win32/fonts.js +1 -1
- package/src/win32/glarea.js +4 -4
- package/src/win32/overlay.js +1 -1
- package/src/win32/panewindow.js +3 -3
- package/src/win32/shell.js +1 -1
- package/src/win32/window.js +2 -2
- package/src/windowid.js +1 -1
- package/src/xvideo.js +189 -0
- package/docs/architecture/accessibility.md +0 -470
- package/docs/architecture/animation.md +0 -707
- package/docs/architecture/container-queries.md +0 -525
- package/docs/architecture/custom-layout.md +0 -334
- package/docs/architecture/drag-and-drop.md +0 -941
- package/docs/architecture/element-layer-contents.md +0 -622
- package/docs/architecture/frame-pacing.md +0 -255
- package/docs/architecture/grid-layout.md +0 -358
- package/docs/architecture/protocol-efficiency.md +0 -357
- package/docs/architecture/video.md +0 -1149
- package/docs/architecture/windowed-regions.md +0 -854
- package/docs/glx.md +0 -137
- package/docs/wayland.md +0 -545
- package/docs/windows-embedding.md +0 -271
- package/docs/windows-gl.md +0 -221
package/docs/glx.md
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# 3D over indirect GLX
|
|
2
|
-
|
|
3
|
-
How a 3D scene works over this transport, and what the transport can never
|
|
4
|
-
do. `<glarea>` and the three ways underneath it are [gl.md](gl.md); the
|
|
5
|
-
scene graph that rides on this one is
|
|
6
|
-
[`@react-x11/components/three`](ecosystem.md). This page is the design
|
|
7
|
-
underneath both, kept because the constraints explain most of the API's
|
|
8
|
-
shape — and because they are permanent: they are properties of a wire
|
|
9
|
-
protocol frozen in the 1990s, not of any implementation.
|
|
10
|
-
|
|
11
|
-
On X11 `<glarea>` is a real X child window on a GLX visual, and under the
|
|
12
|
-
default `glPolicy` everything drawn into it travels as **indirect GLX**: the
|
|
13
|
-
GL protocol encoded into the same X connection as everything else. No direct
|
|
14
|
-
rendering, no native bindings, no GPU driver bindings — the same pure-JS
|
|
15
|
-
story as the rest of the stack. (The direct path, which does take a native
|
|
16
|
-
addon, is [gl.md](gl.md)'s.)
|
|
17
|
-
|
|
18
|
-
The cost of that reach is a **fixed-function OpenGL 1.x pipeline**, and that
|
|
19
|
-
single fact decides the rest.
|
|
20
|
-
|
|
21
|
-
## What the protocol encodes
|
|
22
|
-
|
|
23
|
-
node-x11's `glxrender.js` encodes 70 GL commands:
|
|
24
|
-
|
|
25
|
-
| available | |
|
|
26
|
-
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
-
| immediate mode | `Begin`/`End`, `Vertex3f`, `Normal3f`, `Color3f/4f`, `TexCoord2f` |
|
|
28
|
-
| matrices | `MatrixMode`, `LoadIdentity`, `LoadMatrixf`, `MultMatrixf`, `Push/PopMatrix`, `Translatef`, `Rotatef`, `Scalef`, `Frustum`, `Ortho` |
|
|
29
|
-
| lighting | `Lightfv`, `LightModelf`, `Materialfv`, `Materialf`, `ColorMaterial`, `ShadeModel` |
|
|
30
|
-
| texturing | `TexImage2D`, `BindTexture`, `TexParameter*`, `TexEnv*`, `TexGen*` |
|
|
31
|
-
| state | `Enable`/`Disable`, `Clear*`, `DepthFunc`, `DepthMask`, `BlendFunc`, `AlphaFunc`, `CullFace`, `FrontFace`, `PolygonMode`, `Viewport`, `Scissor`, `Fog*` |
|
|
32
|
-
| display lists | `CallList`, `ListBase` (+ `NewList`/`EndList`/`DeleteLists` in `glx.js`) |
|
|
33
|
-
|
|
34
|
-
There are **no GLSL shaders, no VBOs, no vertex arrays** (`DrawArrays` and
|
|
35
|
-
`VertexPointer` are not encoded), **no framebuffer objects and no
|
|
36
|
-
instancing**. `ProgramString`/`BindProgram` expose ARB _assembly_ programs,
|
|
37
|
-
which are out of scope.
|
|
38
|
-
|
|
39
|
-
That rules out, permanently and by protocol: shader materials and
|
|
40
|
-
post-processing. Both are implemented on the direct backend, and asking for
|
|
41
|
-
one here throws an error naming the reason rather than rendering something
|
|
42
|
-
that only looks right — the scene graph keeps the list, as `DIRECT_ONLY_KINDS`.
|
|
43
|
-
(`<instancedMesh>` works on both, but as a loop over transforms rather than
|
|
44
|
-
as hardware instancing, which GLX also encodes no way to ask for.)
|
|
45
|
-
|
|
46
|
-
## Why display lists are mandatory
|
|
47
|
-
|
|
48
|
-
With no vertex arrays, geometry can only be sent as immediate-mode commands.
|
|
49
|
-
A 1 000-triangle mesh is ~3 000 `Vertex3f` + 3 000 `Normal3f` commands —
|
|
50
|
-
about **96 KB per frame** if re-sent every frame, or 5.7 MB/s at 60fps for
|
|
51
|
-
one modest mesh.
|
|
52
|
-
|
|
53
|
-
So each geometry is compiled into a **server-side display list** once, and a
|
|
54
|
-
frame sends only matrices, material state and one `CallList` per mesh. A
|
|
55
|
-
static scene costs O(meshes) requests per frame instead of O(vertices).
|
|
56
|
-
|
|
57
|
-
This is the AGENTS.md "Protocol efficiency" rule set applied literally — use
|
|
58
|
-
server-side primitives, batch, never re-send what the server already has —
|
|
59
|
-
and because it is a protocol property rather than an intention, the scene
|
|
60
|
-
graph's own tests assert it on the encoded command stream: a 6 000-vertex
|
|
61
|
-
sphere compiles once, and the steady-state frame is under 30 GL commands
|
|
62
|
-
with no vertices in it.
|
|
63
|
-
|
|
64
|
-
The cache is keyed by geometry identity. A geometry prop change recompiles
|
|
65
|
-
that one list; a transform or material change is per-frame state only, so the
|
|
66
|
-
same list is shared by meshes that differ in material.
|
|
67
|
-
|
|
68
|
-
## The shape of the tree
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
<glarea> host element -> real X child window with a
|
|
72
|
-
GLX visual + its own colormap
|
|
73
|
-
|
|
|
74
|
-
GLContext (ntk) MakeCurrent -> context tag
|
|
75
|
-
|
|
|
76
|
-
Scene node tree (parallel to the drawn-node tree)
|
|
77
|
-
|
|
|
78
|
-
commit: compile dirty geometries -> display lists
|
|
79
|
-
frame: Clear -> camera matrices -> per mesh: PushMatrix,
|
|
80
|
-
MultMatrixf, material state, CallList, PopMatrix -> SwapBuffers
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
`<glarea>` is one of the four elements that legitimately need an X window of
|
|
84
|
-
their own — with `<window>`, `<popup>` and `<foreign>` (NEXT_STEPS §4): GLX needs its own visual and cannot share the
|
|
85
|
-
XRender pipeline the 2D elements draw through.
|
|
86
|
-
|
|
87
|
-
A scene tree over this surface is **separate from the drawn-node tree** — no
|
|
88
|
-
yoga, no hit testing against the 2D tree, no painting into the parent's 2d
|
|
89
|
-
context. To layout, `<glarea>` is a leaf sized by ordinary layout props.
|
|
90
|
-
|
|
91
|
-
## The scene graph moved
|
|
92
|
-
|
|
93
|
-
The r3f-shaped names this page used to map — `<mesh>`, the geometries, the
|
|
94
|
-
materials, the lights, the camera prop — belong to
|
|
95
|
-
[`@react-x11/components/three`](ecosystem.md) now, together with the display-
|
|
96
|
-
list cache described above: it keeps its own reconciler and its own indirect
|
|
97
|
-
renderer, built on exactly the constraints this page documents. What stays
|
|
98
|
-
here is the transport, which is what those constraints come from.
|
|
99
|
-
|
|
100
|
-
## Testing
|
|
101
|
-
|
|
102
|
-
The primary tests are **hermetic and assert the encoded GLX command
|
|
103
|
-
stream**, not pixels: that a geometry compiles to one display list, that a
|
|
104
|
-
frame emits matrices plus `CallList` rather than thousands of `Vertex3f`,
|
|
105
|
-
and that a transform change re-sends no geometry. That is the property that
|
|
106
|
-
actually matters, and checking it needs no GL at all. Core's half is
|
|
107
|
-
`test/glarea.test.js` and `test/viewer3d.test.js`; the scene graph tests its
|
|
108
|
-
own in its own repo.
|
|
109
|
-
|
|
110
|
-
Pixels are the awkward part. On XQuartz, GL renders into a Metal surface the
|
|
111
|
-
compositor owns rather than into the X drawable, so `GetImage` reads back
|
|
112
|
-
white and a 3D screenshot has to be captured by hand from
|
|
113
|
-
a scene on a real server with indirect GLX — which is why
|
|
114
|
-
`npm run screenshots` skips it. The documentation site's playground is the
|
|
115
|
-
exception that renders GL headlessly: node-x11's browser GLX emulator
|
|
116
|
-
replays the same protocol onto WebGL2.
|
|
117
|
-
|
|
118
|
-
## Open questions
|
|
119
|
-
|
|
120
|
-
- Is there a depth-buffer-capable visual reachable via `GetVisualConfigs` on
|
|
121
|
-
both XQuartz and Xvfb/llvmpipe?
|
|
122
|
-
- Can a `<glarea>` be composited with 2D content drawn over it, or does the
|
|
123
|
-
GL child window always sit on top? Answered: the GL window is always on
|
|
124
|
-
top of the parent's drawing, so the surface's own children are drawn on
|
|
125
|
-
windows of their own stacked above it — opaque ones, one per region they
|
|
126
|
-
reach, since a child window cannot be translucent without a compositor
|
|
127
|
-
(`src/gloverlay.js`, [elements.md](elements.md#glarea)). Except on
|
|
128
|
-
XQuartz, where the window server composites the surface above every X
|
|
129
|
-
window, those included, and the children are not drawn at all.
|
|
130
|
-
|
|
131
|
-
## Scope discipline
|
|
132
|
-
|
|
133
|
-
Indirect GLX is a 1990s fixed-function pipeline reached over a network
|
|
134
|
-
protocol. The value is _reach_ — 3D in a pure-JS X11 client with no native
|
|
135
|
-
dependencies — not performance or fidelity. A plausible-looking API that
|
|
136
|
-
quietly fails on anything modern would be worse than a small one with honest
|
|
137
|
-
edges, which is why unsupported r3f names throw with the reason.
|