summaryrefslogtreecommitdiff
path: root/docs/guide.md
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 13:44:13 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 13:44:13 +0300
commitc059e3aa7f93da470f052a5cd8ee0d8dc969e679 (patch)
tree63ffa378287ed2c606eda2e940501b9edc3d2b8b /docs/guide.md
parent87d0bc50d53dc216efb2b04495f090616318bc5c (diff)
rename and simplification
Diffstat (limited to 'docs/guide.md')
-rw-r--r--docs/guide.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/docs/guide.md b/docs/guide.md
index 43a7a1e..adcacc8 100644
--- a/docs/guide.md
+++ b/docs/guide.md
@@ -37,11 +37,29 @@ server. A capability does not guarantee every related action: Cocoa currently
returns false for interactive resize and window-menu requests even though
it advertises CSD. Check each result and provide an application fallback.
+## Window creation and callbacks
+
+Open the display with application-wide options and notifications in
+`yasl_display_spec`. Create each toplevel with `yasl_window_spec`, including its
+title, logical size, optional `yasl_window_cbs` table in `cbs`, and userdata in
+`ud`. One display can own multiple windows with separate callback tables.
+
+The window copies its callbacks during creation. Its callbacks cannot run before
+creation returns, so the application can store the returned surface first.
+Userdata stays borrowed until callbacks are replaced or the surface is destroyed.
+Read initial geometry with `yasl_surface_geometry()`; creation does not guarantee
+an initial `configure` notification. Request the first redraw once application
+state is ready. `yasl_surface_set_callbacks()` replaces callbacks later and also
+installs popup callbacks; the setter does not invoke the callbacks.
+
+When using `yasl_run()`, its runner installs callbacks for windows on its display.
+Use `yasl_app_desc.event` and `.frame` rather than `yasl_window_spec.cbs` and `.ud`.
+
## Geometry and scaling
| Value | Units |
| --- | --- |
-| Toplevel `yasl_surface_spec.size` | Logical pixels |
+| Toplevel `yasl_window_spec.size` | Logical pixels |
| `yasl_geometry.size`, framebuffer size | Device pixels |
| Pointer position, caret, window-menu position | Device pixels, relative to the surface |
| Damage rectangles | Device pixels, relative to the draw target |