xwayland: don't transmute setup data to 'static
This commit is contained in:
parent
555bd0a1bc
commit
498e01a8bb
3 changed files with 8 additions and 12 deletions
|
|
@ -161,7 +161,7 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<XBackend>, XBackendError> {
|
||||||
{
|
{
|
||||||
return Err(XBackendError::EnableXkb(e));
|
return Err(XBackendError::EnableXkb(e));
|
||||||
}
|
}
|
||||||
let root = c.setup().screens[0].root;
|
let root = c.root_window();
|
||||||
let drm = {
|
let drm = {
|
||||||
let res = c
|
let res = c
|
||||||
.call(&Dri3Open {
|
.call(&Dri3Open {
|
||||||
|
|
@ -215,7 +215,7 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<XBackend>, XBackendError> {
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
let se = XiSelectEvents {
|
let se = XiSelectEvents {
|
||||||
window: c.setup().screens[0].root,
|
window: c.root_window(),
|
||||||
masks: Cow::Borrowed(&[XiEventMask {
|
masks: Cow::Borrowed(&[XiEventMask {
|
||||||
deviceid: INPUT_DEVICE_ALL,
|
deviceid: INPUT_DEVICE_ALL,
|
||||||
mask: &[XI_EVENT_MASK_HIERARCHY],
|
mask: &[XI_EVENT_MASK_HIERARCHY],
|
||||||
|
|
|
||||||
14
src/xcon.rs
14
src/xcon.rs
|
|
@ -157,7 +157,7 @@ pub struct Xcon {
|
||||||
data: Rc<XconData>,
|
data: Rc<XconData>,
|
||||||
outgoing: Cell<Option<SpawnedFuture<()>>>,
|
outgoing: Cell<Option<SpawnedFuture<()>>>,
|
||||||
incoming: Cell<Option<SpawnedFuture<()>>>,
|
incoming: Cell<Option<SpawnedFuture<()>>>,
|
||||||
setup: Reply<Setup<'static>>,
|
root_window: u32,
|
||||||
extensions: Rc<ExtensionData>,
|
extensions: Rc<ExtensionData>,
|
||||||
|
|
||||||
xid_next: Cell<u32>,
|
xid_next: Cell<u32>,
|
||||||
|
|
@ -371,8 +371,8 @@ impl<T: Message<'static>> Future for AsyncReply<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Xcon {
|
impl Xcon {
|
||||||
pub fn setup(&self) -> &Setup {
|
pub fn root_window(&self) -> u32 {
|
||||||
self.setup.get()
|
self.root_window
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn event(&self) -> Event {
|
pub async fn event(&self) -> Event {
|
||||||
|
|
@ -510,11 +510,7 @@ impl Xcon {
|
||||||
xid_next: Cell::new(setup.resource_id_base),
|
xid_next: Cell::new(setup.resource_id_base),
|
||||||
xid_inc: 1 << setup.resource_id_mask.trailing_zeros(),
|
xid_inc: 1 << setup.resource_id_mask.trailing_zeros(),
|
||||||
xid_max: setup.resource_id_mask | setup.resource_id_base,
|
xid_max: setup.resource_id_mask | setup.resource_id_base,
|
||||||
setup: Reply {
|
root_window: setup.screens[0].root,
|
||||||
socket: data.clone(),
|
|
||||||
t: unsafe { mem::transmute(setup) },
|
|
||||||
buf,
|
|
||||||
},
|
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
slf.data.xorg.set(Rc::downgrade(&slf));
|
slf.data.xorg.set(Rc::downgrade(&slf));
|
||||||
|
|
@ -665,7 +661,7 @@ impl Xcon {
|
||||||
let create_pixmap = self.call(&CreatePixmap {
|
let create_pixmap = self.call(&CreatePixmap {
|
||||||
depth: 32,
|
depth: 32,
|
||||||
pid: pixmap,
|
pid: pixmap,
|
||||||
drawable: self.setup.get().screens[0].root,
|
drawable: self.root_window,
|
||||||
width: width as _,
|
width: width as _,
|
||||||
height: height as _,
|
height: height as _,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ impl Wm {
|
||||||
nf.insert(atoms._NET_WM_WINDOW_TYPE_UTILITY);
|
nf.insert(atoms._NET_WM_WINDOW_TYPE_UTILITY);
|
||||||
nf
|
nf
|
||||||
};
|
};
|
||||||
let root = c.setup().screens[0].root;
|
let root = c.root_window();
|
||||||
{
|
{
|
||||||
let events = 0
|
let events = 0
|
||||||
| EVENT_MASK_SUBSTRUCTURE_NOTIFY
|
| EVENT_MASK_SUBSTRUCTURE_NOTIFY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue