Fix various warnings
This commit is contained in:
parent
09e03cd096
commit
6f45933971
6 changed files with 15 additions and 28 deletions
|
|
@ -114,7 +114,6 @@ enum Msg {
|
|||
WaylandEvent(WaylandEvent),
|
||||
Wayland(wayland::Event),
|
||||
Close,
|
||||
Closed(SurfaceId),
|
||||
ActivateWorkspace(zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1),
|
||||
#[allow(dead_code)]
|
||||
CloseWorkspace(zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1),
|
||||
|
|
@ -183,16 +182,13 @@ enum DragSurface {
|
|||
}
|
||||
|
||||
struct Conf {
|
||||
cosmic_comp_config: cosmic_config::Config,
|
||||
workspace_config: cosmic_comp_config::workspace::WorkspaceConfig,
|
||||
config: CosmicWorkspacesConfig,
|
||||
}
|
||||
|
||||
impl Default for Conf {
|
||||
fn default() -> Self {
|
||||
let cosmic_comp_config = cosmic_config::Config::new("com.system76.CosmicComp", 1).unwrap();
|
||||
Self {
|
||||
cosmic_comp_config,
|
||||
workspace_config: Default::default(),
|
||||
config: Default::default(),
|
||||
}
|
||||
|
|
@ -492,7 +488,6 @@ impl Application for App {
|
|||
Msg::Close => {
|
||||
return self.hide();
|
||||
}
|
||||
Msg::Closed(_) => {}
|
||||
Msg::ActivateWorkspace(workspace_handle) => {
|
||||
let workspace_manager = self.workspace_manager.as_ref().unwrap();
|
||||
workspace_handle.activate();
|
||||
|
|
@ -715,8 +710,8 @@ impl Application for App {
|
|||
text("workspaces").into()
|
||||
}
|
||||
|
||||
fn on_close_requested(&self, id: SurfaceId) -> Option<Msg> {
|
||||
Some(Msg::Closed(id))
|
||||
fn on_close_requested(&self, _id: SurfaceId) -> Option<Msg> {
|
||||
None
|
||||
}
|
||||
|
||||
fn core(&self) -> &cosmic::app::Core {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use cctk::{
|
|||
screencopy::Formats,
|
||||
wayland_client::{
|
||||
protocol::{wl_buffer, wl_shm, wl_shm_pool},
|
||||
Connection, Dispatch, QueueHandle, WEnum,
|
||||
Connection, Dispatch, QueueHandle,
|
||||
},
|
||||
};
|
||||
use cosmic::cctk;
|
||||
|
|
@ -223,7 +223,8 @@ impl AppData {
|
|||
let format = u32::from(wl_shm::Format::Abgr8888);
|
||||
|
||||
#[cfg(not(feature = "force-shm-screencopy"))]
|
||||
if let Some((_, modifiers)) = formats.dmabuf_formats.iter().find(|(f, _)| *f == format) {
|
||||
if let Some((_, _modifiers)) = formats.dmabuf_formats.iter().find(|(f, _)| *f == format) {
|
||||
// TODO Restrict modifiers
|
||||
match self.create_gbm_buffer(format, formats.buffer_size, false) {
|
||||
Ok(Some(buffer)) => {
|
||||
return buffer;
|
||||
|
|
@ -241,6 +242,8 @@ impl AppData {
|
|||
}
|
||||
|
||||
impl Buffer {
|
||||
// Use this when dmabuf/screencopy has a way to specify node
|
||||
#[allow(dead_code)]
|
||||
pub fn node(&self) -> Option<&Path> {
|
||||
self.node.as_deref()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use cctk::{
|
||||
cosmic_protocols::{
|
||||
screencopy::v2::client::{zcosmic_screencopy_manager_v2, zcosmic_screencopy_session_v2},
|
||||
screencopy::v2::client::zcosmic_screencopy_session_v2,
|
||||
toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
|
||||
workspace::v1::client::zcosmic_workspace_handle_v1,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,14 +1,7 @@
|
|||
use cosmic::cctk::{
|
||||
self,
|
||||
cosmic_protocols::{
|
||||
image_source::v1::client::{
|
||||
zcosmic_toplevel_image_source_manager_v1::ZcosmicToplevelImageSourceManagerV1,
|
||||
zcosmic_workspace_image_source_manager_v1::ZcosmicWorkspaceImageSourceManagerV1,
|
||||
},
|
||||
screencopy::v2::client::{
|
||||
zcosmic_screencopy_frame_v2, zcosmic_screencopy_manager_v2,
|
||||
zcosmic_screencopy_session_v2,
|
||||
},
|
||||
cosmic_protocols::screencopy::v2::client::{
|
||||
zcosmic_screencopy_frame_v2, zcosmic_screencopy_manager_v2, zcosmic_screencopy_session_v2,
|
||||
},
|
||||
screencopy::{
|
||||
capture, Formats, Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
|
||||
|
|
@ -45,16 +38,11 @@ impl ScreencopySession {
|
|||
.as_ref()
|
||||
.unwrap()
|
||||
.create_source(toplevel, qh, ()),
|
||||
CaptureSource::Workspace(workspace, output) => screencopy_state
|
||||
CaptureSource::Workspace(workspace, _output) => screencopy_state
|
||||
.workspace_source_manager
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.create_source(
|
||||
workspace,
|
||||
// output,
|
||||
qh,
|
||||
(),
|
||||
),
|
||||
.create_source(workspace, qh, ()),
|
||||
};
|
||||
|
||||
let udata = SessionData {
|
||||
|
|
@ -167,7 +155,7 @@ impl ScreencopyHandler for AppData {
|
|||
conn: &Connection,
|
||||
qh: &QueueHandle<Self>,
|
||||
screencopy_frame: &zcosmic_screencopy_frame_v2::ZcosmicScreencopyFrameV2,
|
||||
frame: Frame,
|
||||
_frame: Frame,
|
||||
) {
|
||||
let session = &screencopy_frame.data::<FrameData>().unwrap().session;
|
||||
let Some(capture) = Capture::for_session(session) else {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ pub use toplevels::toplevels;
|
|||
mod visibility_wrapper;
|
||||
pub use visibility_wrapper::visibility_wrapper;
|
||||
|
||||
// Widget for debugging
|
||||
#[allow(dead_code)]
|
||||
pub fn layout_wrapper<'a, Msg, T: Into<cosmic::Element<'a, Msg>>>(
|
||||
inner: T,
|
||||
) -> LayoutWrapper<'a, Msg> {
|
||||
|
|
|
|||
|
|
@ -106,5 +106,4 @@ impl<'a, Msg: 'a> From<VisibilityWrapper<'a, Msg>> for cosmic::Element<'a, Msg>
|
|||
fn from(widget: VisibilityWrapper<'a, Msg>) -> Self {
|
||||
cosmic::Element::new(widget)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue