Remove settings preview page

This commit is contained in:
jahruz67
2026-07-14 17:01:58 -07:00
parent eea198d882
commit 1e9862ffa1
13 changed files with 73 additions and 694 deletions
+8 -28
View File
@@ -1,41 +1,21 @@
// Copyright 2021 The golang.design Initiative Authors.
// All rights reserved. Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.
//
// Written by Changkun Ou <changkun.de>
//go:build linux && cgo
package hotkey_test
import (
"context"
"fmt"
"strings"
"testing"
"time"
"wis-free-v3/internal/xhotkey"
)
// TestHotkey should always run success.
// This is a test to run and for manually testing, registered combination:
// Ctrl+Alt+A (Ctrl+Mod2+Mod4+A on Linux)
func TestHotkey(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
hk := hotkey.New([]hotkey.Modifier{
hotkey.ModCtrl, hotkey.Mod2, hotkey.Mod4}, hotkey.KeyA)
if err := hk.Register(); err != nil {
t.Errorf("failed to register hotkey: %v", err)
return
func TestHotkeyLinuxUsesDesktopShortcutFallback(t *testing.T) {
hk := hotkey.New([]hotkey.Modifier{hotkey.ModCtrl, hotkey.Mod2, hotkey.Mod4}, hotkey.KeyA)
err := hk.Register()
if err == nil {
t.Fatal("expected Linux in-app hotkey registration to be disabled")
}
for {
select {
case <-ctx.Done():
return
case <-hk.Keydown():
fmt.Println("triggered")
}
if !strings.Contains(err.Error(), "desktop custom-shortcut command") {
t.Fatalf("expected desktop shortcut fallback error, got %v", err)
}
}