When moving a window to another monitor, update is called when the
opengl backing store updates its internal size.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Compute and keep constant the pixel density, to avoid window content
changes when moving to another monitor with a different density.
Use backing store scale, not content scale for input events.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Now that the input router triggers a redraw when a focus event is
added, it is no longer necessary to check for that condition in
Window.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Input events are asynchronous, so add buffered to the event queue
so that a slow client does not stall the native window.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
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>
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>
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>
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>
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>
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>
Move the Record and Stop methods from Ops to MacroOp itself.
Before this change, Ops.Stop stopped the recording of the most
recent macro, which could be a different macro than intended.
After this change, there is no such confusion.
As a bonus, the Ops API becomes less cluttered.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Rename Insets to the verb Inset for consistency with Align.
Uniform is a better description than Equal for the result of
UniformInset.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Exact was too special and can be expressed with RigidConstraints.
RigidConstraints is a better name ("rigid" was in the comment!)
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Before this change `go list <pkg>` was used to sanitize the import
path of the package argument. That doesn't work well for building
Go source files directly:
gio -target android helloworld.go
where `go list helloworld.go` simply returns "command-line-arguments".
A better way is to leave the package path alone, and compute the
output file separately from the import path, as reported by
`go list -f {{.ImportPath}} <pkg>`.
Signed-off-by: Elias Naur <mail@eliasnaur.com>