Expose wlr-data-control-unstable-v1 to non-sandboxed clients

Some users have complained about not supporting clipboard managers. But
this was possible, but hidden under the `COSMIC_DATA_CONTROL_ENABLED`
env var.

Since the security context protocol exists now to provide a way to not
expose a protocol like this to sandboxed clients, it should be safe to
expose this now.
This commit is contained in:
Ian Douglas Scott 2025-10-28 12:55:53 -07:00 committed by Victoria Brekenfeld
parent f82db23f4a
commit d2d7c655ac
2 changed files with 7 additions and 7 deletions

View file

@ -234,7 +234,7 @@ pub struct Common {
pub output_power_state: OutputPowerState, pub output_power_state: OutputPowerState,
pub presentation_state: PresentationState, pub presentation_state: PresentationState,
pub primary_selection_state: PrimarySelectionState, pub primary_selection_state: PrimarySelectionState,
pub data_control_state: Option<DataControlState>, pub data_control_state: DataControlState,
pub image_capture_source_state: ImageCaptureSourceState, pub image_capture_source_state: ImageCaptureSourceState,
pub screencopy_state: ScreencopyState, pub screencopy_state: ScreencopyState,
pub seat_state: SeatState<State>, pub seat_state: SeatState<State>,
@ -651,11 +651,11 @@ impl State {
let idle_inhibit_manager_state = IdleInhibitManagerState::new::<State>(dh); let idle_inhibit_manager_state = IdleInhibitManagerState::new::<State>(dh);
let idle_inhibiting_surfaces = HashSet::new(); let idle_inhibiting_surfaces = HashSet::new();
let data_control_state = crate::utils::env::bool_var("COSMIC_DATA_CONTROL_ENABLED") let data_control_state = DataControlState::new::<Self, _>(
.unwrap_or(false) dh,
.then(|| { Some(&primary_selection_state),
DataControlState::new::<Self, _>(dh, Some(&primary_selection_state), |_| true) client_not_sandboxed,
}); );
let shell = Arc::new(parking_lot::RwLock::new(Shell::new(&config))); let shell = Arc::new(parking_lot::RwLock::new(Shell::new(&config)));

View file

@ -8,7 +8,7 @@ use smithay::{
impl DataControlHandler for State { impl DataControlHandler for State {
fn data_control_state(&mut self) -> &mut DataControlState { fn data_control_state(&mut self) -> &mut DataControlState {
self.common.data_control_state.as_mut().unwrap() &mut self.common.data_control_state
} }
} }