diff --git a/.github/workflows/rustdoc.yml b/.github/workflows/rustdoc.yml index a02769e..cfd5390 100644 --- a/.github/workflows/rustdoc.yml +++ b/.github/workflows/rustdoc.yml @@ -27,10 +27,10 @@ jobs: - name: Build docs run: cd ./api/rust && cargo doc - name: Create index.html - run: echo "" > ./api/rust/target/doc/index.html + run: echo "" > ./target/doc/index.html - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./api/rust/target/doc + publish_dir: ./target/doc destination_dir: ${{ env.BRANCH_NAME }}/rust diff --git a/src/api.rs b/src/api.rs index ba6d2fe..ee2794a 100644 --- a/src/api.rs +++ b/src/api.rs @@ -447,11 +447,7 @@ impl pinnacle_api_defs::pinnacle::process::v0alpha1::process_service_server::Pro } let Ok(mut child) = tokio::process::Command::new(OsString::from(arg0.clone())) - .envs( - [("WAYLAND_DISPLAY", state.socket_name.clone())] - .into_iter() - .chain(state.xdisplay.map(|xdisp| ("DISPLAY", format!(":{xdisp}")))), - ) + .envs(state.xdisplay.map(|xdisp| ("DISPLAY", format!(":{xdisp}")))) .stdin(match has_callback { true => Stdio::piped(), false => Stdio::null(), diff --git a/src/state.rs b/src/state.rs index 7cb255d..345a2bb 100644 --- a/src/state.rs +++ b/src/state.rs @@ -50,8 +50,6 @@ pub struct State { pub clock: Clock, pub space: Space, - /// The name of the Wayland socket - pub socket_name: String, pub seat: Seat, @@ -108,11 +106,11 @@ impl State { let socket = ListeningSocketSource::new_auto()?; let socket_name = socket.socket_name().to_os_string(); - std::env::set_var("WAYLAND_DISPLAY", socket_name.clone()); tracing::info!( - "Set WAYLAND_DISPLAY to {}", - socket_name.clone().to_string_lossy() + "Setting WAYLAND_DISPLAY to {}", + socket_name.to_string_lossy() ); + std::env::set_var("WAYLAND_DISPLAY", socket_name); // Opening a new process will use up a few file descriptors, around 10 for Alacritty, for // example. Because of this, opening up only around 100 processes would exhaust the file @@ -170,8 +168,8 @@ impl State { let xwayland = { let (xwayland, channel) = XWayland::new(&display_handle); - let clone = display_handle.clone(); - tracing::debug!("inserting into loop"); + let dh_clone = display_handle.clone(); + let res = loop_handle.insert_source(channel, move |event, _, state| match event { XWaylandEvent::Ready { connection, @@ -181,7 +179,7 @@ impl State { } => { let mut wm = X11Wm::start_wm( state.loop_handle.clone(), - clone.clone(), + dh_clone.clone(), connection, client, ) @@ -254,11 +252,9 @@ impl State { dnd_icon: None, - socket_name: socket_name.to_string_lossy().to_string(), - popup_manager: PopupManager::default(), - windows: vec![], + windows: Vec::new(), new_windows: Vec::new(), xwayland,