~eliasnaur/gio

go.*: update go-text

This picks up some improvements to face splitting and line wrapping within the
text stack.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
widget: update test expectations

This commit fixes our tests to expect some whitespace-handling changes in upstream
go-text.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
deps: bump go-text/typesetting version to v0.1.0

Using this stable release should ensure user upgrading gio with go get -u do not encouter compilation error

Signed-off-by: Benoit KUGLER <benoit.kugler@gmail.com>
app: [tvOS] fix build failures

Fixes: https://todo.sr.ht/~eliasnaur/gio/567
Signed-off-by: Aman Karmani <aman@tmm1.net>
app: update documentation for Window.Run

Window events are no longer asynchronous, so deadlocks are no longer
possible when calling Run.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: introduce Config.Focused that tracks the window focus state

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] synchronize rendering with Core Animation for smooth resizes

Magic incantations lifted from

https://thume.ca/2019/06/19/glitchless-metal-window-resizing/

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [API] rename Window.NextEvent to Event to match Source.Event

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [API] remove StageEvent and Stage

StageEvent served only redundant purposes:

- To detect whether the window has focus. That is covered by
  key.FocusEvent.
- To detect whether the window is currently visible. That is covered by
  the absence or presence of FrameEvents.
- To detect when the window native handle is valid. That is
  covered by ViewEvent.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [API] make ViewEvent an interface on all platforms

A uniform type allows convenient nil checks and for future window
backends on platforms other than Linux (which already had ViewEvent
as an interface).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] move destruction to NSView.dealloc

The dealloc method is where we're guaranteed the NSView is no longer
used anywhere.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] send ViewEvents when the NSView is attached to a NSWindow

Instead of sending ViewEvents once at construction and once at destruction,
it's better to send them when the underlying NSView changes attachment.

The main advantage is that we're about to move the destruction and
emitting of DestroyEvent to the NSView's dealloc method. However, the
dealloc will not be called if user code has a strong reference to it
through a non-empty ViewEvent. By sending an empty ViewEvent when the
view is detached, well-behaving users will remove the strong reference.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] make gio_trySetPrivateCursor static, remove its prefix

While here, don't use trySetPrivateCursor for the public openHandCursor
and closedHandCursor.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] add missing autoreleasepools

Their absense didn't make a practical difference so far, but we're about
to refactor the macOS event processing loop where the pools do matter.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: merge with internal log package to remove the separate log.appID

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] use cgo.Handle for referring to Go windows from native code

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [macOS] use NSNotificationCenter to receive app events

Notifications don't require a list of windows nor an app delegate.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [iOS] use cgo.Handle for referring to Go windows from native code

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: [API] make the zero-value Window useful and delete NewWindow

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app: prepare Window for removal of Main and asynchronous FrameEvents

This is mostly a refactor, but there are two user-visible effects:
- Window.NextEvent may be called even after DestroyEvent is returned.
- Window.Invalidate always wakes up a blocking NextEvent, even when a
FrameEvent cannot be generated.

As a nice side-effect, X11, Wayland and Wasm no longer require separate
goroutines for their window loops.

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