Skip to content

Commit

Permalink
data-control: Directly reference server in receive_context
Browse files Browse the repository at this point in the history
The data_control reference was only used to get to the server.
  • Loading branch information
layercak3 authored and any1 committed Sep 18, 2024
1 parent aa8a8d3 commit 607bbaf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/data-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
static const char custom_mime_type_data[] = "wayvnc";

struct receive_context {
struct data_control* data_control;
struct nvnc* server;
struct aml_handler* handler;
LIST_ENTRY(receive_context) link;
struct zwlr_data_control_offer_v1* offer;
Expand Down Expand Up @@ -71,8 +71,7 @@ static void on_receive(void* handler)
ctx->mem_fp = NULL;

if (ctx->mem_size)
nvnc_send_cut_text(ctx->data_control->server, ctx->mem_data,
ctx->mem_size);
nvnc_send_cut_text(ctx->server, ctx->mem_data, ctx->mem_size);

destroy_receive_context(ctx);
}
Expand Down Expand Up @@ -103,7 +102,7 @@ static void receive_data(void* data,
close(pipe_fd[1]);

ctx->fd = pipe_fd[0];
ctx->data_control = self;
ctx->server = self->server;
ctx->offer = offer;
ctx->mem_fp = open_memstream(&ctx->mem_data, &ctx->mem_size);
if (!ctx->mem_fp) {
Expand Down

0 comments on commit 607bbaf

Please sign in to comment.