Add ext-data-control-v1 protocol
This is identical to the wlr protocol, and Smithay has implementations for both. New clients should use the `ext` protocol where present. Not sure how widely used it is yet, but we probably should have both for now.
This commit is contained in:
parent
d2d7c655ac
commit
e814eebcc0
4 changed files with 32 additions and 6 deletions
19
src/state.rs
19
src/state.rs
|
|
@ -88,8 +88,10 @@ use smithay::{
|
||||||
seat::WaylandFocus,
|
seat::WaylandFocus,
|
||||||
security_context::{SecurityContext, SecurityContextState},
|
security_context::{SecurityContext, SecurityContextState},
|
||||||
selection::{
|
selection::{
|
||||||
data_device::DataDeviceState, primary_selection::PrimarySelectionState,
|
data_device::DataDeviceState,
|
||||||
wlr_data_control::DataControlState,
|
ext_data_control::DataControlState as ExtDataControlState,
|
||||||
|
primary_selection::PrimarySelectionState,
|
||||||
|
wlr_data_control::DataControlState as WlrDataControlState,
|
||||||
},
|
},
|
||||||
session_lock::SessionLockManagerState,
|
session_lock::SessionLockManagerState,
|
||||||
shell::{
|
shell::{
|
||||||
|
|
@ -234,7 +236,8 @@ 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: DataControlState,
|
pub ext_data_control_state: ExtDataControlState,
|
||||||
|
pub wlr_data_control_state: WlrDataControlState,
|
||||||
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,7 +654,12 @@ 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 = DataControlState::new::<Self, _>(
|
let ext_data_control_state = ExtDataControlState::new::<Self, _>(
|
||||||
|
dh,
|
||||||
|
Some(&primary_selection_state),
|
||||||
|
client_not_sandboxed,
|
||||||
|
);
|
||||||
|
let wlr_data_control_state = WlrDataControlState::new::<Self, _>(
|
||||||
dh,
|
dh,
|
||||||
Some(&primary_selection_state),
|
Some(&primary_selection_state),
|
||||||
client_not_sandboxed,
|
client_not_sandboxed,
|
||||||
|
|
@ -737,7 +745,8 @@ impl State {
|
||||||
overlap_notify_state,
|
overlap_notify_state,
|
||||||
presentation_state,
|
presentation_state,
|
||||||
primary_selection_state,
|
primary_selection_state,
|
||||||
data_control_state,
|
ext_data_control_state,
|
||||||
|
wlr_data_control_state,
|
||||||
viewporter_state,
|
viewporter_state,
|
||||||
wl_drm_state,
|
wl_drm_state,
|
||||||
kde_decoration_state,
|
kde_decoration_state,
|
||||||
|
|
|
||||||
13
src/wayland/handlers/data_control/ext.rs
Normal file
13
src/wayland/handlers/data_control/ext.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
use crate::state::State;
|
||||||
|
use smithay::{
|
||||||
|
delegate_ext_data_control,
|
||||||
|
wayland::selection::ext_data_control::{DataControlHandler, DataControlState},
|
||||||
|
};
|
||||||
|
|
||||||
|
impl DataControlHandler for State {
|
||||||
|
fn data_control_state(&mut self) -> &mut DataControlState {
|
||||||
|
&mut self.common.ext_data_control_state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate_ext_data_control!(State);
|
||||||
4
src/wayland/handlers/data_control/mod.rs
Normal file
4
src/wayland/handlers/data_control/mod.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
|
mod ext;
|
||||||
|
mod wlr;
|
||||||
|
|
@ -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 {
|
||||||
&mut self.common.data_control_state
|
&mut self.common.wlr_data_control_state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue