문제

Due to XIM and XFT usage, I have to use XDisplay sometimes in my XCB based code.

My question, should I open display at the beginning of my program, and close it at end. Or open and close every time I need to use it?

도움이 되었습니까?

해결책

It is better to open once the XDisplay. At least that is the common practice.

IIRC, XOpenDisplay involves setting up a TCP connect to the X11 server and having a few exchanges to initialize, e.g. for X11 atoms which became standard but not predefined (I'm not sure of the last point)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top