github go-gui-org/go-gui v0.92.0

latest releases: v0.94.0, v0.93.0
21 days ago

Added

  • Content transitions on Text (#1021). The new TextCfg.Transition
    animates a change of Text. ContentTransitionNumeric rolls 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;
    Down forces 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. ContentTransitionFade fades the old text out and the
    new text in. ContentTransitionReplace shrinks 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 an ID, as
    TextCfg.Anim does. See examples/content_transition/ and the showcase's
    Content Transition page.

  • Single-instance mode and open events (#1106). instance.Acquire(id) in
    the new gui/instance package elects one primary process per app ID and user.
    A later launch sends its arguments to the primary and gets primary=false, so
    it can exit. Lock.Attach(app) turns this launch's arguments and every
    forwarded launch into a gui.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 reach App.OnOpen too, at launch and while the app runs.
    App.DispatchOpen and gui.ParseOpenArgs are exported for apps that feed
    their own events. The election uses flock on Unix and a named mutex on
    Windows. The kernel frees it when the primary dies, also on kill -9.
    Single-window backend.Run has no App, so it gets no open events; use
    backend.RunApp. See examples/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 plain keydown and keyup events that carry
    none of the keyboard fields, and the backend read them with js.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-mode change event, so an event that a page script
    or an extension builds with new 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=1 keeps 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. A Transparent window 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
    DragScroll container 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 no MouseDX/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. A DragScroll container'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

Full Changelog: v0.91.0...v0.92.0

Don't miss a new go-gui release

NewReleases is sending notifications on new releases.