Skip to content

Commit

Permalink
data-control: Remove unnecessary wl_display_flush()
Browse files Browse the repository at this point in the history
This was only necessary in the initial version of the file where offer
handling was synchronous.
  • Loading branch information
layercak3 committed Sep 23, 2024
1 parent 66dec3c commit 1ed5c5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/data-control.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ struct data_control {
size_t cb_len;
};

void data_control_init(struct data_control* self, struct wl_display* wl_display, struct nvnc* server, struct wl_seat* seat);
void data_control_init(struct data_control* self, struct nvnc* server, struct wl_seat* seat);
void data_control_destroy(struct data_control* self);
void data_control_to_clipboard(struct data_control* self, const char* text, size_t len);
4 changes: 1 addition & 3 deletions src/data-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ static void receive_data(void* data,
}

zwlr_data_control_offer_v1_receive(offer, self->mime_type, pipe_fd[1]);
wl_display_flush(self->wl_display);
close(pipe_fd[1]);

ctx->fd = pipe_fd[0];
Expand Down Expand Up @@ -401,9 +400,8 @@ static struct zwlr_data_control_source_v1* set_selection(struct data_control* se
return selection;
}

void data_control_init(struct data_control* self, struct wl_display* wl_display, struct nvnc* server, struct wl_seat* seat)
void data_control_init(struct data_control* self, struct nvnc* server, struct wl_seat* seat)
{
self->wl_display = wl_display;
self->server = server;
LIST_INIT(&self->receive_contexts);
LIST_INIT(&self->send_contexts);
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ static void client_init_data_control(struct wayvnc_client* self)
return;

self->data_control.manager = wayvnc->data_control_manager;
data_control_init(&self->data_control, wayvnc->display, wayvnc->nvnc,
data_control_init(&self->data_control, wayvnc->nvnc,
self->seat->wl_seat);
}

Expand Down

0 comments on commit 1ed5c5f

Please sign in to comment.