Remove #if 0
Better visibility checking.
Change render loop to use timer for smoother drm rendering as well.
Formatting
Fix x11 pending state.