Major refactor of locker

Moves the meat of the screensaver into its own file, and separates out
the subservice stuff.
This commit is contained in:
2022-05-24 19:52:21 -07:00
parent 611e3b8dd0
commit 63a176c26e
5 changed files with 697 additions and 575 deletions

View File

@ -95,8 +95,12 @@ impl<'a> Embedder<'a> {
flags: info.flags,
})
}
pub fn end(mut self) -> Result<(), Error> {
self.end_internal()
}
pub fn end(self) -> Result<(), Error> {
fn end_internal(&mut self) -> Result<(), Error> {
if self.client == x::WINDOW_NONE {
return Err(Error::ClientDestroyed);
}
@ -290,6 +294,12 @@ impl<'a> Embedder<'a> {
}
}
impl<'a> Drop for Embedder<'a> {
fn drop(&mut self) {
let _ = self.end_internal();
}
}
fn fetch_xembed_info(conn: &xcb::Connection, client: x::Window) -> Result<XEmbedInfo, Error> {
let xembed_info_atom = intern_atom(conn, XEMBED_INFO_ATOM_NAME)?;
let cookie = conn.send_request(&x::GetProperty {