detached 15bc8e7

feat(scanner): refuse requests newer than the bound object version

BaseProxy now records a protocol version. Registry.Bind stores the bound
version, generated requests and new_id events pass it to child objects, and
every generated request with since > 1 calls wl.CheckVersion first. A
request the object does not have returns ErrVersionTooLow locally instead of
reaching the compositor as a fatal protocol error. Objects with an unknown
version (0, e.g. from BindID) are not checked.
commit
15bc8e7afbdf5bbdd7b01c01a38aa17e8bf453ca
author
brice · · 2026-09-29 15:49 UTC
parent
b4a889c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
16 files · +193 -2
M client.go +3 -0
@@ -758,6 +758,9 @@ func (r *Registry) Bind(name uint32, iface string, version uint32, proxy Proxy)
758758 if old, exists := r.display.objects.Load(proxy.ID()); exists && old != proxy {
759759 return fmt.Errorf("object ID %d already registered", proxy.ID())
760760 }
761+ if v, ok := proxy.(interface{ SetVersion(uint32) }); ok {
762+ v.SetVersion(version)
763+ }
761764 // Register the proxy
762765 proxy.Context().Register(proxy)
763766
@@ -758,6 +758,9 @@ func (r *Registry) Bind(name uint32, iface string, version uint32, proxy Proxy)
758 if old, exists := r.display.objects.Load(proxy.ID()); exists && old != proxy {758 if old, exists := r.display.objects.Load(proxy.ID()); exists && old != proxy {
759 return fmt.Errorf("object ID %d already registered", proxy.ID())759 return fmt.Errorf("object ID %d already registered", proxy.ID())
760 }760 }
761+ if v, ok := proxy.(interface{ SetVersion(uint32) }); ok {
762+ v.SetVersion(version)
763+ }
761 // Register the proxy764 // Register the proxy
762 proxy.Context().Register(proxy)765 proxy.Context().Register(proxy)
763 766
M core.go +26 -0
@@ -3,6 +3,7 @@ package wlturbo
33 import (
44 "encoding/binary"
55 "errors"
6+ "fmt"
67 "sync"
78 "sync/atomic"
89
@@ -28,6 +29,7 @@ type Proxy interface {
2829 type BaseProxy struct {
2930 id uint32
3031 context *Context
32+ version uint32
3133 }
3234
3335 // eventPool recycles Events across dispatches; an Event is only valid for
@@ -217,6 +219,30 @@ func (p *BaseProxy) SetContext(ctx *Context) {
217219 p.context = ctx
218220 }
219221
222+// Version returns the protocol version the object was bound or created at,
223+// or 0 when it is unknown (for example after Registry.BindID).
224+func (p *BaseProxy) Version() uint32 {
225+ return p.version
226+}
227+
228+// SetVersion records the object's protocol version. Registry.Bind sets it for
229+// globals and generated requests copy it from parent to child.
230+func (p *BaseProxy) SetVersion(v uint32) {
231+ p.version = v
232+}
233+
234+// ErrVersionTooLow reports a request the bound object version does not have.
235+var ErrVersionTooLow = errors.New("wlturbo: request needs a newer object version")
236+
237+// CheckVersion rejects a request introduced in version since when the
238+// object's known version is lower. An unknown version (0) is not checked.
239+func CheckVersion(version, since uint32, request string) error {
240+ if version != 0 && version < since {
241+ return fmt.Errorf("%w: %s needs version %d, object has %d", ErrVersionTooLow, request, since, version)
242+ }
243+ return nil
244+}
245+
220246 // Dispatch default implementation (does nothing)
221247 func (p *BaseProxy) Dispatch(event *Event) {
222248 // Default implementation does nothing
@@ -3,6 +3,7 @@ package wlturbo
3 import (3 import (
4 "encoding/binary"4 "encoding/binary"
5 "errors"5 "errors"
6+ "fmt"
6 "sync"7 "sync"
7 "sync/atomic"8 "sync/atomic"
8 9
@@ -28,6 +29,7 @@ type Proxy interface {
28 type BaseProxy struct {29 type BaseProxy struct {
29 id uint3230 id uint32
30 context *Context31 context *Context
32+ version uint32
31 }33 }
32 34
33 // eventPool recycles Events across dispatches; an Event is only valid for35 // eventPool recycles Events across dispatches; an Event is only valid for
@@ -217,6 +219,30 @@ func (p *BaseProxy) SetContext(ctx *Context) {
217 p.context = ctx219 p.context = ctx
218 }220 }
219 221
222+// Version returns the protocol version the object was bound or created at,
223+// or 0 when it is unknown (for example after Registry.BindID).
224+func (p *BaseProxy) Version() uint32 {
225+ return p.version
226+}
227+
228+// SetVersion records the object's protocol version. Registry.Bind sets it for
229+// globals and generated requests copy it from parent to child.
230+func (p *BaseProxy) SetVersion(v uint32) {
231+ p.version = v
232+}
233+
234+// ErrVersionTooLow reports a request the bound object version does not have.
235+var ErrVersionTooLow = errors.New("wlturbo: request needs a newer object version")
236+
237+// CheckVersion rejects a request introduced in version since when the
238+// object's known version is lower. An unknown version (0) is not checked.
239+func CheckVersion(version, since uint32, request string) error {
240+ if version != 0 && version < since {
241+ return fmt.Errorf("%w: %s needs version %d, object has %d", ErrVersionTooLow, request, since, version)
242+ }
243+ return nil
244+}
245+
220 // Dispatch default implementation (does nothing)246 // Dispatch default implementation (does nothing)
221 func (p *BaseProxy) Dispatch(event *Event) {247 func (p *BaseProxy) Dispatch(event *Event) {
222 // Default implementation does nothing248 // Default implementation does nothing
M hardening_test.go +24 -0
@@ -136,3 +136,27 @@ func TestMarshalRejectsPlainInt(t *testing.T) {
136136 t.Fatal("SendRequest with int argument succeeded, want error")
137137 }
138138 }
139+
140+func TestCheckVersion(t *testing.T) {
141+ if err := CheckVersion(0, 5, "x.y"); err != nil {
142+ t.Fatalf("unknown version rejected: %v", err)
143+ }
144+ if err := CheckVersion(5, 5, "x.y"); err != nil {
145+ t.Fatalf("exact version rejected: %v", err)
146+ }
147+ if err := CheckVersion(4, 5, "x.y"); !errors.Is(err, ErrVersionTooLow) {
148+ t.Fatalf("older version = %v, want ErrVersionTooLow", err)
149+ }
150+}
151+
152+// Bind records the negotiated version so generated requests can check it.
153+func TestBindRecordsVersion(t *testing.T) {
154+ d := newDisplay(&chunkConn{})
155+ p := &BaseProxy{}
156+ if err := d.Registry().Bind(1, "wl_seat", 3, p); err != nil {
157+ t.Fatal(err)
158+ }
159+ if p.Version() != 3 {
160+ t.Fatalf("version = %d, want 3", p.Version())
161+ }
162+}
@@ -136,3 +136,27 @@ func TestMarshalRejectsPlainInt(t *testing.T) {
136 t.Fatal("SendRequest with int argument succeeded, want error")136 t.Fatal("SendRequest with int argument succeeded, want error")
137 }137 }
138 }138 }
139+
140+func TestCheckVersion(t *testing.T) {
141+ if err := CheckVersion(0, 5, "x.y"); err != nil {
142+ t.Fatalf("unknown version rejected: %v", err)
143+ }
144+ if err := CheckVersion(5, 5, "x.y"); err != nil {
145+ t.Fatalf("exact version rejected: %v", err)
146+ }
147+ if err := CheckVersion(4, 5, "x.y"); !errors.Is(err, ErrVersionTooLow) {
148+ t.Fatalf("older version = %v, want ErrVersionTooLow", err)
149+ }
150+}
151+
152+// Bind records the negotiated version so generated requests can check it.
153+func TestBindRecordsVersion(t *testing.T) {
154+ d := newDisplay(&chunkConn{})
155+ p := &BaseProxy{}
156+ if err := d.Registry().Bind(1, "wl_seat", 3, p); err != nil {
157+ t.Fatal(err)
158+ }
159+ if p.Version() != 3 {
160+ t.Fatalf("version = %d, want 3", p.Version())
161+ }
162+}
M internal/scanner/scanner.go +3 -0
@@ -187,6 +187,7 @@ type requestData struct {
187187 Doc string
188188 Opcode int
189189 Destructor bool
190+ Since int
190191 Params string
191192 Results string
192193 ArgPreparations []string
@@ -407,6 +408,7 @@ func (s *Scanner) processRequest(iface Interface, req Request, opcode int) (requ
407408 Doc: s.formatDescription(req.Description),
408409 Opcode: opcode,
409410 Destructor: req.Type == "destructor",
411+ Since: req.Since,
410412 ChildVar: "child",
411413 }
412414
@@ -549,6 +551,7 @@ func (s *Scanner) processEvent(event Event, opcode int) (eventData, error) {
549551 }
550552 data.DecodeLines = append(data.DecodeLines,
551553 fmt.Sprintf("%s.SetID(%sID)", child, name),
554+ fmt.Sprintf("%s.SetVersion(o.Version())", child),
552555 fmt.Sprintf("o.Context().Register(%s)", child),
553556 )
554557 params = append(params, child+" *"+childType)
@@ -187,6 +187,7 @@ type requestData struct {
187 Doc string187 Doc string
188 Opcode int188 Opcode int
189 Destructor bool189 Destructor bool
190+ Since int
190 Params string191 Params string
191 Results string192 Results string
192 ArgPreparations []string193 ArgPreparations []string
@@ -407,6 +408,7 @@ func (s *Scanner) processRequest(iface Interface, req Request, opcode int) (requ
407 Doc: s.formatDescription(req.Description),408 Doc: s.formatDescription(req.Description),
408 Opcode: opcode,409 Opcode: opcode,
409 Destructor: req.Type == "destructor",410 Destructor: req.Type == "destructor",
411+ Since: req.Since,
410 ChildVar: "child",412 ChildVar: "child",
411 }413 }
412 414
@@ -549,6 +551,7 @@ func (s *Scanner) processEvent(event Event, opcode int) (eventData, error) {
549 }551 }
550 data.DecodeLines = append(data.DecodeLines,552 data.DecodeLines = append(data.DecodeLines,
551 fmt.Sprintf("%s.SetID(%sID)", child, name),553 fmt.Sprintf("%s.SetID(%sID)", child, name),
554+ fmt.Sprintf("%s.SetVersion(o.Version())", child),
552 fmt.Sprintf("o.Context().Register(%s)", child),555 fmt.Sprintf("o.Context().Register(%s)", child),
553 )556 )
554 params = append(params, child+" *"+childType)557 params = append(params, child+" *"+childType)
M internal/scanner/template.go +4 -0
@@ -51,6 +51,9 @@ func New{{$iface.GoName}}(ctx *wl.Context) *{{$iface.GoName}} {
5151 {{- end}}
5252 func (o *{{$iface.GoName}}) {{.GoName}}({{.Params}}) {{.Results}} {
5353 if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} }
54+{{- if gt .Since 1}}
55+ if err := wl.CheckVersion(o.Version(), {{.Since}}, "{{$iface.Name}}.{{.Name}}"); err != nil { return {{.ErrorReturn}} }
56+{{- end}}
5457 {{- range .ArgPreparations}}
5558 {{.}}
5659 {{- end}}
@@ -62,6 +65,7 @@ if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} }
6265 {{.ChildVar}}.SetContext(o.Context())
6366 {{- end}}
6467 {{.ChildVar}}.SetID(o.Context().AllocateID())
68+ {{.ChildVar}}.SetVersion(o.Version())
6569 o.Context().Register({{.ChildVar}})
6670 {{- end}}
6771 if err := o.Context().{{.SendCall}}; err != nil {
@@ -51,6 +51,9 @@ func New{{$iface.GoName}}(ctx *wl.Context) *{{$iface.GoName}} {
51 {{- end}}51 {{- end}}
52 func (o *{{$iface.GoName}}) {{.GoName}}({{.Params}}) {{.Results}} {52 func (o *{{$iface.GoName}}) {{.GoName}}({{.Params}}) {{.Results}} {
53 if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} }53 if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} }
54+{{- if gt .Since 1}}
55+ if err := wl.CheckVersion(o.Version(), {{.Since}}, "{{$iface.Name}}.{{.Name}}"); err != nil { return {{.ErrorReturn}} }
56+{{- end}}
54 {{- range .ArgPreparations}}57 {{- range .ArgPreparations}}
55 {{.}}58 {{.}}
56 {{- end}}59 {{- end}}
@@ -62,6 +65,7 @@ if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} }
62 {{.ChildVar}}.SetContext(o.Context())65 {{.ChildVar}}.SetContext(o.Context())
63 {{- end}}66 {{- end}}
64 {{.ChildVar}}.SetID(o.Context().AllocateID())67 {{.ChildVar}}.SetID(o.Context().AllocateID())
68+ {{.ChildVar}}.SetVersion(o.Version())
65 o.Context().Register({{.ChildVar}})69 o.Context().Register({{.ChildVar}})
66 {{- end}}70 {{- end}}
67 if err := o.Context().{{.SendCall}}; err != nil {71 if err := o.Context().{{.SendCall}}; err != nil {
M protocol/core/wayland_generated.go +68 -0
@@ -779,6 +779,7 @@ func (o *Compositor) CreateSurface() (*Surface, error) {
779779 child := &Surface{}
780780 child.SetContext(o.Context())
781781 child.SetID(o.Context().AllocateID())
782+ child.SetVersion(o.Version())
782783 o.Context().Register(child)
783784 if err := o.Context().SendRequest(o, 0, child); err != nil {
784785 o.Context().Unregister(child)
@@ -795,6 +796,7 @@ func (o *Compositor) CreateRegion() (*Region, error) {
795796 child := &Region{}
796797 child.SetContext(o.Context())
797798 child.SetID(o.Context().AllocateID())
799+ child.SetVersion(o.Version())
798800 o.Context().Register(child)
799801 if err := o.Context().SendRequest(o, 1, child); err != nil {
800802 o.Context().Unregister(child)
@@ -808,6 +810,9 @@ func (o *Compositor) Release() error {
808810 if err := o.Context().CheckProxy(o); err != nil {
809811 return err
810812 }
813+ if err := wl.CheckVersion(o.Version(), 7, "wl_compositor.release"); err != nil {
814+ return err
815+ }
811816 if err := o.Context().SendDestructor(o, 2); err != nil {
812817 return err
813818 }
@@ -853,6 +858,7 @@ func (o *ShmPool) CreateBuffer(offset int32, width int32, height int32, stride i
853858 child := &Buffer{}
854859 child.SetContext(o.Context())
855860 child.SetID(o.Context().AllocateID())
861+ child.SetVersion(o.Version())
856862 o.Context().Register(child)
857863 if err := o.Context().SendRequest(o, 0, child, offset, width, height, stride, format); err != nil {
858864 o.Context().Unregister(child)
@@ -926,6 +932,7 @@ func (o *Shm) CreatePool(fd int, size int32) (*ShmPool, error) {
926932 child := &ShmPool{}
927933 child.SetContext(o.Context())
928934 child.SetID(o.Context().AllocateID())
935+ child.SetVersion(o.Version())
929936 o.Context().Register(child)
930937 if err := o.Context().SendRequestWithFDs(o, 0, []int{fd}, child, uintptr(fd), size); err != nil {
931938 o.Context().Unregister(child)
@@ -940,6 +947,9 @@ func (o *Shm) Release() error {
940947 if err := o.Context().CheckProxy(o); err != nil {
941948 return err
942949 }
950+ if err := wl.CheckVersion(o.Version(), 2, "wl_shm.release"); err != nil {
951+ return err
952+ }
943953 if err := o.Context().SendDestructor(o, 1); err != nil {
944954 return err
945955 }
@@ -1129,6 +1139,9 @@ func (o *DataOffer) Finish() error {
11291139 if err := o.Context().CheckProxy(o); err != nil {
11301140 return err
11311141 }
1142+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.finish"); err != nil {
1143+ return err
1144+ }
11321145 if err := o.Context().SendRequest(o, 3); err != nil {
11331146 return err
11341147 }
@@ -1140,6 +1153,9 @@ func (o *DataOffer) SetActions(dndActions uint32, preferredAction uint32) error
11401153 if err := o.Context().CheckProxy(o); err != nil {
11411154 return err
11421155 }
1156+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.set_actions"); err != nil {
1157+ return err
1158+ }
11431159 if err := o.Context().SendRequest(o, 4, dndActions, preferredAction); err != nil {
11441160 return err
11451161 }
@@ -1306,6 +1322,9 @@ func (o *DataSource) SetActions(dndActions uint32) error {
13061322 if err := o.Context().CheckProxy(o); err != nil {
13071323 return err
13081324 }
1325+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_source.set_actions"); err != nil {
1326+ return err
1327+ }
13091328 if err := o.Context().SendRequest(o, 2, dndActions); err != nil {
13101329 return err
13111330 }
@@ -1583,6 +1602,9 @@ func (o *DataDevice) Release() error {
15831602 if err := o.Context().CheckProxy(o); err != nil {
15841603 return err
15851604 }
1605+ if err := wl.CheckVersion(o.Version(), 2, "wl_data_device.release"); err != nil {
1606+ return err
1607+ }
15861608 if err := o.Context().SendDestructor(o, 2); err != nil {
15871609 return err
15881610 }
@@ -1749,6 +1771,7 @@ func (o *DataDevice) Dispatch(event *wl.Event) {
17491771 idObject := &DataOffer{}
17501772 idObject.SetContext(o.Context())
17511773 idObject.SetID(idID)
1774+ idObject.SetVersion(o.Version())
17521775 o.Context().Register(idObject)
17531776
17541777 for i, handler := range o.handlersForDataOffer() {
@@ -1822,6 +1845,7 @@ func (o *DataDeviceManager) CreateDataSource() (*DataSource, error) {
18221845 child := &DataSource{}
18231846 child.SetContext(o.Context())
18241847 child.SetID(o.Context().AllocateID())
1848+ child.SetVersion(o.Version())
18251849 o.Context().Register(child)
18261850 if err := o.Context().SendRequest(o, 0, child); err != nil {
18271851 o.Context().Unregister(child)
@@ -1842,6 +1866,7 @@ func (o *DataDeviceManager) GetDataDevice(seat *Seat) (*DataDevice, error) {
18421866 child := &DataDevice{}
18431867 child.SetContext(o.Context())
18441868 child.SetID(o.Context().AllocateID())
1869+ child.SetVersion(o.Version())
18451870 o.Context().Register(child)
18461871 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
18471872 o.Context().Unregister(child)
@@ -1855,6 +1880,9 @@ func (o *DataDeviceManager) Release() error {
18551880 if err := o.Context().CheckProxy(o); err != nil {
18561881 return err
18571882 }
1883+ if err := wl.CheckVersion(o.Version(), 4, "wl_data_device_manager.release"); err != nil {
1884+ return err
1885+ }
18581886 if err := o.Context().SendDestructor(o, 2); err != nil {
18591887 return err
18601888 }
@@ -1904,6 +1932,7 @@ func (o *Shell) GetShellSurface(surface *Surface) (*ShellSurface, error) {
19041932 child := &ShellSurface{}
19051933 child.SetContext(o.Context())
19061934 child.SetID(o.Context().AllocateID())
1935+ child.SetVersion(o.Version())
19071936 o.Context().Register(child)
19081937 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {
19091938 o.Context().Unregister(child)
@@ -2264,6 +2293,7 @@ func (o *Surface) Frame() (*Callback, error) {
22642293 child := &Callback{}
22652294 child.SetContext(o.Context())
22662295 child.SetID(o.Context().AllocateID())
2296+ child.SetVersion(o.Version())
22672297 o.Context().Register(child)
22682298 if err := o.Context().SendRequest(o, 3, child); err != nil {
22692299 o.Context().Unregister(child)
@@ -2318,6 +2348,9 @@ func (o *Surface) SetBufferTransform(transform int32) error {
23182348 if err := o.Context().CheckProxy(o); err != nil {
23192349 return err
23202350 }
2351+ if err := wl.CheckVersion(o.Version(), 2, "wl_surface.set_buffer_transform"); err != nil {
2352+ return err
2353+ }
23212354 if err := o.Context().SendRequest(o, 7, transform); err != nil {
23222355 return err
23232356 }
@@ -2329,6 +2362,9 @@ func (o *Surface) SetBufferScale(scale int32) error {
23292362 if err := o.Context().CheckProxy(o); err != nil {
23302363 return err
23312364 }
2365+ if err := wl.CheckVersion(o.Version(), 3, "wl_surface.set_buffer_scale"); err != nil {
2366+ return err
2367+ }
23322368 if err := o.Context().SendRequest(o, 8, scale); err != nil {
23332369 return err
23342370 }
@@ -2340,6 +2376,9 @@ func (o *Surface) DamageBuffer(x int32, y int32, width int32, height int32) erro
23402376 if err := o.Context().CheckProxy(o); err != nil {
23412377 return err
23422378 }
2379+ if err := wl.CheckVersion(o.Version(), 4, "wl_surface.damage_buffer"); err != nil {
2380+ return err
2381+ }
23432382 if err := o.Context().SendRequest(o, 9, x, y, width, height); err != nil {
23442383 return err
23452384 }
@@ -2351,6 +2390,9 @@ func (o *Surface) Offset(x int32, y int32) error {
23512390 if err := o.Context().CheckProxy(o); err != nil {
23522391 return err
23532392 }
2393+ if err := wl.CheckVersion(o.Version(), 5, "wl_surface.offset"); err != nil {
2394+ return err
2395+ }
23542396 if err := o.Context().SendRequest(o, 10, x, y); err != nil {
23552397 return err
23562398 }
@@ -2362,9 +2404,13 @@ func (o *Surface) GetRelease() (*Callback, error) {
23622404 if err := o.Context().CheckProxy(o); err != nil {
23632405 return nil, err
23642406 }
2407+ if err := wl.CheckVersion(o.Version(), 7, "wl_surface.get_release"); err != nil {
2408+ return nil, err
2409+ }
23652410 child := &Callback{}
23662411 child.SetContext(o.Context())
23672412 child.SetID(o.Context().AllocateID())
2413+ child.SetVersion(o.Version())
23682414 o.Context().Register(child)
23692415 if err := o.Context().SendRequest(o, 11, child); err != nil {
23702416 o.Context().Unregister(child)
@@ -2541,6 +2587,7 @@ func (o *Seat) GetPointer() (*Pointer, error) {
25412587 child := &Pointer{}
25422588 child.SetContext(o.Context())
25432589 child.SetID(o.Context().AllocateID())
2590+ child.SetVersion(o.Version())
25442591 o.Context().Register(child)
25452592 if err := o.Context().SendRequest(o, 0, child); err != nil {
25462593 o.Context().Unregister(child)
@@ -2557,6 +2604,7 @@ func (o *Seat) GetKeyboard() (*Keyboard, error) {
25572604 child := &Keyboard{}
25582605 child.SetContext(o.Context())
25592606 child.SetID(o.Context().AllocateID())
2607+ child.SetVersion(o.Version())
25602608 o.Context().Register(child)
25612609 if err := o.Context().SendRequest(o, 1, child); err != nil {
25622610 o.Context().Unregister(child)
@@ -2573,6 +2621,7 @@ func (o *Seat) GetTouch() (*Touch, error) {
25732621 child := &Touch{}
25742622 child.SetContext(o.Context())
25752623 child.SetID(o.Context().AllocateID())
2624+ child.SetVersion(o.Version())
25762625 o.Context().Register(child)
25772626 if err := o.Context().SendRequest(o, 2, child); err != nil {
25782627 o.Context().Unregister(child)
@@ -2586,6 +2635,9 @@ func (o *Seat) Release() error {
25862635 if err := o.Context().CheckProxy(o); err != nil {
25872636 return err
25882637 }
2638+ if err := wl.CheckVersion(o.Version(), 5, "wl_seat.release"); err != nil {
2639+ return err
2640+ }
25892641 if err := o.Context().SendDestructor(o, 3); err != nil {
25902642 return err
25912643 }
@@ -2720,6 +2772,9 @@ func (o *Pointer) Release() error {
27202772 if err := o.Context().CheckProxy(o); err != nil {
27212773 return err
27222774 }
2775+ if err := wl.CheckVersion(o.Version(), 3, "wl_pointer.release"); err != nil {
2776+ return err
2777+ }
27232778 if err := o.Context().SendDestructor(o, 1); err != nil {
27242779 return err
27252780 }
@@ -3158,6 +3213,9 @@ func (o *Keyboard) Release() error {
31583213 if err := o.Context().CheckProxy(o); err != nil {
31593214 return err
31603215 }
3216+ if err := wl.CheckVersion(o.Version(), 3, "wl_keyboard.release"); err != nil {
3217+ return err
3218+ }
31613219 if err := o.Context().SendDestructor(o, 0); err != nil {
31623220 return err
31633221 }
@@ -3413,6 +3471,9 @@ func (o *Touch) Release() error {
34133471 if err := o.Context().CheckProxy(o); err != nil {
34143472 return err
34153473 }
3474+ if err := wl.CheckVersion(o.Version(), 3, "wl_touch.release"); err != nil {
3475+ return err
3476+ }
34163477 if err := o.Context().SendDestructor(o, 0); err != nil {
34173478 return err
34183479 }
@@ -3692,6 +3753,9 @@ func (o *Output) Release() error {
36923753 if err := o.Context().CheckProxy(o); err != nil {
36933754 return err
36943755 }
3756+ if err := wl.CheckVersion(o.Version(), 3, "wl_output.release"); err != nil {
3757+ return err
3758+ }
36953759 if err := o.Context().SendDestructor(o, 0); err != nil {
36963760 return err
36973761 }
@@ -4015,6 +4079,7 @@ func (o *Subcompositor) GetSubsurface(surface *Surface, parent *Surface) (*Subsu
40154079 child := &Subsurface{}
40164080 child.SetContext(o.Context())
40174081 child.SetID(o.Context().AllocateID())
4082+ child.SetVersion(o.Version())
40184083 o.Context().Register(child)
40194084 if err := o.Context().SendRequest(o, 1, child, arg1, arg2); err != nil {
40204085 o.Context().Unregister(child)
@@ -4190,6 +4255,9 @@ func (o *Fixes) AckGlobalRemove(registry *wl.Registry, name uint32) error {
41904255 if err := o.Context().CheckProxy(o); err != nil {
41914256 return err
41924257 }
4258+ if err := wl.CheckVersion(o.Version(), 2, "wl_fixes.ack_global_remove"); err != nil {
4259+ return err
4260+ }
41934261 var arg0 wl.Object
41944262 if registry != nil {
41954263 arg0 = registry
@@ -779,6 +779,7 @@ func (o *Compositor) CreateSurface() (*Surface, error) {
779 child := &Surface{}779 child := &Surface{}
780 child.SetContext(o.Context())780 child.SetContext(o.Context())
781 child.SetID(o.Context().AllocateID())781 child.SetID(o.Context().AllocateID())
782+ child.SetVersion(o.Version())
782 o.Context().Register(child)783 o.Context().Register(child)
783 if err := o.Context().SendRequest(o, 0, child); err != nil {784 if err := o.Context().SendRequest(o, 0, child); err != nil {
784 o.Context().Unregister(child)785 o.Context().Unregister(child)
@@ -795,6 +796,7 @@ func (o *Compositor) CreateRegion() (*Region, error) {
795 child := &Region{}796 child := &Region{}
796 child.SetContext(o.Context())797 child.SetContext(o.Context())
797 child.SetID(o.Context().AllocateID())798 child.SetID(o.Context().AllocateID())
799+ child.SetVersion(o.Version())
798 o.Context().Register(child)800 o.Context().Register(child)
799 if err := o.Context().SendRequest(o, 1, child); err != nil {801 if err := o.Context().SendRequest(o, 1, child); err != nil {
800 o.Context().Unregister(child)802 o.Context().Unregister(child)
@@ -808,6 +810,9 @@ func (o *Compositor) Release() error {
808 if err := o.Context().CheckProxy(o); err != nil {810 if err := o.Context().CheckProxy(o); err != nil {
809 return err811 return err
810 }812 }
813+ if err := wl.CheckVersion(o.Version(), 7, "wl_compositor.release"); err != nil {
814+ return err
815+ }
811 if err := o.Context().SendDestructor(o, 2); err != nil {816 if err := o.Context().SendDestructor(o, 2); err != nil {
812 return err817 return err
813 }818 }
@@ -853,6 +858,7 @@ func (o *ShmPool) CreateBuffer(offset int32, width int32, height int32, stride i
853 child := &Buffer{}858 child := &Buffer{}
854 child.SetContext(o.Context())859 child.SetContext(o.Context())
855 child.SetID(o.Context().AllocateID())860 child.SetID(o.Context().AllocateID())
861+ child.SetVersion(o.Version())
856 o.Context().Register(child)862 o.Context().Register(child)
857 if err := o.Context().SendRequest(o, 0, child, offset, width, height, stride, format); err != nil {863 if err := o.Context().SendRequest(o, 0, child, offset, width, height, stride, format); err != nil {
858 o.Context().Unregister(child)864 o.Context().Unregister(child)
@@ -926,6 +932,7 @@ func (o *Shm) CreatePool(fd int, size int32) (*ShmPool, error) {
926 child := &ShmPool{}932 child := &ShmPool{}
927 child.SetContext(o.Context())933 child.SetContext(o.Context())
928 child.SetID(o.Context().AllocateID())934 child.SetID(o.Context().AllocateID())
935+ child.SetVersion(o.Version())
929 o.Context().Register(child)936 o.Context().Register(child)
930 if err := o.Context().SendRequestWithFDs(o, 0, []int{fd}, child, uintptr(fd), size); err != nil {937 if err := o.Context().SendRequestWithFDs(o, 0, []int{fd}, child, uintptr(fd), size); err != nil {
931 o.Context().Unregister(child)938 o.Context().Unregister(child)
@@ -940,6 +947,9 @@ func (o *Shm) Release() error {
940 if err := o.Context().CheckProxy(o); err != nil {947 if err := o.Context().CheckProxy(o); err != nil {
941 return err948 return err
942 }949 }
950+ if err := wl.CheckVersion(o.Version(), 2, "wl_shm.release"); err != nil {
951+ return err
952+ }
943 if err := o.Context().SendDestructor(o, 1); err != nil {953 if err := o.Context().SendDestructor(o, 1); err != nil {
944 return err954 return err
945 }955 }
@@ -1129,6 +1139,9 @@ func (o *DataOffer) Finish() error {
1129 if err := o.Context().CheckProxy(o); err != nil {1139 if err := o.Context().CheckProxy(o); err != nil {
1130 return err1140 return err
1131 }1141 }
1142+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.finish"); err != nil {
1143+ return err
1144+ }
1132 if err := o.Context().SendRequest(o, 3); err != nil {1145 if err := o.Context().SendRequest(o, 3); err != nil {
1133 return err1146 return err
1134 }1147 }
@@ -1140,6 +1153,9 @@ func (o *DataOffer) SetActions(dndActions uint32, preferredAction uint32) error
1140 if err := o.Context().CheckProxy(o); err != nil {1153 if err := o.Context().CheckProxy(o); err != nil {
1141 return err1154 return err
1142 }1155 }
1156+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.set_actions"); err != nil {
1157+ return err
1158+ }
1143 if err := o.Context().SendRequest(o, 4, dndActions, preferredAction); err != nil {1159 if err := o.Context().SendRequest(o, 4, dndActions, preferredAction); err != nil {
1144 return err1160 return err
1145 }1161 }
@@ -1306,6 +1322,9 @@ func (o *DataSource) SetActions(dndActions uint32) error {
1306 if err := o.Context().CheckProxy(o); err != nil {1322 if err := o.Context().CheckProxy(o); err != nil {
1307 return err1323 return err
1308 }1324 }
1325+ if err := wl.CheckVersion(o.Version(), 3, "wl_data_source.set_actions"); err != nil {
1326+ return err
1327+ }
1309 if err := o.Context().SendRequest(o, 2, dndActions); err != nil {1328 if err := o.Context().SendRequest(o, 2, dndActions); err != nil {
1310 return err1329 return err
1311 }1330 }
@@ -1583,6 +1602,9 @@ func (o *DataDevice) Release() error {
1583 if err := o.Context().CheckProxy(o); err != nil {1602 if err := o.Context().CheckProxy(o); err != nil {
1584 return err1603 return err
1585 }1604 }
1605+ if err := wl.CheckVersion(o.Version(), 2, "wl_data_device.release"); err != nil {
1606+ return err
1607+ }
1586 if err := o.Context().SendDestructor(o, 2); err != nil {1608 if err := o.Context().SendDestructor(o, 2); err != nil {
1587 return err1609 return err
1588 }1610 }
@@ -1749,6 +1771,7 @@ func (o *DataDevice) Dispatch(event *wl.Event) {
1749 idObject := &DataOffer{}1771 idObject := &DataOffer{}
1750 idObject.SetContext(o.Context())1772 idObject.SetContext(o.Context())
1751 idObject.SetID(idID)1773 idObject.SetID(idID)
1774+ idObject.SetVersion(o.Version())
1752 o.Context().Register(idObject)1775 o.Context().Register(idObject)
1753 1776
1754 for i, handler := range o.handlersForDataOffer() {1777 for i, handler := range o.handlersForDataOffer() {
@@ -1822,6 +1845,7 @@ func (o *DataDeviceManager) CreateDataSource() (*DataSource, error) {
1822 child := &DataSource{}1845 child := &DataSource{}
1823 child.SetContext(o.Context())1846 child.SetContext(o.Context())
1824 child.SetID(o.Context().AllocateID())1847 child.SetID(o.Context().AllocateID())
1848+ child.SetVersion(o.Version())
1825 o.Context().Register(child)1849 o.Context().Register(child)
1826 if err := o.Context().SendRequest(o, 0, child); err != nil {1850 if err := o.Context().SendRequest(o, 0, child); err != nil {
1827 o.Context().Unregister(child)1851 o.Context().Unregister(child)
@@ -1842,6 +1866,7 @@ func (o *DataDeviceManager) GetDataDevice(seat *Seat) (*DataDevice, error) {
1842 child := &DataDevice{}1866 child := &DataDevice{}
1843 child.SetContext(o.Context())1867 child.SetContext(o.Context())
1844 child.SetID(o.Context().AllocateID())1868 child.SetID(o.Context().AllocateID())
1869+ child.SetVersion(o.Version())
1845 o.Context().Register(child)1870 o.Context().Register(child)
1846 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {1871 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
1847 o.Context().Unregister(child)1872 o.Context().Unregister(child)
@@ -1855,6 +1880,9 @@ func (o *DataDeviceManager) Release() error {
1855 if err := o.Context().CheckProxy(o); err != nil {1880 if err := o.Context().CheckProxy(o); err != nil {
1856 return err1881 return err
1857 }1882 }
1883+ if err := wl.CheckVersion(o.Version(), 4, "wl_data_device_manager.release"); err != nil {
1884+ return err
1885+ }
1858 if err := o.Context().SendDestructor(o, 2); err != nil {1886 if err := o.Context().SendDestructor(o, 2); err != nil {
1859 return err1887 return err
1860 }1888 }
@@ -1904,6 +1932,7 @@ func (o *Shell) GetShellSurface(surface *Surface) (*ShellSurface, error) {
1904 child := &ShellSurface{}1932 child := &ShellSurface{}
1905 child.SetContext(o.Context())1933 child.SetContext(o.Context())
1906 child.SetID(o.Context().AllocateID())1934 child.SetID(o.Context().AllocateID())
1935+ child.SetVersion(o.Version())
1907 o.Context().Register(child)1936 o.Context().Register(child)
1908 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {1937 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {
1909 o.Context().Unregister(child)1938 o.Context().Unregister(child)
@@ -2264,6 +2293,7 @@ func (o *Surface) Frame() (*Callback, error) {
2264 child := &Callback{}2293 child := &Callback{}
2265 child.SetContext(o.Context())2294 child.SetContext(o.Context())
2266 child.SetID(o.Context().AllocateID())2295 child.SetID(o.Context().AllocateID())
2296+ child.SetVersion(o.Version())
2267 o.Context().Register(child)2297 o.Context().Register(child)
2268 if err := o.Context().SendRequest(o, 3, child); err != nil {2298 if err := o.Context().SendRequest(o, 3, child); err != nil {
2269 o.Context().Unregister(child)2299 o.Context().Unregister(child)
@@ -2318,6 +2348,9 @@ func (o *Surface) SetBufferTransform(transform int32) error {
2318 if err := o.Context().CheckProxy(o); err != nil {2348 if err := o.Context().CheckProxy(o); err != nil {
2319 return err2349 return err
2320 }2350 }
2351+ if err := wl.CheckVersion(o.Version(), 2, "wl_surface.set_buffer_transform"); err != nil {
2352+ return err
2353+ }
2321 if err := o.Context().SendRequest(o, 7, transform); err != nil {2354 if err := o.Context().SendRequest(o, 7, transform); err != nil {
2322 return err2355 return err
2323 }2356 }
@@ -2329,6 +2362,9 @@ func (o *Surface) SetBufferScale(scale int32) error {
2329 if err := o.Context().CheckProxy(o); err != nil {2362 if err := o.Context().CheckProxy(o); err != nil {
2330 return err2363 return err
2331 }2364 }
2365+ if err := wl.CheckVersion(o.Version(), 3, "wl_surface.set_buffer_scale"); err != nil {
2366+ return err
2367+ }
2332 if err := o.Context().SendRequest(o, 8, scale); err != nil {2368 if err := o.Context().SendRequest(o, 8, scale); err != nil {
2333 return err2369 return err
2334 }2370 }
@@ -2340,6 +2376,9 @@ func (o *Surface) DamageBuffer(x int32, y int32, width int32, height int32) erro
2340 if err := o.Context().CheckProxy(o); err != nil {2376 if err := o.Context().CheckProxy(o); err != nil {
2341 return err2377 return err
2342 }2378 }
2379+ if err := wl.CheckVersion(o.Version(), 4, "wl_surface.damage_buffer"); err != nil {
2380+ return err
2381+ }
2343 if err := o.Context().SendRequest(o, 9, x, y, width, height); err != nil {2382 if err := o.Context().SendRequest(o, 9, x, y, width, height); err != nil {
2344 return err2383 return err
2345 }2384 }
@@ -2351,6 +2390,9 @@ func (o *Surface) Offset(x int32, y int32) error {
2351 if err := o.Context().CheckProxy(o); err != nil {2390 if err := o.Context().CheckProxy(o); err != nil {
2352 return err2391 return err
2353 }2392 }
2393+ if err := wl.CheckVersion(o.Version(), 5, "wl_surface.offset"); err != nil {
2394+ return err
2395+ }
2354 if err := o.Context().SendRequest(o, 10, x, y); err != nil {2396 if err := o.Context().SendRequest(o, 10, x, y); err != nil {
2355 return err2397 return err
2356 }2398 }
@@ -2362,9 +2404,13 @@ func (o *Surface) GetRelease() (*Callback, error) {
2362 if err := o.Context().CheckProxy(o); err != nil {2404 if err := o.Context().CheckProxy(o); err != nil {
2363 return nil, err2405 return nil, err
2364 }2406 }
2407+ if err := wl.CheckVersion(o.Version(), 7, "wl_surface.get_release"); err != nil {
2408+ return nil, err
2409+ }
2365 child := &Callback{}2410 child := &Callback{}
2366 child.SetContext(o.Context())2411 child.SetContext(o.Context())
2367 child.SetID(o.Context().AllocateID())2412 child.SetID(o.Context().AllocateID())
2413+ child.SetVersion(o.Version())
2368 o.Context().Register(child)2414 o.Context().Register(child)
2369 if err := o.Context().SendRequest(o, 11, child); err != nil {2415 if err := o.Context().SendRequest(o, 11, child); err != nil {
2370 o.Context().Unregister(child)2416 o.Context().Unregister(child)
@@ -2541,6 +2587,7 @@ func (o *Seat) GetPointer() (*Pointer, error) {
2541 child := &Pointer{}2587 child := &Pointer{}
2542 child.SetContext(o.Context())2588 child.SetContext(o.Context())
2543 child.SetID(o.Context().AllocateID())2589 child.SetID(o.Context().AllocateID())
2590+ child.SetVersion(o.Version())
2544 o.Context().Register(child)2591 o.Context().Register(child)
2545 if err := o.Context().SendRequest(o, 0, child); err != nil {2592 if err := o.Context().SendRequest(o, 0, child); err != nil {
2546 o.Context().Unregister(child)2593 o.Context().Unregister(child)
@@ -2557,6 +2604,7 @@ func (o *Seat) GetKeyboard() (*Keyboard, error) {
2557 child := &Keyboard{}2604 child := &Keyboard{}
2558 child.SetContext(o.Context())2605 child.SetContext(o.Context())
2559 child.SetID(o.Context().AllocateID())2606 child.SetID(o.Context().AllocateID())
2607+ child.SetVersion(o.Version())
2560 o.Context().Register(child)2608 o.Context().Register(child)
2561 if err := o.Context().SendRequest(o, 1, child); err != nil {2609 if err := o.Context().SendRequest(o, 1, child); err != nil {
2562 o.Context().Unregister(child)2610 o.Context().Unregister(child)
@@ -2573,6 +2621,7 @@ func (o *Seat) GetTouch() (*Touch, error) {
2573 child := &Touch{}2621 child := &Touch{}
2574 child.SetContext(o.Context())2622 child.SetContext(o.Context())
2575 child.SetID(o.Context().AllocateID())2623 child.SetID(o.Context().AllocateID())
2624+ child.SetVersion(o.Version())
2576 o.Context().Register(child)2625 o.Context().Register(child)
2577 if err := o.Context().SendRequest(o, 2, child); err != nil {2626 if err := o.Context().SendRequest(o, 2, child); err != nil {
2578 o.Context().Unregister(child)2627 o.Context().Unregister(child)
@@ -2586,6 +2635,9 @@ func (o *Seat) Release() error {
2586 if err := o.Context().CheckProxy(o); err != nil {2635 if err := o.Context().CheckProxy(o); err != nil {
2587 return err2636 return err
2588 }2637 }
2638+ if err := wl.CheckVersion(o.Version(), 5, "wl_seat.release"); err != nil {
2639+ return err
2640+ }
2589 if err := o.Context().SendDestructor(o, 3); err != nil {2641 if err := o.Context().SendDestructor(o, 3); err != nil {
2590 return err2642 return err
2591 }2643 }
@@ -2720,6 +2772,9 @@ func (o *Pointer) Release() error {
2720 if err := o.Context().CheckProxy(o); err != nil {2772 if err := o.Context().CheckProxy(o); err != nil {
2721 return err2773 return err
2722 }2774 }
2775+ if err := wl.CheckVersion(o.Version(), 3, "wl_pointer.release"); err != nil {
2776+ return err
2777+ }
2723 if err := o.Context().SendDestructor(o, 1); err != nil {2778 if err := o.Context().SendDestructor(o, 1); err != nil {
2724 return err2779 return err
2725 }2780 }
@@ -3158,6 +3213,9 @@ func (o *Keyboard) Release() error {
3158 if err := o.Context().CheckProxy(o); err != nil {3213 if err := o.Context().CheckProxy(o); err != nil {
3159 return err3214 return err
3160 }3215 }
3216+ if err := wl.CheckVersion(o.Version(), 3, "wl_keyboard.release"); err != nil {
3217+ return err
3218+ }
3161 if err := o.Context().SendDestructor(o, 0); err != nil {3219 if err := o.Context().SendDestructor(o, 0); err != nil {
3162 return err3220 return err
3163 }3221 }
@@ -3413,6 +3471,9 @@ func (o *Touch) Release() error {
3413 if err := o.Context().CheckProxy(o); err != nil {3471 if err := o.Context().CheckProxy(o); err != nil {
3414 return err3472 return err
3415 }3473 }
3474+ if err := wl.CheckVersion(o.Version(), 3, "wl_touch.release"); err != nil {
3475+ return err
3476+ }
3416 if err := o.Context().SendDestructor(o, 0); err != nil {3477 if err := o.Context().SendDestructor(o, 0); err != nil {
3417 return err3478 return err
3418 }3479 }
@@ -3692,6 +3753,9 @@ func (o *Output) Release() error {
3692 if err := o.Context().CheckProxy(o); err != nil {3753 if err := o.Context().CheckProxy(o); err != nil {
3693 return err3754 return err
3694 }3755 }
3756+ if err := wl.CheckVersion(o.Version(), 3, "wl_output.release"); err != nil {
3757+ return err
3758+ }
3695 if err := o.Context().SendDestructor(o, 0); err != nil {3759 if err := o.Context().SendDestructor(o, 0); err != nil {
3696 return err3760 return err
3697 }3761 }
@@ -4015,6 +4079,7 @@ func (o *Subcompositor) GetSubsurface(surface *Surface, parent *Surface) (*Subsu
4015 child := &Subsurface{}4079 child := &Subsurface{}
4016 child.SetContext(o.Context())4080 child.SetContext(o.Context())
4017 child.SetID(o.Context().AllocateID())4081 child.SetID(o.Context().AllocateID())
4082+ child.SetVersion(o.Version())
4018 o.Context().Register(child)4083 o.Context().Register(child)
4019 if err := o.Context().SendRequest(o, 1, child, arg1, arg2); err != nil {4084 if err := o.Context().SendRequest(o, 1, child, arg1, arg2); err != nil {
4020 o.Context().Unregister(child)4085 o.Context().Unregister(child)
@@ -4190,6 +4255,9 @@ func (o *Fixes) AckGlobalRemove(registry *wl.Registry, name uint32) error {
4190 if err := o.Context().CheckProxy(o); err != nil {4255 if err := o.Context().CheckProxy(o); err != nil {
4191 return err4256 return err
4192 }4257 }
4258+ if err := wl.CheckVersion(o.Version(), 2, "wl_fixes.ack_global_remove"); err != nil {
4259+ return err
4260+ }
4193 var arg0 wl.Object4261 var arg0 wl.Object
4194 if registry != nil {4262 if registry != nil {
4195 arg0 = registry4263 arg0 = registry
M protocol/cursorshape/cursor-shape-v1_generated.go +2 -0
@@ -160,6 +160,7 @@ func (o *WpCursorShapeManager) GetPointer(pointer *cross_wl_pointer.Pointer) (*W
160160 child := &WpCursorShapeDevice{}
161161 child.SetContext(o.Context())
162162 child.SetID(o.Context().AllocateID())
163+ child.SetVersion(o.Version())
163164 o.Context().Register(child)
164165 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
165166 o.Context().Unregister(child)
@@ -180,6 +181,7 @@ func (o *WpCursorShapeManager) GetTabletTool(tabletTool *cross_zwp_tablet_tool_v
180181 child := &WpCursorShapeDevice{}
181182 child.SetContext(o.Context())
182183 child.SetID(o.Context().AllocateID())
184+ child.SetVersion(o.Version())
183185 o.Context().Register(child)
184186 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {
185187 o.Context().Unregister(child)
@@ -160,6 +160,7 @@ func (o *WpCursorShapeManager) GetPointer(pointer *cross_wl_pointer.Pointer) (*W
160 child := &WpCursorShapeDevice{}160 child := &WpCursorShapeDevice{}
161 child.SetContext(o.Context())161 child.SetContext(o.Context())
162 child.SetID(o.Context().AllocateID())162 child.SetID(o.Context().AllocateID())
163+ child.SetVersion(o.Version())
163 o.Context().Register(child)164 o.Context().Register(child)
164 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {165 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
165 o.Context().Unregister(child)166 o.Context().Unregister(child)
@@ -180,6 +181,7 @@ func (o *WpCursorShapeManager) GetTabletTool(tabletTool *cross_zwp_tablet_tool_v
180 child := &WpCursorShapeDevice{}181 child := &WpCursorShapeDevice{}
181 child.SetContext(o.Context())182 child.SetContext(o.Context())
182 child.SetID(o.Context().AllocateID())183 child.SetID(o.Context().AllocateID())
184+ child.SetVersion(o.Version())
183 o.Context().Register(child)185 o.Context().Register(child)
184 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {186 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {
185 o.Context().Unregister(child)187 o.Context().Unregister(child)
M protocol/drmsyncobj/linux-drm-syncobj-v1_generated.go +2 -0
@@ -72,6 +72,7 @@ func (o *WpLinuxDrmSyncobjManager) GetSurface(surface *cross_wl_surface.Surface)
7272 child := &WpLinuxDrmSyncobjSurface{}
7373 child.SetContext(o.Context())
7474 child.SetID(o.Context().AllocateID())
75+ child.SetVersion(o.Version())
7576 o.Context().Register(child)
7677 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
7778 o.Context().Unregister(child)
@@ -88,6 +89,7 @@ func (o *WpLinuxDrmSyncobjManager) ImportTimeline(fd int) (*WpLinuxDrmSyncobjTim
8889 child := &WpLinuxDrmSyncobjTimeline{}
8990 child.SetContext(o.Context())
9091 child.SetID(o.Context().AllocateID())
92+ child.SetVersion(o.Version())
9193 o.Context().Register(child)
9294 if err := o.Context().SendRequestWithFDs(o, 2, []int{fd}, child, uintptr(fd)); err != nil {
9395 o.Context().Unregister(child)
@@ -72,6 +72,7 @@ func (o *WpLinuxDrmSyncobjManager) GetSurface(surface *cross_wl_surface.Surface)
72 child := &WpLinuxDrmSyncobjSurface{}72 child := &WpLinuxDrmSyncobjSurface{}
73 child.SetContext(o.Context())73 child.SetContext(o.Context())
74 child.SetID(o.Context().AllocateID())74 child.SetID(o.Context().AllocateID())
75+ child.SetVersion(o.Version())
75 o.Context().Register(child)76 o.Context().Register(child)
76 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {77 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
77 o.Context().Unregister(child)78 o.Context().Unregister(child)
@@ -88,6 +89,7 @@ func (o *WpLinuxDrmSyncobjManager) ImportTimeline(fd int) (*WpLinuxDrmSyncobjTim
88 child := &WpLinuxDrmSyncobjTimeline{}89 child := &WpLinuxDrmSyncobjTimeline{}
89 child.SetContext(o.Context())90 child.SetContext(o.Context())
90 child.SetID(o.Context().AllocateID())91 child.SetID(o.Context().AllocateID())
92+ child.SetVersion(o.Version())
91 o.Context().Register(child)93 o.Context().Register(child)
92 if err := o.Context().SendRequestWithFDs(o, 2, []int{fd}, child, uintptr(fd)); err != nil {94 if err := o.Context().SendRequestWithFDs(o, 2, []int{fd}, child, uintptr(fd)); err != nil {
93 o.Context().Unregister(child)95 o.Context().Unregister(child)
M protocol/extensions_test.go +6 -2
@@ -4,6 +4,7 @@ package protocol_test
44
55 import (
66 "encoding/binary"
7+ "errors"
78 "net"
89 "os"
910 "strings"
@@ -412,8 +413,11 @@ func TestExtensionsOverSocketpair(t *testing.T) {
412413 request(t, p)
413414 noerr(t, device.Release())
414415 request(t, p)
415- noerr(t, mgr.Release())
416- request(t, p)
416+ // release is a version 4 request; the manager was negotiated at 3, so it
417+ // must be refused locally instead of reaching the compositor.
418+ if err := mgr.Release(); !errors.Is(err, wlturbo.ErrVersionTooLow) {
419+ t.Fatalf("release at v3 = %v, want ErrVersionTooLow", err)
420+ }
417421 // Cursor shape: get a device for a wl_pointer and set a shape at an
418422 // enter serial; check the exact wire arguments.
419423 pointer := core.NewPointer(d.Context())
@@ -4,6 +4,7 @@ package protocol_test
4 4
5 import (5 import (
6 "encoding/binary"6 "encoding/binary"
7+ "errors"
7 "net"8 "net"
8 "os"9 "os"
9 "strings"10 "strings"
@@ -412,8 +413,11 @@ func TestExtensionsOverSocketpair(t *testing.T) {
412 request(t, p)413 request(t, p)
413 noerr(t, device.Release())414 noerr(t, device.Release())
414 request(t, p)415 request(t, p)
415- noerr(t, mgr.Release())416+ // release is a version 4 request; the manager was negotiated at 3, so it
416- request(t, p)417+ // must be refused locally instead of reaching the compositor.
418+ if err := mgr.Release(); !errors.Is(err, wlturbo.ErrVersionTooLow) {
419+ t.Fatalf("release at v3 = %v, want ErrVersionTooLow", err)
420+ }
417 // Cursor shape: get a device for a wl_pointer and set a shape at an421 // Cursor shape: get a device for a wl_pointer and set a shape at an
418 // enter serial; check the exact wire arguments.422 // enter serial; check the exact wire arguments.
419 pointer := core.NewPointer(d.Context())423 pointer := core.NewPointer(d.Context())
M protocol/fractionalscale/fractional-scale-v1_generated.go +1 -0
@@ -53,6 +53,7 @@ func (o *WpFractionalScaleManager) GetFractionalScale(surface *cross_wl_surface.
5353 child := &WpFractionalScale{}
5454 child.SetContext(o.Context())
5555 child.SetID(o.Context().AllocateID())
56+ child.SetVersion(o.Version())
5657 o.Context().Register(child)
5758 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
5859 o.Context().Unregister(child)
@@ -53,6 +53,7 @@ func (o *WpFractionalScaleManager) GetFractionalScale(surface *cross_wl_surface.
53 child := &WpFractionalScale{}53 child := &WpFractionalScale{}
54 child.SetContext(o.Context())54 child.SetContext(o.Context())
55 child.SetID(o.Context().AllocateID())55 child.SetID(o.Context().AllocateID())
56+ child.SetVersion(o.Version())
56 o.Context().Register(child)57 o.Context().Register(child)
57 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {58 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
58 o.Context().Unregister(child)59 o.Context().Unregister(child)
M protocol/linuxdmabuf/linux-dmabuf-v1_generated.go +17 -0
@@ -94,6 +94,7 @@ func (o *LinuxDmabuf) CreateParams() (*LinuxBufferParams, error) {
9494 child := &LinuxBufferParams{}
9595 child.SetContext(o.Context())
9696 child.SetID(o.Context().AllocateID())
97+ child.SetVersion(o.Version())
9798 o.Context().Register(child)
9899 if err := o.Context().SendRequest(o, 1, child); err != nil {
99100 o.Context().Unregister(child)
@@ -107,9 +108,13 @@ func (o *LinuxDmabuf) GetDefaultFeedback() (*LinuxDmabufFeedback, error) {
107108 if err := o.Context().CheckProxy(o); err != nil {
108109 return nil, err
109110 }
111+ if err := wl.CheckVersion(o.Version(), 4, "zwp_linux_dmabuf_v1.get_default_feedback"); err != nil {
112+ return nil, err
113+ }
110114 child := &LinuxDmabufFeedback{}
111115 child.SetContext(o.Context())
112116 child.SetID(o.Context().AllocateID())
117+ child.SetVersion(o.Version())
113118 o.Context().Register(child)
114119 if err := o.Context().SendRequest(o, 2, child); err != nil {
115120 o.Context().Unregister(child)
@@ -123,6 +128,9 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li
123128 if err := o.Context().CheckProxy(o); err != nil {
124129 return nil, err
125130 }
131+ if err := wl.CheckVersion(o.Version(), 4, "zwp_linux_dmabuf_v1.get_surface_feedback"); err != nil {
132+ return nil, err
133+ }
126134 var arg1 wl.Object
127135 if surface != nil {
128136 arg1 = surface
@@ -130,6 +138,7 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li
130138 child := &LinuxDmabufFeedback{}
131139 child.SetContext(o.Context())
132140 child.SetID(o.Context().AllocateID())
141+ child.SetVersion(o.Version())
133142 o.Context().Register(child)
134143 if err := o.Context().SendRequest(o, 3, child, arg1); err != nil {
135144 o.Context().Unregister(child)
@@ -277,8 +286,12 @@ func (o *LinuxBufferParams) CreateImmed(width int32, height int32, format uint32
277286 if err := o.Context().CheckProxy(o); err != nil {
278287 return nil, err
279288 }
289+ if err := wl.CheckVersion(o.Version(), 2, "zwp_linux_buffer_params_v1.create_immed"); err != nil {
290+ return nil, err
291+ }
280292 child := cross_wl_buffer.NewBuffer(o.Context())
281293 child.SetID(o.Context().AllocateID())
294+ child.SetVersion(o.Version())
282295 o.Context().Register(child)
283296 if err := o.Context().SendRequest(o, 3, child, width, height, format, flags); err != nil {
284297 o.Context().Unregister(child)
@@ -292,6 +305,9 @@ func (o *LinuxBufferParams) SetSamplingDevice(device []byte) error {
292305 if err := o.Context().CheckProxy(o); err != nil {
293306 return err
294307 }
308+ if err := wl.CheckVersion(o.Version(), 6, "zwp_linux_buffer_params_v1.set_sampling_device"); err != nil {
309+ return err
310+ }
295311 if err := o.Context().SendRequest(o, 4, device); err != nil {
296312 return err
297313 }
@@ -361,6 +377,7 @@ func (o *LinuxBufferParams) Dispatch(event *wl.Event) {
361377 bufferID := event.Uint32()
362378 bufferObject := cross_wl_buffer.NewBuffer(o.Context())
363379 bufferObject.SetID(bufferID)
380+ bufferObject.SetVersion(o.Version())
364381 o.Context().Register(bufferObject)
365382
366383 for i, handler := range o.handlersForCreated() {
@@ -94,6 +94,7 @@ func (o *LinuxDmabuf) CreateParams() (*LinuxBufferParams, error) {
94 child := &LinuxBufferParams{}94 child := &LinuxBufferParams{}
95 child.SetContext(o.Context())95 child.SetContext(o.Context())
96 child.SetID(o.Context().AllocateID())96 child.SetID(o.Context().AllocateID())
97+ child.SetVersion(o.Version())
97 o.Context().Register(child)98 o.Context().Register(child)
98 if err := o.Context().SendRequest(o, 1, child); err != nil {99 if err := o.Context().SendRequest(o, 1, child); err != nil {
99 o.Context().Unregister(child)100 o.Context().Unregister(child)
@@ -107,9 +108,13 @@ func (o *LinuxDmabuf) GetDefaultFeedback() (*LinuxDmabufFeedback, error) {
107 if err := o.Context().CheckProxy(o); err != nil {108 if err := o.Context().CheckProxy(o); err != nil {
108 return nil, err109 return nil, err
109 }110 }
111+ if err := wl.CheckVersion(o.Version(), 4, "zwp_linux_dmabuf_v1.get_default_feedback"); err != nil {
112+ return nil, err
113+ }
110 child := &LinuxDmabufFeedback{}114 child := &LinuxDmabufFeedback{}
111 child.SetContext(o.Context())115 child.SetContext(o.Context())
112 child.SetID(o.Context().AllocateID())116 child.SetID(o.Context().AllocateID())
117+ child.SetVersion(o.Version())
113 o.Context().Register(child)118 o.Context().Register(child)
114 if err := o.Context().SendRequest(o, 2, child); err != nil {119 if err := o.Context().SendRequest(o, 2, child); err != nil {
115 o.Context().Unregister(child)120 o.Context().Unregister(child)
@@ -123,6 +128,9 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li
123 if err := o.Context().CheckProxy(o); err != nil {128 if err := o.Context().CheckProxy(o); err != nil {
124 return nil, err129 return nil, err
125 }130 }
131+ if err := wl.CheckVersion(o.Version(), 4, "zwp_linux_dmabuf_v1.get_surface_feedback"); err != nil {
132+ return nil, err
133+ }
126 var arg1 wl.Object134 var arg1 wl.Object
127 if surface != nil {135 if surface != nil {
128 arg1 = surface136 arg1 = surface
@@ -130,6 +138,7 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li
130 child := &LinuxDmabufFeedback{}138 child := &LinuxDmabufFeedback{}
131 child.SetContext(o.Context())139 child.SetContext(o.Context())
132 child.SetID(o.Context().AllocateID())140 child.SetID(o.Context().AllocateID())
141+ child.SetVersion(o.Version())
133 o.Context().Register(child)142 o.Context().Register(child)
134 if err := o.Context().SendRequest(o, 3, child, arg1); err != nil {143 if err := o.Context().SendRequest(o, 3, child, arg1); err != nil {
135 o.Context().Unregister(child)144 o.Context().Unregister(child)
@@ -277,8 +286,12 @@ func (o *LinuxBufferParams) CreateImmed(width int32, height int32, format uint32
277 if err := o.Context().CheckProxy(o); err != nil {286 if err := o.Context().CheckProxy(o); err != nil {
278 return nil, err287 return nil, err
279 }288 }
289+ if err := wl.CheckVersion(o.Version(), 2, "zwp_linux_buffer_params_v1.create_immed"); err != nil {
290+ return nil, err
291+ }
280 child := cross_wl_buffer.NewBuffer(o.Context())292 child := cross_wl_buffer.NewBuffer(o.Context())
281 child.SetID(o.Context().AllocateID())293 child.SetID(o.Context().AllocateID())
294+ child.SetVersion(o.Version())
282 o.Context().Register(child)295 o.Context().Register(child)
283 if err := o.Context().SendRequest(o, 3, child, width, height, format, flags); err != nil {296 if err := o.Context().SendRequest(o, 3, child, width, height, format, flags); err != nil {
284 o.Context().Unregister(child)297 o.Context().Unregister(child)
@@ -292,6 +305,9 @@ func (o *LinuxBufferParams) SetSamplingDevice(device []byte) error {
292 if err := o.Context().CheckProxy(o); err != nil {305 if err := o.Context().CheckProxy(o); err != nil {
293 return err306 return err
294 }307 }
308+ if err := wl.CheckVersion(o.Version(), 6, "zwp_linux_buffer_params_v1.set_sampling_device"); err != nil {
309+ return err
310+ }
295 if err := o.Context().SendRequest(o, 4, device); err != nil {311 if err := o.Context().SendRequest(o, 4, device); err != nil {
296 return err312 return err
297 }313 }
@@ -361,6 +377,7 @@ func (o *LinuxBufferParams) Dispatch(event *wl.Event) {
361 bufferID := event.Uint32()377 bufferID := event.Uint32()
362 bufferObject := cross_wl_buffer.NewBuffer(o.Context())378 bufferObject := cross_wl_buffer.NewBuffer(o.Context())
363 bufferObject.SetID(bufferID)379 bufferObject.SetID(bufferID)
380+ bufferObject.SetVersion(o.Version())
364 o.Context().Register(bufferObject)381 o.Context().Register(bufferObject)
365 382
366 for i, handler := range o.handlersForCreated() {383 for i, handler := range o.handlersForCreated() {
M protocol/tablet/tablet-v2_generated.go +8 -0
@@ -118,6 +118,7 @@ func (o *TabletManager) GetTabletSeat(seat *cross_wl_seat.Seat) (*TabletSeat, er
118118 child := &TabletSeat{}
119119 child.SetContext(o.Context())
120120 child.SetID(o.Context().AllocateID())
121+ child.SetVersion(o.Version())
121122 o.Context().Register(child)
122123 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {
123124 o.Context().Unregister(child)
@@ -273,6 +274,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
273274 idObject := &Tablet{}
274275 idObject.SetContext(o.Context())
275276 idObject.SetID(idID)
277+ idObject.SetVersion(o.Version())
276278 o.Context().Register(idObject)
277279
278280 for i, handler := range o.handlersForTabletAdded() {
@@ -284,6 +286,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
284286 idObject := &TabletTool{}
285287 idObject.SetContext(o.Context())
286288 idObject.SetID(idID)
289+ idObject.SetVersion(o.Version())
287290 o.Context().Register(idObject)
288291
289292 for i, handler := range o.handlersForToolAdded() {
@@ -295,6 +298,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
295298 idObject := &TabletPad{}
296299 idObject.SetContext(o.Context())
297300 idObject.SetID(idID)
301+ idObject.SetVersion(o.Version())
298302 o.Context().Register(idObject)
299303
300304 for i, handler := range o.handlersForPadAdded() {
@@ -1808,6 +1812,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
18081812 ringObject := &TabletPadRing{}
18091813 ringObject.SetContext(o.Context())
18101814 ringObject.SetID(ringID)
1815+ ringObject.SetVersion(o.Version())
18111816 o.Context().Register(ringObject)
18121817
18131818 for i, handler := range o.handlersForRing() {
@@ -1819,6 +1824,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
18191824 stripObject := &TabletPadStrip{}
18201825 stripObject.SetContext(o.Context())
18211826 stripObject.SetID(stripID)
1827+ stripObject.SetVersion(o.Version())
18221828 o.Context().Register(stripObject)
18231829
18241830 for i, handler := range o.handlersForStrip() {
@@ -1852,6 +1858,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
18521858 dialObject := &TabletPadDial{}
18531859 dialObject.SetContext(o.Context())
18541860 dialObject.SetID(dialID)
1861+ dialObject.SetVersion(o.Version())
18551862 o.Context().Register(dialObject)
18561863
18571864 for i, handler := range o.handlersForDial() {
@@ -2119,6 +2126,7 @@ func (o *TabletPad) Dispatch(event *wl.Event) {
21192126 padGroupObject := &TabletPadGroup{}
21202127 padGroupObject.SetContext(o.Context())
21212128 padGroupObject.SetID(padGroupID)
2129+ padGroupObject.SetVersion(o.Version())
21222130 o.Context().Register(padGroupObject)
21232131
21242132 for i, handler := range o.handlersForGroup() {
@@ -118,6 +118,7 @@ func (o *TabletManager) GetTabletSeat(seat *cross_wl_seat.Seat) (*TabletSeat, er
118 child := &TabletSeat{}118 child := &TabletSeat{}
119 child.SetContext(o.Context())119 child.SetContext(o.Context())
120 child.SetID(o.Context().AllocateID())120 child.SetID(o.Context().AllocateID())
121+ child.SetVersion(o.Version())
121 o.Context().Register(child)122 o.Context().Register(child)
122 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {123 if err := o.Context().SendRequest(o, 0, child, arg1); err != nil {
123 o.Context().Unregister(child)124 o.Context().Unregister(child)
@@ -273,6 +274,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
273 idObject := &Tablet{}274 idObject := &Tablet{}
274 idObject.SetContext(o.Context())275 idObject.SetContext(o.Context())
275 idObject.SetID(idID)276 idObject.SetID(idID)
277+ idObject.SetVersion(o.Version())
276 o.Context().Register(idObject)278 o.Context().Register(idObject)
277 279
278 for i, handler := range o.handlersForTabletAdded() {280 for i, handler := range o.handlersForTabletAdded() {
@@ -284,6 +286,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
284 idObject := &TabletTool{}286 idObject := &TabletTool{}
285 idObject.SetContext(o.Context())287 idObject.SetContext(o.Context())
286 idObject.SetID(idID)288 idObject.SetID(idID)
289+ idObject.SetVersion(o.Version())
287 o.Context().Register(idObject)290 o.Context().Register(idObject)
288 291
289 for i, handler := range o.handlersForToolAdded() {292 for i, handler := range o.handlersForToolAdded() {
@@ -295,6 +298,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) {
295 idObject := &TabletPad{}298 idObject := &TabletPad{}
296 idObject.SetContext(o.Context())299 idObject.SetContext(o.Context())
297 idObject.SetID(idID)300 idObject.SetID(idID)
301+ idObject.SetVersion(o.Version())
298 o.Context().Register(idObject)302 o.Context().Register(idObject)
299 303
300 for i, handler := range o.handlersForPadAdded() {304 for i, handler := range o.handlersForPadAdded() {
@@ -1808,6 +1812,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
1808 ringObject := &TabletPadRing{}1812 ringObject := &TabletPadRing{}
1809 ringObject.SetContext(o.Context())1813 ringObject.SetContext(o.Context())
1810 ringObject.SetID(ringID)1814 ringObject.SetID(ringID)
1815+ ringObject.SetVersion(o.Version())
1811 o.Context().Register(ringObject)1816 o.Context().Register(ringObject)
1812 1817
1813 for i, handler := range o.handlersForRing() {1818 for i, handler := range o.handlersForRing() {
@@ -1819,6 +1824,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
1819 stripObject := &TabletPadStrip{}1824 stripObject := &TabletPadStrip{}
1820 stripObject.SetContext(o.Context())1825 stripObject.SetContext(o.Context())
1821 stripObject.SetID(stripID)1826 stripObject.SetID(stripID)
1827+ stripObject.SetVersion(o.Version())
1822 o.Context().Register(stripObject)1828 o.Context().Register(stripObject)
1823 1829
1824 for i, handler := range o.handlersForStrip() {1830 for i, handler := range o.handlersForStrip() {
@@ -1852,6 +1858,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) {
1852 dialObject := &TabletPadDial{}1858 dialObject := &TabletPadDial{}
1853 dialObject.SetContext(o.Context())1859 dialObject.SetContext(o.Context())
1854 dialObject.SetID(dialID)1860 dialObject.SetID(dialID)
1861+ dialObject.SetVersion(o.Version())
1855 o.Context().Register(dialObject)1862 o.Context().Register(dialObject)
1856 1863
1857 for i, handler := range o.handlersForDial() {1864 for i, handler := range o.handlersForDial() {
@@ -2119,6 +2126,7 @@ func (o *TabletPad) Dispatch(event *wl.Event) {
2119 padGroupObject := &TabletPadGroup{}2126 padGroupObject := &TabletPadGroup{}
2120 padGroupObject.SetContext(o.Context())2127 padGroupObject.SetContext(o.Context())
2121 padGroupObject.SetID(padGroupID)2128 padGroupObject.SetID(padGroupID)
2129+ padGroupObject.SetVersion(o.Version())
2122 o.Context().Register(padGroupObject)2130 o.Context().Register(padGroupObject)
2123 2131
2124 for i, handler := range o.handlersForGroup() {2132 for i, handler := range o.handlersForGroup() {
M protocol/textinput/text-input-unstable-v3_generated.go +10 -0
@@ -252,6 +252,9 @@ func (o *TextInputV3) SetAvailableActions(availableActions []byte) error {
252252 if err := o.Context().CheckProxy(o); err != nil {
253253 return err
254254 }
255+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.set_available_actions"); err != nil {
256+ return err
257+ }
255258 if err := o.Context().SendRequest(o, 8, availableActions); err != nil {
256259 return err
257260 }
@@ -263,6 +266,9 @@ func (o *TextInputV3) ShowInputPanel() error {
263266 if err := o.Context().CheckProxy(o); err != nil {
264267 return err
265268 }
269+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.show_input_panel"); err != nil {
270+ return err
271+ }
266272 if err := o.Context().SendRequest(o, 9); err != nil {
267273 return err
268274 }
@@ -274,6 +280,9 @@ func (o *TextInputV3) HideInputPanel() error {
274280 if err := o.Context().CheckProxy(o); err != nil {
275281 return err
276282 }
283+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.hide_input_panel"); err != nil {
284+ return err
285+ }
277286 if err := o.Context().SendRequest(o, 10); err != nil {
278287 return err
279288 }
@@ -619,6 +628,7 @@ func (o *TextInputManagerV3) GetTextInput(seat *cross_wl_seat.Seat) (*TextInputV
619628 child := &TextInputV3{}
620629 child.SetContext(o.Context())
621630 child.SetID(o.Context().AllocateID())
631+ child.SetVersion(o.Version())
622632 o.Context().Register(child)
623633 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
624634 o.Context().Unregister(child)
@@ -252,6 +252,9 @@ func (o *TextInputV3) SetAvailableActions(availableActions []byte) error {
252 if err := o.Context().CheckProxy(o); err != nil {252 if err := o.Context().CheckProxy(o); err != nil {
253 return err253 return err
254 }254 }
255+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.set_available_actions"); err != nil {
256+ return err
257+ }
255 if err := o.Context().SendRequest(o, 8, availableActions); err != nil {258 if err := o.Context().SendRequest(o, 8, availableActions); err != nil {
256 return err259 return err
257 }260 }
@@ -263,6 +266,9 @@ func (o *TextInputV3) ShowInputPanel() error {
263 if err := o.Context().CheckProxy(o); err != nil {266 if err := o.Context().CheckProxy(o); err != nil {
264 return err267 return err
265 }268 }
269+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.show_input_panel"); err != nil {
270+ return err
271+ }
266 if err := o.Context().SendRequest(o, 9); err != nil {272 if err := o.Context().SendRequest(o, 9); err != nil {
267 return err273 return err
268 }274 }
@@ -274,6 +280,9 @@ func (o *TextInputV3) HideInputPanel() error {
274 if err := o.Context().CheckProxy(o); err != nil {280 if err := o.Context().CheckProxy(o); err != nil {
275 return err281 return err
276 }282 }
283+ if err := wl.CheckVersion(o.Version(), 2, "zwp_text_input_v3.hide_input_panel"); err != nil {
284+ return err
285+ }
277 if err := o.Context().SendRequest(o, 10); err != nil {286 if err := o.Context().SendRequest(o, 10); err != nil {
278 return err287 return err
279 }288 }
@@ -619,6 +628,7 @@ func (o *TextInputManagerV3) GetTextInput(seat *cross_wl_seat.Seat) (*TextInputV
619 child := &TextInputV3{}628 child := &TextInputV3{}
620 child.SetContext(o.Context())629 child.SetContext(o.Context())
621 child.SetID(o.Context().AllocateID())630 child.SetID(o.Context().AllocateID())
631+ child.SetVersion(o.Version())
622 o.Context().Register(child)632 o.Context().Register(child)
623 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {633 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
624 o.Context().Unregister(child)634 o.Context().Unregister(child)
M protocol/viewporter/viewporter_generated.go +1 -0
@@ -63,6 +63,7 @@ func (o *WpViewporter) GetViewport(surface *cross_wl_surface.Surface) (*WpViewpo
6363 child := &WpViewport{}
6464 child.SetContext(o.Context())
6565 child.SetID(o.Context().AllocateID())
66+ child.SetVersion(o.Version())
6667 o.Context().Register(child)
6768 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
6869 o.Context().Unregister(child)
@@ -63,6 +63,7 @@ func (o *WpViewporter) GetViewport(surface *cross_wl_surface.Surface) (*WpViewpo
63 child := &WpViewport{}63 child := &WpViewport{}
64 child.SetContext(o.Context())64 child.SetContext(o.Context())
65 child.SetID(o.Context().AllocateID())65 child.SetID(o.Context().AllocateID())
66+ child.SetVersion(o.Version())
66 o.Context().Register(child)67 o.Context().Register(child)
67 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {68 if err := o.Context().SendRequest(o, 1, child, arg1); err != nil {
68 o.Context().Unregister(child)69 o.Context().Unregister(child)
M protocol/xdgshell/xdg-shell_generated.go +16 -0
@@ -259,6 +259,7 @@ func (o *XdgWmBase) CreatePositioner() (*XdgPositioner, error) {
259259 child := &XdgPositioner{}
260260 child.SetContext(o.Context())
261261 child.SetID(o.Context().AllocateID())
262+ child.SetVersion(o.Version())
262263 o.Context().Register(child)
263264 if err := o.Context().SendRequest(o, 1, child); err != nil {
264265 o.Context().Unregister(child)
@@ -279,6 +280,7 @@ func (o *XdgWmBase) GetXdgSurface(surface *cross_wl_surface.Surface) (*XdgSurfac
279280 child := &XdgSurface{}
280281 child.SetContext(o.Context())
281282 child.SetID(o.Context().AllocateID())
283+ child.SetVersion(o.Version())
282284 o.Context().Register(child)
283285 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {
284286 o.Context().Unregister(child)
@@ -442,6 +444,9 @@ func (o *XdgPositioner) SetReactive() error {
442444 if err := o.Context().CheckProxy(o); err != nil {
443445 return err
444446 }
447+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_reactive"); err != nil {
448+ return err
449+ }
445450 if err := o.Context().SendRequest(o, 7); err != nil {
446451 return err
447452 }
@@ -453,6 +458,9 @@ func (o *XdgPositioner) SetParentSize(parentWidth int32, parentHeight int32) err
453458 if err := o.Context().CheckProxy(o); err != nil {
454459 return err
455460 }
461+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_size"); err != nil {
462+ return err
463+ }
456464 if err := o.Context().SendRequest(o, 8, parentWidth, parentHeight); err != nil {
457465 return err
458466 }
@@ -464,6 +472,9 @@ func (o *XdgPositioner) SetParentConfigure(serial uint32) error {
464472 if err := o.Context().CheckProxy(o); err != nil {
465473 return err
466474 }
475+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_configure"); err != nil {
476+ return err
477+ }
467478 if err := o.Context().SendRequest(o, 9, serial); err != nil {
468479 return err
469480 }
@@ -524,6 +535,7 @@ func (o *XdgSurface) GetToplevel() (*XdgToplevel, error) {
524535 child := &XdgToplevel{}
525536 child.SetContext(o.Context())
526537 child.SetID(o.Context().AllocateID())
538+ child.SetVersion(o.Version())
527539 o.Context().Register(child)
528540 if err := o.Context().SendRequest(o, 1, child); err != nil {
529541 o.Context().Unregister(child)
@@ -548,6 +560,7 @@ func (o *XdgSurface) GetPopup(parent *XdgSurface, positioner *XdgPositioner) (*X
548560 child := &XdgPopup{}
549561 child.SetContext(o.Context())
550562 child.SetID(o.Context().AllocateID())
563+ child.SetVersion(o.Version())
551564 o.Context().Register(child)
552565 if err := o.Context().SendRequest(o, 2, child, arg1, arg2); err != nil {
553566 o.Context().Unregister(child)
@@ -1015,6 +1028,9 @@ func (o *XdgPopup) Reposition(positioner *XdgPositioner, token uint32) error {
10151028 if err := o.Context().CheckProxy(o); err != nil {
10161029 return err
10171030 }
1031+ if err := wl.CheckVersion(o.Version(), 3, "xdg_popup.reposition"); err != nil {
1032+ return err
1033+ }
10181034 var arg0 wl.Object
10191035 if positioner != nil {
10201036 arg0 = positioner
@@ -259,6 +259,7 @@ func (o *XdgWmBase) CreatePositioner() (*XdgPositioner, error) {
259 child := &XdgPositioner{}259 child := &XdgPositioner{}
260 child.SetContext(o.Context())260 child.SetContext(o.Context())
261 child.SetID(o.Context().AllocateID())261 child.SetID(o.Context().AllocateID())
262+ child.SetVersion(o.Version())
262 o.Context().Register(child)263 o.Context().Register(child)
263 if err := o.Context().SendRequest(o, 1, child); err != nil {264 if err := o.Context().SendRequest(o, 1, child); err != nil {
264 o.Context().Unregister(child)265 o.Context().Unregister(child)
@@ -279,6 +280,7 @@ func (o *XdgWmBase) GetXdgSurface(surface *cross_wl_surface.Surface) (*XdgSurfac
279 child := &XdgSurface{}280 child := &XdgSurface{}
280 child.SetContext(o.Context())281 child.SetContext(o.Context())
281 child.SetID(o.Context().AllocateID())282 child.SetID(o.Context().AllocateID())
283+ child.SetVersion(o.Version())
282 o.Context().Register(child)284 o.Context().Register(child)
283 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {285 if err := o.Context().SendRequest(o, 2, child, arg1); err != nil {
284 o.Context().Unregister(child)286 o.Context().Unregister(child)
@@ -442,6 +444,9 @@ func (o *XdgPositioner) SetReactive() error {
442 if err := o.Context().CheckProxy(o); err != nil {444 if err := o.Context().CheckProxy(o); err != nil {
443 return err445 return err
444 }446 }
447+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_reactive"); err != nil {
448+ return err
449+ }
445 if err := o.Context().SendRequest(o, 7); err != nil {450 if err := o.Context().SendRequest(o, 7); err != nil {
446 return err451 return err
447 }452 }
@@ -453,6 +458,9 @@ func (o *XdgPositioner) SetParentSize(parentWidth int32, parentHeight int32) err
453 if err := o.Context().CheckProxy(o); err != nil {458 if err := o.Context().CheckProxy(o); err != nil {
454 return err459 return err
455 }460 }
461+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_size"); err != nil {
462+ return err
463+ }
456 if err := o.Context().SendRequest(o, 8, parentWidth, parentHeight); err != nil {464 if err := o.Context().SendRequest(o, 8, parentWidth, parentHeight); err != nil {
457 return err465 return err
458 }466 }
@@ -464,6 +472,9 @@ func (o *XdgPositioner) SetParentConfigure(serial uint32) error {
464 if err := o.Context().CheckProxy(o); err != nil {472 if err := o.Context().CheckProxy(o); err != nil {
465 return err473 return err
466 }474 }
475+ if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_configure"); err != nil {
476+ return err
477+ }
467 if err := o.Context().SendRequest(o, 9, serial); err != nil {478 if err := o.Context().SendRequest(o, 9, serial); err != nil {
468 return err479 return err
469 }480 }
@@ -524,6 +535,7 @@ func (o *XdgSurface) GetToplevel() (*XdgToplevel, error) {
524 child := &XdgToplevel{}535 child := &XdgToplevel{}
525 child.SetContext(o.Context())536 child.SetContext(o.Context())
526 child.SetID(o.Context().AllocateID())537 child.SetID(o.Context().AllocateID())
538+ child.SetVersion(o.Version())
527 o.Context().Register(child)539 o.Context().Register(child)
528 if err := o.Context().SendRequest(o, 1, child); err != nil {540 if err := o.Context().SendRequest(o, 1, child); err != nil {
529 o.Context().Unregister(child)541 o.Context().Unregister(child)
@@ -548,6 +560,7 @@ func (o *XdgSurface) GetPopup(parent *XdgSurface, positioner *XdgPositioner) (*X
548 child := &XdgPopup{}560 child := &XdgPopup{}
549 child.SetContext(o.Context())561 child.SetContext(o.Context())
550 child.SetID(o.Context().AllocateID())562 child.SetID(o.Context().AllocateID())
563+ child.SetVersion(o.Version())
551 o.Context().Register(child)564 o.Context().Register(child)
552 if err := o.Context().SendRequest(o, 2, child, arg1, arg2); err != nil {565 if err := o.Context().SendRequest(o, 2, child, arg1, arg2); err != nil {
553 o.Context().Unregister(child)566 o.Context().Unregister(child)
@@ -1015,6 +1028,9 @@ func (o *XdgPopup) Reposition(positioner *XdgPositioner, token uint32) error {
1015 if err := o.Context().CheckProxy(o); err != nil {1028 if err := o.Context().CheckProxy(o); err != nil {
1016 return err1029 return err
1017 }1030 }
1031+ if err := wl.CheckVersion(o.Version(), 3, "xdg_popup.reposition"); err != nil {
1032+ return err
1033+ }
1018 var arg0 wl.Object1034 var arg0 wl.Object
1019 if positioner != nil {1035 if positioner != nil {
1020 arg0 = positioner1036 arg0 = positioner
M wl/wl.go +2 -0
@@ -35,6 +35,7 @@ var (
3535 NewFixed = wlturbo.NewFixed
3636 NewContext = wlturbo.NewContext
3737 CloseSentFD = wlturbo.CloseSentFD
38+ CheckVersion = wlturbo.CheckVersion
3839 CreateAnonymousFile = wlturbo.CreateAnonymousFile
3940 MapMemory = wlturbo.MapMemory
4041 UnmapMemory = wlturbo.UnmapMemory
@@ -47,4 +48,5 @@ var (
4748 ErrUnknownObject = wlturbo.ErrUnknownObject
4849 ErrUnknownOpcode = wlturbo.ErrUnknownOpcode
4950 ErrDisplayError = wlturbo.ErrDisplayError
51+ ErrVersionTooLow = wlturbo.ErrVersionTooLow
5052 )
@@ -35,6 +35,7 @@ var (
35 NewFixed = wlturbo.NewFixed35 NewFixed = wlturbo.NewFixed
36 NewContext = wlturbo.NewContext36 NewContext = wlturbo.NewContext
37 CloseSentFD = wlturbo.CloseSentFD37 CloseSentFD = wlturbo.CloseSentFD
38+ CheckVersion = wlturbo.CheckVersion
38 CreateAnonymousFile = wlturbo.CreateAnonymousFile39 CreateAnonymousFile = wlturbo.CreateAnonymousFile
39 MapMemory = wlturbo.MapMemory40 MapMemory = wlturbo.MapMemory
40 UnmapMemory = wlturbo.UnmapMemory41 UnmapMemory = wlturbo.UnmapMemory
@@ -47,4 +48,5 @@ var (
47 ErrUnknownObject = wlturbo.ErrUnknownObject48 ErrUnknownObject = wlturbo.ErrUnknownObject
48 ErrUnknownOpcode = wlturbo.ErrUnknownOpcode49 ErrUnknownOpcode = wlturbo.ErrUnknownOpcode
49 ErrDisplayError = wlturbo.ErrDisplayError50 ErrDisplayError = wlturbo.ErrDisplayError
51+ ErrVersionTooLow = wlturbo.ErrVersionTooLow
50 )52 )

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 8

↑↓ moveenter openesc close