1
0
Fork 0
forked from wry/wry

autocommit 2022-02-17 19:12:52 CET

This commit is contained in:
Julian Orth 2022-02-17 19:12:52 +01:00
parent cf322f05be
commit 195a92d98b
29 changed files with 610 additions and 175 deletions

View file

@ -1,15 +1,12 @@
use std::rc::Rc;
use crate::backend::Backend;
use std::rc::Rc;
pub struct DummyBackend {
}
pub struct DummyBackend {}
impl DummyBackend {
pub fn new() -> Rc<Self> {
Rc::new(Self { })
Rc::new(Self {})
}
}
impl Backend for DummyBackend {
}
impl Backend for DummyBackend {}

View file

@ -1,2 +1,2 @@
pub mod xorg;
pub mod dummy;
pub mod xorg;

View file

@ -1,4 +1,7 @@
use crate::backend::{BackendEvent, KeyState, Keyboard, KeyboardEvent, KeyboardId, Mouse, MouseEvent, MouseId, Output, OutputId, ScrollAxis, Backend};
use crate::backend::{
Backend, BackendEvent, KeyState, Keyboard, KeyboardEvent, KeyboardId, Mouse, MouseEvent,
MouseId, Output, OutputId, ScrollAxis,
};
use crate::drm::drm::{Drm, DrmError};
use crate::drm::gbm::{GbmDevice, GbmError, GBM_BO_USE_RENDERING};
use crate::drm::{ModifiedFormat, INVALID_MODIFIER};
@ -211,8 +214,7 @@ pub struct XorgBackend {
b: Cell<f32>,
}
impl Backend for XorgBackend {
}
impl Backend for XorgBackend {}
fn get_drm(con: &XcbCon) -> Result<Drm, XorgBackendError> {
unsafe {
@ -1098,7 +1100,9 @@ impl Keyboard for XorgSeat {
0,
ptr::null(),
);
let res = con.input.xcb_input_xi_grab_device_reply(con.c, res, &mut err);
let res = con
.input
.xcb_input_xi_grab_device_reply(con.c, res, &mut err);
let res = match con.check(res, err) {
Ok(r) => r,
Err(e) => {
@ -1110,7 +1114,9 @@ impl Keyboard for XorgSeat {
log::error!("Could not grab device {}: status = {}", self.kb, res.status);
}
} else {
let cookie = con.input.xcb_input_xi_ungrab_device_checked(con.c, 0, self.kb);
let cookie = con
.input
.xcb_input_xi_ungrab_device_checked(con.c, 0, self.kb);
if let Err(e) = con.check_cookie(cookie) {
log::error!("Could not ungrab device {}: {}", self.kb, ErrorFmt(e));
}