XCB: simplify, fix assertion on grayscale displays