chore: Update deps
This commit is contained in:
parent
4f3a682564
commit
4e12957169
39 changed files with 1146 additions and 1001 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)) => {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ pub fn update_reactive_popups<'a>(
|
|||
}
|
||||
}
|
||||
}
|
||||
PopupKind::InputMethod(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use smithay::{
|
|||
zwlr_output_mode_v1::{self, ZwlrOutputModeV1},
|
||||
},
|
||||
wayland_server::{
|
||||
backend::{ClientId, GlobalId, ObjectId},
|
||||
backend::{ClientId, GlobalId},
|
||||
protocol::wl_output::WlOutput,
|
||||
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
|
||||
},
|
||||
|
|
@ -247,9 +247,9 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &Output) {
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: &ZwlrOutputHeadV1, _data: &Output) {
|
||||
for instance in &mut state.output_configuration_state().instances {
|
||||
instance.heads.retain(|h| h.head.id() != resource);
|
||||
instance.heads.retain(|h| &h.head != resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -883,18 +883,18 @@ where
|
|||
fn destroyed(
|
||||
state: &mut D,
|
||||
_client: wayland_backend::server::ClientId,
|
||||
resource: wayland_backend::server::ObjectId,
|
||||
resource: &ZcosmicScreencopySessionV1,
|
||||
data: &SessionData,
|
||||
) {
|
||||
if data.inner.lock().unwrap().is_cursor() {
|
||||
let session = CursorSession {
|
||||
obj: SessionResource::Destroyed(resource),
|
||||
obj: SessionResource::Destroyed(resource.id()),
|
||||
data: data.clone(),
|
||||
};
|
||||
state.cursor_session_destroyed(session)
|
||||
} else {
|
||||
let session = Session {
|
||||
obj: SessionResource::Destroyed(resource),
|
||||
obj: SessionResource::Destroyed(resource.id()),
|
||||
data: data.clone(),
|
||||
};
|
||||
state.session_destroyed(session)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::{collections::HashMap, sync::Mutex};
|
|||
use smithay::{
|
||||
output::Output,
|
||||
reexports::wayland_server::{
|
||||
backend::{ClientId, GlobalId, ObjectId},
|
||||
backend::{ClientId, GlobalId},
|
||||
protocol::wl_surface::WlSurface,
|
||||
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
|
||||
},
|
||||
|
|
@ -139,11 +139,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &()) {
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: &ZcosmicToplevelInfoV1, _data: &()) {
|
||||
state
|
||||
.toplevel_info_state_mut()
|
||||
.instances
|
||||
.retain(|i| i.id() != resource);
|
||||
.retain(|i| i != resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -174,16 +174,12 @@ where
|
|||
fn destroyed(
|
||||
state: &mut D,
|
||||
_client: ClientId,
|
||||
resource: ObjectId,
|
||||
resource: &ZcosmicToplevelHandleV1,
|
||||
_data: &ToplevelHandleState<W>,
|
||||
) {
|
||||
for toplevel in &state.toplevel_info_state_mut().toplevels {
|
||||
if let Some(state) = toplevel.user_data().get::<ToplevelState>() {
|
||||
state
|
||||
.lock()
|
||||
.unwrap()
|
||||
.instances
|
||||
.retain(|i| i.id() != resource);
|
||||
state.lock().unwrap().instances.retain(|i| i != resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use smithay::{
|
|||
input::{Seat, SeatHandler},
|
||||
output::Output,
|
||||
reexports::wayland_server::{
|
||||
backend::{ClientId, GlobalId, ObjectId},
|
||||
backend::{ClientId, GlobalId},
|
||||
protocol::wl_surface::WlSurface,
|
||||
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
|
||||
},
|
||||
|
|
@ -225,9 +225,9 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, client: ClientId, resource: ObjectId, _data: &()) {
|
||||
fn destroyed(state: &mut D, client: ClientId, resource: &ZcosmicToplevelManagerV1, _data: &()) {
|
||||
let mng_state = state.toplevel_management_state();
|
||||
mng_state.instances.retain(|i| i.id() != resource);
|
||||
mng_state.instances.retain(|i| i != resource);
|
||||
if !mng_state
|
||||
.instances
|
||||
.iter()
|
||||
|
|
|
|||
|
|
@ -211,11 +211,16 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &()) {
|
||||
fn destroyed(
|
||||
state: &mut D,
|
||||
_client: ClientId,
|
||||
resource: &ZcosmicWorkspaceManagerV1,
|
||||
_data: &(),
|
||||
) {
|
||||
state
|
||||
.workspace_state_mut()
|
||||
.instances
|
||||
.retain(|i| i.id() != resource);
|
||||
.retain(|i| i != resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,9 +273,14 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &WorkspaceGroupData) {
|
||||
fn destroyed(
|
||||
state: &mut D,
|
||||
_client: ClientId,
|
||||
resource: &ZcosmicWorkspaceGroupHandleV1,
|
||||
_data: &WorkspaceGroupData,
|
||||
) {
|
||||
for group in &mut state.workspace_state_mut().groups {
|
||||
group.instances.retain(|i| i.id() != resource)
|
||||
group.instances.retain(|i| i != resource)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -361,10 +371,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &WorkspaceData) {
|
||||
fn destroyed(
|
||||
state: &mut D,
|
||||
_client: ClientId,
|
||||
resource: &ZcosmicWorkspaceHandleV1,
|
||||
_data: &WorkspaceData,
|
||||
) {
|
||||
for group in &mut state.workspace_state_mut().groups {
|
||||
for workspace in &mut group.workspaces {
|
||||
workspace.instances.retain(|i| i.id() != resource)
|
||||
workspace.instances.retain(|i| i != resource)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue