fix build issue for x and wayland environment