mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
client: reject prepare_read if the display queue has events
The display queue is dispatched when and only when any other queue is dispatched. Therefore, a client that only ever dispatches in response to prepare_read returning -1 would never dispatch wl_display.error events. Signed-off-by: Julian Orth <ju.orth@gmail.com>
This commit is contained in:
parent
1ab6b693b1
commit
b43b06d31c
1 changed files with 4 additions and 1 deletions
|
|
@ -1898,10 +1898,13 @@ wl_display_prepare_read_queue(struct wl_display *display,
|
||||||
struct wl_event_queue *queue)
|
struct wl_event_queue *queue)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
bool has_events;
|
||||||
|
|
||||||
pthread_mutex_lock(&display->mutex);
|
pthread_mutex_lock(&display->mutex);
|
||||||
|
|
||||||
if (!wl_list_empty(&queue->event_list)) {
|
has_events = !wl_list_empty(&queue->event_list) ||
|
||||||
|
!wl_list_empty(&display->display_queue.event_list);
|
||||||
|
if (has_events) {
|
||||||
errno = EAGAIN;
|
errno = EAGAIN;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue