Platform/Unix/X11Display.cpp: Minor cleanup.
This commit is contained in:
parent
f5d80aa46f
commit
61b233f708
1 changed files with 7 additions and 4 deletions
|
|
@ -24,6 +24,8 @@ bool X11Display::create(DisplayDescription description)
|
|||
XSetWindowAttributes attr;
|
||||
XVisualInfo* vi;
|
||||
Atom protocols;
|
||||
Visual* visual;
|
||||
Window root_win;
|
||||
|
||||
m_disp = XGetDisplay();
|
||||
if (m_disp == NULL) {
|
||||
|
|
@ -32,21 +34,22 @@ bool X11Display::create(DisplayDescription description)
|
|||
}
|
||||
|
||||
m_screen = DefaultScreen(m_disp);
|
||||
root_win = XRootWindow(m_disp, m_screen);
|
||||
visual = DefaultVisual(m_disp, m_screen);
|
||||
|
||||
attr.border_pixel = BlackPixel(m_disp, m_screen);
|
||||
attr.background_pixel = WhitePixel(m_disp, m_screen);
|
||||
//attr.override_redirect = True;
|
||||
attr.colormap = ::XCreateColormap(m_disp, RootWindow(m_disp, m_screen), DefaultVisual(m_disp, m_screen), AllocNone);
|
||||
attr.colormap = ::XCreateColormap(m_disp, root_win, visual, AllocNone);
|
||||
// We want Keyboard,Mouse,Resize,Exposure (repaint) events.
|
||||
attr.event_mask = KeyPressMask | KeyReleaseMask
|
||||
| ButtonPressMask | ButtonReleaseMask | PointerMotionMask
|
||||
| StructureNotifyMask | ExposureMask;
|
||||
|
||||
m_win = XCreateWindow(m_disp,
|
||||
RootWindow(m_disp, m_screen),
|
||||
m_win = XCreateWindow(m_disp, root_win,
|
||||
0, 0,
|
||||
m_size.x, m_size.y, 0, DefaultDepth(m_disp, m_screen),
|
||||
InputOutput, DefaultVisual(m_disp, m_screen),
|
||||
InputOutput, visual,
|
||||
CWBackPixel | CWColormap | CWBorderPixel | CWEventMask, &attr);
|
||||
|
||||
// Register event handler
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue