mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Don't sleep in the event thread
The person who wrote this seemed to misunderstand how XPending and XNextEvent actually work. XNextEvent will wait in poll if there's no event yet, meaning that we don't need to sleep after we process all the events; the kernel will sleep for us. This changes indentation, so view with -w or a similar feature to understand what's actually changed here.
This commit is contained in:
@ -57,8 +57,6 @@ void cX11Window::XEventThread()
|
||||
while (win)
|
||||
{
|
||||
XEvent event;
|
||||
for (int num_events = XPending(dpy); num_events > 0; num_events--)
|
||||
{
|
||||
XNextEvent(dpy, &event);
|
||||
switch (event.type)
|
||||
{
|
||||
@ -70,6 +68,4 @@ void cX11Window::XEventThread()
|
||||
break;
|
||||
}
|
||||
}
|
||||
Common::SleepCurrentThread(20);
|
||||
}
|
||||
}
|
||||
|
@ -199,8 +199,6 @@ class PlatformX11 : public Platform
|
||||
{
|
||||
XEvent event;
|
||||
KeySym key;
|
||||
for (int num_events = XPending(dpy); num_events > 0; num_events--)
|
||||
{
|
||||
XNextEvent(dpy, &event);
|
||||
switch (event.type)
|
||||
{
|
||||
@ -265,7 +263,6 @@ class PlatformX11 : public Platform
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!fullscreen)
|
||||
{
|
||||
Window winDummy;
|
||||
@ -277,7 +274,6 @@ class PlatformX11 : public Platform
|
||||
(unsigned int *)&SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight,
|
||||
&borderDummy, &depthDummy);
|
||||
}
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user