chore: Update deps

This commit is contained in:
Victoria Brekenfeld 2023-09-29 21:33:16 +02:00
parent 4f3a682564
commit 4e12957169
39 changed files with 1146 additions and 1001 deletions

View file

@ -2,7 +2,7 @@
use crate::{
shell::CosmicSurface,
state::{BackendData, ClientState, Data},
state::{BackendData, ClientState},
utils::prelude::*,
wayland::protocols::screencopy::SessionType,
};
@ -73,20 +73,21 @@ impl State {
}
fn xdg_popup_ensure_initial_configure(&mut self, popup: &PopupKind) {
let PopupKind::Xdg(ref popup) = popup;
let initial_configure_sent = with_states(popup.wl_surface(), |states| {
states
.data_map
.get::<Mutex<XdgPopupSurfaceRoleAttributes>>()
.unwrap()
.lock()
.unwrap()
.initial_configure_sent
});
if !initial_configure_sent {
// NOTE: This should never fail as the initial configure is always
// allowed.
popup.send_configure().expect("initial configure failed");
if let PopupKind::Xdg(ref popup) = popup {
let initial_configure_sent = with_states(popup.wl_surface(), |states| {
states
.data_map
.get::<Mutex<XdgPopupSurfaceRoleAttributes>>()
.unwrap()
.lock()
.unwrap()
.initial_configure_sent
});
if !initial_configure_sent {
// NOTE: This should never fail as the initial configure is always
// allowed.
popup.send_configure().expect("initial configure failed");
}
}
}
@ -149,10 +150,11 @@ impl CompositorHandler for State {
state
.common
.event_loop_handle
.insert_source(source, move |_, _, data| {
data.state
.insert_source(source, move |_, _, state| {
let dh = state.common.display_handle.clone();
state
.client_compositor_state(&client)
.blocker_cleared(&mut data.state, &data.display.handle());
.blocker_cleared(state, &dh);
Ok(())
});
if res.is_ok() {
@ -164,7 +166,7 @@ impl CompositorHandler for State {
}
fn commit(&mut self, surface: &WlSurface) {
X11Wm::commit_hook::<Data>(surface);
X11Wm::commit_hook::<State>(surface);
// first load the buffer for various smithay helper functions
on_commit_buffer_handler::<Self>(surface);

View file

@ -137,8 +137,8 @@ impl State {
self.common
.config
.write_outputs(self.common.output_configuration_state.outputs());
self.common.event_loop_handle.insert_idle(move |data| {
data.state.common.output_configuration_state.update();
self.common.event_loop_handle.insert_idle(move |state| {
state.common.output_configuration_state.update();
});
true

View file

@ -46,7 +46,7 @@ use crate::{
render_output, render_workspace, CursorMode, CLEAR_COLOR,
},
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
state::{BackendData, ClientState, Common, Data, State},
state::{BackendData, ClientState, Common, State},
utils::prelude::OutputExt,
wayland::protocols::{
screencopy::{
@ -1173,19 +1173,14 @@ impl State {
if active.wl_surface().as_ref() == Some(surface) {
for (session, params) in active.pending_buffers() {
let window = active.clone();
self.common.event_loop_handle.insert_idle(move |data| {
self.common.event_loop_handle.insert_idle(move |state| {
if !session.alive() {
return;
}
match render_window_to_buffer(
&mut data.state,
&session,
params.clone(),
&window,
) {
match render_window_to_buffer(state, &session, params.clone(), &window) {
// rendering yielded no damage, buffer is still pending
Ok(false) => data.state.common.still_pending(session, params),
Ok(false) => state.common.still_pending(session, params),
Ok(true) => {} // success
Err((reason, err)) => {
warn!(?err, "Screencopy session failed");
@ -1291,21 +1286,21 @@ impl State {
}
pub fn schedule_offscreen_workspace_session(
event_loop_handle: &LoopHandle<'static, Data>,
event_loop_handle: &LoopHandle<'static, State>,
session: Session,
params: BufferParams,
output: Output,
handle: WorkspaceHandle,
) {
event_loop_handle.insert_idle(move |data| {
event_loop_handle.insert_idle(move |state| {
if !session.alive() {
return;
}
if !data.state.common.shell.outputs.contains(&output) {
if !state.common.shell.outputs.contains(&output) {
return;
}
match render_workspace_to_buffer(
&mut data.state,
state,
&session,
params.clone(),
&output,
@ -1313,7 +1308,7 @@ pub fn schedule_offscreen_workspace_session(
) {
Ok(false) => {
// rendering yielded no new damage, buffer still pending
data.state.common.still_pending(session, params);
state.common.still_pending(session, params);
}
Ok(true) => {}
Err((reason, err)) => {

View file

@ -16,12 +16,12 @@ impl SecurityContextHandler for State {
) {
self.common
.event_loop_handle
.insert_source(source, move |client_stream, _, data| {
if let Err(err) = data.display.handle().insert_client(
.insert_source(source, move |client_stream, _, state| {
if let Err(err) = state.common.display_handle.insert_client(
client_stream,
Arc::new(ClientState {
security_context: Some(security_context.clone()),
..data.state.new_client_state()
..state.new_client_state()
}),
) {
warn!(?err, "Error adding wayland client");

View file

@ -95,6 +95,7 @@ pub fn update_reactive_popups<'a>(
}
}
}
PopupKind::InputMethod(_) => {}
}
}
}