chore: apply rustfmt config with module import granulatiry

This commit is contained in:
Michael Aaron Murphy 2026-04-29 17:50:08 +02:00 committed by Michael Murphy
parent 2b9906f941
commit 2acf6f9f14
28 changed files with 190 additions and 288 deletions

View file

@ -1,37 +1,23 @@
// Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::{
cctk::{
cosmic_protocols::{
toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
workspace::v2::client::zcosmic_workspace_handle_v2,
},
wayland_client::{
Connection, WEnum,
protocol::{wl_output, wl_shm},
},
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
},
iced::{
self,
futures::{FutureExt, SinkExt, executor::block_on},
},
iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer},
};
use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1;
use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
use cosmic::cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
use cosmic::cctk::wayland_client::protocol::{wl_output, wl_shm};
use cosmic::cctk::wayland_client::{Connection, WEnum};
use cosmic::cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1;
use cosmic::iced::futures::executor::block_on;
use cosmic::iced::futures::{FutureExt, SinkExt};
use cosmic::iced::{self};
use cosmic::iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer};
use futures_channel::mpsc;
use std::{
collections::HashSet,
fs,
io::{self, Write},
sync::{
Arc,
atomic::{AtomicU32, Ordering},
},
thread,
};
use std::collections::HashSet;
use std::io::{self, Write};
use std::sync::Arc;
use std::sync::atomic::{AtomicU32, Ordering};
use std::{fs, thread};
use super::{CaptureImage, Cmd, Event};
use crate::utils;

View file

@ -7,13 +7,9 @@
//! There are two backends: one that uses cosmic-comp protocols, and a mock
//! backend for testing without any special protocols.
use cosmic::{
cctk::{
cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
wayland_client::protocol::wl_output,
},
iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer,
};
use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
use cosmic::cctk::wayland_client::protocol::wl_output;
use cosmic::iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer;
use std::collections::HashSet;
// Wayland backend using cosmic-comp specific protocols

View file

@ -1,15 +1,12 @@
use cctk::{
screencopy::{Formats, Rect},
wayland_client::{
Connection, Dispatch, QueueHandle,
protocol::{wl_buffer, wl_shm, wl_shm_pool},
},
use cctk::screencopy::{Formats, Rect};
use cctk::wayland_client::protocol::{wl_buffer, wl_shm, wl_shm_pool};
use cctk::wayland_client::{Connection, Dispatch, QueueHandle};
use cosmic::cctk;
use cosmic::iced::platform_specific::shell::subsurface_widget::{
BufferSource, Dmabuf, Plane, Shmbuf,
};
use cosmic::{
cctk,
iced::platform_specific::shell::subsurface_widget::{BufferSource, Dmabuf, Plane, Shmbuf},
};
use std::{os::fd::AsFd, sync::Arc};
use std::os::fd::AsFd;
use std::sync::Arc;
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1;
use super::AppData;

View file

@ -1,7 +1,5 @@
use cctk::{
screencopy::{CaptureSession, CaptureSource, ScreencopyState},
wayland_client::QueueHandle,
};
use cctk::screencopy::{CaptureSession, CaptureSource, ScreencopyState};
use cctk::wayland_client::QueueHandle;
use cosmic::cctk;
use std::sync::{Arc, Mutex};

View file

@ -1,16 +1,11 @@
use cctk::{
sctk::{
self,
dmabuf::{DmabufFeedback, DmabufHandler, DmabufState},
},
wayland_client::{Connection, QueueHandle, protocol::wl_buffer},
};
use cctk::sctk::dmabuf::{DmabufFeedback, DmabufHandler, DmabufState};
use cctk::sctk::{self};
use cctk::wayland_client::protocol::wl_buffer;
use cctk::wayland_client::{Connection, QueueHandle};
use cosmic::cctk;
use wayland_protocols::wp::linux_dmabuf::zv1::client::{
zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1,
zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1,
};
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1;
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1;
use super::AppData;

View file

@ -1,9 +1,7 @@
use std::{
collections::hash_map::{self, HashMap},
fs, io,
os::unix::fs::MetadataExt,
path::{Path, PathBuf},
};
use std::collections::hash_map::{self, HashMap};
use std::os::unix::fs::MetadataExt;
use std::path::{Path, PathBuf};
use std::{fs, io};
// TODO Purge gbm devices that are no longer needed/valid?
#[derive(Default)]

View file

@ -2,35 +2,29 @@
// subscription.
use calloop_wayland_source::WaylandSource;
use cctk::{
cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2,
screencopy::{CaptureSource, ScreencopyState},
sctk::{
self,
dmabuf::{DmabufFeedback, DmabufState},
registry::{ProvidesRegistryState, RegistryState},
seat::{SeatHandler, SeatState},
shm::{Shm, ShmHandler},
},
toplevel_info::ToplevelInfoState,
toplevel_management::ToplevelManagerState,
wayland_client::{
Connection, Proxy, QueueHandle, globals::registry_queue_init, protocol::wl_seat,
},
workspace::WorkspaceState,
};
use cosmic::{
cctk,
iced::{
self,
futures::{
FutureExt, SinkExt,
channel::mpsc,
executor::{ThreadPool, block_on},
},
},
};
use std::{cell::RefCell, collections::HashMap, hash::Hash, sync::Arc, thread};
use cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
use cctk::screencopy::{CaptureSource, ScreencopyState};
use cctk::sctk::dmabuf::{DmabufFeedback, DmabufState};
use cctk::sctk::registry::{ProvidesRegistryState, RegistryState};
use cctk::sctk::seat::{SeatHandler, SeatState};
use cctk::sctk::shm::{Shm, ShmHandler};
use cctk::sctk::{self};
use cctk::toplevel_info::ToplevelInfoState;
use cctk::toplevel_management::ToplevelManagerState;
use cctk::wayland_client::globals::registry_queue_init;
use cctk::wayland_client::protocol::wl_seat;
use cctk::wayland_client::{Connection, Proxy, QueueHandle};
use cctk::workspace::WorkspaceState;
use cosmic::cctk;
use cosmic::iced::futures::channel::mpsc;
use cosmic::iced::futures::executor::{ThreadPool, block_on};
use cosmic::iced::futures::{FutureExt, SinkExt};
use cosmic::iced::{self};
use std::cell::RefCell;
use std::collections::HashMap;
use std::hash::Hash;
use std::sync::Arc;
use std::thread;
mod buffer;
use buffer::Buffer;

View file

@ -1,21 +1,15 @@
use cosmic::{
cctk::{
self,
screencopy::{
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats,
Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
},
wayland_client::{Connection, QueueHandle, WEnum},
},
iced::platform_specific::shell::subsurface_widget::{
SubsurfaceBuffer, SubsurfaceBufferRelease,
},
use cosmic::cctk::screencopy::{
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats, Frame,
ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler, ScreencopySessionData,
ScreencopySessionDataExt, ScreencopyState,
};
use std::{
array,
sync::{Arc, Weak},
use cosmic::cctk::wayland_client::{Connection, QueueHandle, WEnum};
use cosmic::cctk::{self};
use cosmic::iced::platform_specific::shell::subsurface_widget::{
SubsurfaceBuffer, SubsurfaceBufferRelease,
};
use std::array;
use std::sync::{Arc, Weak};
use super::{AppData, Buffer, Capture, CaptureImage, Event};

View file

@ -1,9 +1,7 @@
use cctk::{
cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
toplevel_info::{ToplevelInfoHandler, ToplevelInfoState},
toplevel_management::{ToplevelManagerHandler, ToplevelManagerState},
wayland_client::{Connection, QueueHandle, WEnum},
};
use cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
use cctk::toplevel_info::{ToplevelInfoHandler, ToplevelInfoState};
use cctk::toplevel_management::{ToplevelManagerHandler, ToplevelManagerState};
use cctk::wayland_client::{Connection, QueueHandle, WEnum};
use cosmic::cctk;
use wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1;

View file

@ -1,5 +1,7 @@
use ash::{prelude::VkResult, vk};
use std::{collections::HashMap, ffi::CStr};
use ash::prelude::VkResult;
use ash::vk;
use std::collections::HashMap;
use std::ffi::CStr;
pub struct Vulkan {
instance: ash::Instance,