mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
screencast: skip duplicated format-modifier pairs
This commit is contained in:
parent
2219db7508
commit
e70a1efa43
1 changed files with 8 additions and 1 deletions
|
@ -548,8 +548,15 @@ static void wlr_remove_output(struct xdpw_wlr_output *out) {
|
|||
|
||||
static void wlr_format_modifier_pair_add(struct xdpw_screencast_context *ctx,
|
||||
uint32_t format, uint64_t modifier) {
|
||||
struct xdpw_format_modifier_pair *fm_pair = calloc(1, sizeof(struct xdpw_format_modifier_pair));
|
||||
struct xdpw_format_modifier_pair *fm_pair;
|
||||
wl_list_for_each(fm_pair, &ctx->format_modifier_pairs, link) {
|
||||
if (fm_pair->fourcc == format && fm_pair->modifier == modifier) {
|
||||
logprint(TRACE, "wlroots: skipping duplicated format %u (%lu)", fm_pair->fourcc, fm_pair->modifier);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fm_pair = calloc(1, sizeof(struct xdpw_format_modifier_pair));
|
||||
fm_pair->fourcc = format;
|
||||
fm_pair->modifier = modifier;
|
||||
|
||||
|
|
Loading…
Reference in a new issue