diff options
Diffstat (limited to 'src/wayland/surface.c')
| -rw-r--r-- | src/wayland/surface.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/wayland/surface.c b/src/wayland/surface.c index 5138201..86f30a3 100644 --- a/src/wayland/surface.c +++ b/src/wayland/surface.c @@ -123,14 +123,13 @@ static bool display_arm(struct yasl_display *c) return had_pending; } -static bool display_has_immediate_work(const struct yasl_display *c) +static inline bool display_has_immediate_work(const struct yasl_display *c) { - if (!c || c->lost) return false; + if (unlikely(!c || c->lost)) return false; for (struct yasl_surface *w = c->surfaces; w; w = w->conn_next) { - if (w->closed) continue; - if (w->input.count > 0) - return true; - if (w->want_draw && !w->frame_cb && w->configured) + bool ready_draw = w->want_draw & (w->frame_cb == NULL) & w->configured; + bool has_input = (w->input.count > 0); + if (unlikely((ready_draw | has_input) & !w->closed)) return true; } return false; |
