简体   繁体   English

Display是否在X11中的每个窗口都是唯一的?

[英]Is Display unique for every window in X11?

I'm a beginner to X11, i created a class just to create,show and destroy the window. 我是X11的初学者,我创建了一个仅用于创建,显示和销毁窗口的类。 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? 在构造函数中,我为Window,Display等创建变量,但是我是否需要为创建的每个Window创建Display,还是应该对所有窗口使用相同的Display?



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. 如果它在同一系统上-同一GPU,则可以,您可以使用同一Display。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM