quexten / swiftmouse

A shortcat like app for keyboard-based mouse navigation on Linux
4 stars 2 forks source link

error[E0063]: missing field `excluded_windows` in initializer of `Options` #8

Open Vaisakhkm2625 opened 2 weeks ago

Vaisakhkm2625 commented 2 weeks ago

First of all, thanks for making this program.. I couldn't get it run though, i am looking forward to trying it out..

i was looking for this for long time and i also unsuccessfully tried build my own with opencv...

hello

The Issue

I was trying to build a nix flake package to try out app on my machine.. (https://github.com/Vaisakhkm2625/swiftmouse/blob/nixflakes/flake.nix took like 5-6 hours )

But while building, i am getting this error..

swiftmouse on  main [!+?] is 📦 v0.1.0 via 🦀 via ❄️  impure (nix-shell-env) took 20s 
❮ cargo run --bin daemon
.
.
error[E0063]: missing field `excluded_windows` in initializer of `Options`
   --> /home/vaisakh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scap-0.0.5/src/capturer/engine/linux/mod.rs:338:23
    |
338 |         let options = Options {
    |                       ^^^^^^^ missing `excluded_windows`

For more information about this error, try `rustc --explain E0063`.
error: could not compile `scap` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

i don't know much rust, but i figured just need to add excluded_windows option, but it's already there... https://github.com/quexten/swiftmouse/blob/4c19d0802b096a5b1a4a3bef43c36bc62879abd1/src/screenshot/mod.rs#L188

and as it's a issue with a dependency, i am not sure what to do, can you please help?

Vaisakhkm2625 commented 2 weeks ago

Infact, itseems they resolved it...

https://github.com/CapSoftware/scap/issues/108

just need to update scap package to 0.0.6 version and remove excluded_windows and source_rect options

Vaisakhkm2625 commented 2 weeks ago

i got it to complie.. but..

swiftmouse/target/debug on  nixflakes [!?] via ❄️  impure (nix-shell-env) took 7s 
❯ ./daemon
[Global Shortcuts] Listening on D-Bus
[Main] Waiting for events
Taking screenshot using pipewire
Capturer stopped, starting: 19.5µs
[Watchdog] No capturer found
Capturer started in 103.282µs
Capturer started: 127.156µs
Capturer found: 2.522µs
[PipewireCapturer] Elapsed lock: 1.901µs
[PipewireCapturer] Elapsed rx: 1.001698663s
[PipewireCapturer] Timeout
[Screenshot Tool] Failed to take screenshot using pipewire: Error
[Screenshot Tool] Failed to take screenshot using pipewire, falling back to screenshot portal
[PipewireCapturer] Cleanup job started
[Scoeeenshot] Screenshot taken: file:///run/user/1000/hypr/xdph_screenshot_5aaa7514.png
[Screencapture Thread] Starting capture
[Screencapture Thread] Capture started
thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
zsh: abort (core dumped)  ./daemon