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