Skip to content

Commit d2d7c65

Browse files
ids1024Drakulix
authored andcommitted
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.
1 parent f82db23 commit d2d7c65

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/state.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub struct Common {
234234
pub output_power_state: OutputPowerState,
235235
pub presentation_state: PresentationState,
236236
pub primary_selection_state: PrimarySelectionState,
237-
pub data_control_state: Option<DataControlState>,
237+
pub data_control_state: DataControlState,
238238
pub image_capture_source_state: ImageCaptureSourceState,
239239
pub screencopy_state: ScreencopyState,
240240
pub seat_state: SeatState<State>,
@@ -651,11 +651,11 @@ impl State {
651651
let idle_inhibit_manager_state = IdleInhibitManagerState::new::<State>(dh);
652652
let idle_inhibiting_surfaces = HashSet::new();
653653

654-
let data_control_state = crate::utils::env::bool_var("COSMIC_DATA_CONTROL_ENABLED")
655-
.unwrap_or(false)
656-
.then(|| {
657-
DataControlState::new::<Self, _>(dh, Some(&primary_selection_state), |_| true)
658-
});
654+
let data_control_state = DataControlState::new::<Self, _>(
655+
dh,
656+
Some(&primary_selection_state),
657+
client_not_sandboxed,
658+
);
659659

660660
let shell = Arc::new(parking_lot::RwLock::new(Shell::new(&config)));
661661

src/wayland/handlers/data_control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use smithay::{
88

99
impl DataControlHandler for State {
1010
fn data_control_state(&mut self) -> &mut DataControlState {
11-
self.common.data_control_state.as_mut().unwrap()
11+
&mut self.common.data_control_state
1212
}
1313
}
1414

0 commit comments

Comments
 (0)