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 Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· 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) | |||
| 758 | 758 | if old, exists := r.display.objects.Load(proxy.ID()); exists && old != proxy { | |
| 759 | 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 | 764 | // Register the proxy | |
| 762 | 765 | proxy.Context().Register(proxy) | |
| 763 | 766 | ||
| @@ -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 proxy | 764 | // 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 | |||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/binary" | |
| 5 | 5 | "errors" | |
| 6 | + | "fmt" | |
| 6 | 7 | "sync" | |
| 7 | 8 | "sync/atomic" | |
| 8 | 9 | ||
| @@ -28,6 +29,7 @@ type Proxy interface { | |||
| 28 | 29 | type BaseProxy struct { | |
| 29 | 30 | id uint32 | |
| 30 | 31 | context *Context | |
| 32 | + | version uint32 | |
| 31 | 33 | } | |
| 32 | 34 | ||
| 33 | 35 | // eventPool recycles Events across dispatches; an Event is only valid for | |
| @@ -217,6 +219,30 @@ func (p *BaseProxy) SetContext(ctx *Context) { | |||
| 217 | 219 | 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 | 246 | // Dispatch default implementation (does nothing) | |
| 221 | 247 | func (p *BaseProxy) Dispatch(event *Event) { | |
| 222 | 248 | // 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 uint32 | 30 | id uint32 | ||
| 30 | context *Context | 31 | context *Context | ||
| 32 | + | version uint32 | |||
| 31 | } | 33 | } | ||
| 32 | 34 | ||||
| 33 | // eventPool recycles Events across dispatches; an Event is only valid for | 35 | // eventPool recycles Events across dispatches; an Event is only valid for | ||
| @@ -217,6 +219,30 @@ func (p *BaseProxy) SetContext(ctx *Context) { | |||||
| 217 | p.context = ctx | 219 | 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 nothing | 248 | // Default implementation does nothing | ||
M hardening_test.go +24 -0
| @@ -136,3 +136,27 @@ func TestMarshalRejectsPlainInt(t *testing.T) { | |||
| 136 | 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 | + | } | |
| @@ -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 { | |||
| 187 | 187 | Doc string | |
| 188 | 188 | Opcode int | |
| 189 | 189 | Destructor bool | |
| 190 | + | Since int | |
| 190 | 191 | Params string | |
| 191 | 192 | Results string | |
| 192 | 193 | ArgPreparations []string | |
| @@ -407,6 +408,7 @@ func (s *Scanner) processRequest(iface Interface, req Request, opcode int) (requ | |||
| 407 | 408 | Doc: s.formatDescription(req.Description), | |
| 408 | 409 | Opcode: opcode, | |
| 409 | 410 | Destructor: req.Type == "destructor", | |
| 411 | + | Since: req.Since, | |
| 410 | 412 | ChildVar: "child", | |
| 411 | 413 | } | |
| 412 | 414 | ||
| @@ -549,6 +551,7 @@ func (s *Scanner) processEvent(event Event, opcode int) (eventData, error) { | |||
| 549 | 551 | } | |
| 550 | 552 | data.DecodeLines = append(data.DecodeLines, | |
| 551 | 553 | fmt.Sprintf("%s.SetID(%sID)", child, name), | |
| 554 | + | fmt.Sprintf("%s.SetVersion(o.Version())", child), | |
| 552 | 555 | fmt.Sprintf("o.Context().Register(%s)", child), | |
| 553 | 556 | ) | |
| 554 | 557 | params = append(params, child+" *"+childType) | |
| @@ -187,6 +187,7 @@ type requestData struct { | |||||
| 187 | Doc string | 187 | Doc string | ||
| 188 | Opcode int | 188 | Opcode int | ||
| 189 | Destructor bool | 189 | Destructor bool | ||
| 190 | + | Since int | |||
| 190 | Params string | 191 | Params string | ||
| 191 | Results string | 192 | Results string | ||
| 192 | ArgPreparations []string | 193 | 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}} { | |||
| 51 | 51 | {{- end}} | |
| 52 | 52 | func (o *{{$iface.GoName}}) {{.GoName}}({{.Params}}) {{.Results}} { | |
| 53 | 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 | 57 | {{- range .ArgPreparations}} | |
| 55 | 58 | {{.}} | |
| 56 | 59 | {{- end}} | |
| @@ -62,6 +65,7 @@ if err := o.Context().CheckProxy(o); err != nil { return {{.ErrorReturn}} } | |||
| 62 | 65 | {{.ChildVar}}.SetContext(o.Context()) | |
| 63 | 66 | {{- end}} | |
| 64 | 67 | {{.ChildVar}}.SetID(o.Context().AllocateID()) | |
| 68 | + | {{.ChildVar}}.SetVersion(o.Version()) | |
| 65 | 69 | o.Context().Register({{.ChildVar}}) | |
| 66 | 70 | {{- end}} | |
| 67 | 71 | 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) { | |||
| 779 | 779 | child := &Surface{} | |
| 780 | 780 | child.SetContext(o.Context()) | |
| 781 | 781 | child.SetID(o.Context().AllocateID()) | |
| 782 | + | child.SetVersion(o.Version()) | |
| 782 | 783 | o.Context().Register(child) | |
| 783 | 784 | if err := o.Context().SendRequest(o, 0, child); err != nil { | |
| 784 | 785 | o.Context().Unregister(child) | |
| @@ -795,6 +796,7 @@ func (o *Compositor) CreateRegion() (*Region, error) { | |||
| 795 | 796 | child := &Region{} | |
| 796 | 797 | child.SetContext(o.Context()) | |
| 797 | 798 | child.SetID(o.Context().AllocateID()) | |
| 799 | + | child.SetVersion(o.Version()) | |
| 798 | 800 | o.Context().Register(child) | |
| 799 | 801 | if err := o.Context().SendRequest(o, 1, child); err != nil { | |
| 800 | 802 | o.Context().Unregister(child) | |
| @@ -808,6 +810,9 @@ func (o *Compositor) Release() error { | |||
| 808 | 810 | if err := o.Context().CheckProxy(o); err != nil { | |
| 809 | 811 | return err | |
| 810 | 812 | } | |
| 813 | + | if err := wl.CheckVersion(o.Version(), 7, "wl_compositor.release"); err != nil { | |
| 814 | + | return err | |
| 815 | + | } | |
| 811 | 816 | if err := o.Context().SendDestructor(o, 2); err != nil { | |
| 812 | 817 | return err | |
| 813 | 818 | } | |
| @@ -853,6 +858,7 @@ func (o *ShmPool) CreateBuffer(offset int32, width int32, height int32, stride i | |||
| 853 | 858 | child := &Buffer{} | |
| 854 | 859 | child.SetContext(o.Context()) | |
| 855 | 860 | child.SetID(o.Context().AllocateID()) | |
| 861 | + | child.SetVersion(o.Version()) | |
| 856 | 862 | o.Context().Register(child) | |
| 857 | 863 | if err := o.Context().SendRequest(o, 0, child, offset, width, height, stride, format); err != nil { | |
| 858 | 864 | o.Context().Unregister(child) | |
| @@ -926,6 +932,7 @@ func (o *Shm) CreatePool(fd int, size int32) (*ShmPool, error) { | |||
| 926 | 932 | child := &ShmPool{} | |
| 927 | 933 | child.SetContext(o.Context()) | |
| 928 | 934 | child.SetID(o.Context().AllocateID()) | |
| 935 | + | child.SetVersion(o.Version()) | |
| 929 | 936 | o.Context().Register(child) | |
| 930 | 937 | if err := o.Context().SendRequestWithFDs(o, 0, []int{fd}, child, uintptr(fd), size); err != nil { | |
| 931 | 938 | o.Context().Unregister(child) | |
| @@ -940,6 +947,9 @@ func (o *Shm) Release() error { | |||
| 940 | 947 | if err := o.Context().CheckProxy(o); err != nil { | |
| 941 | 948 | return err | |
| 942 | 949 | } | |
| 950 | + | if err := wl.CheckVersion(o.Version(), 2, "wl_shm.release"); err != nil { | |
| 951 | + | return err | |
| 952 | + | } | |
| 943 | 953 | if err := o.Context().SendDestructor(o, 1); err != nil { | |
| 944 | 954 | return err | |
| 945 | 955 | } | |
| @@ -1129,6 +1139,9 @@ func (o *DataOffer) Finish() error { | |||
| 1129 | 1139 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1130 | 1140 | return err | |
| 1131 | 1141 | } | |
| 1142 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.finish"); err != nil { | |
| 1143 | + | return err | |
| 1144 | + | } | |
| 1132 | 1145 | if err := o.Context().SendRequest(o, 3); err != nil { | |
| 1133 | 1146 | return err | |
| 1134 | 1147 | } | |
| @@ -1140,6 +1153,9 @@ func (o *DataOffer) SetActions(dndActions uint32, preferredAction uint32) error | |||
| 1140 | 1153 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1141 | 1154 | return err | |
| 1142 | 1155 | } | |
| 1156 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_data_offer.set_actions"); err != nil { | |
| 1157 | + | return err | |
| 1158 | + | } | |
| 1143 | 1159 | if err := o.Context().SendRequest(o, 4, dndActions, preferredAction); err != nil { | |
| 1144 | 1160 | return err | |
| 1145 | 1161 | } | |
| @@ -1306,6 +1322,9 @@ func (o *DataSource) SetActions(dndActions uint32) error { | |||
| 1306 | 1322 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1307 | 1323 | return err | |
| 1308 | 1324 | } | |
| 1325 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_data_source.set_actions"); err != nil { | |
| 1326 | + | return err | |
| 1327 | + | } | |
| 1309 | 1328 | if err := o.Context().SendRequest(o, 2, dndActions); err != nil { | |
| 1310 | 1329 | return err | |
| 1311 | 1330 | } | |
| @@ -1583,6 +1602,9 @@ func (o *DataDevice) Release() error { | |||
| 1583 | 1602 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1584 | 1603 | return err | |
| 1585 | 1604 | } | |
| 1605 | + | if err := wl.CheckVersion(o.Version(), 2, "wl_data_device.release"); err != nil { | |
| 1606 | + | return err | |
| 1607 | + | } | |
| 1586 | 1608 | if err := o.Context().SendDestructor(o, 2); err != nil { | |
| 1587 | 1609 | return err | |
| 1588 | 1610 | } | |
| @@ -1749,6 +1771,7 @@ func (o *DataDevice) Dispatch(event *wl.Event) { | |||
| 1749 | 1771 | idObject := &DataOffer{} | |
| 1750 | 1772 | idObject.SetContext(o.Context()) | |
| 1751 | 1773 | idObject.SetID(idID) | |
| 1774 | + | idObject.SetVersion(o.Version()) | |
| 1752 | 1775 | o.Context().Register(idObject) | |
| 1753 | 1776 | ||
| 1754 | 1777 | for i, handler := range o.handlersForDataOffer() { | |
| @@ -1822,6 +1845,7 @@ func (o *DataDeviceManager) CreateDataSource() (*DataSource, error) { | |||
| 1822 | 1845 | child := &DataSource{} | |
| 1823 | 1846 | child.SetContext(o.Context()) | |
| 1824 | 1847 | child.SetID(o.Context().AllocateID()) | |
| 1848 | + | child.SetVersion(o.Version()) | |
| 1825 | 1849 | o.Context().Register(child) | |
| 1826 | 1850 | if err := o.Context().SendRequest(o, 0, child); err != nil { | |
| 1827 | 1851 | o.Context().Unregister(child) | |
| @@ -1842,6 +1866,7 @@ func (o *DataDeviceManager) GetDataDevice(seat *Seat) (*DataDevice, error) { | |||
| 1842 | 1866 | child := &DataDevice{} | |
| 1843 | 1867 | child.SetContext(o.Context()) | |
| 1844 | 1868 | child.SetID(o.Context().AllocateID()) | |
| 1869 | + | child.SetVersion(o.Version()) | |
| 1845 | 1870 | o.Context().Register(child) | |
| 1846 | 1871 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 1847 | 1872 | o.Context().Unregister(child) | |
| @@ -1855,6 +1880,9 @@ func (o *DataDeviceManager) Release() error { | |||
| 1855 | 1880 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1856 | 1881 | return err | |
| 1857 | 1882 | } | |
| 1883 | + | if err := wl.CheckVersion(o.Version(), 4, "wl_data_device_manager.release"); err != nil { | |
| 1884 | + | return err | |
| 1885 | + | } | |
| 1858 | 1886 | if err := o.Context().SendDestructor(o, 2); err != nil { | |
| 1859 | 1887 | return err | |
| 1860 | 1888 | } | |
| @@ -1904,6 +1932,7 @@ func (o *Shell) GetShellSurface(surface *Surface) (*ShellSurface, error) { | |||
| 1904 | 1932 | child := &ShellSurface{} | |
| 1905 | 1933 | child.SetContext(o.Context()) | |
| 1906 | 1934 | child.SetID(o.Context().AllocateID()) | |
| 1935 | + | child.SetVersion(o.Version()) | |
| 1907 | 1936 | o.Context().Register(child) | |
| 1908 | 1937 | if err := o.Context().SendRequest(o, 0, child, arg1); err != nil { | |
| 1909 | 1938 | o.Context().Unregister(child) | |
| @@ -2264,6 +2293,7 @@ func (o *Surface) Frame() (*Callback, error) { | |||
| 2264 | 2293 | child := &Callback{} | |
| 2265 | 2294 | child.SetContext(o.Context()) | |
| 2266 | 2295 | child.SetID(o.Context().AllocateID()) | |
| 2296 | + | child.SetVersion(o.Version()) | |
| 2267 | 2297 | o.Context().Register(child) | |
| 2268 | 2298 | if err := o.Context().SendRequest(o, 3, child); err != nil { | |
| 2269 | 2299 | o.Context().Unregister(child) | |
| @@ -2318,6 +2348,9 @@ func (o *Surface) SetBufferTransform(transform int32) error { | |||
| 2318 | 2348 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2319 | 2349 | return err | |
| 2320 | 2350 | } | |
| 2351 | + | if err := wl.CheckVersion(o.Version(), 2, "wl_surface.set_buffer_transform"); err != nil { | |
| 2352 | + | return err | |
| 2353 | + | } | |
| 2321 | 2354 | if err := o.Context().SendRequest(o, 7, transform); err != nil { | |
| 2322 | 2355 | return err | |
| 2323 | 2356 | } | |
| @@ -2329,6 +2362,9 @@ func (o *Surface) SetBufferScale(scale int32) error { | |||
| 2329 | 2362 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2330 | 2363 | return err | |
| 2331 | 2364 | } | |
| 2365 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_surface.set_buffer_scale"); err != nil { | |
| 2366 | + | return err | |
| 2367 | + | } | |
| 2332 | 2368 | if err := o.Context().SendRequest(o, 8, scale); err != nil { | |
| 2333 | 2369 | return err | |
| 2334 | 2370 | } | |
| @@ -2340,6 +2376,9 @@ func (o *Surface) DamageBuffer(x int32, y int32, width int32, height int32) erro | |||
| 2340 | 2376 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2341 | 2377 | return err | |
| 2342 | 2378 | } | |
| 2379 | + | if err := wl.CheckVersion(o.Version(), 4, "wl_surface.damage_buffer"); err != nil { | |
| 2380 | + | return err | |
| 2381 | + | } | |
| 2343 | 2382 | if err := o.Context().SendRequest(o, 9, x, y, width, height); err != nil { | |
| 2344 | 2383 | return err | |
| 2345 | 2384 | } | |
| @@ -2351,6 +2390,9 @@ func (o *Surface) Offset(x int32, y int32) error { | |||
| 2351 | 2390 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2352 | 2391 | return err | |
| 2353 | 2392 | } | |
| 2393 | + | if err := wl.CheckVersion(o.Version(), 5, "wl_surface.offset"); err != nil { | |
| 2394 | + | return err | |
| 2395 | + | } | |
| 2354 | 2396 | if err := o.Context().SendRequest(o, 10, x, y); err != nil { | |
| 2355 | 2397 | return err | |
| 2356 | 2398 | } | |
| @@ -2362,9 +2404,13 @@ func (o *Surface) GetRelease() (*Callback, error) { | |||
| 2362 | 2404 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2363 | 2405 | 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 | 2410 | child := &Callback{} | |
| 2366 | 2411 | child.SetContext(o.Context()) | |
| 2367 | 2412 | child.SetID(o.Context().AllocateID()) | |
| 2413 | + | child.SetVersion(o.Version()) | |
| 2368 | 2414 | o.Context().Register(child) | |
| 2369 | 2415 | if err := o.Context().SendRequest(o, 11, child); err != nil { | |
| 2370 | 2416 | o.Context().Unregister(child) | |
| @@ -2541,6 +2587,7 @@ func (o *Seat) GetPointer() (*Pointer, error) { | |||
| 2541 | 2587 | child := &Pointer{} | |
| 2542 | 2588 | child.SetContext(o.Context()) | |
| 2543 | 2589 | child.SetID(o.Context().AllocateID()) | |
| 2590 | + | child.SetVersion(o.Version()) | |
| 2544 | 2591 | o.Context().Register(child) | |
| 2545 | 2592 | if err := o.Context().SendRequest(o, 0, child); err != nil { | |
| 2546 | 2593 | o.Context().Unregister(child) | |
| @@ -2557,6 +2604,7 @@ func (o *Seat) GetKeyboard() (*Keyboard, error) { | |||
| 2557 | 2604 | child := &Keyboard{} | |
| 2558 | 2605 | child.SetContext(o.Context()) | |
| 2559 | 2606 | child.SetID(o.Context().AllocateID()) | |
| 2607 | + | child.SetVersion(o.Version()) | |
| 2560 | 2608 | o.Context().Register(child) | |
| 2561 | 2609 | if err := o.Context().SendRequest(o, 1, child); err != nil { | |
| 2562 | 2610 | o.Context().Unregister(child) | |
| @@ -2573,6 +2621,7 @@ func (o *Seat) GetTouch() (*Touch, error) { | |||
| 2573 | 2621 | child := &Touch{} | |
| 2574 | 2622 | child.SetContext(o.Context()) | |
| 2575 | 2623 | child.SetID(o.Context().AllocateID()) | |
| 2624 | + | child.SetVersion(o.Version()) | |
| 2576 | 2625 | o.Context().Register(child) | |
| 2577 | 2626 | if err := o.Context().SendRequest(o, 2, child); err != nil { | |
| 2578 | 2627 | o.Context().Unregister(child) | |
| @@ -2586,6 +2635,9 @@ func (o *Seat) Release() error { | |||
| 2586 | 2635 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2587 | 2636 | return err | |
| 2588 | 2637 | } | |
| 2638 | + | if err := wl.CheckVersion(o.Version(), 5, "wl_seat.release"); err != nil { | |
| 2639 | + | return err | |
| 2640 | + | } | |
| 2589 | 2641 | if err := o.Context().SendDestructor(o, 3); err != nil { | |
| 2590 | 2642 | return err | |
| 2591 | 2643 | } | |
| @@ -2720,6 +2772,9 @@ func (o *Pointer) Release() error { | |||
| 2720 | 2772 | if err := o.Context().CheckProxy(o); err != nil { | |
| 2721 | 2773 | return err | |
| 2722 | 2774 | } | |
| 2775 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_pointer.release"); err != nil { | |
| 2776 | + | return err | |
| 2777 | + | } | |
| 2723 | 2778 | if err := o.Context().SendDestructor(o, 1); err != nil { | |
| 2724 | 2779 | return err | |
| 2725 | 2780 | } | |
| @@ -3158,6 +3213,9 @@ func (o *Keyboard) Release() error { | |||
| 3158 | 3213 | if err := o.Context().CheckProxy(o); err != nil { | |
| 3159 | 3214 | return err | |
| 3160 | 3215 | } | |
| 3216 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_keyboard.release"); err != nil { | |
| 3217 | + | return err | |
| 3218 | + | } | |
| 3161 | 3219 | if err := o.Context().SendDestructor(o, 0); err != nil { | |
| 3162 | 3220 | return err | |
| 3163 | 3221 | } | |
| @@ -3413,6 +3471,9 @@ func (o *Touch) Release() error { | |||
| 3413 | 3471 | if err := o.Context().CheckProxy(o); err != nil { | |
| 3414 | 3472 | return err | |
| 3415 | 3473 | } | |
| 3474 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_touch.release"); err != nil { | |
| 3475 | + | return err | |
| 3476 | + | } | |
| 3416 | 3477 | if err := o.Context().SendDestructor(o, 0); err != nil { | |
| 3417 | 3478 | return err | |
| 3418 | 3479 | } | |
| @@ -3692,6 +3753,9 @@ func (o *Output) Release() error { | |||
| 3692 | 3753 | if err := o.Context().CheckProxy(o); err != nil { | |
| 3693 | 3754 | return err | |
| 3694 | 3755 | } | |
| 3756 | + | if err := wl.CheckVersion(o.Version(), 3, "wl_output.release"); err != nil { | |
| 3757 | + | return err | |
| 3758 | + | } | |
| 3695 | 3759 | if err := o.Context().SendDestructor(o, 0); err != nil { | |
| 3696 | 3760 | return err | |
| 3697 | 3761 | } | |
| @@ -4015,6 +4079,7 @@ func (o *Subcompositor) GetSubsurface(surface *Surface, parent *Surface) (*Subsu | |||
| 4015 | 4079 | child := &Subsurface{} | |
| 4016 | 4080 | child.SetContext(o.Context()) | |
| 4017 | 4081 | child.SetID(o.Context().AllocateID()) | |
| 4082 | + | child.SetVersion(o.Version()) | |
| 4018 | 4083 | o.Context().Register(child) | |
| 4019 | 4084 | if err := o.Context().SendRequest(o, 1, child, arg1, arg2); err != nil { | |
| 4020 | 4085 | o.Context().Unregister(child) | |
| @@ -4190,6 +4255,9 @@ func (o *Fixes) AckGlobalRemove(registry *wl.Registry, name uint32) error { | |||
| 4190 | 4255 | if err := o.Context().CheckProxy(o); err != nil { | |
| 4191 | 4256 | return err | |
| 4192 | 4257 | } | |
| 4258 | + | if err := wl.CheckVersion(o.Version(), 2, "wl_fixes.ack_global_remove"); err != nil { | |
| 4259 | + | return err | |
| 4260 | + | } | |
| 4193 | 4261 | var arg0 wl.Object | |
| 4194 | 4262 | if registry != nil { | |
| 4195 | 4263 | 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 err | 811 | 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 err | 817 | 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 err | 948 | 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 err | 954 | 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 err | 1140 | 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 err | 1146 | 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 err | 1154 | 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 err | 1160 | 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 err | 1323 | 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 err | 1329 | 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 err | 1603 | 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 err | 1609 | 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 err | 1881 | 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 err | 1887 | 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 err | 2349 | 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 err | 2355 | 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 err | 2363 | 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 err | 2369 | 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 err | 2377 | 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 err | 2383 | 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 err | 2391 | 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 err | 2397 | 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, err | 2405 | 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 err | 2636 | 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 err | 2642 | 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 err | 2773 | 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 err | 2779 | 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 err | 3214 | 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 err | 3220 | 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 err | 3472 | 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 err | 3478 | 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 err | 3754 | 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 err | 3760 | 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 err | 4256 | 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.Object | 4261 | var arg0 wl.Object | ||
| 4194 | if registry != nil { | 4262 | if registry != nil { | ||
| 4195 | arg0 = registry | 4263 | 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 | |||
| 160 | 160 | child := &WpCursorShapeDevice{} | |
| 161 | 161 | child.SetContext(o.Context()) | |
| 162 | 162 | child.SetID(o.Context().AllocateID()) | |
| 163 | + | child.SetVersion(o.Version()) | |
| 163 | 164 | o.Context().Register(child) | |
| 164 | 165 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 165 | 166 | o.Context().Unregister(child) | |
| @@ -180,6 +181,7 @@ func (o *WpCursorShapeManager) GetTabletTool(tabletTool *cross_zwp_tablet_tool_v | |||
| 180 | 181 | child := &WpCursorShapeDevice{} | |
| 181 | 182 | child.SetContext(o.Context()) | |
| 182 | 183 | child.SetID(o.Context().AllocateID()) | |
| 184 | + | child.SetVersion(o.Version()) | |
| 183 | 185 | o.Context().Register(child) | |
| 184 | 186 | if err := o.Context().SendRequest(o, 2, child, arg1); err != nil { | |
| 185 | 187 | 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) | |||
| 72 | 72 | child := &WpLinuxDrmSyncobjSurface{} | |
| 73 | 73 | child.SetContext(o.Context()) | |
| 74 | 74 | child.SetID(o.Context().AllocateID()) | |
| 75 | + | child.SetVersion(o.Version()) | |
| 75 | 76 | o.Context().Register(child) | |
| 76 | 77 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 77 | 78 | o.Context().Unregister(child) | |
| @@ -88,6 +89,7 @@ func (o *WpLinuxDrmSyncobjManager) ImportTimeline(fd int) (*WpLinuxDrmSyncobjTim | |||
| 88 | 89 | child := &WpLinuxDrmSyncobjTimeline{} | |
| 89 | 90 | child.SetContext(o.Context()) | |
| 90 | 91 | child.SetID(o.Context().AllocateID()) | |
| 92 | + | child.SetVersion(o.Version()) | |
| 91 | 93 | o.Context().Register(child) | |
| 92 | 94 | if err := o.Context().SendRequestWithFDs(o, 2, []int{fd}, child, uintptr(fd)); err != nil { | |
| 93 | 95 | 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 | |||
| 4 | 4 | ||
| 5 | 5 | import ( | |
| 6 | 6 | "encoding/binary" | |
| 7 | + | "errors" | |
| 7 | 8 | "net" | |
| 8 | 9 | "os" | |
| 9 | 10 | "strings" | |
| @@ -412,8 +413,11 @@ func TestExtensionsOverSocketpair(t *testing.T) { | |||
| 412 | 413 | request(t, p) | |
| 413 | 414 | noerr(t, device.Release()) | |
| 414 | 415 | 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 | + | } | |
| 417 | 421 | // Cursor shape: get a device for a wl_pointer and set a shape at an | |
| 418 | 422 | // enter serial; check the exact wire arguments. | |
| 419 | 423 | 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 an | 421 | // 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. | |||
| 53 | 53 | child := &WpFractionalScale{} | |
| 54 | 54 | child.SetContext(o.Context()) | |
| 55 | 55 | child.SetID(o.Context().AllocateID()) | |
| 56 | + | child.SetVersion(o.Version()) | |
| 56 | 57 | o.Context().Register(child) | |
| 57 | 58 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 58 | 59 | 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) { | |||
| 94 | 94 | child := &LinuxBufferParams{} | |
| 95 | 95 | child.SetContext(o.Context()) | |
| 96 | 96 | child.SetID(o.Context().AllocateID()) | |
| 97 | + | child.SetVersion(o.Version()) | |
| 97 | 98 | o.Context().Register(child) | |
| 98 | 99 | if err := o.Context().SendRequest(o, 1, child); err != nil { | |
| 99 | 100 | o.Context().Unregister(child) | |
| @@ -107,9 +108,13 @@ func (o *LinuxDmabuf) GetDefaultFeedback() (*LinuxDmabufFeedback, error) { | |||
| 107 | 108 | if err := o.Context().CheckProxy(o); err != nil { | |
| 108 | 109 | 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 | 114 | child := &LinuxDmabufFeedback{} | |
| 111 | 115 | child.SetContext(o.Context()) | |
| 112 | 116 | child.SetID(o.Context().AllocateID()) | |
| 117 | + | child.SetVersion(o.Version()) | |
| 113 | 118 | o.Context().Register(child) | |
| 114 | 119 | if err := o.Context().SendRequest(o, 2, child); err != nil { | |
| 115 | 120 | o.Context().Unregister(child) | |
| @@ -123,6 +128,9 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li | |||
| 123 | 128 | if err := o.Context().CheckProxy(o); err != nil { | |
| 124 | 129 | 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 | 134 | var arg1 wl.Object | |
| 127 | 135 | if surface != nil { | |
| 128 | 136 | arg1 = surface | |
| @@ -130,6 +138,7 @@ func (o *LinuxDmabuf) GetSurfaceFeedback(surface *cross_wl_surface.Surface) (*Li | |||
| 130 | 138 | child := &LinuxDmabufFeedback{} | |
| 131 | 139 | child.SetContext(o.Context()) | |
| 132 | 140 | child.SetID(o.Context().AllocateID()) | |
| 141 | + | child.SetVersion(o.Version()) | |
| 133 | 142 | o.Context().Register(child) | |
| 134 | 143 | if err := o.Context().SendRequest(o, 3, child, arg1); err != nil { | |
| 135 | 144 | o.Context().Unregister(child) | |
| @@ -277,8 +286,12 @@ func (o *LinuxBufferParams) CreateImmed(width int32, height int32, format uint32 | |||
| 277 | 286 | if err := o.Context().CheckProxy(o); err != nil { | |
| 278 | 287 | 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 | 292 | child := cross_wl_buffer.NewBuffer(o.Context()) | |
| 281 | 293 | child.SetID(o.Context().AllocateID()) | |
| 294 | + | child.SetVersion(o.Version()) | |
| 282 | 295 | o.Context().Register(child) | |
| 283 | 296 | if err := o.Context().SendRequest(o, 3, child, width, height, format, flags); err != nil { | |
| 284 | 297 | o.Context().Unregister(child) | |
| @@ -292,6 +305,9 @@ func (o *LinuxBufferParams) SetSamplingDevice(device []byte) error { | |||
| 292 | 305 | if err := o.Context().CheckProxy(o); err != nil { | |
| 293 | 306 | 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 | 311 | if err := o.Context().SendRequest(o, 4, device); err != nil { | |
| 296 | 312 | return err | |
| 297 | 313 | } | |
| @@ -361,6 +377,7 @@ func (o *LinuxBufferParams) Dispatch(event *wl.Event) { | |||
| 361 | 377 | bufferID := event.Uint32() | |
| 362 | 378 | bufferObject := cross_wl_buffer.NewBuffer(o.Context()) | |
| 363 | 379 | bufferObject.SetID(bufferID) | |
| 380 | + | bufferObject.SetVersion(o.Version()) | |
| 364 | 381 | o.Context().Register(bufferObject) | |
| 365 | 382 | ||
| 366 | 383 | 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, err | 109 | 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, err | 129 | 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.Object | 134 | var arg1 wl.Object | ||
| 127 | if surface != nil { | 135 | if surface != nil { | ||
| 128 | arg1 = surface | 136 | 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, err | 287 | 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 err | 306 | 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 err | 312 | 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 | |||
| 118 | 118 | child := &TabletSeat{} | |
| 119 | 119 | child.SetContext(o.Context()) | |
| 120 | 120 | child.SetID(o.Context().AllocateID()) | |
| 121 | + | child.SetVersion(o.Version()) | |
| 121 | 122 | o.Context().Register(child) | |
| 122 | 123 | if err := o.Context().SendRequest(o, 0, child, arg1); err != nil { | |
| 123 | 124 | o.Context().Unregister(child) | |
| @@ -273,6 +274,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) { | |||
| 273 | 274 | idObject := &Tablet{} | |
| 274 | 275 | idObject.SetContext(o.Context()) | |
| 275 | 276 | idObject.SetID(idID) | |
| 277 | + | idObject.SetVersion(o.Version()) | |
| 276 | 278 | o.Context().Register(idObject) | |
| 277 | 279 | ||
| 278 | 280 | for i, handler := range o.handlersForTabletAdded() { | |
| @@ -284,6 +286,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) { | |||
| 284 | 286 | idObject := &TabletTool{} | |
| 285 | 287 | idObject.SetContext(o.Context()) | |
| 286 | 288 | idObject.SetID(idID) | |
| 289 | + | idObject.SetVersion(o.Version()) | |
| 287 | 290 | o.Context().Register(idObject) | |
| 288 | 291 | ||
| 289 | 292 | for i, handler := range o.handlersForToolAdded() { | |
| @@ -295,6 +298,7 @@ func (o *TabletSeat) Dispatch(event *wl.Event) { | |||
| 295 | 298 | idObject := &TabletPad{} | |
| 296 | 299 | idObject.SetContext(o.Context()) | |
| 297 | 300 | idObject.SetID(idID) | |
| 301 | + | idObject.SetVersion(o.Version()) | |
| 298 | 302 | o.Context().Register(idObject) | |
| 299 | 303 | ||
| 300 | 304 | for i, handler := range o.handlersForPadAdded() { | |
| @@ -1808,6 +1812,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) { | |||
| 1808 | 1812 | ringObject := &TabletPadRing{} | |
| 1809 | 1813 | ringObject.SetContext(o.Context()) | |
| 1810 | 1814 | ringObject.SetID(ringID) | |
| 1815 | + | ringObject.SetVersion(o.Version()) | |
| 1811 | 1816 | o.Context().Register(ringObject) | |
| 1812 | 1817 | ||
| 1813 | 1818 | for i, handler := range o.handlersForRing() { | |
| @@ -1819,6 +1824,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) { | |||
| 1819 | 1824 | stripObject := &TabletPadStrip{} | |
| 1820 | 1825 | stripObject.SetContext(o.Context()) | |
| 1821 | 1826 | stripObject.SetID(stripID) | |
| 1827 | + | stripObject.SetVersion(o.Version()) | |
| 1822 | 1828 | o.Context().Register(stripObject) | |
| 1823 | 1829 | ||
| 1824 | 1830 | for i, handler := range o.handlersForStrip() { | |
| @@ -1852,6 +1858,7 @@ func (o *TabletPadGroup) Dispatch(event *wl.Event) { | |||
| 1852 | 1858 | dialObject := &TabletPadDial{} | |
| 1853 | 1859 | dialObject.SetContext(o.Context()) | |
| 1854 | 1860 | dialObject.SetID(dialID) | |
| 1861 | + | dialObject.SetVersion(o.Version()) | |
| 1855 | 1862 | o.Context().Register(dialObject) | |
| 1856 | 1863 | ||
| 1857 | 1864 | for i, handler := range o.handlersForDial() { | |
| @@ -2119,6 +2126,7 @@ func (o *TabletPad) Dispatch(event *wl.Event) { | |||
| 2119 | 2126 | padGroupObject := &TabletPadGroup{} | |
| 2120 | 2127 | padGroupObject.SetContext(o.Context()) | |
| 2121 | 2128 | padGroupObject.SetID(padGroupID) | |
| 2129 | + | padGroupObject.SetVersion(o.Version()) | |
| 2122 | 2130 | o.Context().Register(padGroupObject) | |
| 2123 | 2131 | ||
| 2124 | 2132 | 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 { | |||
| 252 | 252 | if err := o.Context().CheckProxy(o); err != nil { | |
| 253 | 253 | 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 | 258 | if err := o.Context().SendRequest(o, 8, availableActions); err != nil { | |
| 256 | 259 | return err | |
| 257 | 260 | } | |
| @@ -263,6 +266,9 @@ func (o *TextInputV3) ShowInputPanel() error { | |||
| 263 | 266 | if err := o.Context().CheckProxy(o); err != nil { | |
| 264 | 267 | 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 | 272 | if err := o.Context().SendRequest(o, 9); err != nil { | |
| 267 | 273 | return err | |
| 268 | 274 | } | |
| @@ -274,6 +280,9 @@ func (o *TextInputV3) HideInputPanel() error { | |||
| 274 | 280 | if err := o.Context().CheckProxy(o); err != nil { | |
| 275 | 281 | 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 | 286 | if err := o.Context().SendRequest(o, 10); err != nil { | |
| 278 | 287 | return err | |
| 279 | 288 | } | |
| @@ -619,6 +628,7 @@ func (o *TextInputManagerV3) GetTextInput(seat *cross_wl_seat.Seat) (*TextInputV | |||
| 619 | 628 | child := &TextInputV3{} | |
| 620 | 629 | child.SetContext(o.Context()) | |
| 621 | 630 | child.SetID(o.Context().AllocateID()) | |
| 631 | + | child.SetVersion(o.Version()) | |
| 622 | 632 | o.Context().Register(child) | |
| 623 | 633 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 624 | 634 | 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 err | 253 | 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 err | 259 | 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 err | 267 | 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 err | 273 | 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 err | 281 | 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 err | 287 | 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 | |||
| 63 | 63 | child := &WpViewport{} | |
| 64 | 64 | child.SetContext(o.Context()) | |
| 65 | 65 | child.SetID(o.Context().AllocateID()) | |
| 66 | + | child.SetVersion(o.Version()) | |
| 66 | 67 | o.Context().Register(child) | |
| 67 | 68 | if err := o.Context().SendRequest(o, 1, child, arg1); err != nil { | |
| 68 | 69 | 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) { | |||
| 259 | 259 | child := &XdgPositioner{} | |
| 260 | 260 | child.SetContext(o.Context()) | |
| 261 | 261 | child.SetID(o.Context().AllocateID()) | |
| 262 | + | child.SetVersion(o.Version()) | |
| 262 | 263 | o.Context().Register(child) | |
| 263 | 264 | if err := o.Context().SendRequest(o, 1, child); err != nil { | |
| 264 | 265 | o.Context().Unregister(child) | |
| @@ -279,6 +280,7 @@ func (o *XdgWmBase) GetXdgSurface(surface *cross_wl_surface.Surface) (*XdgSurfac | |||
| 279 | 280 | child := &XdgSurface{} | |
| 280 | 281 | child.SetContext(o.Context()) | |
| 281 | 282 | child.SetID(o.Context().AllocateID()) | |
| 283 | + | child.SetVersion(o.Version()) | |
| 282 | 284 | o.Context().Register(child) | |
| 283 | 285 | if err := o.Context().SendRequest(o, 2, child, arg1); err != nil { | |
| 284 | 286 | o.Context().Unregister(child) | |
| @@ -442,6 +444,9 @@ func (o *XdgPositioner) SetReactive() error { | |||
| 442 | 444 | if err := o.Context().CheckProxy(o); err != nil { | |
| 443 | 445 | return err | |
| 444 | 446 | } | |
| 447 | + | if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_reactive"); err != nil { | |
| 448 | + | return err | |
| 449 | + | } | |
| 445 | 450 | if err := o.Context().SendRequest(o, 7); err != nil { | |
| 446 | 451 | return err | |
| 447 | 452 | } | |
| @@ -453,6 +458,9 @@ func (o *XdgPositioner) SetParentSize(parentWidth int32, parentHeight int32) err | |||
| 453 | 458 | if err := o.Context().CheckProxy(o); err != nil { | |
| 454 | 459 | return err | |
| 455 | 460 | } | |
| 461 | + | if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_size"); err != nil { | |
| 462 | + | return err | |
| 463 | + | } | |
| 456 | 464 | if err := o.Context().SendRequest(o, 8, parentWidth, parentHeight); err != nil { | |
| 457 | 465 | return err | |
| 458 | 466 | } | |
| @@ -464,6 +472,9 @@ func (o *XdgPositioner) SetParentConfigure(serial uint32) error { | |||
| 464 | 472 | if err := o.Context().CheckProxy(o); err != nil { | |
| 465 | 473 | return err | |
| 466 | 474 | } | |
| 475 | + | if err := wl.CheckVersion(o.Version(), 3, "xdg_positioner.set_parent_configure"); err != nil { | |
| 476 | + | return err | |
| 477 | + | } | |
| 467 | 478 | if err := o.Context().SendRequest(o, 9, serial); err != nil { | |
| 468 | 479 | return err | |
| 469 | 480 | } | |
| @@ -524,6 +535,7 @@ func (o *XdgSurface) GetToplevel() (*XdgToplevel, error) { | |||
| 524 | 535 | child := &XdgToplevel{} | |
| 525 | 536 | child.SetContext(o.Context()) | |
| 526 | 537 | child.SetID(o.Context().AllocateID()) | |
| 538 | + | child.SetVersion(o.Version()) | |
| 527 | 539 | o.Context().Register(child) | |
| 528 | 540 | if err := o.Context().SendRequest(o, 1, child); err != nil { | |
| 529 | 541 | o.Context().Unregister(child) | |
| @@ -548,6 +560,7 @@ func (o *XdgSurface) GetPopup(parent *XdgSurface, positioner *XdgPositioner) (*X | |||
| 548 | 560 | child := &XdgPopup{} | |
| 549 | 561 | child.SetContext(o.Context()) | |
| 550 | 562 | child.SetID(o.Context().AllocateID()) | |
| 563 | + | child.SetVersion(o.Version()) | |
| 551 | 564 | o.Context().Register(child) | |
| 552 | 565 | if err := o.Context().SendRequest(o, 2, child, arg1, arg2); err != nil { | |
| 553 | 566 | o.Context().Unregister(child) | |
| @@ -1015,6 +1028,9 @@ func (o *XdgPopup) Reposition(positioner *XdgPositioner, token uint32) error { | |||
| 1015 | 1028 | if err := o.Context().CheckProxy(o); err != nil { | |
| 1016 | 1029 | return err | |
| 1017 | 1030 | } | |
| 1031 | + | if err := wl.CheckVersion(o.Version(), 3, "xdg_popup.reposition"); err != nil { | |
| 1032 | + | return err | |
| 1033 | + | } | |
| 1018 | 1034 | var arg0 wl.Object | |
| 1019 | 1035 | if positioner != nil { | |
| 1020 | 1036 | 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 err | 445 | 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 err | 451 | 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 err | 459 | 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 err | 465 | 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 err | 473 | 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 err | 479 | 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 err | 1029 | 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.Object | 1034 | var arg0 wl.Object | ||
| 1019 | if positioner != nil { | 1035 | if positioner != nil { | ||
| 1020 | arg0 = positioner | 1036 | arg0 = positioner | ||
M wl/wl.go +2 -0
| @@ -35,6 +35,7 @@ var ( | |||
| 35 | 35 | NewFixed = wlturbo.NewFixed | |
| 36 | 36 | NewContext = wlturbo.NewContext | |
| 37 | 37 | CloseSentFD = wlturbo.CloseSentFD | |
| 38 | + | CheckVersion = wlturbo.CheckVersion | |
| 38 | 39 | CreateAnonymousFile = wlturbo.CreateAnonymousFile | |
| 39 | 40 | MapMemory = wlturbo.MapMemory | |
| 40 | 41 | UnmapMemory = wlturbo.UnmapMemory | |
| @@ -47,4 +48,5 @@ var ( | |||
| 47 | 48 | ErrUnknownObject = wlturbo.ErrUnknownObject | |
| 48 | 49 | ErrUnknownOpcode = wlturbo.ErrUnknownOpcode | |
| 49 | 50 | ErrDisplayError = wlturbo.ErrDisplayError | |
| 51 | + | ErrVersionTooLow = wlturbo.ErrVersionTooLow | |
| 50 | 52 | ) | |
| @@ -35,6 +35,7 @@ var ( | |||||
| 35 | NewFixed = wlturbo.NewFixed | 35 | NewFixed = wlturbo.NewFixed | ||
| 36 | NewContext = wlturbo.NewContext | 36 | NewContext = wlturbo.NewContext | ||
| 37 | CloseSentFD = wlturbo.CloseSentFD | 37 | CloseSentFD = wlturbo.CloseSentFD | ||
| 38 | + | CheckVersion = wlturbo.CheckVersion | |||
| 38 | CreateAnonymousFile = wlturbo.CreateAnonymousFile | 39 | CreateAnonymousFile = wlturbo.CreateAnonymousFile | ||
| 39 | MapMemory = wlturbo.MapMemory | 40 | MapMemory = wlturbo.MapMemory | ||
| 40 | UnmapMemory = wlturbo.UnmapMemory | 41 | UnmapMemory = wlturbo.UnmapMemory | ||
| @@ -47,4 +48,5 @@ var ( | |||||
| 47 | ErrUnknownObject = wlturbo.ErrUnknownObject | 48 | ErrUnknownObject = wlturbo.ErrUnknownObject | ||
| 48 | ErrUnknownOpcode = wlturbo.ErrUnknownOpcode | 49 | ErrUnknownOpcode = wlturbo.ErrUnknownOpcode | ||
| 49 | ErrDisplayError = wlturbo.ErrDisplayError | 50 | ErrDisplayError = wlturbo.ErrDisplayError | ||
| 51 | + | ErrVersionTooLow = wlturbo.ErrVersionTooLow | |||
| 50 | ) | 52 | ) | ||