xwayland: Add initial support
This commit is contained in:
parent
78ffe3a93d
commit
1d28574088
23 changed files with 781 additions and 185 deletions
|
|
@ -301,6 +301,9 @@ pub fn init_backend(
|
|||
devices: HashMap::new(),
|
||||
});
|
||||
|
||||
// TODO: Do multiple Xwaylands for better multigpu
|
||||
state.launch_xwayland(Some(primary));
|
||||
|
||||
for (dev, path) in udev_dispatcher.as_source_ref().device_list() {
|
||||
state
|
||||
.device_added(dev, path.into(), dh)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use smithay::{
|
|||
wayland_server::{backend::GlobalId, Client, DisplayHandle},
|
||||
},
|
||||
wayland::{dmabuf::DmabufGlobal, socket::ListeningSocketSource},
|
||||
xwayland::XWaylandClientData,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
@ -46,8 +47,15 @@ impl State {
|
|||
|
||||
// initialize globals
|
||||
let filter = move |client: &Client| {
|
||||
let dev_id = client.get_data::<ClientState>().unwrap().drm_node.unwrap();
|
||||
dev_id == render_node
|
||||
if let Some(normal_client) = client.get_data::<ClientState>() {
|
||||
let dev_id = normal_client.drm_node.unwrap();
|
||||
return dev_id == render_node;
|
||||
}
|
||||
if let Some(xwayland_client) = client.get_data::<XWaylandClientData>() {
|
||||
let dev_id = xwayland_client.user_data().get::<DrmNode>().unwrap();
|
||||
return *dev_id == render_node;
|
||||
}
|
||||
false
|
||||
};
|
||||
|
||||
let dmabuf_global = self
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ pub fn init_backend(
|
|||
#[cfg(feature = "debug")]
|
||||
fps,
|
||||
});
|
||||
|
||||
state
|
||||
.common
|
||||
.output_configuration_state
|
||||
|
|
@ -255,6 +256,8 @@ pub fn init_backend(
|
|||
&state.common.event_loop_handle,
|
||||
);
|
||||
|
||||
state.launch_xwayland(None);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -305,6 +305,8 @@ pub fn init_backend(
|
|||
&state.common.event_loop_handle,
|
||||
);
|
||||
|
||||
state.launch_xwayland(None);
|
||||
|
||||
event_loop
|
||||
.handle()
|
||||
.insert_source(backend, move |event, _, data| match event {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue