Skip to content

Commit

Permalink
fix invalid conditional statements at line 240. (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
MapoMagpie authored Mar 12, 2024
1 parent bf17503 commit 4ca3f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static void frame_handle_buffer(void *, struct zwlr_screencopy_frame_v1 *frame,
}

auto& buffer = buffers.capture();

auto old_format = buffer.format;
buffer.format = (wl_shm_format)format;
buffer.drm_format = wl_shm_to_drm_format(format);
buffer.width = width;
Expand All @@ -237,7 +237,7 @@ static void frame_handle_buffer(void *, struct zwlr_screencopy_frame_v1 *frame,
if (buffer.height % 2)
buffer.height -= 1;

if (!buffer.wl_buffer || buffer.format != format) {
if (!buffer.wl_buffer || old_format != format) {
free_shm_buffer(buffer);
buffer.wl_buffer =
create_shm_buffer(format, width, height, stride, &buffer.data);
Expand Down

0 comments on commit 4ca3f83

Please sign in to comment.