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
29
Cargo.lock
generated
29
Cargo.lock
generated
|
|
@ -444,8 +444,6 @@ dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"uapi",
|
"uapi",
|
||||||
"x11rb",
|
"x11rb",
|
||||||
"xcb-dl",
|
|
||||||
"xcb-dl-util",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -1110,30 +1108,3 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
"winapi-wsapoll",
|
"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",
|
|
||||||
]
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ futures = "0.3.19"
|
||||||
num-traits = "0.2.14"
|
num-traits = "0.2.14"
|
||||||
num-derive = "0.3.3"
|
num-derive = "0.3.3"
|
||||||
bitflags = "1.3.2"
|
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"
|
libloading = "0.7.2"
|
||||||
bstr = "0.2.17"
|
bstr = "0.2.17"
|
||||||
isnt = "0.1.0"
|
isnt = "0.1.0"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
pub mod metal;
|
pub mod metal;
|
||||||
pub mod xorg;
|
|
||||||
pub mod xorgng;
|
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 {
|
let cc = CreateCursor {
|
||||||
cid: c.generate_id()?,
|
cid: c.generate_id()?,
|
||||||
source: cp.pid,
|
source: cp.pid,
|
||||||
mask: 0,
|
mask: cp.pid,
|
||||||
fore_red: 0,
|
fore_red: 0,
|
||||||
fore_green: 0,
|
fore_green: 0,
|
||||||
fore_blue: 0,
|
fore_blue: 0,
|
||||||
|
|
@ -204,6 +204,7 @@ impl XorgngBackend {
|
||||||
if let Err(e) = c.call(&cc).await {
|
if let Err(e) = c.call(&cc).await {
|
||||||
return Err(XorgngBackendError::CreateCursor(e));
|
return Err(XorgngBackendError::CreateCursor(e));
|
||||||
}
|
}
|
||||||
|
c.call(&FreePixmap { pixmap: cp.pid });
|
||||||
cc.cid
|
cc.cid
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
|
|
@ -230,7 +231,7 @@ impl XorgngBackend {
|
||||||
cursor,
|
cursor,
|
||||||
root,
|
root,
|
||||||
scheduled_present: Default::default(),
|
scheduled_present: Default::default(),
|
||||||
grab_requests: Default::default()
|
grab_requests: Default::default(),
|
||||||
});
|
});
|
||||||
data.add_output().await?;
|
data.add_output().await?;
|
||||||
data.query_devices(INPUT_DEVICE_ALL_MASTER).await?;
|
data.query_devices(INPUT_DEVICE_ALL_MASTER).await?;
|
||||||
|
|
@ -256,7 +257,10 @@ impl XorgngBackendData {
|
||||||
loop {
|
loop {
|
||||||
let event = self.c.event().await;
|
let event = self.c.event().await;
|
||||||
if let Err(e) = self.handle_event(&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();
|
self.state.el.stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
use crate::backends::xorgng::XorgngBackend;
|
||||||
use crate::{metal, ErrorFmt, State};
|
use crate::{metal, ErrorFmt, State};
|
||||||
use std::future::pending;
|
use std::future::pending;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use crate::backends::xorgng::XorgngBackend;
|
|
||||||
|
|
||||||
pub async fn start_backend(state: Rc<State>) {
|
pub async fn start_backend(state: Rc<State>) {
|
||||||
log::info!("Trying to start X backend");
|
log::info!("Trying to start X backend");
|
||||||
|
|
@ -13,9 +13,7 @@ pub async fn start_backend(state: Rc<State>) {
|
||||||
// Err(e) => e,
|
// Err(e) => e,
|
||||||
// };
|
// };
|
||||||
let e = match XorgngBackend::run(&state).await {
|
let e = match XorgngBackend::run(&state).await {
|
||||||
Ok(_) => {
|
Ok(_) => pending().await,
|
||||||
pending().await
|
|
||||||
},
|
|
||||||
Err(e) => e,
|
Err(e) => e,
|
||||||
};
|
};
|
||||||
log::warn!("Could not start X backend: {}", ErrorFmt(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_INVALID_TIME: u8 = 2;
|
||||||
pub const GRAB_STATUS_NOT_VIEWABLE: u8 = 3;
|
pub const GRAB_STATUS_NOT_VIEWABLE: u8 = 3;
|
||||||
pub const GRAB_STATUS_FROZEN: u8 = 4;
|
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;
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,7 @@ request PutImage = 72 (
|
||||||
depth: u8,
|
depth: u8,
|
||||||
@pad 2,
|
@pad 2,
|
||||||
data: list(u8),
|
data: list(u8),
|
||||||
|
@align 4,
|
||||||
);
|
);
|
||||||
|
|
||||||
request CreateCursor = 93 (
|
request CreateCursor = 93 (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue