Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `lich quit` no longer fails with "EOF" when lich quits before answering: it waits for the port to close instead of calling the lost reply a refusal.
- On Wayland, the native window shows the desktop's own cursor, in its theme and size, where it could show another theme. On a monitor with a smaller scale than the largest one, the cursor no longer jumps as it enters the window.
- On Linux, the native window groups under lich's own icon in the dock, where it showed up as a separate app with a generic icon.

## [0.71.2] - 2026-10-19

Expand Down
13 changes: 13 additions & 0 deletions native/cmd/lich-native/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var (

func main() {
flag.Parse()
app.ID = windowClass(os.Getenv)
rt, err := backendRuntime()
if err != nil {
log.Fatal(err)
Expand All @@ -81,6 +82,18 @@ func main() {
app.Main()
}

// windowClass is the Wayland app_id and X11 WM_CLASS. Gio's default, the
// binary's name, matches no .desktop entry, so the dock shows the window as an
// unknown app beside lich's own icon. It mirrors the web window's (main.go's
// windowTarget): build/linux/lich.desktop claims "lich", and the dev window
// keeps its own so compositor rules for the daily driver never capture it.
func windowClass(getenv func(string) string) string {
if getenv("LICH_DEV") != "" {
return "lichdev"
}
return "lich"
}

type window struct {
ctx context.Context
client *lichclient.Client
Expand Down
27 changes: 27 additions & 0 deletions native/cmd/lich-native/windowclass_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

import "testing"

func TestWindowClass(t *testing.T) {
cases := []struct {
name string
dev string
want string
}{
{"installed window matches lich.desktop", "", "lich"},
{"dev window keeps its own", "1", "lichdev"},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
getenv := func(key string) string {
if key == "LICH_DEV" {
return c.dev
}
return ""
}
if got := windowClass(getenv); got != c.want {
t.Errorf("windowClass = %q, want %q", got, c.want)
}
})
}
}
Loading