#!/bin/sh
here="$(cd "$(dirname "$0")" && pwd)"
bin="$here/odoo_client"
export GDK_BACKEND="${GDK_BACKEND:-x11}"
webkit_virtual_gpu() {
  if [ -d /sys/module/vmwgfx ] || [ -d /sys/module/vboxvideo ] || [ -d /sys/module/virtio_gpu ] || [ -d /sys/module/hyperv_drm ]; then
    return 0
  fi
  for f in /sys/bus/pci/devices/*/vendor; do
    [ -f "$f" ] || continue
    [ "$(tr -d '[:space:]' < "$f")" = "0x15ad" ] && return 0
  done
  return 1
}
if webkit_virtual_gpu; then
  if [ -z "${WEBKIT_DISABLE_DMABUF_RENDERER+x}" ]; then
    export WEBKIT_DISABLE_DMABUF_RENDERER=1
  fi
  if [ -z "${WEBKIT_DISABLE_COMPOSITING_MODE+x}" ]; then
    export WEBKIT_DISABLE_COMPOSITING_MODE=1
  fi
  if [ -z "${LIBGL_ALWAYS_SOFTWARE+x}" ]; then
    export LIBGL_ALWAYS_SOFTWARE=1
  fi
fi
exec "$bin" "$@"
