Skip to content

Commit

Permalink
handle scale for output width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickvP committed Feb 13, 2019
1 parent 8c98acc commit ae970ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ static void output_handle_mode(void *data, struct wl_output *wl_output,
uint32_t flags, int32_t width, int32_t height, int32_t refresh) {
struct slurp_output *output = data;

// todo: scale?
output->geometry.width = width;
output->geometry.height = height;
}
Expand All @@ -211,11 +210,16 @@ static void output_handle_scale(void *data, struct wl_output *wl_output,

output->scale = scale;
}
static void output_handle_done(void *data, struct wl_output *wl_output) {
struct slurp_output *output = data;
output->geometry.width /= output->scale;
output->geometry.height /= output->scale;
}

static const struct wl_output_listener output_listener = {
.geometry = output_handle_geometry,
.mode = output_handle_mode,
.done = noop,
.done = output_handle_done,
.scale = output_handle_scale,
};

Expand Down

0 comments on commit ae970ca

Please sign in to comment.