add opcode field to packets

X11 requests must contain an opcode field
to be sent so the X11 server can identify
the request
This commit is contained in:
Richard Ramsden 2012-05-19 13:17:16 -07:00
parent 23fa93fa24
commit 1dafc7ee61

View file

@ -25,7 +25,7 @@ module X11
end
end
packet.join
((@opcode ? [X11::Type::Int8.pack(@opcode)] : []) + packet).join
end
def read(socket)
@ -73,6 +73,10 @@ module X11
@structs << s
end
def opcode(value)
@opcode = value
end
private
def lengths_for(args)