Fix cursor position in xshm plugin