autocommit 2022-03-23 00:14:22 CET
This commit is contained in:
parent
2ff60ff817
commit
6597a57ad5
8 changed files with 14 additions and 1209 deletions
|
|
@ -1,3 +1,2 @@
|
|||
pub mod metal;
|
||||
pub mod xorg;
|
||||
pub mod xorgng;
|
||||
|
|
|
|||
1170
src/backends/xorg.rs
1170
src/backends/xorg.rs
File diff suppressed because it is too large
Load diff
|
|
@ -191,7 +191,7 @@ impl XorgngBackend {
|
|||
let cc = CreateCursor {
|
||||
cid: c.generate_id()?,
|
||||
source: cp.pid,
|
||||
mask: 0,
|
||||
mask: cp.pid,
|
||||
fore_red: 0,
|
||||
fore_green: 0,
|
||||
fore_blue: 0,
|
||||
|
|
@ -204,6 +204,7 @@ impl XorgngBackend {
|
|||
if let Err(e) = c.call(&cc).await {
|
||||
return Err(XorgngBackendError::CreateCursor(e));
|
||||
}
|
||||
c.call(&FreePixmap { pixmap: cp.pid });
|
||||
cc.cid
|
||||
};
|
||||
{
|
||||
|
|
@ -230,7 +231,7 @@ impl XorgngBackend {
|
|||
cursor,
|
||||
root,
|
||||
scheduled_present: Default::default(),
|
||||
grab_requests: Default::default()
|
||||
grab_requests: Default::default(),
|
||||
});
|
||||
data.add_output().await?;
|
||||
data.query_devices(INPUT_DEVICE_ALL_MASTER).await?;
|
||||
|
|
@ -256,7 +257,10 @@ impl XorgngBackendData {
|
|||
loop {
|
||||
let event = self.c.event().await;
|
||||
if let Err(e) = self.handle_event(&event).await {
|
||||
log::error!("Fatal error: Could not handle an event from the X server: {}", ErrorFmt(e));
|
||||
log::error!(
|
||||
"Fatal error: Could not handle an event from the X server: {}",
|
||||
ErrorFmt(e)
|
||||
);
|
||||
self.state.el.stop();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::backends::xorgng::XorgngBackend;
|
||||
use crate::{metal, ErrorFmt, State};
|
||||
use std::future::pending;
|
||||
use std::rc::Rc;
|
||||
use crate::backends::xorgng::XorgngBackend;
|
||||
|
||||
pub async fn start_backend(state: Rc<State>) {
|
||||
log::info!("Trying to start X backend");
|
||||
|
|
@ -13,9 +13,7 @@ pub async fn start_backend(state: Rc<State>) {
|
|||
// Err(e) => e,
|
||||
// };
|
||||
let e = match XorgngBackend::run(&state).await {
|
||||
Ok(_) => {
|
||||
pending().await
|
||||
},
|
||||
Ok(_) => pending().await,
|
||||
Err(e) => e,
|
||||
};
|
||||
log::warn!("Could not start X backend: {}", ErrorFmt(e));
|
||||
|
|
|
|||
|
|
@ -101,3 +101,7 @@ pub const GRAB_STATUS_ALREADY_GRABBED: u8 = 1;
|
|||
pub const GRAB_STATUS_INVALID_TIME: u8 = 2;
|
||||
pub const GRAB_STATUS_NOT_VIEWABLE: u8 = 3;
|
||||
pub const GRAB_STATUS_FROZEN: u8 = 4;
|
||||
|
||||
pub const IMAGE_FORMAT_XY_BITMAP: u8 = 0;
|
||||
pub const IMAGE_FORMAT_XY_PIXMAP: u8 = 1;
|
||||
pub const IMAGE_FORMAT_Z_PIXMAP: u8 = 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue