~eliasnaur/gio

ui/text,ui/layout: move ui.Config and input.Queue to parameters

I too often forget to initialize widgets' config and queue. Moving
them from fields to parameters fix that. The change results in a
little more verbosity but cleaner code.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/go.mod: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (macOS) don't release opengl context

I haven't found a reliable way to re-create the context and redraw
after deminiaturization or app unhide.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (macOS) destroy the GL context correctly

The NSOpenGLView owns the NSOpenGLContext so we can't just CFRelease
the context. Use [NSOpenGLView releaseGLContext] instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: return a concrete Queue from Window.Queue

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/go.mod: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (macOS) ignore asynchronous redraws to deleted windows

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: (macOS) serialize access to the views map

The CVDisplayLink used for synchronizing rendering to the display
refresh rate runs on a separate thread from the main thread.
View callbacks must therefore be serialized. Implement that by
introducing a singleton goroutine that owns the view map and runs
incoming commands.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app/internal/input: only drop handlers completely when inactive

Delete a redundant loop; dropHandlers already does the required work.

Fixes pointer event issues found after pointer events with no side
effects no longer trigger redraws.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: update to rename Window.Invalidate method

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app: rename Window.Redraw to Invalidate to match ui.InvalidateOp

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: update to renamed ImageOp.Src field

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/draw: rename ImageOp.Img to Src

To match widget.Image.Src field name.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
README.md: add shameless plug to Scatter

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/input,ui/layout: update comments

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: reset StackOp in Pop

To enable re-use.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: update to StackOp

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: replace PushOp, PopOp with a StackOp

Before this change, there was no guarantee that a PopOp matched
the intended PushOp. With a single stack operation, the client is
forced to match pop with the right push.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Next