improve wait of x11 event to avoid blocking

This commit is contained in:
Jinhao
2019-09-11 00:10:11 +08:00
parent 02676e9c75
commit 0f66b0cb26
3 changed files with 117 additions and 19 deletions

View File

@@ -622,6 +622,7 @@ namespace detail
}
break;
case ConfigureNotify:
++(root_runtime->x11msg.config);
if(msgwnd->dimension.width != static_cast<unsigned>(xevent.xconfigure.width) || msgwnd->dimension.height != static_cast<unsigned>(xevent.xconfigure.height))
{
auto & cf = xevent.xconfigure;
@@ -890,7 +891,12 @@ namespace detail
case MapNotify:
case UnmapNotify:
if(xevent.type == MapNotify)
{
++(root_runtime->x11msg.map);
x11_apply_exposed_position(native_window);
}
else
++(root_runtime->x11msg.unmap);
brock.event_expose(msgwnd, (xevent.type == MapNotify));
context.platform.motion_window = nullptr;