Merge branch 'feature/primary' into master_jammy

This commit is contained in:
Victoria Brekenfeld 2022-07-18 17:43:37 +02:00
commit ed0104be01
5 changed files with 41 additions and 18 deletions

View file

@ -16,6 +16,7 @@ use smithay::{
wayland::{
data_device::set_data_device_focus,
output::Output,
primary_selection::set_primary_focus,
seat::{
keysyms, ButtonEvent, CursorImageStatus, FilterResult, KeysymHandle, MotionEvent, Seat,
XkbConfig,
@ -126,6 +127,8 @@ pub fn add_seat(dh: &DisplayHandle, name: String) -> Seat<State> {
focus.and_then(|s| dh_clone.get_client(s.id()).ok())
{
set_data_device_focus(&dh_clone, seat, Some(client));
let client2 = focus.and_then(|s| dh_clone.get_client(s.id()).ok()).unwrap();
set_primary_focus(&dh_clone, seat, Some(client2))
}
},
);

View file

@ -24,6 +24,7 @@ use smithay::{
data_device::DataDeviceState,
dmabuf::DmabufState,
output::{Mode as OutputMode, Output, OutputManagerState, Scale},
primary_selection::PrimarySelectionState,
seat::{Seat, SeatState},
shm::ShmState,
viewporter::ViewporterState,
@ -86,6 +87,7 @@ pub struct Common {
pub dmabuf_state: DmabufState,
pub output_state: OutputManagerState,
pub output_configuration_state: OutputConfigurationState<State>,
pub primary_selection_state: PrimarySelectionState,
pub seat_state: SeatState<State>,
pub shm_state: ShmState,
pub wl_drm_state: WlDrmState,
@ -213,6 +215,7 @@ impl State {
let dmabuf_state = DmabufState::new();
let output_state = OutputManagerState::new_with_xdg_output::<Self>(dh);
let output_configuration_state = OutputConfigurationState::new(dh, |_| true);
let primary_selection_state = PrimarySelectionState::new::<Self, _>(dh, None);
let shm_state = ShmState::new::<Self, _>(dh, vec![], None);
let seat_state = SeatState::<Self>::new();
let viewporter_state = ViewporterState::new::<Self, _>(dh, None);
@ -264,6 +267,7 @@ impl State {
seat_state,
output_state,
output_configuration_state,
primary_selection_state,
viewporter_state,
wl_drm_state,
},

View file

@ -7,6 +7,7 @@ pub mod dmabuf;
pub mod layer_shell;
pub mod output;
pub mod output_configuration;
pub mod primary_selection;
pub mod seat;
pub mod shm;
pub mod toplevel_info;

View file

@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
use crate::state::State;
use smithay::{
delegate_primary_selection,
wayland::primary_selection::{PrimarySelectionHandler, PrimarySelectionState},
};
impl PrimarySelectionHandler for State {
fn primary_selection_state(&self) -> &PrimarySelectionState {
&self.common.primary_selection_state
}
}
delegate_primary_selection!(State);