Added
-
Content transitions on
Text(#1021). The newTextCfg.Transition
animates a change ofText.ContentTransitionNumericrolls only the
characters that change, compared by grapheme from the right, so "41" to "42"
rolls the "1" and leaves the "4" still, and "99" to "100" rolls three columns.
A larger number comes up from below and a smaller one comes down from above;
Downforces down. Each rolling character is clipped to the line, and the
text asks for tabular figures, so where the font has them its width does not
change with the digits.ContentTransitionFadefades the old text out and the
new text in.ContentTransitionReplaceshrinks an old icon away while the new
one grows in. Under reduced motion, and for wrapped or multiline text, every
kind fades. A focused text, or one with a selection, shows the new text at
once, so its caret and selection stay. Every frame is render-only: no view
function and no layout runs while the text moves. The text needs anID, as
TextCfg.Animdoes. Seeexamples/content_transition/and the showcase's
Content Transition page. -
Single-instance mode and open events (#1106).
instance.Acquire(id)in
the newgui/instancepackage elects one primary process per app ID and user.
A later launch sends its arguments to the primary and getsprimary=false, so
it can exit.Lock.Attach(app)turns this launch's arguments and every
forwarded launch into agui.OpenEvent(files and URLs) for the new
App.OnOpen, which runs on the main thread and rebuilds the view after. On
macOS, files opened from Finder or the Dock and links in a scheme the bundle
registers reachApp.OnOpentoo, at launch and while the app runs.
App.DispatchOpenandgui.ParseOpenArgsare exported for apps that feed
their own events. The election usesflockon Unix and a named mutex on
Windows. The kernel frees it when the primary dies, also onkill -9.
Single-windowbackend.Runhas noApp, so it gets no open events; use
backend.RunApp. Seeexamples/single_instance/.
Fixed
-
iOS Safari opens the soft keyboard when a text field is tapped (#1126).
The web backend focused its hidden input from the next frame
(requestAnimationFrame), after the touch handler had returned. iOS opens a
keyboard only for a focus made while it handles the touch, so a tapped field
showed a blinking caret but no keyboard came up. A press that focuses an
editable field now starts the input method and shows the keyboard inside the
press itself: at the touch-down, or at the lift where a scrollable holds the
press until it knows the touch is a tap. A press that leaves the field, or
that focuses a widget the next frame builds, is still settled in the frame.
Other platforms get the same calls one frame sooner. -
Web: a saved password no longer stops the app (#1128). Picking a saved
password from Chrome's autofill froze the page: no tap, scroll or key reached
the app again. Autofill sends plainkeydownandkeyupevents that carry
none of the keyboard fields, and the backend read them withjs.Value.Bool,
which panics on a missing value. The panic stopped the Go program. Every event
listener now reads a missing field as its zero value: key, mouse, wheel and
touch events and the dark-modechangeevent, so an event that a page script
or an extension builds withnew Event()cannot stop the app either. A mouse
press or release with no button is dropped, not read as a left click at the
top-left corner, and a touch list entry that is not a touch is skipped. -
macOS: Apple Events reach a running app (#1106). The event loop polled
with a fixed list of event types. AppKit dispatches Apple Events only when the
poll asks for every type, so a document opened while the app ran, a Dock
reopen and other Apple Events were lost. The loop now polls with
NSEventMaskAny, as[NSApp run]does. -
A Wayland window without a frame provider falls back to X11 (#1121).
v0.91.0 made Wayland the default. GNOME draws no window frames, so go-gui
needs libdecor and its GTK plugin there. Without them the window had no title
bar, no close button and could not be moved. Now the first window falls back
to X11, and XWayland draws its frame, as in v0.90.0. A warning names
libdecor-0-plugin-1-gtk, which gives native Wayland with a frame.
GOGUI_WAYLAND=1keeps the frameless Wayland window. KDE and wlroots
compositors draw the frame themselves and are not affected. -
Wayland windows no longer show dark edges on borders, text and switches
(#1121). The blend function also blended the alpha channel, so a translucent
draw over an opaque pixel left the pixel's alpha below 1. On X11 the window
has no alpha channel and this did not show. A Wayland buffer carries the alpha
to the compositor, so anti-aliased edges, text and translucent borders let the
desktop, or black in a screenshot, show through. An opaque Wayland window now
sets its alpha to 1 at the end of each frame. ATransparentwindow is
unchanged. -
Scrolling a list by touch no longer clicks the row under the finger
(#1116). A touch-down sent the mouse press at once, and a press fires
OnClick, so a scroll that started on a row picked the row; in the showcase
catalog on a phone it also closed the drawer. Inside a scrollable that can
scroll, the press now waits for the finger: a lift before the 10 px pan
threshold is a tap and clicks, at the lift; a pan the scrollable can follow,
diagonal ones included, drops the press; a pan clearly along the other axis,
or a long press, sends it. A tap that stops a fling only stops it and picks
nothing, as on iOS and Android. On a scrollbar the bar's axis decides: a pan
along it drags the thumb, a pan across it scrolls the content, and a tap still
jumps the track. Outside a scrollable, in content that fits and in a
DragScrollcontainer the press goes out at touch-down, as before. Mouse
input is unchanged. This applies on Android, iOS and the web backend on
phones. -
The scrollbar thumb follows a finger (#1116). A touch drag on the thumb
did not move it: mouse moves synthesized from touch carried noMouseDX/DY.
Past the pan threshold the content panned with the finger instead, so pulling
the thumb down scrolled up. Touch moves now carry their delta, and a pan no
longer scrolls the content while a press holds the mouse lock, as a thumb or
slider drag does. ADragScrollcontainer's lock is the exception, so a
vertical swipe on a horizontal carousel still scrolls the page, and a sideways
swipe on it does not move the page.
What's Changed
Other changes
- Hold touch presses in scrollables until tap or scroll (#1116) by @ollex in #1120
- Fix Wayland dark edges and missing window frame (Refs #1121) by @mike-ward in #1123
- Add single-instance mode and open-with events (#1106) by @mike-ward in #1124
- ci: add clobberfree=1 to the Windows asyncpreemptoff leg (Refs #886) by @mike-ward in #1125
- Add content transitions to Text: numeric roll, fade, icon replace (#1021) by @mike-ward in #1130
- Show the soft keyboard inside the press that focuses a field (#1126) by @ollex in #1127
- Read missing DOM event fields as zero in the web backend (#1128) by @ollex in #1129
- changelog: add v0.92.0 (content transitions, single-instance mode) by @mike-ward in #1132
Full Changelog: v0.91.0...v0.92.0