app/internal/window: replace ppoll with poll

We're about to add FreeBSD where ppoll is not supported.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-30 13:44:07 +01:00
parent c131a7f423
commit 1cc1fb1c72
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -783,8 +783,8 @@ loop:
}
// Clear poll events.
dispFd.Revents = 0
if _, err := syscall.Ppoll(pollfds, nil, nil); err != nil && err != syscall.EINTR {
panic(fmt.Errorf("ppoll failed: %v", err))
if _, err := syscall.Poll(pollfds, -1); err != nil && err != syscall.EINTR {
panic(fmt.Errorf("poll failed: %v", err))
}
redraw := false
// Clear notifications.
+2 -2
View File
@@ -141,7 +141,7 @@ loop:
var syn, redraw bool
// Check for pending draw events before checking animation or blocking.
// This fixes an issue on Xephyr where on startup XPending() > 0 but
// Ppoll will still block. This also prevents no-op calls to Ppoll.
// poll will still block. This also prevents no-op calls to poll.
if syn = h.handleEvents(); !syn {
w.mu.Lock()
animating := w.animating
@@ -152,7 +152,7 @@ loop:
// Clear poll events.
*xEvents = 0
// Wait for X event or gio notification.
if _, err := syscall.Ppoll(pollfds, nil, nil); err != nil && err != syscall.EINTR {
if _, err := syscall.Poll(pollfds, -1); err != nil && err != syscall.EINTR {
panic(fmt.Errorf("x11 loop: poll failed: %w", err))
}
switch {