v0.3.0 cf370a0

decoration_test.go RawHistoryFolder

1package wayland
2
3import (
4	"testing"
5	"time"
6
7	"github.com/bnema/go-wayland-bindings/server/serverdecoration"
8	"github.com/bnema/go-wayland-bindings/server/wayland"
9	"github.com/bnema/neferwl/internal/ports"
10	"github.com/bnema/wlturbo"
11)
12
13type kdeModeProxy struct {
14	wlturbo.BaseProxy
15	modes chan uint32
16}
17
18func (p *kdeModeProxy) Dispatch(e *wlturbo.Event) { p.modes <- e.Uint32() }
19
20// KDE decoration defaults to server-side and acknowledges the mode a client
21// asks for: answering server to Firefox's client request made it ask again
22// in a tight loop.
23func TestKDEDecorationAcknowledgesMode(t *testing.T) {
24	s, _, _, dir := dmabufServer(t, ports.DMABufSupport{})
25	c := protocolClient(t, s, dir)
26	comp := bindProtocol(t, c, "wl_compositor")
27	mgr := bindProtocol(t, c, "org_kde_kwin_server_decoration_manager")
28	registerProtocol(t, c, mgr)
29	surf := c.AllocateID()
30	requestProtocol(t, c, comp, wayland.CompositorRequestCreateSurface, surf)
31	deco := c.AllocateID()
32	proxy := &kdeModeProxy{modes: make(chan uint32, 8)}
33	proxy.SetID(deco)
34	registerWireProxy(c, proxy)
35	requestProtocol(t, c, mgr, serverdecoration.OrgKdeKwinServerDecorationManagerRequestCreate, deco, surf)
36	requestProtocol(t, c, deco, serverdecoration.OrgKdeKwinServerDecorationRequestRequestMode, uint32(serverdecoration.OrgKdeKwinServerDecorationModeClient))
37	// An undefined mode gets no answer.
38	requestProtocol(t, c, deco, serverdecoration.OrgKdeKwinServerDecorationRequestRequestMode, uint32(3))
39	if err := c.Roundtrip(); err != nil {
40		t.Fatal(err)
41	}
42	for _, want := range []serverdecoration.OrgKdeKwinServerDecorationMode{serverdecoration.OrgKdeKwinServerDecorationModeServer, serverdecoration.OrgKdeKwinServerDecorationModeClient} {
43		select {
44		case got := <-proxy.modes:
45			if got != uint32(want) {
46				t.Fatalf("mode %d want %d", got, want)
47			}
48		case <-time.After(2 * time.Second):
49			t.Fatalf("no mode %d", want)
50		}
51	}
52	select {
53	case got := <-proxy.modes:
54		t.Fatalf("extra mode %d", got)
55	default:
56	}
57}

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 25

Tags 10

↑↓ moveenter openesc close