Newsletter, July 2022
Editor Enhancements

This month saw a number of small-but-useful improvements to widget.Editor, including the ability to filter characters, enforce a maximum length, and built-in support for undo/redo. Additionally, numerous subtle event processing bugs were ironed out.

core gio

Breaking changes by author:

Chris Waldon:

  • widget: [API] implement editor undo/redo. This commit adds a simple linear-history undo/redo mechanism to widget.Editor bound to Short-(Shift)-Z as well as tests for this new feature. This is a breaking change because the editor now consumes key events for Short-(Shift)-Z. 41de0048

Changes by author:

Elias Naur:

  • layout: respect minimum constraint size in Flex.Layout. 16225039
  • widget: ensure that Border.Layout dimensions fully contains the border. 53da73de
  • widget: emit only one ChangeEvent per Editor.Layout. ChangeEvent contains no information, so emitting multiple instances per layout is pointless. 48e9cdaf
  • widget: add Editor.MaxLen for limiting the content length of Editor. 1d9ab653
  • app: [X11] send DestroyEvent after ViewEvent{}. c73125e1
  • app: ensure no window wakeups are in flight when destroying it. When a window is destroyed, it is no longer valid to call its wakeup method. 63d23538
  • app: [Wayland] account for fallback decoration height in window sizes. Pass through a fallback window decoration height to the Wayland backend, so that it can account for it when determining surface size. 2993ba18
  • io/router: try all handlers if a key don’t match the focus ancestor tree. When a key.InputOp is focused, a key.Event is matched to it and its ancestors. If there is no focus, every handler is matched. This change always matches to every handler, after checking the focus and its ancestors. 28c206fc
  • widget: don’t let unfocused Clickables swallow key presses. 26e71011
  • app: [macOS] don’t miss pointer presses. We used to track the pressed pointer buttons through the global function [NSEvent pressedMouseButtons]. However, it’s possible that at the time a pointer press event is delivered, the pointer button is up again. To ensure a consistent view of the pointer press state, track it through the buttonNumber property on delivered events. 0f51cb90
  • widget: add Editor.Filter for filtering unwanted characters. f7bc744a
  • all: add support for macOS to flake.nix. The Nix version of the macOS toolchain has difficulties compiling Objective-C modules; disable modules instead of figuring out why. It also doesn’t include any frameworks automatically; add them explicitly. 5326ca5f
  • app/permission/wakelock: add package for requesting wake locks. dbbae051
  • all: format comments with go fmt ./… using Go 1.19. 61b2e376
  • Revert "io/router: [API] don’t emit Enter and Leave events for touch input”. This reverts commit cd0c9dab9fcd2dd70f9f900f480473879d16f683. It turns out that Enter/Leave is important for cancelling press-then-release-outside for clickables. 96d6fd27

Inkeliz:

  • app: [windows] recover focus on click. Previously, Gio doesn’t reclaim the focus when they lose that to a parent window. In such a case, the child window can steal keyboard focus, and Gio will never recover it. fc5689ea
  • app: [android] use GioView inside FrameLayout. Before that change, on Android, was impossible to overlay GioView with a custom view. This change adds FrameLayout and renders GioView into that, allowing to use addView from Android API. 3e9d4d96
  • app: [android] fix insets. Previously, the Inset could be report wrongly when the bottom inset is smaller than the top. 65a4366e

Egon Elbre:

  • gpu: avoid bounds checks in decode. 0777afb8
  • widget: fix Enum with Return. The input op started listening to Return, however the check was looking for Enter. b4acc239

Dominik Honnef:

  • f32: fix typo in comment. b9416c7c
  • io/pointer: fix order of Cursor comments. b67bef3e

psydvl:

  • internal/vk: fix wayland-client linking. e711cbc0

gio-example

Changes by author:

Chris Waldon:

  • deps: update to latest gio and gio-x. 57fec8c
  • markdown: update to new API. 6253df2