Merge branch 'feature/transparent-bg-pipewire' into 'main'

pipewire: Add transparent background support for overlay composition

See merge request wayland/weston!1973
This commit is contained in:
Paul GOULPIÉ 2026-04-29 11:27:13 +00:00
commit 693bfafc08
3 changed files with 16 additions and 1 deletions

View file

@ -4244,6 +4244,7 @@ pipewire_backend_output_configure(struct weston_output *output)
struct weston_config *wc = wet_get_config(output->compositor);
struct weston_config_section *section;
char *gbm_format = NULL;
bool transparent_background = false;
int width;
int height;
int framerate = -1;
@ -4261,6 +4262,13 @@ pipewire_backend_output_configure(struct weston_output *output)
parsed_options);
weston_config_section_get_string(section, "gbm-format", &gbm_format, NULL);
weston_config_section_get_bool(section, "transparent-background",
&transparent_background, false);
if (transparent_background) {
free(gbm_format);
gbm_format = strdup("argb8888");
}
wet_output_set_scale(output, section, 1, 0);
weston_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL);

View file

@ -718,7 +718,12 @@ kiosk_shell_output_recreate_background(struct kiosk_shell_output *shoutput)
curtain_params.r = ((bg_color >> 16) & 0xff) / 255.0;
curtain_params.g = ((bg_color >> 8) & 0xff) / 255.0;
curtain_params.b = ((bg_color >> 0) & 0xff) / 255.0;
curtain_params.a = 1.0;
curtain_params.a = ((bg_color >> 24) & 0xff) / 255.0;
if (curtain_params.a == 0.0) {
shoutput->curtain = NULL;
return;
}
curtain_params.pos = output->pos;
curtain_params.width = output->width;

View file

@ -200,6 +200,8 @@ spa_video_format_from_drm_fourcc(uint32_t fourcc)
switch (fourcc) {
case DRM_FORMAT_XRGB8888:
return SPA_VIDEO_FORMAT_BGRx;
case DRM_FORMAT_ARGB8888:
return SPA_VIDEO_FORMAT_BGRA;
case DRM_FORMAT_RGB565:
return SPA_VIDEO_FORMAT_RGB16;
default: