danyspin97 / wpaperd

Modern wallpaper daemon for Wayland
GNU General Public License v3.0
332 stars 26 forks source link

Add mutex to prevent borrowing error #16

Closed 1995parham closed 2 years ago

1995parham commented 2 years ago

Resolve #10

I have added mutex to prevent multiple mutable reference at the same time, and it works.

danyspin97 commented 2 years ago

The idea of using a mutex is corret, we just need to wrap surfaces with a mutex instead of RefCell in https://github.com/danyspin97/wpaperd/blob/main/src/main.rs#L84.

1995parham commented 2 years ago

Sure, I will change it to use mutex on surfaces.

1995parham commented 2 years ago

I tried to use Mutex instead of RefCell, I hope it is okay :see_no_evil:

danyspin97 commented 2 years ago

Yea, it is okay. Thank you for your PR! 😄