Advertisement
Guest User

Untitled

a guest
May 21st, 2024
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. void Window::poll_events() {
  2.     while (wl_display_prepare_read(_display.get())) {
  3.         wl_display_dispatch_pending(_display.get());
  4.     }
  5.     while (wl_display_flush(_display.get()) < 0 && errno == EAGAIN) {
  6.  
  7.     }
  8.     wl_display_read_events(_display.get());
  9.     wl_display_dispatch_pending(_display.get());
  10.  
  11.     if (wl_display_get_error(_display.get())) {
  12.         throw std::runtime_error("Wayland protocol error");
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement