mirror of
https://codeberg.org/vyivel/dulcepan/
synced 2025-06-24 22:44:18 +03:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
f9665e2661 | |||
fccc2e2e97 |
@ -1,7 +1,7 @@
|
|||||||
project(
|
project(
|
||||||
'dulcepan',
|
'dulcepan',
|
||||||
'c',
|
'c',
|
||||||
version: '1.0.1',
|
version: '1.0.2',
|
||||||
license: 'GPL-3.0-only',
|
license: 'GPL-3.0-only',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
|
11
src/output.c
11
src/output.c
@ -79,6 +79,12 @@ static void frame_handle_buffer(void *data, struct zwlr_screencopy_frame_v1 *fra
|
|||||||
wl_buffer_destroy(output->frame_buffer);
|
wl_buffer_destroy(output->frame_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int32_t)width != output->width || (int32_t)height != output->height) {
|
||||||
|
dp_log_fatal("Output/buffer size mismatch: mode=%" PRIi32 "x%" PRIi32 ", buffer=%" PRIu32
|
||||||
|
"x%" PRIu32,
|
||||||
|
output->width, output->height, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
output->frame_format = format;
|
output->frame_format = format;
|
||||||
output->frame_stride = (int)stride;
|
output->frame_stride = (int)stride;
|
||||||
output->frame_buffer = dp_buffer_create(output->state, output->width, output->height,
|
output->frame_buffer = dp_buffer_create(output->state, output->width, output->height,
|
||||||
@ -156,6 +162,10 @@ static void output_handle_geometry(void *data, struct wl_output *wl_output, int3
|
|||||||
|
|
||||||
static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
|
static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
|
||||||
int32_t width, int32_t height, int32_t refresh) {
|
int32_t width, int32_t height, int32_t refresh) {
|
||||||
|
if ((flags & WL_OUTPUT_MODE_CURRENT) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct dp_output *output = data;
|
struct dp_output *output = data;
|
||||||
|
|
||||||
if (output->has_geom) {
|
if (output->has_geom) {
|
||||||
@ -178,6 +188,7 @@ static void output_handle_done(void *data, struct wl_output *wl_output) {
|
|||||||
|
|
||||||
assert(output->name != NULL);
|
assert(output->name != NULL);
|
||||||
|
|
||||||
|
assert(output->width > 0 && output->height > 0);
|
||||||
if ((output->transform & WL_OUTPUT_TRANSFORM_90) != 0) {
|
if ((output->transform & WL_OUTPUT_TRANSFORM_90) != 0) {
|
||||||
output->transformed_width = output->height;
|
output->transformed_width = output->height;
|
||||||
output->transformed_height = output->width;
|
output->transformed_height = output->width;
|
||||||
|
Reference in New Issue
Block a user