detached 1a6c6c9

negotiation_test.go RawHistoryFolder

1//go:build linux
2
3package client_test
4
5import (
6	"encoding/binary"
7	"errors"
8	"testing"
9
10	"github.com/bnema/go-wayland-bindings/client/xdgshell"
11	"github.com/bnema/wlturbo"
12)
13
14func TestAnnouncedVersionNegotiation(t *testing.T) {
15	c, p := pair(t)
16	d, e := wlturbo.ConnectFromConn(c)
17	noerr(t, e)
18	defer d.Close()
19	request(t, p)
20	iface := xdgshell.XdgWmBaseInterface
21	if v, e := d.Registry().BindNegotiated(iface, 6, xdgshell.NewXdgWmBase(d.Context())); v != 0 || !errors.Is(e, wlturbo.ErrGlobalNotFound) {
22		t.Fatalf("missing: %d %v", v, e)
23	}
24	if v, e := d.Registry().BindNegotiated(iface, 0, xdgshell.NewXdgWmBase(d.Context())); v != 0 || e == nil || errors.Is(e, wlturbo.ErrGlobalNotFound) {
25		t.Fatalf("unsupported zero: %d %v", v, e)
26	}
27	for i, version := range []uint32{2, 9} {
28		name := uint32(30 + i)
29		announcement := append(msg(0, 0, name)[8:], str(iface)...)
30		announcement = append(announcement, msg(0, 0, version)[8:]...)
31		send(t, p, payload(d.Registry().ID(), 0, announcement...))
32		noerr(t, d.Dispatch())
33		proxy := xdgshell.NewXdgWmBase(d.Context())
34		if v, e := d.Registry().BindNegotiated(iface, 0, proxy); v != 0 || e == nil || errors.Is(e, wlturbo.ErrGlobalNotFound) {
35			t.Fatalf("supported zero with global: %d %v", v, e)
36		}
37		negotiated, e := d.Registry().BindNegotiated(iface, 6, proxy)
38		noerr(t, e)
39		want := version
40		if want > 6 {
41			want = 6
42		}
43		_, op, body := request(t, p)
44		if op != 0 || negotiated != want || binary.NativeEndian.Uint32(body) != name || binary.NativeEndian.Uint32(body[len(body)-8:]) != want || binary.NativeEndian.Uint32(body[len(body)-4:]) != proxy.ID() {
45			t.Fatalf("server=%d negotiated=%d wire=%x", version, negotiated, body)
46		}
47		send(t, p, msg(d.Registry().ID(), 1, name))
48		noerr(t, d.Dispatch())
49	}
50}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 1

↑↓ moveenter openesc close