MacOS – XQuartz – FSLeyes (fsleyes) – received an X Window System error

A MacOS user may get an error message when starts FSLeyes (fsleyes) program on the PSY cluster:

Gdk-ERROR **: The program 'fsleyes' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 695 error_code 2 request_code 149 minor_code 24)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Please check the following post for a fix: