Skip to content

Commit

Permalink
title_bar: Hide screen share when user doesn't have the permission (#…
Browse files Browse the repository at this point in the history
…25192)

On macos: 
- user has the required permission to screen share. 
- user doesn't have the can_use_microphone permission


When an user doesn't have the can_use_microphone permission the screen
share icon would be visible. If an user therefor would click on it, we
would give the error that they don't have the permission given to zed to
screen share. (which is false).

I've tested this together with @JosephTLyons because we first thought it
was a mac os permission issue.

Should we mention in the zed.dev/docs/collaboration what kind of
permissions are needed to be able to screen share?

Release Notes:

- Fixed: Screen sharing would be visible even when user didn't have the
right permission resulting in errors later on.
  • Loading branch information
devzeth authored Feb 21, 2025
1 parent 59a153b commit 2d6592d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions crates/title_bar/src/collab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,25 +428,25 @@ impl TitleBar {
.on_click(move |_, _, cx| toggle_deafen(&Default::default(), cx))
.into_any_element(),
);
}

if screen_sharing_supported {
children.push(
IconButton::new("screen-share", ui::IconName::Screen)
.style(ButtonStyle::Subtle)
.icon_size(IconSize::Small)
.toggle_state(is_screen_sharing)
.selected_style(ButtonStyle::Tinted(TintColor::Accent))
.tooltip(Tooltip::text(if is_screen_sharing {
"Stop Sharing Screen"
} else {
"Share Screen"
}))
.on_click(move |_, window, cx| {
toggle_screen_sharing(&Default::default(), window, cx)
})
.into_any_element(),
);
if screen_sharing_supported {
children.push(
IconButton::new("screen-share", ui::IconName::Screen)
.style(ButtonStyle::Subtle)
.icon_size(IconSize::Small)
.toggle_state(is_screen_sharing)
.selected_style(ButtonStyle::Tinted(TintColor::Accent))
.tooltip(Tooltip::text(if is_screen_sharing {
"Stop Sharing Screen"
} else {
"Share Screen"
}))
.on_click(move |_, window, cx| {
toggle_screen_sharing(&Default::default(), window, cx)
})
.into_any_element(),
);
}
}

children.push(div().pr_2().into_any_element());
Expand Down

0 comments on commit 2d6592d

Please sign in to comment.