Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ec5ca62
fix(linux): fall back to a hand for the grabbing cursor
Ezreal-byte Nov 21, 2026
3929552
feat(app): report a web view's title, history and loading
MYCF711 Nov 21, 2026
efd9c5c
fix(windows): keep the frame constant ABI test in step with the shader
t8y2 Nov 21, 2026
eedbe8d
docs(release): v0.6.7 notes
t8y2 Nov 21, 2026
e6712a7
docs: point at v0.6.7
t8y2 Nov 21, 2026
4e6fa27
test(darwin): compare Dock icon colors by dominant channel
1lck Nov 21, 2026
1742b8f
test(windows): check the frame shader field offsets
1lck Nov 21, 2026
737c245
feat(components): add CodeEditor gutter and byte decorations
caichangqing1120 Nov 21, 2026
3a4c371
feat(app): let a host put an image on the clipboard
MYCF711 Nov 21, 2026
6b58fd1
feat(base): break a long word when the box has no room
MYCF711 Nov 21, 2026
619c354
test(darwin): share the Dock icon size rule and require a color margin
t8y2 Nov 21, 2026
30e3c0d
fix(windows): reuse complete text pictures during resize
t8y2 Nov 21, 2026
4d05db5
feat(app): let a web view keep its data in a named partition
MYCF711 Nov 21, 2026
a590e31
chore(components): regenerate the CodeEditor decorations recipe
t8y2 Nov 21, 2026
0c6e2d2
feat(components): add a force-directed link graph
Lan-zk Nov 21, 2026
15d4e38
fix(gfx): wrap long paragraphs in time linear in their length
t8y2 Nov 21, 2026
21b6aca
fix(gfx): keep a screen's working set of cell glyphs cached
t8y2 Nov 21, 2026
99d6146
fix(framebuild): send layer and clip changes as a range, not a rebuild
t8y2 Nov 21, 2026
8695305
fix(app): compare published hit labels by text, not by pointer
t8y2 Nov 21, 2026
f53eddc
fix(base): hand out released slots in constant time and stable order
t8y2 Nov 21, 2026
3a8af08
fix(platform): stop idle wakeups in background windows and prompts
t8y2 Nov 21, 2026
76824aa
fix(website): name the graph component in the sidebar
t8y2 Nov 21, 2026
0ab9054
fix(web): give the clipboard test a PNG its check can read
t8y2 Nov 21, 2026
5da48b6
feat(ui): fill the control gaps in fields, splitter, tooltip and tree
1lck Nov 21, 2026
69aa619
docs(website): resync the input guide from its example
t8y2 Nov 21, 2026
c59e92d
fix(focus): support explicit one-shot focus requests
t8y2 Nov 21, 2026
e94ad04
feat(app): report a window losing the activation
t8y2 Nov 21, 2026
73515ed
fix(text): draw nothing for fully transparent text
Ezreal-byte Nov 21, 2026
3a7d451
feat(theme): scale text size and line height by a preference
Ezreal-byte Nov 21, 2026
8f69ffe
feat(app): add a clickable notification popup
Ezreal-byte Nov 21, 2026
c23aa44
feat(app): report when a web view's process dies
MYCF711 Nov 21, 2026
3be62de
fix(ui): keep element identities stable across conditional declarations
t8y2 Nov 21, 2026
c6e7aae
feat(app): let a goroutine hand its result to a window with Post
t8y2 Nov 21, 2026
3f8845b
fix(ui): correct the List, Slider, Select and command examples
t8y2 Nov 21, 2026
15be1f1
feat(ui): make a page and its Table whole in package ui alone
t8y2 Nov 21, 2026
d5da72e
feat(ui): open overlays on a bool and label form controls by default
t8y2 Nov 21, 2026
ac5b092
test(web): exercise wake while the page is open
caichangqing1120 Nov 22, 2026
83c1fc6
feat(app): open a window maximized from Config
DeanCen Nov 22, 2026
669b9fb
fix(text): find a click's offset and a word's range without scanning …
t8y2 Nov 22, 2026
09af469
fix(text): keep the editor's text across edits and convert offsets in…
t8y2 Nov 22, 2026
0c27804
perf(app): drop the semantic tree and payload copy nobody read
t8y2 Nov 22, 2026
98bab0a
fix(components): place select and combobox lists by the popup rule
t8y2 Nov 22, 2026
c9b165f
fix(components): animate single and multi select lists like a Select
t8y2 Nov 22, 2026
4ad1fd1
fix(base): let go what a shrunken page held in its reused arrays
t8y2 Nov 22, 2026
3b0da70
perf(windows): call COM methods without allocating per call
t8y2 Nov 22, 2026
9ad1e9d
perf(linux): load the xcb and Vulkan function tables once per process
t8y2 Nov 22, 2026
7d89faa
merge: port panel wheel routing onto the base engine
xiaoyumuxi Nov 22, 2026
1f7b7b1
Merge remote-tracking branch 'origin/main' into fix/popover-wheel-sta…
xiaoyumuxi Nov 22, 2026
a4a56fd
ui: align panel wheel regressions with the current page API
xiaoyumuxi Nov 22, 2026
954ea60
Merge upstream wheel review fix into fork
xiaoyumuxi Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 28 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,28 @@ jobs:
wait "$pid" || status=1
done
exit "$status"
- name: Native Linux text rasterization
run: |
sudo apt-get install -y libpangocairo-1.0-0 fonts-noto-color-emoji ||
{ sudo apt-get update && sudo apt-get install -y libpangocairo-1.0-0 fonts-noto-color-emoji; }
go test ./internal/platform/linux -run '^TestTextEngineRasterizesProportionalText$' -count=1 -v
- name: GTK optional capability contracts
run: |
go vet -tags vivagtk ./app ./internal/platform/linux
go test -tags vivagtk ./internal/platform/linux -run '^TestGTK(WaylandAlwaysOnTopReportsUnsupported|ClipboardFileWriteReportsUnsupportedWithoutASetter)$' -count=1
go test -tags vivagtk ./internal/platform/linux -run '^Test(GTK(WaylandAlwaysOnTopReportsUnsupported|ClipboardFileWriteReportsUnsupportedWithoutASetter|ClipboardImageWriteReportsUnsupportedWithoutSetWithData)|APartition(KeepsItsStoreInTheUsersDirectories|FollowsTheXdgDirectories|IsNamedAfterTheApplicationWithoutAClass))$' -count=1
# The Linux package is not part of the sharded run (it drives X11), so the
# titlebar contracts that do not need a server name their tests here.
- name: Titlebar and window contracts
run: go test ./internal/platform/linux -run '^Test(MaximizeButtonSetsBothDirections|PreviewMovePreservesSizeAndFocus)$' -count=1 -v
- name: Native X11 drag preview
run: go test ./internal/platform/linux -run '^Test(MaximizeButtonSetsBothDirections|OpeningMaximizedAsksForBothDirectionsBeforeMapping|PreviewMovePreservesSizeAndFocus|AClipboardImageIsOfferedAsPNGAndNoText|SetClipboardImageClaimsTheClipboardAndDropsOtherFlavours)$' -count=1 -v
- name: Native X11 drag preview and notification
env:
VIVA_TEST_PREVIEW_XVFB: '1'
VIVA_TEST_NOTIFICATION_XVFB: '1'
run: |
sudo apt-get install -y xvfb libxcb-shape0 ||
{ sudo apt-get update && sudo apt-get install -y xvfb libxcb-shape0; }
xvfb-run -a go test ./internal/platform/linux -run '^TestPreviewNativeX11Contract$' -count=1 -v
sudo apt-get install -y xvfb libxcb-shape0 libgtk-3-0 ||
{ sudo apt-get update && sudo apt-get install -y xvfb libxcb-shape0 libgtk-3-0; }
xvfb-run -a go test ./internal/platform/linux -run '^Test(PreviewNativeX11Contract|NotificationNativeX11)$' -count=1 -v
GDK_BACKEND=x11 VIVA_TEST_GTK_NOTIFICATION=1 xvfb-run -a go test -tags vivagtk ./internal/platform/linux -run '^TestGTKNotificationFocusHints$' -count=1 -v
- name: Native X11 global shortcut
env:
VIVA_NATIVE_GLOBAL_SHORTCUT_TEST: '1'
Expand Down Expand Up @@ -305,6 +312,11 @@ jobs:
with:
go-version-file: go.mod
cache: true
- name: Native AppKit notification focus and click
working-directory: internal/platform/darwin
run: |
xcrun clang -fno-objc-arc -Werror -Wno-deprecated-declarations testdata/window_notification.m -o "$RUNNER_TEMP/window-notification" -framework Cocoa -framework CoreText -framework Metal -framework QuartzCore
"$RUNNER_TEMP/window-notification"
# A package with no darwin file compiles to the same source on every
# operating system, so the lint job's `go vet ./...` already covers it;
# what is left here is the darwin build of the packages that have one. The
Expand All @@ -328,6 +340,7 @@ jobs:
VIVA_NATIVE_GLOBAL_SHORTCUT_TEST: '1'
run: go test ./internal/platform/darwin -run '^TestNativeCarbonGlobalShortcut$' -count=1 -v


windows-materials:
needs: changes
if: needs.changes.outputs.code == 'true'
Expand All @@ -344,17 +357,23 @@ jobs:
# native structure ABI tests are here for the same reason: they build only
# on Windows.
- name: Material contracts and controls (WARP)
run: go test ./internal/platform/windows ./ui ./components ./headless ./app -run 'Test(Backdrop|WindowBackdrop|Notification|TaskbarCreated|CompositionClear|CompositionFallback|CompositionCreation|CustomBackdrop|AcrylicAccent|LegacyAcrylic|RoundedOutline|Translucent|MonospaceFamilies|FontWeights|(The)?MonoWeights|(The)?InterfaceWeights|EveryListedFamilyResolves|EngineReportsTheFontsUnderline|AlwaysOnTop|SaveDialogCheckbox|FileIcon|NativeStructureABI|ResizePresents|WindowSwapChain|LiveResize|FlipWindowResize|RedrawWaits|ContinuousRedraw|NoOpFrame|SameSize|ZeroSize|ResizeTimer|RedrawQueue|NativeRedrawMessage|CompositionSupersededFrame|DragPreview)' -count=1 -v
run: go test ./internal/platform/windows ./ui ./components ./headless ./app -run 'Test(Backdrop|WindowBackdrop|OpeningMaximized|Notification|TaskbarCreated|CompositionClear|CompositionFallback|CompositionCreation|CustomBackdrop|AcrylicAccent|LegacyAcrylic|RoundedOutline|Translucent|MonospaceFamilies|FontWeights|(The)?MonoWeights|(The)?InterfaceWeights|EveryListedFamilyResolves|EngineReportsTheFontsUnderline|AlwaysOnTop|SaveDialogCheckbox|FileIcon|NativeStructureABI|ResizePresents|WindowSwapChain|LiveResize|FlipWindowResize|RedrawWaits|ContinuousRedraw|NoOpFrame|SameSize|ZeroSize|ResizeTimer|RedrawQueue|NativeRedrawMessage|CompositionSupersededFrame|DragPreview)' -count=1 -v
- name: Web view partitions
run: go test ./internal/platform/windows -run '^Test(APageWithoutAPartitionAsksForNoProfileOfItsOwn|APartitionNamesTheWebView2Profile|AnEphemeralPartitionIsAnOffTheRecordProfile|EphemeralPagesWithoutAPartitionEachGetAProfileOfTheirOwn)$' -count=1 -v
- name: Terminal keyboard routing
run: go test ./internal/platform/windows -run '^TestATerminalGetsEditingKeysAndChordsAsRawKeys$' -count=1 -v
- name: Native window and grouped taskbar icons
run: go test ./internal/platform/windows -run '^TestWindowIconUpdatesOnTheWindowThread$' -count=1 -v
- name: Non-activating desktop notification
env:
VIVA_TEST_NOTIFICATION_DESKTOP: '1'
run: go test ./internal/platform/windows -run '^TestNotificationNativeWindows$' -count=1 -v
- name: Native Windows global shortcut
env:
VIVA_NATIVE_GLOBAL_SHORTCUT_TEST: '1'
run: go test ./internal/platform/windows -run '^TestNativeGlobalShortcutRegistration$' -count=1 -v
- name: Native Direct2D text origins
run: go test ./internal/platform/windows -run '^TestDirectTextLayoutOriginByValue$' -count=1 -v
- name: Native Direct2D text origins and hidden labels
run: go test ./internal/platform/windows -run '^Test(DirectTextLayoutOriginByValue|HiddenNativeEditorDoesNotDrawColorEmoji|TextEngineRasterizesProportionalText)$' -count=1 -v
# The installer contracts, including WinVerifyTrust's struct layout, only
# compile and run on Windows.
- name: Update installer contracts
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Wayland client and needs the system's GTK 3), and a Vulkan loader and driver for
and DirectWrite. Viva loads the system libraries at runtime and bundles none of
them.

The current release is `v0.6.6`; name it explicitly (`@v0.6.6`) to pin it. Guides,
The current release is `v0.6.7`; name it explicitly (`@v0.6.7`) to pin it. Guides,
the API reference, and a component catalog with live previews live in
[`website/`](website/); run it with `npm run dev` there, or read them on
[vivaui.dev](https://vivaui.dev/en/), which is also available in
Expand Down Expand Up @@ -112,6 +112,8 @@ WebView and no bundled rendering runtime.
StatusNotifier host; `StatusItemConfig.Menu` makes it open the system's own
menu (NSMenu, a Win32 popup menu, `com.canonical.dbusmenu`); `WindowPanel` is
the borderless popup that opens beside it and closes when it loses focus;
`WindowNotification` is a clickable popup that does not take the keyboard and
stays open when focus moves away;
`Window.Hide`/`Show` keep an application running without a visible window.
- `Application.SetDockBadge` puts a label in the red badge macOS draws at the
corner of the application's Dock tile, and an empty label removes it.
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ viva dev . # hot reload: save a file, the window updates and keeps its st

环境要求:Go 1.26 或更新版本(缺失时 viva 会自己下载)。macOS 上需要 Xcode 命令行工具,因为 Viva 通过 cgo 访问 Cocoa 和 Metal;Linux 上需要带系统 XCB、Pango 和 Cairo 库的 X11(可选的 GTK 3 外壳用 `-tags vivagtk` 构建,是原生 Wayland 客户端,需要系统的 GTK 3),Vulkan 加载库和驱动用于 GPU 加速,缺失时窗口用 CPU 渲染;Windows 上需要 Win32、Direct3D 11 和 DirectWrite。Viva 在运行时加载系统库,自身不捆绑任何一个。

当前版本是 `v0.6.6`;要固定版本就写明(`@v0.6.6`)。指南、API 参考和带实时预览的组件目录在 [`website/`](website/) 里,本地用 `npm run dev` 运行;也已经发布在 [vivaui.dev](https://vivaui.dev/zh/)。
当前版本是 `v0.6.7`;要固定版本就写明(`@v0.6.7`)。指南、API 参考和带实时预览的组件目录在 [`website/`](website/) 里,本地用 `npm run dev` 运行;也已经发布在 [vivaui.dev](https://vivaui.dev/zh/)。

下面的一切描述的都是这个仓库:它的测量、它自己的程序,以及如何开发框架本身,而不是如何用框架。

Expand Down
4 changes: 0 additions & 4 deletions app/accessibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ func TestAccessibilityNodesCarryInvalid(t *testing.T) {
if len(painter.accessibility) != 1 || !painter.accessibility[0].Invalid {
t.Fatalf("accessibility = %+v", painter.accessibility)
}
node, ok := painter.semantics.Get(painter.semanticIDs[0])
if !ok || !node.Invalid {
t.Fatalf("semantic node = %+v", node)
}
}

func TestAccessibilityPressClicksOnceAndIgnoresDisabledControls(t *testing.T) {
Expand Down
38 changes: 30 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/vivaui/viva/gfx"
"github.com/vivaui/viva/internal/platform"
)

const (
Expand Down Expand Up @@ -40,6 +41,12 @@ const (
// closes itself when it loses focus; OnClosed reports that, and OnCloseRequest
// is not asked.
WindowPanel
// WindowNotification opens a desktop popup that accepts pointer input and
// stays open when focus changes. On Windows, macOS and X11 it requests the
// bottom-right of the pointer monitor's work area without taking keyboard
// focus. On native Wayland, the compositor decides placement, stacking and
// keyboard focus. Use SendNotification for a system-managed notification.
WindowNotification WindowMode = WindowMode(platform.WindowNotification)
)

// Config describes the initial native window.
Expand Down Expand Up @@ -72,7 +79,12 @@ type Config struct {
// (kept on a screen); an X11 window manager places the window's frame there,
// so the content area sits below the title bar. Window.Frame reports where it
// really is.
Origin *gfx.Point
Origin *gfx.Point
// Maximized asks the window manager to open the window maximized on Windows
// and Linux, while keeping Width, Height and Origin as its restored floating
// bounds. Opening maximized reports it through OnMaximize, like maximizing
// later does. Ignored on macOS, web, and WindowPanel.
Maximized bool
WindowMode WindowMode
// TitlebarHeight is the height in logical pixels of the strip the
// application paints under a custom titlebar's traffic lights, where the
Expand Down Expand Up @@ -207,11 +219,19 @@ type Config struct {
// call it. It lets an application refresh data that may have gone stale
// while the window was in the background, without polling.
OnActivate func()
// OnDeactivate runs on the window thread when the top-level window stops
// being the active window, after the keys that were down are released. It
// is how an application saves or hides what only makes sense while it has
// the user's attention. Its Repaint asks for a new frame. Moving focus
// between editors inside the window does not call it, and the Web target
// does not report it.
OnDeactivate func() gfx.EventResult
// OnMaximize runs on the window thread when the window is maximized or
// restored on Windows and Linux, including by the system (the window
// manager, the taskbar, or a keyboard shortcut), not only by Viva's own
// window controls. On macOS, windows zoom or enter full screen instead,
// and this callback is not invoked.
// window controls, and once when a window opens maximized. On macOS,
// windows zoom or enter full screen instead, and this callback is not
// invoked.
OnMaximize func(maximized bool)

// OnFullscreen runs on the window thread after the host observes a
Expand All @@ -229,13 +249,15 @@ type Config struct {
// OnClosed runs exactly once on the window thread after native resources
// stop receiving events. Release window-owned application resources here.
OnClosed func()
// Invalidator, when set, lets other goroutines request a repaint with
// Invalidate. Pair it with OnWake to apply what they produced. Unset, no
// wake-up machinery exists. A development reload worker ignores it.
// Invalidator, when set, lets other goroutines hand results to the window
// with Post, or request a repaint with Invalidate. Unset, no wake-up
// machinery exists. A development reload worker ignores it.
Invalidator *Invalidator
// OnWake runs on the window thread right before each repaint that
// Invalidate or a running transition requested. Move the results of
// background work into application state here, so Paint only reads state.
// Invalidate, Post or a running transition requested, after the updates
// Post queued. It runs on every such wake, a transition's frames included,
// so it is for state the window thread advances itself; a result of
// background work is handed over with Invalidator.Post, which applies it once.
// It runs for a window nobody can see too (hidden, minimized, or covered, where
// the platform says so), which is not painted: the frame it missed is painted
// once the window shows again, so a status icon can be refreshed from here.
Expand Down
2 changes: 2 additions & 0 deletions app/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func (application *Application) OpenWindow(config Config, canvas *gfx.Canvas) (*
return nil, errors.New("app: application is not running")
}
window := &Window{}
config.attachPosts()
application.mu.Lock()
if application.windows == nil {
application.windows = make(map[*Window]struct{})
Expand Down Expand Up @@ -275,6 +276,7 @@ func (application *Application) OpenWindow(config Config, canvas *gfx.Canvas) (*
}
control, err := application.host.OpenWindow(config, canvas, closed)
if err != nil {
config.Invalidator.closePosts()
forget()
return nil, err
}
Expand Down
8 changes: 8 additions & 0 deletions app/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const (
// proxy settings. Linux reads the environment only, and macOS reports a
// PAC policy as an error.
CapabilitySystemProxy
// CapabilityClipboardImageWrite means SetClipboardImage can put a picture on
// the clipboard synchronously. The browser offers the write only through a
// Promise, so it reports CapabilityClipboardImageWriteAsync instead.
CapabilityClipboardImageWrite
// CapabilityClipboardImageWriteAsync means SetClipboardImageAsync can put a
// picture on the clipboard, completing before the call returns on a desktop
// and on the event loop in a browser.
CapabilityClipboardImageWriteAsync
)

// Capabilities is a set of platform integrations.
Expand Down
2 changes: 2 additions & 0 deletions app/capabilities_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func nativeCapabilities() Capabilities {
CapabilityClipboardTextAsync |
CapabilityClipboardImage |
CapabilityClipboardImageAsync |
CapabilityClipboardImageWrite |
CapabilityClipboardImageWriteAsync |
CapabilityClipboardFiles |
CapabilityClipboardHTML |
CapabilityFileDialogs |
Expand Down
1 change: 1 addition & 0 deletions app/capabilities_web.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ func nativeCapabilities() Capabilities {
CapabilityClipboardTextAsync |
CapabilityClipboardHTML |
CapabilityClipboardImageAsync |
CapabilityClipboardImageWriteAsync |
CapabilityFileDialogsAsync |
CapabilitySecretStoreAsync |
CapabilityNotifications |
Expand Down
33 changes: 32 additions & 1 deletion app/clipboard_image.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package app

import "github.com/vivaui/viva/internal/platform"
import (
"fmt"

"github.com/vivaui/viva/internal/platform"
)

var (
// ErrNoImage reports that the clipboard holds no image.
Expand Down Expand Up @@ -52,3 +56,30 @@ func ClipboardImagePNG() ([]byte, error) {
func RequestClipboardImage(done func(png []byte, err error)) {
nativeRequestClipboardImage(done)
}

// SetClipboardImage makes png the picture the clipboard holds, as copying an
// image in a browser or a photo viewer does, so that any application's Paste
// puts it there. It replaces whatever the clipboard held, text included: one
// clipboard holds one copy. This is the write side of ClipboardImagePNG, and a
// paste of what it wrote reads back as the same picture.
//
// Each platform offers the picture in the flavours its readers ask for: macOS
// public.png beside its TIFF conversion, Windows the registered "PNG" format
// beside CF_DIB, and Linux the X11 CLIPBOARD's image/png target (the GTK shell
// serves the same target through GTK). png must be a PNG within
// MaxClipboardImageBytes and must carry a picture the platform can hold; a PNG
// that fails either check is an error and leaves the clipboard as it was. The
// Web target writes through a Promise and returns ErrAsyncRequired;
// SetClipboardImageAsync writes there.
func SetClipboardImage(png []byte) error {
if len(png) == 0 {
return fmt.Errorf("app: no image to put on the clipboard")
}
if err := platform.CheckClipboardPNG(png); err != nil {
return err
}
if err, handled := driverSetClipboardImage(png); handled {
return err
}
return nativeSetClipboardImage(png)
}
Loading
Loading