Possible fix for Bug 1548992.
This patch computes the display number in initialize-x11-values instead of x-set-device-variables.
Not sure it's 100% correct, but it works for me.
Patch to fix garnet display number bug
Patch to fix garnet display number bug