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