I'm a beginner to X11, i created a class just to create,show and destroy the window. In the Constructor i create variables for Window,Display etc, But do i need to create Display for every Window o create or shall i use the same Display for all windows?
class Widget
{
public:
Widget();
void createWidget(int x,int y,int w,int h);
void showWidget();
void destroyWidget();
private:
Display *disp;
int screenNumber;
unsigned long white;
unsigned long black;
Window win;
XEvent evt;
long eventMask;
};
对您的应用程序中的所有Windows使用一个Display。
That depends on where you want to create the window. If it is on the same system - same GPU, then yes, you can use the same Display.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.