Check for g_wayland in every API call.