autocommit 2022-03-26 23:23:07 CET
This commit is contained in:
parent
707ff6066c
commit
86eb70ac3c
2 changed files with 62 additions and 50 deletions
12
src/xcon.rs
12
src/xcon.rs
|
|
@ -29,6 +29,7 @@ use std::pin::Pin;
|
||||||
use std::rc::{Rc, Weak};
|
use std::rc::{Rc, Weak};
|
||||||
use std::task::{Context, Poll, Waker};
|
use std::task::{Context, Poll, Waker};
|
||||||
use std::{mem, ptr};
|
use std::{mem, ptr};
|
||||||
|
use std::fmt::Debug;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use uapi::{c, OwnedFd};
|
use uapi::{c, OwnedFd};
|
||||||
|
|
||||||
|
|
@ -170,6 +171,14 @@ pub struct Reply<T: Message<'static>> {
|
||||||
t: T::Generic<'static>,
|
t: T::Generic<'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: Message<'static>> Debug for Reply<T>
|
||||||
|
where T::Generic<'static>: Debug
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
self.t.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Event {
|
pub struct Event {
|
||||||
bufio: Rc<BufIo>,
|
bufio: Rc<BufIo>,
|
||||||
ext: Option<Extension>,
|
ext: Option<Extension>,
|
||||||
|
|
@ -250,6 +259,8 @@ impl<T: Message<'static>> AsyncReplyHandler<T> {
|
||||||
if let Some(waker) = slot.waker.take() {
|
if let Some(waker) = slot.waker.take() {
|
||||||
waker.wake();
|
waker.wake();
|
||||||
}
|
}
|
||||||
|
} else if let Err(e) = res {
|
||||||
|
log::error!("Received an error whose handler has already been dropped: {}", ErrorFmt(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -756,6 +767,7 @@ impl XconData {
|
||||||
let mut buf = self.bufio.buf();
|
let mut buf = self.bufio.buf();
|
||||||
let mut formatter = Formatter::new(&mut fds, &mut buf, opcode);
|
let mut formatter = Formatter::new(&mut fds, &mut buf, opcode);
|
||||||
t.serialize(&mut formatter);
|
t.serialize(&mut formatter);
|
||||||
|
formatter.align(4);
|
||||||
formatter.write_request_length();
|
formatter.write_request_length();
|
||||||
self.need_sync.set(T::IS_VOID);
|
self.need_sync.set(T::IS_VOID);
|
||||||
self.send(fds, buf)
|
self.send(fds, buf)
|
||||||
|
|
|
||||||
|
|
@ -199,64 +199,64 @@ impl Wm {
|
||||||
if let Err(e) = c.call(&cw).await {
|
if let Err(e) = c.call(&cw).await {
|
||||||
return Err(XWaylandError::CreateXWindow(e));
|
return Err(XWaylandError::CreateXWindow(e));
|
||||||
}
|
}
|
||||||
// c.call(&ChangeProperty {
|
c.call(&ChangeProperty {
|
||||||
// mode: PROP_MODE_REPLACE,
|
mode: PROP_MODE_REPLACE,
|
||||||
// window: xwin,
|
window: xwin,
|
||||||
// property: atoms._NET_WM_NAME,
|
property: atoms._NET_WM_NAME,
|
||||||
// ty: atoms.UTF8_STRING,
|
ty: atoms.UTF8_STRING,
|
||||||
// format: 8,
|
format: 8,
|
||||||
// data: "jay wm".as_bytes(),
|
data: "wlroots wm".as_bytes(),
|
||||||
// });
|
});
|
||||||
// c.call(&ChangeProperty {
|
c.call(&ChangeProperty {
|
||||||
// mode: PROP_MODE_REPLACE,
|
mode: PROP_MODE_REPLACE,
|
||||||
// window: root,
|
window: root,
|
||||||
// property: atoms._NET_SUPPORTING_WM_CHECK,
|
property: atoms._NET_SUPPORTING_WM_CHECK,
|
||||||
// ty: ATOM_WINDOW,
|
ty: ATOM_WINDOW,
|
||||||
// format: 32,
|
format: 32,
|
||||||
// data: uapi::as_bytes(&xwin),
|
data: uapi::as_bytes(&xwin),
|
||||||
// });
|
});
|
||||||
// c.call(&ChangeProperty {
|
c.call(&ChangeProperty {
|
||||||
// mode: PROP_MODE_REPLACE,
|
mode: PROP_MODE_REPLACE,
|
||||||
// window: xwin,
|
window: xwin,
|
||||||
// property: atoms._NET_SUPPORTING_WM_CHECK,
|
property: atoms._NET_SUPPORTING_WM_CHECK,
|
||||||
// ty: ATOM_WINDOW,
|
ty: ATOM_WINDOW,
|
||||||
// format: 32,
|
format: 32,
|
||||||
// data: uapi::as_bytes(&xwin),
|
data: uapi::as_bytes(&xwin),
|
||||||
// });
|
});
|
||||||
c.call(&SetSelectionOwner {
|
c.call(&SetSelectionOwner {
|
||||||
owner: xwin,
|
owner: xwin,
|
||||||
selection: atoms.WM_S0,
|
selection: atoms.WM_S0,
|
||||||
time: 0,
|
time: 0,
|
||||||
});
|
});
|
||||||
// c.call(&SetSelectionOwner {
|
c.call(&SetSelectionOwner {
|
||||||
// owner: xwin,
|
owner: xwin,
|
||||||
// selection: atoms._NET_WM_CM_S0,
|
selection: atoms._NET_WM_CM_S0,
|
||||||
// time: 0,
|
time: 0,
|
||||||
// });
|
});
|
||||||
xwin
|
xwin
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
// let supported_atoms = [
|
let supported_atoms = [
|
||||||
// atoms._NET_WM_STATE,
|
atoms._NET_WM_STATE,
|
||||||
// atoms._NET_ACTIVE_WINDOW,
|
atoms._NET_ACTIVE_WINDOW,
|
||||||
// atoms._NET_WM_MOVERESIZE,
|
atoms._NET_WM_MOVERESIZE,
|
||||||
// atoms._NET_WM_STATE_FOCUSED,
|
atoms._NET_WM_STATE_FOCUSED,
|
||||||
// atoms._NET_WM_STATE_MODAL,
|
atoms._NET_WM_STATE_MODAL,
|
||||||
// atoms._NET_WM_STATE_FULLSCREEN,
|
atoms._NET_WM_STATE_FULLSCREEN,
|
||||||
// atoms._NET_WM_STATE_MAXIMIZED_VERT,
|
atoms._NET_WM_STATE_MAXIMIZED_VERT,
|
||||||
// atoms._NET_WM_STATE_MAXIMIZED_HORZ,
|
atoms._NET_WM_STATE_MAXIMIZED_HORZ,
|
||||||
// atoms._NET_WM_STATE_HIDDEN,
|
atoms._NET_WM_STATE_HIDDEN,
|
||||||
// atoms._NET_CLIENT_LIST,
|
atoms._NET_CLIENT_LIST,
|
||||||
// atoms._NET_CLIENT_LIST_STACKING,
|
atoms._NET_CLIENT_LIST_STACKING,
|
||||||
// ];
|
];
|
||||||
// c.call(&ChangeProperty {
|
c.call(&ChangeProperty {
|
||||||
// mode: PROP_MODE_REPLACE,
|
mode: PROP_MODE_REPLACE,
|
||||||
// window: root,
|
window: root,
|
||||||
// property: atoms._NET_SUPPORTED,
|
property: atoms._NET_SUPPORTED,
|
||||||
// ty: ATOM_ATOM,
|
ty: ATOM_ATOM,
|
||||||
// format: 32,
|
format: 32,
|
||||||
// data: uapi::as_bytes(&supported_atoms[..]),
|
data: uapi::as_bytes(&supported_atoms[..]),
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
c.call(&ChangeProperty {
|
c.call(&ChangeProperty {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue