diff options
| author | jEzEk <[email protected]> | 2022-05-01 18:21:54 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-01 18:21:54 +0200 |
| commit | 7effddcf465f2b8e142c828c90951614922d9b32 (patch) | |
| tree | 8095023d44a3cf95b5d186d5de9e077b35b485b7 | |
| parent | 7a4fade77cf2a8406e63409d11ac844dfb150679 (diff) | |
| parent | 500d3701979d754212493ad266fa835c5aa4d857 (diff) | |
Merge pull request #7 from woofdoggo/patch-eventcopyv1.0.1
- Fixed EventCopy.Write() in xgbgen to write the type of the event rather than keep the type of the event it is derived from
- Regenerated bindings from xcbproto 1.11
| -rw-r--r-- | xgbgen/go_event.go | 4 | ||||
| -rw-r--r-- | xproto/xproto.go | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/xgbgen/go_event.go b/xgbgen/go_event.go index 9b5e748..a4ed3ea 100644 --- a/xgbgen/go_event.go +++ b/xgbgen/go_event.go @@ -162,7 +162,9 @@ func (e *EventCopy) Read(c *Context) { func (e *EventCopy) Write(c *Context) { c.Putln("// Bytes writes a %s value to a byte slice.", e.EvType()) c.Putln("func (v %s) Bytes() []byte {", e.EvType()) - c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType()) + c.Putln("buf := %s(v).Bytes()", e.Old.(*Event).EvType()) + c.Putln("buf[0] = %d", e.Number) + c.Putln("return buf") c.Putln("}") c.Putln("") } diff --git a/xproto/xproto.go b/xproto/xproto.go index 8d7e51b..e6b2c6b 100644 --- a/xproto/xproto.go +++ b/xproto/xproto.go @@ -526,7 +526,9 @@ func ButtonReleaseEventNew(buf []byte) xgb.Event { // Bytes writes a ButtonReleaseEvent value to a byte slice. func (v ButtonReleaseEvent) Bytes() []byte { - return ButtonPressEvent(v).Bytes() + buf := ButtonPressEvent(v).Bytes() + buf[0] = 5 + return buf } // SequenceId returns the sequence id attached to the ButtonRelease event. @@ -806,7 +808,9 @@ func CirculateRequestEventNew(buf []byte) xgb.Event { // Bytes writes a CirculateRequestEvent value to a byte slice. func (v CirculateRequestEvent) Bytes() []byte { - return CirculateNotifyEvent(v).Bytes() + buf := CirculateNotifyEvent(v).Bytes() + buf[0] = 27 + return buf } // SequenceId returns the sequence id attached to the CirculateRequest event. @@ -2441,7 +2445,9 @@ func FocusOutEventNew(buf []byte) xgb.Event { // Bytes writes a FocusOutEvent value to a byte slice. func (v FocusOutEvent) Bytes() []byte { - return FocusInEvent(v).Bytes() + buf := FocusInEvent(v).Bytes() + buf[0] = 10 + return buf } // SequenceId returns the sequence id attached to the FocusOut event. @@ -3412,7 +3418,9 @@ func KeyReleaseEventNew(buf []byte) xgb.Event { // Bytes writes a KeyReleaseEvent value to a byte slice. func (v KeyReleaseEvent) Bytes() []byte { - return KeyPressEvent(v).Bytes() + buf := KeyPressEvent(v).Bytes() + buf[0] = 3 + return buf } // SequenceId returns the sequence id attached to the KeyRelease event. @@ -3514,7 +3522,9 @@ func LeaveNotifyEventNew(buf []byte) xgb.Event { // Bytes writes a LeaveNotifyEvent value to a byte slice. func (v LeaveNotifyEvent) Bytes() []byte { - return EnterNotifyEvent(v).Bytes() + buf := EnterNotifyEvent(v).Bytes() + buf[0] = 8 + return buf } // SequenceId returns the sequence id attached to the LeaveNotify event. |
