mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-25 14:10:55 +03:00
reference count capture (#209)
* reference count capture Multiple captures can now be created at the same position. Captures at the same position are reference counted. * update testcase will be required by #200 / #164
This commit is contained in:
committed by
GitHub
parent
ab1b45ff45
commit
5b1dc4ccf8
@@ -3,10 +3,7 @@ use std::task::Poll;
|
||||
use async_trait::async_trait;
|
||||
use futures_core::Stream;
|
||||
|
||||
use super::{
|
||||
error::X11InputCaptureCreationError, Capture, CaptureError, CaptureEvent, CaptureHandle,
|
||||
Position,
|
||||
};
|
||||
use super::{error::X11InputCaptureCreationError, Capture, CaptureError, CaptureEvent, Position};
|
||||
|
||||
pub struct X11InputCapture {}
|
||||
|
||||
@@ -18,11 +15,11 @@ impl X11InputCapture {
|
||||
|
||||
#[async_trait]
|
||||
impl Capture for X11InputCapture {
|
||||
async fn create(&mut self, _id: CaptureHandle, _pos: Position) -> Result<(), CaptureError> {
|
||||
async fn create(&mut self, _pos: Position) -> Result<(), CaptureError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn destroy(&mut self, _id: CaptureHandle) -> Result<(), CaptureError> {
|
||||
async fn destroy(&mut self, _pos: Position) -> Result<(), CaptureError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -36,7 +33,7 @@ impl Capture for X11InputCapture {
|
||||
}
|
||||
|
||||
impl Stream for X11InputCapture {
|
||||
type Item = Result<(CaptureHandle, CaptureEvent), CaptureError>;
|
||||
type Item = Result<(Position, CaptureEvent), CaptureError>;
|
||||
|
||||
fn poll_next(
|
||||
self: std::pin::Pin<&mut Self>,
|
||||
|
||||
Reference in New Issue
Block a user