The evdpy should be used for the X11 window creation and in the event

thread.  dpy should only be used for GL.
This commit is contained in:
Glenn Rice 2013-04-25 23:41:45 -05:00
parent 3b732f695d
commit 03dfe7b816
1 changed files with 7 additions and 7 deletions

View File

@ -157,7 +157,7 @@ void cX11Window::CreateXWindow(void)
void cX11Window::DestroyXWindow(void) void cX11Window::DestroyXWindow(void)
{ {
XUnmapWindow(GLWin.dpy, GLWin.win); XUnmapWindow(GLWin.evdpy, GLWin.win);
GLWin.win = 0; GLWin.win = 0;
if (GLWin.xEventThread.joinable()) if (GLWin.xEventThread.joinable())
GLWin.xEventThread.join(); GLWin.xEventThread.join();
@ -175,9 +175,9 @@ void cX11Window::XEventThread()
{ {
XEvent event; XEvent event;
KeySym key; KeySym key;
for (int num_events = XPending(GLWin.dpy); num_events > 0; num_events--) for (int num_events = XPending(GLWin.evdpy); num_events > 0; num_events--)
{ {
XNextEvent(GLWin.dpy, &event); XNextEvent(GLWin.evdpy, &event);
switch(event.type) { switch(event.type) {
case KeyPress: case KeyPress:
key = XLookupKeysym((XKeyEvent*)&event, 0); key = XLookupKeysym((XKeyEvent*)&event, 0);
@ -305,17 +305,17 @@ void cX11Window::XEventThread()
case ConfigureNotify: case ConfigureNotify:
Window winDummy; Window winDummy;
unsigned int borderDummy, depthDummy; unsigned int borderDummy, depthDummy;
XGetGeometry(GLWin.dpy, GLWin.win, &winDummy, &GLWin.x, &GLWin.y, XGetGeometry(GLWin.evdpy, GLWin.win, &winDummy, &GLWin.x, &GLWin.y,
&GLWin.width, &GLWin.height, &borderDummy, &depthDummy); &GLWin.width, &GLWin.height, &borderDummy, &depthDummy);
GLInterface->SetBackBufferDimensions(GLWin.width, GLWin.height); GLInterface->SetBackBufferDimensions(GLWin.width, GLWin.height);
break; break;
case ClientMessage: case ClientMessage:
if ((unsigned long) event.xclient.data.l[0] == if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.dpy, "WM_DELETE_WINDOW", False)) XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", False))
Host_Message(WM_USER_STOP); Host_Message(WM_USER_STOP);
if ((unsigned long) event.xclient.data.l[0] == if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.dpy, "RESIZE", False)) XInternAtom(GLWin.evdpy, "RESIZE", False))
XMoveResizeWindow(GLWin.dpy, GLWin.win, XMoveResizeWindow(GLWin.evdpy, GLWin.win,
event.xclient.data.l[1], event.xclient.data.l[2], event.xclient.data.l[1], event.xclient.data.l[2],
event.xclient.data.l[3], event.xclient.data.l[4]); event.xclient.data.l[3], event.xclient.data.l[4]);
break; break;