compositor+evdevd: eliminate remaining disguised stubs
Compositor: - XDG_POPUP_GRAB: read serial from payload (was generating fake serial) - XDG_POPUP_REPOSITION: fix payload parsing, look up positioner state, send configure+repositioned events with correct token - WL_SUBSURFACE_PLACE_ABOVE/BELOW: implement z_index tracking for real subsurface stacking order - Unknown global bind: log warning instead of silent type-0 assignment - DRM page flip: log ioctl errors instead of silently ignoring - handlers.rs: 4 silent message drops replaced with eprintln warnings - Shell(_) ack_configure: clean up code smell (let _ = serial) evdevd: - F_GETFL/F_SETFL: store and return file status flags on Handle - F_GETFD/F_SETFD: store and return fd flags on Handle - EVIOCSCLOCKID: read, validate (0-2), and store clock_id on device handle relibc submodule pointer update (dso.rs catch-alls → log+skip).
This commit is contained in:
@@ -37,6 +37,10 @@ struct TouchSlot {
|
||||
|
||||
struct Handle {
|
||||
kind: HandleKind,
|
||||
/// File status flags from fcntl(F_SETFL) — e.g. O_NONBLOCK, O_APPEND.
|
||||
flags: usize,
|
||||
/// File descriptor flags from fcntl(F_SETFD) — e.g. FD_CLOEXEC.
|
||||
fd_flags: usize,
|
||||
}
|
||||
|
||||
enum HandleKind {
|
||||
@@ -44,6 +48,9 @@ enum HandleKind {
|
||||
Device {
|
||||
device_idx: usize,
|
||||
events: VecDeque<InputEvent>,
|
||||
/// Clock source for event timestamps, set via EVIOCSCLOCKID.
|
||||
/// 0 = CLOCK_REALTIME (default), 1 = CLOCK_MONOTONIC, 2 = CLOCK_BOOTTIME.
|
||||
clock_id: i32,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -80,7 +87,7 @@ impl EvdevScheme {
|
||||
};
|
||||
scheme
|
||||
.handles
|
||||
.insert(ROOT_ID, Handle { kind: HandleKind::Root });
|
||||
.insert(ROOT_ID, Handle { kind: HandleKind::Root, flags: 0, fd_flags: 0 });
|
||||
scheme.devices.push(InputDevice::new_keyboard(0));
|
||||
scheme.devices.push(InputDevice::new_mouse(1));
|
||||
scheme.devices.push(InputDevice::new_touchpad(2));
|
||||
@@ -127,6 +134,7 @@ impl EvdevScheme {
|
||||
if let HandleKind::Device {
|
||||
device_idx: handle_device_idx,
|
||||
events: handle_events,
|
||||
clock_id: _,
|
||||
} = &mut handle.kind
|
||||
{
|
||||
if *handle_device_idx == device_idx {
|
||||
@@ -427,6 +435,7 @@ impl SchemeSync for EvdevScheme {
|
||||
HandleKind::Device {
|
||||
device_idx: idx,
|
||||
events: VecDeque::new(),
|
||||
clock_id: 0,
|
||||
}
|
||||
} else {
|
||||
return Err(Error::new(ENOENT));
|
||||
@@ -434,7 +443,7 @@ impl SchemeSync for EvdevScheme {
|
||||
|
||||
let id = self.next_id;
|
||||
self.next_id += 1;
|
||||
self.handles.insert(id, Handle { kind });
|
||||
self.handles.insert(id, Handle { kind, flags: 0, fd_flags: 0 });
|
||||
Ok(OpenResult::ThisScheme {
|
||||
number: id,
|
||||
flags: NewFdFlags::empty(),
|
||||
@@ -536,9 +545,22 @@ impl SchemeSync for EvdevScheme {
|
||||
};
|
||||
|
||||
match cmd_raw {
|
||||
F_GETFL => return Ok(O_RDONLY),
|
||||
F_GETFD => return Ok(0),
|
||||
F_SETFL | F_SETFD => {
|
||||
F_GETFL => {
|
||||
let handle = self.handles.get(&id).ok_or(Error::new(EBADF))?;
|
||||
return Ok(handle.flags | O_RDONLY);
|
||||
}
|
||||
F_GETFD => {
|
||||
let handle = self.handles.get(&id).ok_or(Error::new(EBADF))?;
|
||||
return Ok(handle.fd_flags);
|
||||
}
|
||||
F_SETFL => {
|
||||
let handle = self.handles.get_mut(&id).ok_or(Error::new(EBADF))?;
|
||||
handle.flags = arg;
|
||||
return Ok(0);
|
||||
}
|
||||
F_SETFD => {
|
||||
let handle = self.handles.get_mut(&id).ok_or(Error::new(EBADF))?;
|
||||
handle.fd_flags = arg;
|
||||
return Ok(0);
|
||||
}
|
||||
_ => {}
|
||||
@@ -569,6 +591,14 @@ impl SchemeSync for EvdevScheme {
|
||||
}
|
||||
|
||||
if cmd_raw == EVIOCSCLOCKID as usize {
|
||||
let clock_id = unsafe { Self::read_value_from_user::<i32>(arg)? };
|
||||
if !matches!(clock_id, 0..=2) {
|
||||
return Err(Error::new(EINVAL));
|
||||
}
|
||||
match &mut self.handles.get_mut(&id).ok_or(Error::new(EBADF))?.kind {
|
||||
HandleKind::Device { clock_id: ref mut cid, .. } => *cid = clock_id,
|
||||
HandleKind::Root => return Err(Error::new(EINVAL)),
|
||||
}
|
||||
return Ok(0);
|
||||
}
|
||||
let cmd = cmd_raw as u64;
|
||||
|
||||
Reference in New Issue
Block a user