| 381 | } |
| 382 | |
| 383 | void WindowImpl::ProcessEvents(bool block) |
| 384 | { |
| 385 | if (m_ownsWindow) |
| 386 | { |
| 387 | xcb_generic_event_t* event = nullptr; |
| 388 | |
| 389 | if (block) |
| 390 | { |
| 391 | event = xcb_wait_for_event(connection); |
| 392 | if (event) |
| 393 | { |
| 394 | UpdateEventQueue(event); |
| 395 | ProcessEvent(event); |
| 396 | } |
| 397 | } |
| 398 | else |
| 399 | { |
| 400 | event = xcb_poll_for_event(connection); |
| 401 | while (event) |
| 402 | { |
| 403 | UpdateEventQueue(event); |
| 404 | xcb_generic_event_t* tmp = xcb_poll_for_event(connection); |
| 405 | UpdateEventQueue(tmp); |
| 406 | ProcessEvent(event); |
| 407 | if (tmp) |
| 408 | ProcessEvent(tmp); |
| 409 | event = xcb_poll_for_event(connection); |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | void WindowImpl::SetCursor(const Cursor& cursor) |
| 416 | { |