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 12, 2019
1 parent 3a85490 commit a0c40f7
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 @@ -203,7 +203,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 @@ -214,11 +213,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 a0c40f7

Please sign in to comment.