Skip to content

Commit

Permalink
screencast: fix SelectSources type bitmask check
Browse files Browse the repository at this point in the history
In the same vein as aff78ae, `WINDOW`
is the value and not the index in the bitmask. But additionally, as I
understand it, a "non-monitor" source type would be one that lacks
`MONITOR` rather than one that includes `WINDOW` (or `VIRTUAL`) at all.

Technically this is a change in behavior since previously `WINDOW`-only
source types were accepted but treated as `MONITOR` source types, and
those will now be rejected (as only `VIRTUAL` source types were
technically checked by mistake due to the bitmask value/index checking
bug).
  • Loading branch information
lilyinstarlight authored and emersion committed May 22, 2024
1 parent 0776565 commit d9ada84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/screencast/screencast.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static int method_screencast_select_sources(sd_bus_message *msg, void *data,
} else if (strcmp(key, "types") == 0) {
uint32_t mask;
sd_bus_message_read(msg, "v", "u", &mask);
if (mask & (1<<WINDOW)) {
if (!(mask & MONITOR)) {
logprint(INFO, "dbus: non-monitor cast requested, not replying");
return -1;
}
Expand Down

0 comments on commit d9ada84

Please sign in to comment.