Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downsampling breaks on systems with multiple monitors. #15

Open
THEGOLDENPRO opened this issue Oct 13, 2024 · 8 comments
Open

Downsampling breaks on systems with multiple monitors. #15

THEGOLDENPRO opened this issue Oct 13, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@THEGOLDENPRO
Copy link
Member

THEGOLDENPRO commented Oct 13, 2024

rdev's display_size() on systems with more than one monitor returns the dimensions of all the monitors combined which breaks the image down-sampling optimization as it gets skipped if those combined monitor dimensions are bigger than the image which is almost always true.

Down-sampling optimization should only occur if the image is quite a bit bigger than ONLY the current monitor in use but display_size() from rdev returns the size of all the monitors combined. This is important as now images that are high res will NOT get down-sampled leading to pixely images and more memory being consumed than normal.

Source code in question:

roseate/src/app.rs

Lines 96 to 104 in 5456d28

let (width, height) = display_size().expect("Failed to get monitor size!");
let mut optimizations = Vec::new();
if mutable_image.image_size.width > width as usize && mutable_image.image_size.height > height as usize {
optimizations.push(ImageOptimization::Downsample(width as u32, height as u32));
}
mutable_image.load_image(&optimizations);

@THEGOLDENPRO THEGOLDENPRO added the bug Something isn't working label Oct 13, 2024
@THEGOLDENPRO THEGOLDENPRO self-assigned this Oct 13, 2024
@THEGOLDENPRO
Copy link
Member Author

this might be good: https://crates.io/crates/display-info

@THEGOLDENPRO
Copy link
Member Author

switched over to that display-info crate but this will need testing. idk if it will blow up on other systems

@THEGOLDENPRO
Copy link
Member Author

I wonder how this crate will play on something FreeBSD as I would like Roseate to support that. 🤔

@r3tr0ananas
Copy link
Member

display-info doesn't work on freebsd.

@THEGOLDENPRO
Copy link
Member Author

I guess someone will have to add support to display-info for it then.

@THEGOLDENPRO
Copy link
Member Author

it could be a matter of just allowing the linux module in display-info for freebsd too but I don't know that until I can test it or get someone to test it.

https://doc.rust-lang.org/reference/conditional-compilation.html#target_os
https://github.com/nashaofu/display-info/blob/master/src/lib.rs#L18-L21

@THEGOLDENPRO
Copy link
Member Author

@r3tr0ananas if you want something to work on could you possibly try and get display-info to work in FreeBSD. I was having trouble getting x11 in FreeBSD to pick up my mouse under a VM. (I should probably try USB passthrough)

@r3tr0ananas
Copy link
Member

I already tried it with adding target_os = "freebsd" and it doesn't work. I get use of declared crate or module xcb and use of declared crate or module smithay_client_toolkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants