Merge pull request #896 from magcius/event-thread-bozo

Don't sleep in the event thread
This commit is contained in:
shuffle2 2014-09-04 19:33:49 -07:00
commit f09978ddeb
2 changed files with 64 additions and 72 deletions

View File

@ -57,8 +57,6 @@ void cX11Window::XEventThread()
while (win) while (win)
{ {
XEvent event; XEvent event;
for (int num_events = XPending(dpy); num_events > 0; num_events--)
{
XNextEvent(dpy, &event); XNextEvent(dpy, &event);
switch (event.type) switch (event.type)
{ {
@ -70,6 +68,4 @@ void cX11Window::XEventThread()
break; break;
} }
} }
Common::SleepCurrentThread(20);
}
} }

View File

@ -199,8 +199,6 @@ class PlatformX11 : public Platform
{ {
XEvent event; XEvent event;
KeySym key; KeySym key;
for (int num_events = XPending(dpy); num_events > 0; num_events--)
{
XNextEvent(dpy, &event); XNextEvent(dpy, &event);
switch (event.type) switch (event.type)
{ {
@ -265,7 +263,6 @@ class PlatformX11 : public Platform
running = false; running = false;
break; break;
} }
}
if (!fullscreen) if (!fullscreen)
{ {
Window winDummy; Window winDummy;
@ -277,7 +274,6 @@ class PlatformX11 : public Platform
(unsigned int *)&SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight, (unsigned int *)&SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight,
&borderDummy, &depthDummy); &borderDummy, &depthDummy);
} }
usleep(100000);
} }
} }