Merge pull request #219 from mahkoh/jorth/duplicate-kb-events
all: add missing object tracking
This commit is contained in:
commit
136e6e7240
54 changed files with 190 additions and 178 deletions
|
|
@ -84,10 +84,10 @@ pub struct MetalDrmDevice {
|
||||||
pub crtcs: AHashMap<DrmCrtc, Rc<MetalCrtc>>,
|
pub crtcs: AHashMap<DrmCrtc, Rc<MetalCrtc>>,
|
||||||
pub encoders: AHashMap<DrmEncoder, Rc<MetalEncoder>>,
|
pub encoders: AHashMap<DrmEncoder, Rc<MetalEncoder>>,
|
||||||
pub planes: AHashMap<DrmPlane, Rc<MetalPlane>>,
|
pub planes: AHashMap<DrmPlane, Rc<MetalPlane>>,
|
||||||
pub min_width: u32,
|
pub _min_width: u32,
|
||||||
pub max_width: u32,
|
pub _max_width: u32,
|
||||||
pub min_height: u32,
|
pub _min_height: u32,
|
||||||
pub max_height: u32,
|
pub _max_height: u32,
|
||||||
pub cursor_width: u64,
|
pub cursor_width: u64,
|
||||||
pub cursor_height: u64,
|
pub cursor_height: u64,
|
||||||
pub gbm: GbmDevice,
|
pub gbm: GbmDevice,
|
||||||
|
|
@ -308,7 +308,7 @@ pub struct ConnectorDisplayData {
|
||||||
pub connection: ConnectorStatus,
|
pub connection: ConnectorStatus,
|
||||||
pub mm_width: u32,
|
pub mm_width: u32,
|
||||||
pub mm_height: u32,
|
pub mm_height: u32,
|
||||||
pub subpixel: u32,
|
pub _subpixel: u32,
|
||||||
|
|
||||||
pub connector_type: ConnectorType,
|
pub connector_type: ConnectorType,
|
||||||
pub connector_type_id: u32,
|
pub connector_type_id: u32,
|
||||||
|
|
@ -535,7 +535,7 @@ impl HardwareCursor for MetalHardwareCursor {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ConnectorFutures {
|
pub struct ConnectorFutures {
|
||||||
pub present: SpawnedFuture<()>,
|
pub _present: SpawnedFuture<()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Debug for ConnectorFutures {
|
impl Debug for ConnectorFutures {
|
||||||
|
|
@ -1272,7 +1272,7 @@ impl Connector for MetalConnector {
|
||||||
pub struct MetalCrtc {
|
pub struct MetalCrtc {
|
||||||
pub id: DrmCrtc,
|
pub id: DrmCrtc,
|
||||||
pub idx: usize,
|
pub idx: usize,
|
||||||
pub master: Rc<DrmMaster>,
|
pub _master: Rc<DrmMaster>,
|
||||||
|
|
||||||
pub lease: Cell<Option<MetalLeaseId>>,
|
pub lease: Cell<Option<MetalLeaseId>>,
|
||||||
|
|
||||||
|
|
@ -1314,7 +1314,7 @@ pub struct PlaneFormat {
|
||||||
|
|
||||||
pub struct MetalPlane {
|
pub struct MetalPlane {
|
||||||
pub id: DrmPlane,
|
pub id: DrmPlane,
|
||||||
pub master: Rc<DrmMaster>,
|
pub _master: Rc<DrmMaster>,
|
||||||
|
|
||||||
pub ty: PlaneType,
|
pub ty: PlaneType,
|
||||||
|
|
||||||
|
|
@ -1417,7 +1417,7 @@ fn create_connector(
|
||||||
next_flip_nsec: Cell::new(0),
|
next_flip_nsec: Cell::new(0),
|
||||||
});
|
});
|
||||||
let futures = ConnectorFutures {
|
let futures = ConnectorFutures {
|
||||||
present: backend
|
_present: backend
|
||||||
.state
|
.state
|
||||||
.eng
|
.eng
|
||||||
.spawn2(Phase::Present, slf.clone().present_loop()),
|
.spawn2(Phase::Present, slf.clone().present_loop()),
|
||||||
|
|
@ -1530,7 +1530,7 @@ fn create_connector_display_data(
|
||||||
connection,
|
connection,
|
||||||
mm_width: info.mm_width,
|
mm_width: info.mm_width,
|
||||||
mm_height: info.mm_height,
|
mm_height: info.mm_height,
|
||||||
subpixel: info.subpixel,
|
_subpixel: info.subpixel,
|
||||||
connector_type,
|
connector_type,
|
||||||
connector_type_id: info.connector_type_id,
|
connector_type_id: info.connector_type_id,
|
||||||
})
|
})
|
||||||
|
|
@ -1571,7 +1571,7 @@ fn create_crtc(
|
||||||
Ok(MetalCrtc {
|
Ok(MetalCrtc {
|
||||||
id: crtc,
|
id: crtc,
|
||||||
idx,
|
idx,
|
||||||
master: master.clone(),
|
_master: master.clone(),
|
||||||
lease: Cell::new(None),
|
lease: Cell::new(None),
|
||||||
possible_planes,
|
possible_planes,
|
||||||
connector: Default::default(),
|
connector: Default::default(),
|
||||||
|
|
@ -1639,7 +1639,7 @@ fn create_plane(plane: DrmPlane, master: &Rc<DrmMaster>) -> Result<MetalPlane, D
|
||||||
};
|
};
|
||||||
Ok(MetalPlane {
|
Ok(MetalPlane {
|
||||||
id: plane,
|
id: plane,
|
||||||
master: master.clone(),
|
_master: master.clone(),
|
||||||
ty,
|
ty,
|
||||||
possible_crtcs: info.possible_crtcs,
|
possible_crtcs: info.possible_crtcs,
|
||||||
formats,
|
formats,
|
||||||
|
|
@ -2025,10 +2025,10 @@ impl MetalBackend {
|
||||||
crtcs,
|
crtcs,
|
||||||
encoders,
|
encoders,
|
||||||
planes,
|
planes,
|
||||||
min_width: resources.min_width,
|
_min_width: resources.min_width,
|
||||||
max_width: resources.max_width,
|
_max_width: resources.max_width,
|
||||||
min_height: resources.min_height,
|
_min_height: resources.min_height,
|
||||||
max_height: resources.max_height,
|
_max_height: resources.max_height,
|
||||||
cursor_width,
|
cursor_width,
|
||||||
cursor_height,
|
cursor_height,
|
||||||
gbm,
|
gbm,
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<XBackend>, XBackendError> {
|
||||||
{
|
{
|
||||||
return Err(XBackendError::EnableXkb(e));
|
return Err(XBackendError::EnableXkb(e));
|
||||||
}
|
}
|
||||||
let root = c.setup().screens[0].root;
|
let root = c.root_window();
|
||||||
let drm = {
|
let drm = {
|
||||||
let res = c
|
let res = c
|
||||||
.call(&Dri3Open {
|
.call(&Dri3Open {
|
||||||
|
|
@ -215,7 +215,7 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<XBackend>, XBackendError> {
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
let se = XiSelectEvents {
|
let se = XiSelectEvents {
|
||||||
window: c.setup().screens[0].root,
|
window: c.root_window(),
|
||||||
masks: Cow::Borrowed(&[XiEventMask {
|
masks: Cow::Borrowed(&[XiEventMask {
|
||||||
deviceid: INPUT_DEVICE_ALL,
|
deviceid: INPUT_DEVICE_ALL,
|
||||||
mask: &[XI_EVENT_MASK_HIERARCHY],
|
mask: &[XI_EVENT_MASK_HIERARCHY],
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ pub trait RequestParser<'a>: Debug + Sized {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PidInfo {
|
pub struct PidInfo {
|
||||||
pub uid: c::uid_t,
|
pub _uid: c::uid_t,
|
||||||
pub pid: c::pid_t,
|
pub pid: c::pid_t,
|
||||||
pub comm: String,
|
pub comm: String,
|
||||||
}
|
}
|
||||||
|
|
@ -525,5 +525,9 @@ fn get_pid_info(uid: c::uid_t, pid: c::pid_t) -> PidInfo {
|
||||||
"Unknown".to_string()
|
"Unknown".to_string()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
PidInfo { uid, pid, comm }
|
PidInfo {
|
||||||
|
_uid: uid,
|
||||||
|
pid,
|
||||||
|
comm,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
src/edid.rs
20
src/edid.rs
|
|
@ -30,6 +30,7 @@ pub enum DigitalVideoInterfaceStandard {
|
||||||
HdmiB,
|
HdmiB,
|
||||||
MDDI,
|
MDDI,
|
||||||
DisplayPort,
|
DisplayPort,
|
||||||
|
#[allow(dead_code)]
|
||||||
Unknown(u8),
|
Unknown(u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ impl Debug for SignalLevelStandard {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum VideoInputDefinition {
|
pub enum VideoInputDefinition {
|
||||||
Analog {
|
Analog {
|
||||||
signal_level_standard: SignalLevelStandard,
|
signal_level_standard: SignalLevelStandard,
|
||||||
|
|
@ -73,6 +75,7 @@ pub struct ScreenDimensions {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct ChromaticityCoordinates {
|
pub struct ChromaticityCoordinates {
|
||||||
pub red_x: u16,
|
pub red_x: u16,
|
||||||
pub red_y: u16,
|
pub red_y: u16,
|
||||||
|
|
@ -85,6 +88,7 @@ pub struct ChromaticityCoordinates {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct EstablishedTimings {
|
pub struct EstablishedTimings {
|
||||||
pub s_720x400_70: bool,
|
pub s_720x400_70: bool,
|
||||||
pub s_720x400_88: bool,
|
pub s_720x400_88: bool,
|
||||||
|
|
@ -115,6 +119,7 @@ pub enum AspectRatio {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct StandardTiming {
|
pub struct StandardTiming {
|
||||||
pub x_resolution: u16,
|
pub x_resolution: u16,
|
||||||
pub aspect_ratio: AspectRatio,
|
pub aspect_ratio: AspectRatio,
|
||||||
|
|
@ -128,6 +133,7 @@ pub enum AnalogSyncType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum SyncSignal {
|
pub enum SyncSignal {
|
||||||
Analog {
|
Analog {
|
||||||
ty: AnalogSyncType,
|
ty: AnalogSyncType,
|
||||||
|
|
@ -179,6 +185,7 @@ impl Debug for StereoViewingSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct DisplayRangeLimitsAndAdditionalTiming {
|
pub struct DisplayRangeLimitsAndAdditionalTiming {
|
||||||
pub vertical_field_rate_min: u16,
|
pub vertical_field_rate_min: u16,
|
||||||
pub vertical_field_rate_max: u16,
|
pub vertical_field_rate_max: u16,
|
||||||
|
|
@ -195,10 +202,12 @@ pub enum AspectRatioPreference {
|
||||||
A16_10,
|
A16_10,
|
||||||
A5_4,
|
A5_4,
|
||||||
A15_9,
|
A15_9,
|
||||||
|
#[allow(dead_code)]
|
||||||
Unknown(u8),
|
Unknown(u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum ExtendedTimingInformation {
|
pub enum ExtendedTimingInformation {
|
||||||
DefaultGtf,
|
DefaultGtf,
|
||||||
NoTimingInformation,
|
NoTimingInformation,
|
||||||
|
|
@ -232,6 +241,7 @@ pub enum ExtendedTimingInformation {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct ColorPoint {
|
pub struct ColorPoint {
|
||||||
pub white_point_index: u8,
|
pub white_point_index: u8,
|
||||||
pub white_point_x: u16,
|
pub white_point_x: u16,
|
||||||
|
|
@ -240,6 +250,7 @@ pub struct ColorPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct EstablishedTimings3 {
|
pub struct EstablishedTimings3 {
|
||||||
pub s640x350_85: bool,
|
pub s640x350_85: bool,
|
||||||
pub s640x400_85: bool,
|
pub s640x400_85: bool,
|
||||||
|
|
@ -288,6 +299,7 @@ pub struct EstablishedTimings3 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct ColorManagementData {
|
pub struct ColorManagementData {
|
||||||
pub red_a3: u16,
|
pub red_a3: u16,
|
||||||
pub red_a2: u16,
|
pub red_a2: u16,
|
||||||
|
|
@ -314,6 +326,7 @@ pub enum CvtPreferredVerticalRate {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct Cvt3ByteCode {
|
pub struct Cvt3ByteCode {
|
||||||
pub addressable_lines_per_field: u16,
|
pub addressable_lines_per_field: u16,
|
||||||
pub aspect_ration: CvtAspectRatio,
|
pub aspect_ration: CvtAspectRatio,
|
||||||
|
|
@ -326,6 +339,7 @@ pub struct Cvt3ByteCode {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct DetailedTimingDescriptor {
|
pub struct DetailedTimingDescriptor {
|
||||||
pub pixel_clock_khz: u32,
|
pub pixel_clock_khz: u32,
|
||||||
pub horizontal_addressable_pixels: u16,
|
pub horizontal_addressable_pixels: u16,
|
||||||
|
|
@ -346,6 +360,7 @@ pub struct DetailedTimingDescriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum Descriptor {
|
pub enum Descriptor {
|
||||||
Unknown(u8),
|
Unknown(u8),
|
||||||
DetailedTimingDescriptor(DetailedTimingDescriptor),
|
DetailedTimingDescriptor(DetailedTimingDescriptor),
|
||||||
|
|
@ -379,6 +394,7 @@ macro_rules! bail {
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum EdidParseContext {
|
pub enum EdidParseContext {
|
||||||
|
#[allow(dead_code)]
|
||||||
ReadingBytes(usize),
|
ReadingBytes(usize),
|
||||||
BaseBlock,
|
BaseBlock,
|
||||||
Descriptors,
|
Descriptors,
|
||||||
|
|
@ -1015,6 +1031,7 @@ pub enum DisplayColorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum FeatureSupport2 {
|
pub enum FeatureSupport2 {
|
||||||
Analog {
|
Analog {
|
||||||
display_color_type: DisplayColorType,
|
display_color_type: DisplayColorType,
|
||||||
|
|
@ -1027,6 +1044,7 @@ pub enum FeatureSupport2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct FeatureSupport {
|
pub struct FeatureSupport {
|
||||||
pub standby_supported: bool,
|
pub standby_supported: bool,
|
||||||
pub suspend_supported: bool,
|
pub suspend_supported: bool,
|
||||||
|
|
@ -1038,6 +1056,7 @@ pub struct FeatureSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct EdidBaseBlock {
|
pub struct EdidBaseBlock {
|
||||||
pub id_manufacturer_name: BString,
|
pub id_manufacturer_name: BString,
|
||||||
pub id_product_code: u16,
|
pub id_product_code: u16,
|
||||||
|
|
@ -1064,6 +1083,7 @@ pub enum EdidExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct EdidFile {
|
pub struct EdidFile {
|
||||||
pub base_block: EdidBaseBlock,
|
pub base_block: EdidBaseBlock,
|
||||||
pub extension_blocks: Vec<EdidExtension>,
|
pub extension_blocks: Vec<EdidExtension>,
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,6 @@ dynload! {
|
||||||
renderbuffertarget: GLenum,
|
renderbuffertarget: GLenum,
|
||||||
renderbuffer: GLuint,
|
renderbuffer: GLuint,
|
||||||
),
|
),
|
||||||
glFramebufferTexture2D: unsafe fn(
|
|
||||||
target: GLenum,
|
|
||||||
attachment: GLenum,
|
|
||||||
textarget: GLenum,
|
|
||||||
texture: GLenum,
|
|
||||||
level: GLint,
|
|
||||||
),
|
|
||||||
glCheckFramebufferStatus: unsafe fn(target: GLenum) -> GLenum,
|
glCheckFramebufferStatus: unsafe fn(target: GLenum) -> GLenum,
|
||||||
glClear: unsafe fn(mask: GLbitfield),
|
glClear: unsafe fn(mask: GLbitfield),
|
||||||
glBlendFunc: unsafe fn(sfactor: GLenum, dfactor: GLenum),
|
glBlendFunc: unsafe fn(sfactor: GLenum, dfactor: GLenum),
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ impl ExtIdleNotifierV1RequestHandler for ExtIdleNotifierV1 {
|
||||||
duration_usec: (req.timeout as u64).max(1000).saturating_mul(1000),
|
duration_usec: (req.timeout as u64).max(1000).saturating_mul(1000),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, notification);
|
||||||
self.client.add_client_obj(¬ification)?;
|
self.client.add_client_obj(¬ification)?;
|
||||||
let future = self.client.state.eng.spawn(run(notification.clone()));
|
let future = self.client.state.eng.spawn(run(notification.clone()));
|
||||||
notification.task.set(Some(future));
|
notification.task.set(Some(future));
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ const MODE_PREFERRED: u32 = 2;
|
||||||
|
|
||||||
pub struct WlOutputGlobal {
|
pub struct WlOutputGlobal {
|
||||||
pub name: GlobalName,
|
pub name: GlobalName,
|
||||||
pub state: Rc<State>,
|
pub _state: Rc<State>,
|
||||||
pub connector: Rc<ConnectorData>,
|
pub connector: Rc<ConnectorData>,
|
||||||
pub pos: Cell<Rect>,
|
pub pos: Cell<Rect>,
|
||||||
pub output_id: Rc<OutputId>,
|
pub output_id: Rc<OutputId>,
|
||||||
|
|
@ -127,7 +127,7 @@ impl WlOutputGlobal {
|
||||||
);
|
);
|
||||||
Self {
|
Self {
|
||||||
name,
|
name,
|
||||||
state: state.clone(),
|
_state: state.clone(),
|
||||||
connector: connector.clone(),
|
connector: connector.clone(),
|
||||||
pos: Cell::new(Rect::new_sized(x, y, width, height).unwrap()),
|
pos: Cell::new(Rect::new_sized(x, y, width, height).unwrap()),
|
||||||
output_id: output_id.clone(),
|
output_id: output_id.clone(),
|
||||||
|
|
|
||||||
|
|
@ -149,10 +149,6 @@ impl NodeSeatState {
|
||||||
self.kb_foci.iter().for_each(|(_, s)| f(s));
|
self.kb_foci.iter().for_each(|(_, s)| f(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn for_each_pointer_focus<F: FnMut(Rc<WlSeatGlobal>)>(&self, mut f: F) {
|
|
||||||
self.pointer_foci.iter().for_each(|(_, s)| f(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn destroy_node(&self, node: &dyn Node) {
|
pub fn destroy_node(&self, node: &dyn Node) {
|
||||||
self.destroy_node2(node, true);
|
self.destroy_node2(node, true);
|
||||||
}
|
}
|
||||||
|
|
@ -173,11 +169,11 @@ impl NodeSeatState {
|
||||||
while let Some((_, seat)) = self.pointer_foci.pop() {
|
while let Some((_, seat)) = self.pointer_foci.pop() {
|
||||||
let mut ps = seat.pointer_stack.borrow_mut();
|
let mut ps = seat.pointer_stack.borrow_mut();
|
||||||
while let Some(last) = ps.pop() {
|
while let Some(last) = ps.pop() {
|
||||||
|
last.node_on_leave(&seat);
|
||||||
if last.node_id() == node_id {
|
if last.node_id() == node_id {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last.node_seat_state().leave(&seat);
|
last.node_seat_state().leave(&seat);
|
||||||
last.node_on_leave(&seat);
|
|
||||||
}
|
}
|
||||||
seat.pointer_stack_modified.set(true);
|
seat.pointer_stack_modified.set(true);
|
||||||
seat.state.tree_changed();
|
seat.state.tree_changed();
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@ impl ZwpPointerConstraintsV1RequestHandler for ZwpPointerConstraintsV1 {
|
||||||
constraint,
|
constraint,
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, lp);
|
||||||
self.client.add_client_obj(&lp)?;
|
self.client.add_client_obj(&lp)?;
|
||||||
lp.constraint.owner.set(Some(lp.clone()));
|
lp.constraint.owner.set(Some(lp.clone()));
|
||||||
lp.constraint
|
lp.constraint
|
||||||
|
|
@ -250,6 +251,7 @@ impl ZwpPointerConstraintsV1RequestHandler for ZwpPointerConstraintsV1 {
|
||||||
constraint,
|
constraint,
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, lp);
|
||||||
self.client.add_client_obj(&lp)?;
|
self.client.add_client_obj(&lp)?;
|
||||||
lp.constraint.owner.set(Some(lp.clone()));
|
lp.constraint.owner.set(Some(lp.clone()));
|
||||||
lp.constraint
|
lp.constraint
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ impl ZwpPointerGesturesV1RequestHandler for ZwpPointerGesturesV1 {
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_client_obj(&obj)?;
|
self.client.add_client_obj(&obj)?;
|
||||||
seat.swipe_bindings.add(&self.client, &obj);
|
seat.swipe_bindings.add(&self.client, &obj);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -93,6 +94,7 @@ impl ZwpPointerGesturesV1RequestHandler for ZwpPointerGesturesV1 {
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_client_obj(&obj)?;
|
self.client.add_client_obj(&obj)?;
|
||||||
seat.pinch_bindings.add(&self.client, &obj);
|
seat.pinch_bindings.add(&self.client, &obj);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -112,6 +114,7 @@ impl ZwpPointerGesturesV1RequestHandler for ZwpPointerGesturesV1 {
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_client_obj(&obj)?;
|
self.client.add_client_obj(&obj)?;
|
||||||
seat.hold_bindings.add(&self.client, &obj);
|
seat.hold_bindings.add(&self.client, &obj);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -1261,13 +1261,6 @@ impl WlSurface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_seat_release_events(&self) {
|
|
||||||
self.seat_state
|
|
||||||
.for_each_pointer_focus(|s| s.leave_surface(self));
|
|
||||||
self.seat_state
|
|
||||||
.for_each_kb_focus(|s| s.unfocus_surface(self));
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_visible(&self, visible: bool) {
|
pub fn set_visible(&self, visible: bool) {
|
||||||
if self.visible.replace(visible) == visible {
|
if self.visible.replace(visible) == visible {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1287,9 +1280,6 @@ impl WlSurface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !visible {
|
|
||||||
self.send_seat_release_events();
|
|
||||||
}
|
|
||||||
self.seat_state.set_visible(self, visible);
|
self.seat_state.set_visible(self, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1318,7 +1308,6 @@ impl WlSurface {
|
||||||
data.focus_node.remove(&seat);
|
data.focus_node.remove(&seat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.send_seat_release_events();
|
|
||||||
self.seat_state.destroy_node(self);
|
self.seat_state.destroy_node(self);
|
||||||
if self.visible.get() {
|
if self.visible.get() {
|
||||||
self.client.state.damage();
|
self.client.state.damage();
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ pub struct ZwlrLayerSurfaceV1 {
|
||||||
pub client: Rc<Client>,
|
pub client: Rc<Client>,
|
||||||
pub surface: Rc<WlSurface>,
|
pub surface: Rc<WlSurface>,
|
||||||
pub output: Rc<OutputGlobalOpt>,
|
pub output: Rc<OutputGlobalOpt>,
|
||||||
pub namespace: String,
|
pub _namespace: String,
|
||||||
pub tracker: Tracker<Self>,
|
pub tracker: Tracker<Self>,
|
||||||
output_extents: Cell<Rect>,
|
output_extents: Cell<Rect>,
|
||||||
pos: Cell<Rect>,
|
pos: Cell<Rect>,
|
||||||
|
|
@ -160,7 +160,7 @@ impl ZwlrLayerSurfaceV1 {
|
||||||
client: shell.client.clone(),
|
client: shell.client.clone(),
|
||||||
surface: surface.clone(),
|
surface: surface.clone(),
|
||||||
output: output.clone(),
|
output: output.clone(),
|
||||||
namespace: namespace.to_string(),
|
_namespace: namespace.to_string(),
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
output_extents: Default::default(),
|
output_extents: Default::default(),
|
||||||
pos: Default::default(),
|
pos: Default::default(),
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl WpAlphaModifierV1RequestHandler for WpAlphaModifierV1 {
|
||||||
&surface,
|
&surface,
|
||||||
self.version,
|
self.version,
|
||||||
));
|
));
|
||||||
track!(self.client, surface);
|
track!(self.client, modifier);
|
||||||
self.client.add_client_obj(&modifier)?;
|
self.client.add_client_obj(&modifier)?;
|
||||||
modifier.install()?;
|
modifier.install()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ impl WpDrmLeaseDeviceV1 {
|
||||||
connector_id: output.connector.connector.id(),
|
connector_id: output.connector.connector.id(),
|
||||||
bindings: output.lease_connectors.clone(),
|
bindings: output.lease_connectors.clone(),
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_server_obj(&obj);
|
self.client.add_server_obj(&obj);
|
||||||
self.send_connector(&obj);
|
self.send_connector(&obj);
|
||||||
obj.send_name(&output.connector.name);
|
obj.send_name(&output.connector.name);
|
||||||
|
|
@ -172,6 +173,7 @@ impl WpDrmLeaseDeviceV1RequestHandler for WpDrmLeaseDeviceV1 {
|
||||||
device: self.device,
|
device: self.device,
|
||||||
connectors: Default::default(),
|
connectors: Default::default(),
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_client_obj(&obj)?;
|
self.client.add_client_obj(&obj)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ impl WpDrmLeaseRequestV1RequestHandler for WpDrmLeaseRequestV1 {
|
||||||
finished: Cell::new(false),
|
finished: Cell::new(false),
|
||||||
lease: Default::default(),
|
lease: Default::default(),
|
||||||
});
|
});
|
||||||
|
track!(self.client, obj);
|
||||||
self.client.add_client_obj(&obj)?;
|
self.client.add_client_obj(&obj)?;
|
||||||
if self.connectors.is_empty() {
|
if self.connectors.is_empty() {
|
||||||
return Err(WpDrmLeaseRequestV1Error::EmptyLease);
|
return Err(WpDrmLeaseRequestV1Error::EmptyLease);
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ impl WpLinuxDrmSyncobjManagerV1RequestHandler for WpLinuxDrmSyncobjManagerV1 {
|
||||||
&sync_obj,
|
&sync_obj,
|
||||||
self.version,
|
self.version,
|
||||||
));
|
));
|
||||||
|
track!(self.client, sync);
|
||||||
self.client.add_client_obj(&sync)?;
|
self.client.add_client_obj(&sync)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ impl WpPresentationRequestHandler for WpPresentation {
|
||||||
let fb = Rc::new(WpPresentationFeedback {
|
let fb = Rc::new(WpPresentationFeedback {
|
||||||
id: req.callback,
|
id: req.callback,
|
||||||
client: self.client.clone(),
|
client: self.client.clone(),
|
||||||
surface: surface.clone(),
|
_surface: surface.clone(),
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
version: self.version,
|
version: self.version,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use {
|
||||||
pub struct WpPresentationFeedback {
|
pub struct WpPresentationFeedback {
|
||||||
pub id: WpPresentationFeedbackId,
|
pub id: WpPresentationFeedbackId,
|
||||||
pub client: Rc<Client>,
|
pub client: Rc<Client>,
|
||||||
pub surface: Rc<WlSurface>,
|
pub _surface: Rc<WlSurface>,
|
||||||
pub tracker: Tracker<Self>,
|
pub tracker: Tracker<Self>,
|
||||||
pub version: Version,
|
pub version: Version,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ pub struct ZwlrScreencopyFrameV1 {
|
||||||
pub tracker: Tracker<Self>,
|
pub tracker: Tracker<Self>,
|
||||||
pub output: Rc<OutputGlobalOpt>,
|
pub output: Rc<OutputGlobalOpt>,
|
||||||
pub rect: Rect,
|
pub rect: Rect,
|
||||||
pub overlay_cursor: bool,
|
pub _overlay_cursor: bool,
|
||||||
pub used: Cell<bool>,
|
pub used: Cell<bool>,
|
||||||
pub with_damage: Cell<bool>,
|
pub with_damage: Cell<bool>,
|
||||||
pub buffer: Cell<Option<Rc<WlBuffer>>>,
|
pub buffer: Cell<Option<Rc<WlBuffer>>>,
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ impl ZwlrScreencopyManagerV1 {
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
output: output.global.clone(),
|
output: output.global.clone(),
|
||||||
rect,
|
rect,
|
||||||
overlay_cursor,
|
_overlay_cursor: overlay_cursor,
|
||||||
used: Cell::new(false),
|
used: Cell::new(false),
|
||||||
with_damage: Cell::new(false),
|
with_damage: Cell::new(false),
|
||||||
buffer: Cell::new(None),
|
buffer: Cell::new(None),
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ use {
|
||||||
|
|
||||||
pub struct TestCallback {
|
pub struct TestCallback {
|
||||||
pub id: WlCallbackId,
|
pub id: WlCallbackId,
|
||||||
pub tran: Rc<TestTransport>,
|
pub _tran: Rc<TestTransport>,
|
||||||
pub handler: Cell<Option<Box<dyn FnOnce()>>>,
|
pub handler: Cell<Option<Box<dyn FnOnce()>>>,
|
||||||
pub done: Cell<bool>,
|
pub done: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ pub struct PendingFeedback {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Feedback {
|
pub struct Feedback {
|
||||||
pub format_table: Rc<OwnedFd>,
|
pub _format_table: Rc<OwnedFd>,
|
||||||
pub format_table_size: usize,
|
pub _format_table_size: usize,
|
||||||
pub main_device: c::dev_t,
|
pub _main_device: c::dev_t,
|
||||||
pub tranches: Vec<Tranche>,
|
pub tranches: Vec<Tranche>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,12 +69,12 @@ impl TestDmabufFeedback {
|
||||||
let _ev = Done::parse_full(parser)?;
|
let _ev = Done::parse_full(parser)?;
|
||||||
let mut pending = mem::take(self.pending_feedback.borrow_mut().deref_mut());
|
let mut pending = mem::take(self.pending_feedback.borrow_mut().deref_mut());
|
||||||
self.feedback.push(Feedback {
|
self.feedback.push(Feedback {
|
||||||
format_table: match pending.format_table.take() {
|
_format_table: match pending.format_table.take() {
|
||||||
None => bail!("compositor did not send format table"),
|
None => bail!("compositor did not send format table"),
|
||||||
Some(ft) => ft,
|
Some(ft) => ft,
|
||||||
},
|
},
|
||||||
format_table_size: pending.format_table_size,
|
_format_table_size: pending.format_table_size,
|
||||||
main_device: pending.main_device,
|
_main_device: pending.main_device,
|
||||||
tranches: pending.tranches,
|
tranches: pending.tranches,
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use {
|
||||||
pub struct TestEnterEvent {
|
pub struct TestEnterEvent {
|
||||||
pub serial: u32,
|
pub serial: u32,
|
||||||
pub surface: WlSurfaceId,
|
pub surface: WlSurfaceId,
|
||||||
pub keys: Vec<u32>,
|
pub _keys: Vec<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestKeyboard {
|
pub struct TestKeyboard {
|
||||||
|
|
@ -49,7 +49,7 @@ impl TestKeyboard {
|
||||||
self.enter.push(TestEnterEvent {
|
self.enter.push(TestEnterEvent {
|
||||||
serial: ev.serial,
|
serial: ev.serial,
|
||||||
surface: ev.surface,
|
surface: ev.surface,
|
||||||
keys: ev.keys.to_vec(),
|
_keys: ev.keys.to_vec(),
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use {
|
||||||
pub struct TestGlobal {
|
pub struct TestGlobal {
|
||||||
pub name: u32,
|
pub name: u32,
|
||||||
pub interface: String,
|
pub interface: String,
|
||||||
pub version: u32,
|
pub _version: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestRegistrySingletons {
|
pub struct TestRegistrySingletons {
|
||||||
|
|
@ -294,7 +294,7 @@ impl TestRegistry {
|
||||||
let global = Rc::new(TestGlobal {
|
let global = Rc::new(TestGlobal {
|
||||||
name: ev.name,
|
name: ev.name,
|
||||||
interface: ev.interface.to_string(),
|
interface: ev.interface.to_string(),
|
||||||
version: ev.version,
|
_version: ev.version,
|
||||||
});
|
});
|
||||||
let prev = self.globals.set(ev.name, global.clone());
|
let prev = self.globals.set(ev.name, global.clone());
|
||||||
let name = GlobalName::from_raw(ev.name);
|
let name = GlobalName::from_raw(ev.name);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ impl TestSubcompositor {
|
||||||
id,
|
id,
|
||||||
tran: self.tran.clone(),
|
tran: self.tran.clone(),
|
||||||
destroyed: Cell::new(false),
|
destroyed: Cell::new(false),
|
||||||
server: self.tran.get_server_obj(id)?,
|
_server: self.tran.get_server_obj(id)?,
|
||||||
});
|
});
|
||||||
self.tran.add_obj(ss.clone())?;
|
self.tran.add_obj(ss.clone())?;
|
||||||
Ok(ss)
|
Ok(ss)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ pub struct TestSubsurface {
|
||||||
pub id: WlSubsurfaceId,
|
pub id: WlSubsurfaceId,
|
||||||
pub tran: Rc<TestTransport>,
|
pub tran: Rc<TestTransport>,
|
||||||
pub destroyed: Cell<bool>,
|
pub destroyed: Cell<bool>,
|
||||||
pub server: Rc<WlSubsurface>,
|
pub _server: Rc<WlSubsurface>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestSubsurface {
|
impl TestSubsurface {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use {
|
||||||
pub struct TestVirtualKeyboardManager {
|
pub struct TestVirtualKeyboardManager {
|
||||||
pub id: ZwpVirtualKeyboardManagerV1Id,
|
pub id: ZwpVirtualKeyboardManagerV1Id,
|
||||||
pub tran: Rc<TestTransport>,
|
pub tran: Rc<TestTransport>,
|
||||||
pub destroyed: Cell<bool>,
|
pub _destroyed: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestVirtualKeyboardManager {
|
impl TestVirtualKeyboardManager {
|
||||||
|
|
@ -22,7 +22,7 @@ impl TestVirtualKeyboardManager {
|
||||||
Self {
|
Self {
|
||||||
id: tran.id(),
|
id: tran.id(),
|
||||||
tran: tran.clone(),
|
tran: tran.clone(),
|
||||||
destroyed: Cell::new(false),
|
_destroyed: Cell::new(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ impl TestXdgWmBase {
|
||||||
let xdg = Rc::new(TestXdgSurface {
|
let xdg = Rc::new(TestXdgSurface {
|
||||||
id,
|
id,
|
||||||
tran: self.tran.clone(),
|
tran: self.tran.clone(),
|
||||||
server,
|
_server: server,
|
||||||
destroyed: Cell::new(false),
|
destroyed: Cell::new(false),
|
||||||
last_serial: Cell::new(0),
|
last_serial: Cell::new(0),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use {
|
||||||
pub struct TestXdgSurface {
|
pub struct TestXdgSurface {
|
||||||
pub id: XdgSurfaceId,
|
pub id: XdgSurfaceId,
|
||||||
pub tran: Rc<TestTransport>,
|
pub tran: Rc<TestTransport>,
|
||||||
pub server: Rc<XdgSurface>,
|
pub _server: Rc<XdgSurface>,
|
||||||
pub destroyed: Cell<bool>,
|
pub destroyed: Cell<bool>,
|
||||||
pub last_serial: Cell<u32>,
|
pub last_serial: Cell<u32>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ impl TestTransport {
|
||||||
pub fn sync(self: &Rc<Self>) -> impl Future<Output = ()> {
|
pub fn sync(self: &Rc<Self>) -> impl Future<Output = ()> {
|
||||||
let cb = Rc::new(TestCallback {
|
let cb = Rc::new(TestCallback {
|
||||||
id: self.id(),
|
id: self.id(),
|
||||||
tran: self.clone(),
|
_tran: self.clone(),
|
||||||
handler: Cell::new(None),
|
handler: Cell::new(None),
|
||||||
done: Cell::new(self.killed.get()),
|
done: Cell::new(self.killed.get()),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ impl PwCon {
|
||||||
pub fn get_registry(self: &Rc<Self>) -> Rc<PwRegistry> {
|
pub fn get_registry(self: &Rc<Self>) -> Rc<PwRegistry> {
|
||||||
let registry = Rc::new(PwRegistry {
|
let registry = Rc::new(PwRegistry {
|
||||||
data: self.proxy_data(),
|
data: self.proxy_data(),
|
||||||
con: self.clone(),
|
_con: self.clone(),
|
||||||
});
|
});
|
||||||
if !self.dead.get() {
|
if !self.dead.get() {
|
||||||
self.objects.set(registry.data.id, registry.clone());
|
self.objects.set(registry.data.id, registry.clone());
|
||||||
|
|
@ -340,7 +340,7 @@ impl PwConHolder {
|
||||||
});
|
});
|
||||||
let client = Rc::new(PwClient {
|
let client = Rc::new(PwClient {
|
||||||
data: data.proxy_data(),
|
data: data.proxy_data(),
|
||||||
con: data.clone(),
|
_con: data.clone(),
|
||||||
});
|
});
|
||||||
data.objects.set(0, core.clone());
|
data.objects.set(0, core.clone());
|
||||||
data.objects.set(1, client.clone());
|
data.objects.set(1, client.clone());
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ pw_opcodes! {
|
||||||
|
|
||||||
pub struct PwClient {
|
pub struct PwClient {
|
||||||
pub data: PwObjectData,
|
pub data: PwObjectData,
|
||||||
pub con: Rc<PwCon>,
|
pub _con: Rc<PwCon>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PwClient {
|
impl PwClient {
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ pub struct PwClientNodePort {
|
||||||
pub direction: SpaDirection,
|
pub direction: SpaDirection,
|
||||||
pub id: u32,
|
pub id: u32,
|
||||||
|
|
||||||
pub destroyed: Cell<bool>,
|
pub _destroyed: Cell<bool>,
|
||||||
|
|
||||||
pub effective_format: Cell<PwClientNodePortFormat>,
|
pub effective_format: Cell<PwClientNodePortFormat>,
|
||||||
pub supported_formats: RefCell<Option<PwClientNodePortSupportedFormats>>,
|
pub supported_formats: RefCell<Option<PwClientNodePortSupportedFormats>>,
|
||||||
|
|
@ -129,18 +129,18 @@ pub struct PwClientNodePort {
|
||||||
pub struct PwClientNodeBufferConfig {
|
pub struct PwClientNodeBufferConfig {
|
||||||
pub num_buffers: usize,
|
pub num_buffers: usize,
|
||||||
pub planes: usize,
|
pub planes: usize,
|
||||||
pub size: Option<u32>,
|
pub _size: Option<u32>,
|
||||||
pub stride: Option<u32>,
|
pub _stride: Option<u32>,
|
||||||
pub align: usize,
|
pub _align: usize,
|
||||||
pub data_type: SpaDataType,
|
pub data_type: SpaDataType,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PwClientNodeBuffer {
|
pub struct PwClientNodeBuffer {
|
||||||
pub meta_header: Option<Rc<PwMemTyped<spa_meta_header>>>,
|
pub _meta_header: Option<Rc<PwMemTyped<spa_meta_header>>>,
|
||||||
pub meta_busy: Option<Rc<PwMemTyped<spa_meta_busy>>>,
|
pub _meta_busy: Option<Rc<PwMemTyped<spa_meta_busy>>>,
|
||||||
pub meta_video_crop: Option<Rc<PwMemTyped<spa_meta_region>>>,
|
pub meta_video_crop: Option<Rc<PwMemTyped<spa_meta_region>>>,
|
||||||
pub chunks: Vec<Rc<PwMemTyped<spa_chunk>>>,
|
pub chunks: Vec<Rc<PwMemTyped<spa_chunk>>>,
|
||||||
pub slices: Vec<Rc<PwMemSlice>>,
|
pub _slices: Vec<Rc<PwMemSlice>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
|
|
@ -181,8 +181,8 @@ pub struct PwClientNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PwNodeActivation {
|
pub struct PwNodeActivation {
|
||||||
pub activation: Rc<PwMemTyped<pw_node_activation>>,
|
pub _activation: Rc<PwMemTyped<pw_node_activation>>,
|
||||||
pub fd: Rc<OwnedFd>,
|
pub _fd: Rc<OwnedFd>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub struct PwNodeBuffer {
|
// pub struct PwNodeBuffer {
|
||||||
|
|
@ -250,7 +250,7 @@ impl PwClientNode {
|
||||||
node: self.clone(),
|
node: self.clone(),
|
||||||
direction,
|
direction,
|
||||||
id: ids.borrow_mut().acquire(),
|
id: ids.borrow_mut().acquire(),
|
||||||
destroyed: Cell::new(false),
|
_destroyed: Cell::new(false),
|
||||||
effective_format: Cell::new(Default::default()),
|
effective_format: Cell::new(Default::default()),
|
||||||
supported_formats: RefCell::new(None),
|
supported_formats: RefCell::new(None),
|
||||||
supported_metas: Cell::new(PwClientNodePortSupportedMetas::none()),
|
supported_metas: Cell::new(PwClientNodePortSupportedMetas::none()),
|
||||||
|
|
@ -676,11 +676,11 @@ impl PwClientNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
res.push(Rc::new(PwClientNodeBuffer {
|
res.push(Rc::new(PwClientNodeBuffer {
|
||||||
meta_header,
|
_meta_header: meta_header,
|
||||||
meta_busy,
|
_meta_busy: meta_busy,
|
||||||
meta_video_crop,
|
meta_video_crop,
|
||||||
chunks,
|
chunks,
|
||||||
slices,
|
_slices: slices,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -765,8 +765,8 @@ impl PwClientNode {
|
||||||
self.activations.set(
|
self.activations.set(
|
||||||
node,
|
node,
|
||||||
Rc::new(PwNodeActivation {
|
Rc::new(PwNodeActivation {
|
||||||
activation: typed,
|
_activation: typed,
|
||||||
fd: signalfd,
|
_fd: signalfd,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ impl PwCore {
|
||||||
self.con.mem.mems.set(
|
self.con.mem.mems.set(
|
||||||
id,
|
id,
|
||||||
Rc::new(PwMem {
|
Rc::new(PwMem {
|
||||||
ty,
|
_ty: ty,
|
||||||
read,
|
read,
|
||||||
write,
|
write,
|
||||||
fd,
|
fd,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ pw_opcodes! {
|
||||||
|
|
||||||
pub struct PwRegistry {
|
pub struct PwRegistry {
|
||||||
pub data: PwObjectData,
|
pub data: PwObjectData,
|
||||||
pub con: Rc<PwCon>,
|
pub _con: Rc<PwCon>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PwRegistry {
|
impl PwRegistry {
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ pub enum PwMemType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PwMem {
|
pub struct PwMem {
|
||||||
pub ty: PwMemType,
|
pub _ty: PwMemType,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub write: bool,
|
pub write: bool,
|
||||||
pub fd: Rc<OwnedFd>,
|
pub fd: Rc<OwnedFd>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PwMemMap {
|
pub struct PwMemMap {
|
||||||
pub mem: Rc<PwMem>,
|
pub _mem: Rc<PwMem>,
|
||||||
pub range: Range<usize>,
|
pub range: Range<usize>,
|
||||||
pub map: Mmapped,
|
pub map: Mmapped,
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +77,7 @@ impl PwMem {
|
||||||
Err(e) => return Err(PwMemError::MmapFailed(e)),
|
Err(e) => return Err(PwMemError::MmapFailed(e)),
|
||||||
};
|
};
|
||||||
Ok(Rc::new(PwMemMap {
|
Ok(Rc::new(PwMemMap {
|
||||||
mem: self.clone(),
|
_mem: self.clone(),
|
||||||
range,
|
range,
|
||||||
map,
|
map,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
|
|
@ -261,8 +261,8 @@ impl<'a> PwParser<'a> {
|
||||||
controls: PwParser::new(&self.data[self.pos + 8..self.pos + len], self.fds),
|
controls: PwParser::new(&self.data[self.pos + 8..self.pos + len], self.fds),
|
||||||
}),
|
}),
|
||||||
PW_TYPE_Pointer => PwPod::Pointer(PwPodPointer {
|
PW_TYPE_Pointer => PwPod::Pointer(PwPodPointer {
|
||||||
ty: PwPointerType(self.read_raw(0)?),
|
_ty: PwPointerType(self.read_raw(0)?),
|
||||||
value: self.read_raw(8)?,
|
_value: self.read_raw(8)?,
|
||||||
}),
|
}),
|
||||||
PW_TYPE_Fd => PwPod::Fd(self.read_raw(0)?),
|
PW_TYPE_Fd => PwPod::Fd(self.read_raw(0)?),
|
||||||
PW_TYPE_Choice => PwPod::Choice(PwPodChoice {
|
PW_TYPE_Choice => PwPod::Choice(PwPodChoice {
|
||||||
|
|
@ -298,9 +298,9 @@ impl<'a> PwParser<'a> {
|
||||||
let ty = PwControlType(self.read_raw(4)?);
|
let ty = PwControlType(self.read_raw(4)?);
|
||||||
self.pos += 8;
|
self.pos += 8;
|
||||||
Ok(PwPodControl {
|
Ok(PwPodControl {
|
||||||
offset,
|
_offset: offset,
|
||||||
ty,
|
_ty: ty,
|
||||||
value: self.read_pod()?,
|
_value: self.read_pod()?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1124,15 +1124,15 @@ pub struct PwPodSequence<'a> {
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct PwPodControl<'a> {
|
pub struct PwPodControl<'a> {
|
||||||
pub offset: u32,
|
pub _offset: u32,
|
||||||
pub ty: PwControlType,
|
pub _ty: PwControlType,
|
||||||
pub value: PwPod<'a>,
|
pub _value: PwPod<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct PwPodPointer {
|
pub struct PwPodPointer {
|
||||||
pub ty: PwPointerType,
|
pub _ty: PwPointerType,
|
||||||
pub value: usize,
|
pub _value: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,10 @@ impl UsrJayRenderCtxOwner for PortalDisplay {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let ctx = Rc::new(PortalRenderCtx { dev_id, ctx });
|
let ctx = Rc::new(PortalRenderCtx {
|
||||||
|
_dev_id: dev_id,
|
||||||
|
ctx,
|
||||||
|
});
|
||||||
self.render_ctx.set(Some(ctx.clone()));
|
self.render_ctx.set(Some(ctx.clone()));
|
||||||
self.state.render_ctxs.set(dev_id, Rc::downgrade(&ctx));
|
self.state.render_ctxs.set(dev_id, Rc::downgrade(&ctx));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use {crate::gfx_api::GfxContext, std::rc::Rc, uapi::c};
|
use {crate::gfx_api::GfxContext, std::rc::Rc, uapi::c};
|
||||||
|
|
||||||
pub struct PortalRenderCtx {
|
pub struct PortalRenderCtx {
|
||||||
pub dev_id: c::dev_t,
|
pub _dev_id: c::dev_t,
|
||||||
pub ctx: Rc<dyn GfxContext>,
|
pub ctx: Rc<dyn GfxContext>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ pub struct SelectingWorkspaceScreencast {
|
||||||
|
|
||||||
pub struct StartingScreencast {
|
pub struct StartingScreencast {
|
||||||
pub session: Rc<ScreencastSession>,
|
pub session: Rc<ScreencastSession>,
|
||||||
pub request_obj: Rc<DbusObject>,
|
pub _request_obj: Rc<DbusObject>,
|
||||||
pub reply: Rc<PendingReply<StartReply<'static>>>,
|
pub reply: Rc<PendingReply<StartReply<'static>>>,
|
||||||
pub node: Rc<PwClientNode>,
|
pub node: Rc<PwClientNode>,
|
||||||
pub dpy: Rc<PortalDisplay>,
|
pub dpy: Rc<PortalDisplay>,
|
||||||
|
|
@ -241,7 +241,7 @@ impl SelectingScreencastCore {
|
||||||
]);
|
]);
|
||||||
let starting = Rc::new(StartingScreencast {
|
let starting = Rc::new(StartingScreencast {
|
||||||
session: self.session.clone(),
|
session: self.session.clone(),
|
||||||
request_obj: self.request_obj.clone(),
|
_request_obj: self.request_obj.clone(),
|
||||||
reply: self.reply.clone(),
|
reply: self.reply.clone(),
|
||||||
node,
|
node,
|
||||||
dpy: dpy.clone(),
|
dpy: dpy.clone(),
|
||||||
|
|
@ -391,9 +391,9 @@ impl UsrJayScreencastOwner for StartedScreencast {
|
||||||
let bc = PwClientNodeBufferConfig {
|
let bc = PwClientNodeBufferConfig {
|
||||||
num_buffers: buffers.len(),
|
num_buffers: buffers.len(),
|
||||||
planes: buffer.planes.len(),
|
planes: buffer.planes.len(),
|
||||||
stride: Some(buffer.planes[0].stride),
|
_stride: Some(buffer.planes[0].stride),
|
||||||
size: Some(buffer.planes[0].stride * buffer.height as u32),
|
_size: Some(buffer.planes[0].stride * buffer.height as u32),
|
||||||
align: 16,
|
_align: 16,
|
||||||
data_type: SPA_DATA_DmaBuf,
|
data_type: SPA_DATA_DmaBuf,
|
||||||
};
|
};
|
||||||
self.port.buffer_config.set(Some(bc));
|
self.port.buffer_config.set(Some(bc));
|
||||||
|
|
|
||||||
|
|
@ -846,7 +846,7 @@ pub struct GuiBuffer {
|
||||||
pub fb: Rc<dyn GfxFramebuffer>,
|
pub fb: Rc<dyn GfxFramebuffer>,
|
||||||
pub _bo: Option<GbmBo>,
|
pub _bo: Option<GbmBo>,
|
||||||
pub free: Cell<bool>,
|
pub free: Cell<bool>,
|
||||||
pub size: (i32, i32),
|
pub _size: (i32, i32),
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GuiBufferPending {
|
struct GuiBufferPending {
|
||||||
|
|
@ -897,7 +897,7 @@ impl UsrLinuxBufferParamsOwner for GuiBufferPending {
|
||||||
fb: self.fb.clone(),
|
fb: self.fb.clone(),
|
||||||
_bo: self.bo.take(),
|
_bo: self.bo.take(),
|
||||||
free: Cell::new(true),
|
free: Cell::new(true),
|
||||||
size: self.size,
|
_size: self.size,
|
||||||
});
|
});
|
||||||
buf.wl.owner.set(Some(buf.clone()));
|
buf.wl.owner.set(Some(buf.clone()));
|
||||||
self.window.bufs.borrow_mut().push(buf);
|
self.window.bufs.borrow_mut().push(buf);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ impl Region {
|
||||||
if rects.len() == 1 {
|
if rects.len() == 1 {
|
||||||
return Self::new(rects[0]);
|
return Self::new(rects[0]);
|
||||||
}
|
}
|
||||||
let rects = rects_to_bands(unsafe { mem::transmute(rects) });
|
let rects = rects_to_bands(unsafe { mem::transmute::<&[Rect], &[RectRaw]>(rects) });
|
||||||
Rc::new(Self {
|
Rc::new(Self {
|
||||||
extents: Rect {
|
extents: Rect {
|
||||||
raw: extents(&rects),
|
raw: extents(&rects),
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ impl IdleState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct InputDeviceData {
|
pub struct InputDeviceData {
|
||||||
pub handler: SpawnedFuture<()>,
|
pub _handler: SpawnedFuture<()>,
|
||||||
pub id: InputDeviceId,
|
pub id: InputDeviceId,
|
||||||
pub data: Rc<DeviceHandlerData>,
|
pub data: Rc<DeviceHandlerData>,
|
||||||
pub async_event: Rc<AsyncEvent>,
|
pub async_event: Rc<AsyncEvent>,
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
|
||||||
state.input_device_handlers.borrow_mut().insert(
|
state.input_device_handlers.borrow_mut().insert(
|
||||||
dev.id(),
|
dev.id(),
|
||||||
InputDeviceData {
|
InputDeviceData {
|
||||||
handler,
|
_handler: handler,
|
||||||
id: dev.id(),
|
id: dev.id(),
|
||||||
data,
|
data,
|
||||||
async_event: ae,
|
async_event: ae,
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,9 @@ pub enum ToolClientError {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ToolClient {
|
pub struct ToolClient {
|
||||||
pub logger: Arc<Logger>,
|
pub _logger: Arc<Logger>,
|
||||||
pub ring: Rc<IoUring>,
|
pub ring: Rc<IoUring>,
|
||||||
pub wheel: Rc<Wheel>,
|
pub _wheel: Rc<Wheel>,
|
||||||
pub eng: Rc<AsyncEngine>,
|
pub eng: Rc<AsyncEngine>,
|
||||||
obj_ids: RefCell<Bitfield>,
|
obj_ids: RefCell<Bitfield>,
|
||||||
handlers: RefCell<
|
handlers: RefCell<
|
||||||
|
|
@ -173,9 +173,9 @@ impl ToolClient {
|
||||||
obj_ids.take(0);
|
obj_ids.take(0);
|
||||||
obj_ids.take(1);
|
obj_ids.take(1);
|
||||||
let slf = Rc::new(Self {
|
let slf = Rc::new(Self {
|
||||||
logger,
|
_logger: logger,
|
||||||
ring,
|
ring,
|
||||||
wheel,
|
_wheel: wheel,
|
||||||
eng,
|
eng,
|
||||||
obj_ids: RefCell::new(obj_ids),
|
obj_ids: RefCell::new(obj_ids),
|
||||||
handlers: Default::default(),
|
handlers: Default::default(),
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ struct clone_args {
|
||||||
|
|
||||||
pub enum Forked {
|
pub enum Forked {
|
||||||
Parent { pid: c::pid_t, pidfd: OwnedFd },
|
Parent { pid: c::pid_t, pidfd: OwnedFd },
|
||||||
Child { pidfd: Option<OwnedFd> },
|
Child { _pidfd: Option<OwnedFd> },
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fork_with_pidfd(pidfd_for_child: bool) -> Result<Forked, ForkerError> {
|
pub fn fork_with_pidfd(pidfd_for_child: bool) -> Result<Forked, ForkerError> {
|
||||||
|
|
@ -47,7 +47,9 @@ pub fn fork_with_pidfd(pidfd_for_child: bool) -> Result<Forked, ForkerError> {
|
||||||
return Err(ForkerError::Fork(e.into()));
|
return Err(ForkerError::Fork(e.into()));
|
||||||
}
|
}
|
||||||
let res = if pid == 0 {
|
let res = if pid == 0 {
|
||||||
Forked::Child { pidfd: child_pidfd }
|
Forked::Child {
|
||||||
|
_pidfd: child_pidfd,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Forked::Parent {
|
Forked::Parent {
|
||||||
pid: pid as _,
|
pid: pid as _,
|
||||||
|
|
|
||||||
|
|
@ -628,28 +628,28 @@ impl NodeType {
|
||||||
pub struct DrmPropertyDefinition {
|
pub struct DrmPropertyDefinition {
|
||||||
pub id: DrmProperty,
|
pub id: DrmProperty,
|
||||||
pub name: BString,
|
pub name: BString,
|
||||||
pub immutable: bool,
|
pub _immutable: bool,
|
||||||
pub atomic: bool,
|
pub _atomic: bool,
|
||||||
pub ty: DrmPropertyType,
|
pub ty: DrmPropertyType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum DrmPropertyType {
|
pub enum DrmPropertyType {
|
||||||
Range {
|
Range {
|
||||||
min: u64,
|
_min: u64,
|
||||||
max: u64,
|
_max: u64,
|
||||||
},
|
},
|
||||||
SignedRange {
|
SignedRange {
|
||||||
min: i64,
|
_min: i64,
|
||||||
max: i64,
|
_max: i64,
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
ty: u32,
|
_ty: u32,
|
||||||
},
|
},
|
||||||
Blob,
|
Blob,
|
||||||
Enum {
|
Enum {
|
||||||
values: Vec<DrmPropertyEnumValue>,
|
values: Vec<DrmPropertyEnumValue>,
|
||||||
bitmask: bool,
|
_bitmask: bool,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -712,7 +712,7 @@ pub struct DrmCardResources {
|
||||||
pub max_width: u32,
|
pub max_width: u32,
|
||||||
pub min_height: u32,
|
pub min_height: u32,
|
||||||
pub max_height: u32,
|
pub max_height: u32,
|
||||||
pub fbs: Vec<DrmFb>,
|
pub _fbs: Vec<DrmFb>,
|
||||||
pub crtcs: Vec<DrmCrtc>,
|
pub crtcs: Vec<DrmCrtc>,
|
||||||
pub connectors: Vec<DrmConnector>,
|
pub connectors: Vec<DrmConnector>,
|
||||||
pub encoders: Vec<DrmEncoder>,
|
pub encoders: Vec<DrmEncoder>,
|
||||||
|
|
@ -720,21 +720,21 @@ pub struct DrmCardResources {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct DrmPlaneInfo {
|
pub struct DrmPlaneInfo {
|
||||||
pub plane_id: DrmPlane,
|
pub _plane_id: DrmPlane,
|
||||||
pub crtc_id: DrmCrtc,
|
pub _crtc_id: DrmCrtc,
|
||||||
pub fb_id: DrmFb,
|
pub _fb_id: DrmFb,
|
||||||
pub possible_crtcs: u32,
|
pub possible_crtcs: u32,
|
||||||
pub gamma_size: u32,
|
pub _gamma_size: u32,
|
||||||
pub format_types: Vec<u32>,
|
pub format_types: Vec<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct DrmEncoderInfo {
|
pub struct DrmEncoderInfo {
|
||||||
pub encoder_id: DrmEncoder,
|
pub _encoder_id: DrmEncoder,
|
||||||
pub encoder_type: u32,
|
pub _encoder_type: u32,
|
||||||
pub crtc_id: DrmCrtc,
|
pub _crtc_id: DrmCrtc,
|
||||||
pub possible_crtcs: u32,
|
pub possible_crtcs: u32,
|
||||||
pub possible_clones: u32,
|
pub _possible_clones: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||||
|
|
@ -820,10 +820,10 @@ impl DrmModeInfo {
|
||||||
pub struct DrmConnectorInfo {
|
pub struct DrmConnectorInfo {
|
||||||
pub encoders: Vec<DrmEncoder>,
|
pub encoders: Vec<DrmEncoder>,
|
||||||
pub modes: Vec<DrmModeInfo>,
|
pub modes: Vec<DrmModeInfo>,
|
||||||
pub props: Vec<DrmPropertyValue>,
|
pub _props: Vec<DrmPropertyValue>,
|
||||||
|
|
||||||
pub encoder_id: DrmEncoder,
|
pub _encoder_id: DrmEncoder,
|
||||||
pub connector_id: DrmConnector,
|
pub _connector_id: DrmConnector,
|
||||||
pub connector_type: u32,
|
pub connector_type: u32,
|
||||||
pub connector_type_id: u32,
|
pub connector_type_id: u32,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,13 +277,13 @@ pub fn mode_getproperty(
|
||||||
get(&mut prop)?;
|
get(&mut prop)?;
|
||||||
if ty == DRM_MODE_PROP_RANGE {
|
if ty == DRM_MODE_PROP_RANGE {
|
||||||
DrmPropertyType::Range {
|
DrmPropertyType::Range {
|
||||||
min: vals[0],
|
_min: vals[0],
|
||||||
max: vals[1],
|
_max: vals[1],
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DrmPropertyType::SignedRange {
|
DrmPropertyType::SignedRange {
|
||||||
min: vals[0] as _,
|
_min: vals[0] as _,
|
||||||
max: vals[1] as _,
|
_max: vals[1] as _,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -305,7 +305,7 @@ pub fn mode_getproperty(
|
||||||
}
|
}
|
||||||
DrmPropertyType::Enum {
|
DrmPropertyType::Enum {
|
||||||
values,
|
values,
|
||||||
bitmask: ty == DRM_MODE_PROP_BITMASK,
|
_bitmask: ty == DRM_MODE_PROP_BITMASK,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DRM_MODE_PROP_BLOB => DrmPropertyType::Blob,
|
DRM_MODE_PROP_BLOB => DrmPropertyType::Blob,
|
||||||
|
|
@ -316,7 +316,7 @@ pub fn mode_getproperty(
|
||||||
let mut ty = 0u64;
|
let mut ty = 0u64;
|
||||||
prop.values_ptr = &mut ty as *mut _ as u64;
|
prop.values_ptr = &mut ty as *mut _ as u64;
|
||||||
get(&mut prop)?;
|
get(&mut prop)?;
|
||||||
DrmPropertyType::Object { ty: ty as _ }
|
DrmPropertyType::Object { _ty: ty as _ }
|
||||||
}
|
}
|
||||||
_ => return Err(DrmError::UnknownPropertyType(ty)),
|
_ => return Err(DrmError::UnknownPropertyType(ty)),
|
||||||
};
|
};
|
||||||
|
|
@ -324,8 +324,8 @@ pub fn mode_getproperty(
|
||||||
Ok(DrmPropertyDefinition {
|
Ok(DrmPropertyDefinition {
|
||||||
id: property_id,
|
id: property_id,
|
||||||
name: prop.name.split(|n| *n == 0).next().unwrap().to_vec().into(),
|
name: prop.name.split(|n| *n == 0).next().unwrap().to_vec().into(),
|
||||||
immutable: prop.flags.contains(DRM_MODE_PROP_IMMUTABLE),
|
_immutable: prop.flags.contains(DRM_MODE_PROP_IMMUTABLE),
|
||||||
atomic: prop.flags.contains(DRM_MODE_PROP_ATOMIC),
|
_atomic: prop.flags.contains(DRM_MODE_PROP_ATOMIC),
|
||||||
ty,
|
ty,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -549,7 +549,7 @@ pub fn mode_get_resources(fd: c::c_int) -> Result<DrmCardResources, DrmError> {
|
||||||
max_width: res.max_width,
|
max_width: res.max_width,
|
||||||
min_height: res.min_height,
|
min_height: res.min_height,
|
||||||
max_height: res.max_height,
|
max_height: res.max_height,
|
||||||
fbs,
|
_fbs: fbs,
|
||||||
crtcs,
|
crtcs,
|
||||||
connectors,
|
connectors,
|
||||||
encoders,
|
encoders,
|
||||||
|
|
@ -647,11 +647,11 @@ pub fn mode_getplane(fd: c::c_int, plane_id: u32) -> Result<DrmPlaneInfo, DrmErr
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(DrmPlaneInfo {
|
Ok(DrmPlaneInfo {
|
||||||
plane_id: DrmPlane(plane_id),
|
_plane_id: DrmPlane(plane_id),
|
||||||
crtc_id: DrmCrtc(res.crtc_id),
|
_crtc_id: DrmCrtc(res.crtc_id),
|
||||||
fb_id: DrmFb(res.fb_id),
|
_fb_id: DrmFb(res.fb_id),
|
||||||
possible_crtcs: res.possible_crtcs,
|
possible_crtcs: res.possible_crtcs,
|
||||||
gamma_size: res.gamma_size,
|
_gamma_size: res.gamma_size,
|
||||||
format_types: formats,
|
format_types: formats,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -683,11 +683,11 @@ pub fn mode_getencoder(fd: c::c_int, encoder_id: u32) -> Result<DrmEncoderInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(DrmEncoderInfo {
|
Ok(DrmEncoderInfo {
|
||||||
encoder_id: DrmEncoder(encoder_id),
|
_encoder_id: DrmEncoder(encoder_id),
|
||||||
encoder_type: res.encoder_type,
|
_encoder_type: res.encoder_type,
|
||||||
crtc_id: DrmCrtc(res.crtc_id),
|
_crtc_id: DrmCrtc(res.crtc_id),
|
||||||
possible_crtcs: res.possible_crtcs,
|
possible_crtcs: res.possible_crtcs,
|
||||||
possible_clones: res.possible_clones,
|
_possible_clones: res.possible_clones,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -831,7 +831,7 @@ pub fn mode_getconnector(
|
||||||
Ok(DrmConnectorInfo {
|
Ok(DrmConnectorInfo {
|
||||||
encoders,
|
encoders,
|
||||||
modes: modes.into_iter().map(|m| m.into()).collect(),
|
modes: modes.into_iter().map(|m| m.into()).collect(),
|
||||||
props: props
|
_props: props
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(prop_values)
|
.zip(prop_values)
|
||||||
.map(|(id, value)| DrmPropertyValue {
|
.map(|(id, value)| DrmPropertyValue {
|
||||||
|
|
@ -839,8 +839,8 @@ pub fn mode_getconnector(
|
||||||
value,
|
value,
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
encoder_id: DrmEncoder(res.encoder_id),
|
_encoder_id: DrmEncoder(res.encoder_id),
|
||||||
connector_id: DrmConnector(res.connector_id),
|
_connector_id: DrmConnector(res.connector_id),
|
||||||
connector_type: res.connector_type,
|
connector_type: res.connector_type,
|
||||||
connector_type_id: res.connector_type_id,
|
connector_type_id: res.connector_type_id,
|
||||||
connection: res.connection,
|
connection: res.connection,
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ pub enum UsrConError {
|
||||||
|
|
||||||
pub struct UsrCon {
|
pub struct UsrCon {
|
||||||
pub ring: Rc<IoUring>,
|
pub ring: Rc<IoUring>,
|
||||||
pub wheel: Rc<Wheel>,
|
pub _wheel: Rc<Wheel>,
|
||||||
pub eng: Rc<AsyncEngine>,
|
pub eng: Rc<AsyncEngine>,
|
||||||
pub server_id: u32,
|
pub server_id: u32,
|
||||||
obj_ids: RefCell<Bitfield>,
|
obj_ids: RefCell<Bitfield>,
|
||||||
|
|
@ -115,7 +115,7 @@ impl UsrCon {
|
||||||
obj_ids.take(1);
|
obj_ids.take(1);
|
||||||
let slf = Rc::new(Self {
|
let slf = Rc::new(Self {
|
||||||
ring: ring.clone(),
|
ring: ring.clone(),
|
||||||
wheel: wheel.clone(),
|
_wheel: wheel.clone(),
|
||||||
eng: eng.clone(),
|
eng: eng.clone(),
|
||||||
server_id,
|
server_id,
|
||||||
obj_ids: RefCell::new(obj_ids),
|
obj_ids: RefCell::new(obj_ids),
|
||||||
|
|
|
||||||
16
src/xcon.rs
16
src/xcon.rs
|
|
@ -157,7 +157,7 @@ pub struct Xcon {
|
||||||
data: Rc<XconData>,
|
data: Rc<XconData>,
|
||||||
outgoing: Cell<Option<SpawnedFuture<()>>>,
|
outgoing: Cell<Option<SpawnedFuture<()>>>,
|
||||||
incoming: Cell<Option<SpawnedFuture<()>>>,
|
incoming: Cell<Option<SpawnedFuture<()>>>,
|
||||||
setup: Reply<Setup<'static>>,
|
root_window: u32,
|
||||||
extensions: Rc<ExtensionData>,
|
extensions: Rc<ExtensionData>,
|
||||||
|
|
||||||
xid_next: Cell<u32>,
|
xid_next: Cell<u32>,
|
||||||
|
|
@ -371,8 +371,8 @@ impl<T: Message<'static>> Future for AsyncReply<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Xcon {
|
impl Xcon {
|
||||||
pub fn setup(&self) -> &Setup {
|
pub fn root_window(&self) -> u32 {
|
||||||
self.setup.get()
|
self.root_window
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn event(&self) -> Event {
|
pub async fn event(&self) -> Event {
|
||||||
|
|
@ -510,11 +510,7 @@ impl Xcon {
|
||||||
xid_next: Cell::new(setup.resource_id_base),
|
xid_next: Cell::new(setup.resource_id_base),
|
||||||
xid_inc: 1 << setup.resource_id_mask.trailing_zeros(),
|
xid_inc: 1 << setup.resource_id_mask.trailing_zeros(),
|
||||||
xid_max: setup.resource_id_mask | setup.resource_id_base,
|
xid_max: setup.resource_id_mask | setup.resource_id_base,
|
||||||
setup: Reply {
|
root_window: setup.screens[0].root,
|
||||||
socket: data.clone(),
|
|
||||||
t: unsafe { mem::transmute(setup) },
|
|
||||||
buf,
|
|
||||||
},
|
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
slf.data.xorg.set(Rc::downgrade(&slf));
|
slf.data.xorg.set(Rc::downgrade(&slf));
|
||||||
|
|
@ -665,7 +661,7 @@ impl Xcon {
|
||||||
let create_pixmap = self.call(&CreatePixmap {
|
let create_pixmap = self.call(&CreatePixmap {
|
||||||
depth: 32,
|
depth: 32,
|
||||||
pid: pixmap,
|
pid: pixmap,
|
||||||
drawable: self.setup.get().screens[0].root,
|
drawable: self.root_window,
|
||||||
width: width as _,
|
width: width as _,
|
||||||
height: height as _,
|
height: height as _,
|
||||||
});
|
});
|
||||||
|
|
@ -684,7 +680,7 @@ impl Xcon {
|
||||||
dst_y: 0,
|
dst_y: 0,
|
||||||
left_pad: 0,
|
left_pad: 0,
|
||||||
depth: 32,
|
depth: 32,
|
||||||
data: unsafe { mem::transmute(pixels) },
|
data: unsafe { mem::transmute::<&[Cell<u8>], &[u8]>(pixels) },
|
||||||
});
|
});
|
||||||
self.call(&FreeGC { gc });
|
self.call(&FreeGC { gc });
|
||||||
let create_picture = self.call(&RenderCreatePicture {
|
let create_picture = self.call(&RenderCreatePicture {
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ impl Wm {
|
||||||
nf.insert(atoms._NET_WM_WINDOW_TYPE_UTILITY);
|
nf.insert(atoms._NET_WM_WINDOW_TYPE_UTILITY);
|
||||||
nf
|
nf
|
||||||
};
|
};
|
||||||
let root = c.setup().screens[0].root;
|
let root = c.root_window();
|
||||||
{
|
{
|
||||||
let events = 0
|
let events = 0
|
||||||
| EVENT_MASK_SUBSTRUCTURE_NOTIFY
|
| EVENT_MASK_SUBSTRUCTURE_NOTIFY
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
context::Context,
|
|
||||||
extractor::ExtractorError,
|
extractor::ExtractorError,
|
||||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||||
},
|
},
|
||||||
|
|
@ -12,7 +11,7 @@ use {
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct ColorParser<'a>(pub &'a Context<'a>);
|
pub struct ColorParser;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum ColorParserError {
|
pub enum ColorParserError {
|
||||||
|
|
@ -28,7 +27,7 @@ pub enum ColorParserError {
|
||||||
ParseIntError(#[from] ParseIntError),
|
ParseIntError(#[from] ParseIntError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parser for ColorParser<'_> {
|
impl Parser for ColorParser {
|
||||||
type Value = Color;
|
type Value = Color;
|
||||||
type Error = ColorParserError;
|
type Error = ColorParserError;
|
||||||
const EXPECTED: &'static [DataType] = &[DataType::String];
|
const EXPECTED: &'static [DataType] = &[DataType::String];
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ impl Parser for ThemeParser<'_> {
|
||||||
($e:expr) => {
|
($e:expr) => {
|
||||||
match $e {
|
match $e {
|
||||||
None => None,
|
None => None,
|
||||||
Some(v) => match v.parse(&mut ColorParser(self.0)) {
|
Some(v) => match v.parse(&mut ColorParser) {
|
||||||
Ok(v) => Some(v),
|
Ok(v) => Some(v),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::warn!("Could not parse a color: {}", self.0.error(e));
|
log::warn!("Could not parse a color: {}", self.0.error(e));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue