chore: Update deps
This commit is contained in:
parent
4f3a682564
commit
4e12957169
39 changed files with 1146 additions and 1001 deletions
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
backend::render,
|
||||
config::OutputConfig,
|
||||
input::Devices,
|
||||
state::{BackendData, Common, Data},
|
||||
state::{BackendData, Common},
|
||||
utils::prelude::*,
|
||||
wayland::protocols::screencopy::{BufferParams, Session as ScreencopySession},
|
||||
};
|
||||
|
|
@ -63,7 +63,7 @@ pub struct X11State {
|
|||
}
|
||||
|
||||
impl X11State {
|
||||
pub fn add_window(&mut self, handle: LoopHandle<'_, Data>) -> Result<Output> {
|
||||
pub fn add_window(&mut self, handle: LoopHandle<'_, State>) -> Result<Output> {
|
||||
let window = WindowBuilder::new()
|
||||
.title("COSMIC")
|
||||
.build(&self.handle)
|
||||
|
|
@ -124,15 +124,15 @@ impl X11State {
|
|||
let (ping, source) =
|
||||
ping::make_ping().with_context(|| "Failed to create output event loop source")?;
|
||||
let _token = handle
|
||||
.insert_source(source, move |_, _, data| {
|
||||
let x11_state = data.state.backend.x11();
|
||||
.insert_source(source, move |_, _, state| {
|
||||
let x11_state = state.backend.x11();
|
||||
if let Some(surface) = x11_state
|
||||
.surfaces
|
||||
.iter_mut()
|
||||
.find(|s| s.output == output_ref)
|
||||
{
|
||||
if let Err(err) =
|
||||
surface.render_output(&mut x11_state.renderer, &mut data.state.common)
|
||||
surface.render_output(&mut x11_state.renderer, &mut state.common)
|
||||
{
|
||||
error!(?err, "Error rendering.");
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ fn try_gbm_allocator(fd: OwnedFd) -> Option<Allocator> {
|
|||
|
||||
pub fn init_backend(
|
||||
dh: &DisplayHandle,
|
||||
event_loop: &mut EventLoop<Data>,
|
||||
event_loop: &mut EventLoop<State>,
|
||||
state: &mut State,
|
||||
) -> Result<()> {
|
||||
let backend = X11Backend::new().with_context(|| "Failed to initilize X11 backend")?;
|
||||
|
|
@ -391,12 +391,11 @@ pub fn init_backend(
|
|||
|
||||
event_loop
|
||||
.handle()
|
||||
.insert_source(backend, move |event, _, data| match event {
|
||||
.insert_source(backend, move |event, _, state| match event {
|
||||
X11Event::CloseRequested { window_id } => {
|
||||
// TODO: drain_filter
|
||||
let mut outputs_removed = Vec::new();
|
||||
for surface in data
|
||||
.state
|
||||
for surface in state
|
||||
.backend
|
||||
.x11()
|
||||
.surfaces
|
||||
|
|
@ -406,13 +405,13 @@ pub fn init_backend(
|
|||
surface.window.unmap();
|
||||
outputs_removed.push(surface.output.clone());
|
||||
}
|
||||
data.state
|
||||
state
|
||||
.backend
|
||||
.x11()
|
||||
.surfaces
|
||||
.retain(|s| s.window.id() != window_id);
|
||||
for output in outputs_removed.into_iter() {
|
||||
data.state
|
||||
state
|
||||
.common
|
||||
.shell
|
||||
.remove_output(&output, seats.iter().cloned());
|
||||
|
|
@ -427,8 +426,7 @@ pub fn init_backend(
|
|||
size,
|
||||
refresh: 60_000,
|
||||
};
|
||||
if let Some(surface) = data
|
||||
.state
|
||||
if let Some(surface) = state
|
||||
.backend
|
||||
.x11()
|
||||
.surfaces
|
||||
|
|
@ -449,8 +447,8 @@ pub fn init_backend(
|
|||
output.change_current_state(Some(mode), None, None, None);
|
||||
output.set_preferred(mode);
|
||||
layer_map_for_output(output).arrange();
|
||||
data.state.common.output_configuration_state.update();
|
||||
data.state.common.shell.refresh_outputs();
|
||||
state.common.output_configuration_state.update();
|
||||
state.common.shell.refresh_outputs();
|
||||
surface.dirty = true;
|
||||
if !surface.pending {
|
||||
surface.render.ping();
|
||||
|
|
@ -458,8 +456,7 @@ pub fn init_backend(
|
|||
}
|
||||
}
|
||||
X11Event::Refresh { window_id } | X11Event::PresentCompleted { window_id } => {
|
||||
if let Some(surface) = data
|
||||
.state
|
||||
if let Some(surface) = state
|
||||
.backend
|
||||
.x11()
|
||||
.surfaces
|
||||
|
|
@ -473,7 +470,7 @@ pub fn init_backend(
|
|||
}
|
||||
}
|
||||
}
|
||||
X11Event::Input(event) => data.state.process_x11_event(event),
|
||||
X11Event::Input(event) => state.process_x11_event(event),
|
||||
})
|
||||
.map_err(|_| anyhow::anyhow!("Failed to insert X11 Backend into event loop"))?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue