Temporary close handling for Xlib (needs a proper solution)

This commit is contained in:
2015-11-05 01:28:51 -08:00
parent 4a92735119
commit 1e5ae0c89b
4 changed files with 122 additions and 36 deletions

View File

@@ -45,20 +45,12 @@ static Window GetWindowOfEvent(XEvent* event, bool& windowEvent)
return event->xconfigure.window;
}
case KeyPress:
{
windowEvent = true;
return event->xkey.window;
}
case KeyRelease:
{
windowEvent = true;
return event->xkey.window;
}
case ButtonPress:
{
windowEvent = true;
return event->xbutton.window;
}
case ButtonRelease:
{
windowEvent = true;
@@ -69,6 +61,18 @@ static Window GetWindowOfEvent(XEvent* event, bool& windowEvent)
windowEvent = true;
return event->xmotion.window;
}
case EnterNotify:
case LeaveNotify:
{
windowEvent = true;
return event->xcrossing.window;
}
case FocusIn:
case FocusOut:
{
windowEvent = true;
return event->xfocus.window;
}
case GenericEvent:
{
if (event->xgeneric.extension == XINPUT_OPCODE)
@@ -223,12 +227,12 @@ public:
return 1;
/* Spawn client thread */
int clientReturn = 0;
int clientReturn = INT_MIN;
std::thread clientThread([&]()
{clientReturn = m_callback.appMain(this);});
/* Begin application event loop */
while (true)
while (clientReturn == INT_MIN)
{
fd_set fds;
FD_ZERO(&fds);