Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
surface: ignore viewport src rect on NULL buffer
Browse files Browse the repository at this point in the history
According to the viewporter protocol:

> If the wl_buffer is NULL, the surface has no content and therefore no size.
  • Loading branch information
emersion authored and ddevault committed Jun 18, 2020
1 parent c18c419 commit d177abe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions types/wlr_surface.c
Expand Up @@ -147,6 +147,11 @@ static void surface_set_input_region(struct wl_client *client,
*/
static void surface_state_viewport_src_size(struct wlr_surface_state *state,
int *out_width, int *out_height) {
if (state->buffer_width == 0 && state->buffer_height == 0) {
*out_width = *out_height = 0;
return;
}

if (state->viewport.has_src) {
*out_width = state->viewport.src.width;
*out_height = state->viewport.src.height;
Expand Down

0 comments on commit d177abe

Please sign in to comment.