-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement portal screenshot creation #142
base: main
Are you sure you want to change the base?
Implement portal screenshot creation #142
Conversation
…dcreate_screenshots-creates-blank-screenshots
@@ -0,0 +1,100 @@ | |||
//! The fallback screenshot creator if all previous attempts failed to create the screenshots of a monitor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Desktop Portals are independent of Display protocol. We will need them for gnome on wayland too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh fair, I'll dig into it
pub struct Fallback; | ||
|
||
impl ScreenshotCreator for Fallback { | ||
fn create_screenshot( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not use the portal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And is this even used anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not use the portal?
No it doesn't, the fallback creator tries to create an image of the screens on its own. Maybe I should've chosen a better name for it :D
And is this even used anymore?
Yes! If the other creators (like the portal) failed, this fallback version will be called.
@@ -48,6 +54,25 @@ pub enum Error { | |||
/// } | |||
/// ``` | |||
pub fn create_screenshots() -> Result<Vec<(OutputInfo, image::DynamicImage)>, Error> { | |||
let creators = [PortalScreenshot::new()?]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we discard native x11 method? We could still use it for all dekstop envs except KDE and GNOME. Also the user has to have the portal installed then, idependent of desktop env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using X11 always as fallback is not optimal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using X11 always as fallback is not optimal
May I ask what you mean here?
/// and return it. | ||
fn create_screenshot( | ||
&self, | ||
conn: &RustConnection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Portal does not need this. Add is as a paramter to ::new of Fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
hm... ok, after reading through your comments, I think that there has been a missunderstanding. I thought that we only want to use the portal if the user is on X11 and GNOME or KDE. Will fix it 👍 |
…dcreate_screenshots-creates-blank-screenshots
No description provided.