Frage

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?

War es hilfreich?

Lösung

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)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top