seat: add cursor groups
This commit is contained in:
parent
dc97827f7a
commit
efdca4de49
28 changed files with 629 additions and 401 deletions
|
|
@ -956,7 +956,7 @@ impl ConfigProxyHandler {
|
|||
if size < 0 {
|
||||
return Err(CphError::NegativeCursorSize);
|
||||
}
|
||||
seat.set_cursor_size(size as _);
|
||||
seat.cursor_group().set_cursor_size(size as _);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -972,14 +972,7 @@ impl ConfigProxyHandler {
|
|||
use_hardware_cursor: bool,
|
||||
) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
if use_hardware_cursor {
|
||||
for other in self.state.globals.seats.lock().values() {
|
||||
if other.id() != seat.id() {
|
||||
other.set_hardware_cursor(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
seat.set_hardware_cursor(use_hardware_cursor);
|
||||
seat.cursor_group().set_hardware_cursor(use_hardware_cursor);
|
||||
self.state.refresh_hardware_cursors();
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1037,18 +1030,7 @@ impl ConfigProxyHandler {
|
|||
if x < 0 || y < 0 || x > MAX_EXTENTS || y > MAX_EXTENTS {
|
||||
return Err(CphError::InvalidConnectorPosition(x, y));
|
||||
}
|
||||
let old_pos = connector.global.pos.get();
|
||||
connector.set_position(x, y);
|
||||
let seats = self.state.globals.seats.lock();
|
||||
for seat in seats.values() {
|
||||
if seat.get_output().id == connector.id {
|
||||
let seat_pos = seat.position();
|
||||
seat.set_position(
|
||||
seat_pos.0.round_down() + x - old_pos.x1(),
|
||||
seat_pos.1.round_down() + y - old_pos.y1(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue