v0.2.0 a558f49

xdgoutput.go RawHistoryFolder

1package testserver
2
3import (
4	"github.com/bnema/purego-libwayland/protocol/wayland"
5	"github.com/bnema/purego-libwayland/protocol/xdgoutput"
6	"github.com/bnema/purego-libwayland/server"
7)
8
9// xdg-output is offered only when an output announces a logical size.
10func (s *Server) xdgOutputWanted() bool {
11	for _, o := range s.outputs {
12		if o.spec.LogicalWidth > 0 {
13			return true
14		}
15	}
16	return false
17}
18
19func (s *Server) addXdgOutput(must func(error)) {
20	must(xdgoutput.NewZxdgOutputManagerV1Global(s.d, 3, func(c server.Client, v, id uint32) {
21		if _, err := xdgoutput.NewZxdgOutputManagerV1(c, int32(v), id, xdgManager{s}); err != nil {
22			must(err)
23		}
24	}))
25}
26
27type xdgManager struct{ s *Server }
28
29func (xdgManager) Destroy(*xdgoutput.ZxdgOutputManagerV1) {}
30func (m xdgManager) GetXdgOutput(self *xdgoutput.ZxdgOutputManagerV1, id uint32, out *wayland.Output) {
31	res, err := xdgoutput.NewZxdgOutputV1(self.Client(), int32(self.Version()), id, xdgHandler{})
32	if err != nil {
33		return
34	}
35	res.OnDestroy = func() { m.s.stats.DestroyedXdgOutputs++ }
36	if o := m.s.outputOf(out.Resource); o != nil && o.spec.LogicalWidth > 0 {
37		res.SendLogicalPosition(0, 0)
38		res.SendLogicalSize(o.spec.LogicalWidth, o.spec.LogicalHeight)
39		res.SendDone()
40	}
41}
42
43type xdgHandler struct{}
44
45func (xdgHandler) Destroy(*xdgoutput.ZxdgOutputV1) {}

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 2

Tags 9

↑↓ moveenter openesc close