emoon / rust_minifb

Cross platfrom window and framebuffer crate for Rust
MIT License
1k stars 95 forks source link

Server side decorations under Gnome Wayland #273

Open xkevio opened 2 years ago

xkevio commented 2 years ago

Similar to this issue #224, I am experiencing the same thing. Now in that issue it says it is Gnome's fault and upon reading up on that, that does seem to be the case. But will there ever be a way to use this library under Gnome Wayland?

Right now, this makes this library not really usable on say Manjaro Linux with Gnome. I get the warning: Failed to create server-side surface decoration: Missing and a borderless window with an invisible cursor that only updates when the cursor is moved.

emoon commented 2 years ago

The thing is that I haven't implemented Wayland support myself and have got PRs from others that have helped implementing support for it. So if possibile I would like to have help with this to implement it as I don't run Wayland myself.

xkevio commented 2 years ago

It seems like the smithay-client-toolkit crate is made for creating kind of "fall-back" client-side window decorations with Wayland. I would like to help but I wouldn't really know where to even start putting this kind of stuff. From what I've seen, the error check appears in the wayland.rs on line 301, so maybe there. (Btw, wouldn't using eprintln!() make a little bit more sense for printing to stderr?)

emoon commented 2 years ago

It seems like the smithay-client-toolkit crate is made for creating kind of "fall-back" client-side window decorations with Wayland. I would like to help but I wouldn't really know where to even start putting this kind of stuff.

It's great that you want to help! That said I know pretty nothing at all regarding Wayland so I wouldn't be able to assist that much. Also brining in another crate is something (if possible) I would refrain from doing as the dependency list of crates is growing quite large and it's mainly the wayland support that causes this. Tho, if some solution can be found that would of course be great.

(Btw, wouldn't using eprintln!() make a little bit more sense for printing to stderr?)

If it's an error that makes this not working at all it should be a panic! really.

emoon commented 2 years ago

Yeah, that is possible and it's being used here https://github.com/emoon/rust_minifb/blob/master/Cargo.toml#L45-L53 thing is that building for Linux now requires quite a bunch of dependencies so I would just like to trim them down if possible. So one way would be to try to use the crate suggested and see what is required to get it working and perhaps just take the minimum amount of code from it and do a manual implementation.

As I don't know it's hard to say what makes sense here. Getting it working (using the crate) is likely a good first step and then take it from there.

xkevio commented 2 years ago

Oh I deleted my comment since I saw that it was already done that way but for context and others reading, it was me asking about optional dependencies.

I can try in the near future to get a minimal working example going perhaps but yeah, I did see the rather large dependency list.