1
0
Fork 0
forked from wry/wry

autocommit 2022-03-23 00:14:22 CET

This commit is contained in:
Julian Orth 2022-03-23 00:14:22 +01:00
parent 2ff60ff817
commit 6597a57ad5
8 changed files with 14 additions and 1209 deletions

29
Cargo.lock generated
View file

@ -444,8 +444,6 @@ dependencies = [
"thiserror",
"uapi",
"x11rb",
"xcb-dl",
"xcb-dl-util",
]
[[package]]
@ -1110,30 +1108,3 @@ dependencies = [
"winapi",
"winapi-wsapoll",
]
[[package]]
name = "xcb-dl"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ce37e57249f12cbdf43844a3c9b3162f528ec27a1dc1dd7c6f46826063f51e8"
dependencies = [
"libc",
"libloading",
]
[[package]]
name = "xcb-dl-util"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac09222229087f380311b876bf8651de4cfe78cf793ef8702932a81385c0f400"
dependencies = [
"bitflags",
"bstr",
"byteorder",
"isnt",
"libc",
"log",
"smallvec",
"thiserror",
"xcb-dl",
]

View file

@ -23,8 +23,6 @@ futures = "0.3.19"
num-traits = "0.2.14"
num-derive = "0.3.3"
bitflags = "1.3.2"
xcb-dl = "0.2.0"
xcb-dl-util = { version = "0.2.0", features = ["xcb_shm", "xcb_xinput", "xcb_xkb", "xcb_dri3", "xcb_present", "xcb_render"]}
libloading = "0.7.2"
bstr = "0.2.17"
isnt = "0.1.0"

View file

@ -1,3 +1,2 @@
pub mod metal;
pub mod xorg;
pub mod xorgng;

File diff suppressed because it is too large Load diff

View file

@ -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;
}

View file

@ -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));

View file

@ -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;

View file

@ -235,6 +235,7 @@ request PutImage = 72 (
depth: u8,
@pad 2,
data: list(u8),
@align 4,
);
request CreateCursor = 93 (