Update deps and add Cargo.lock
This commit is contained in:
parent
038d27fa88
commit
039e0a9585
4 changed files with 3441 additions and 13 deletions
3422
Cargo.lock
generated
Normal file
3422
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -6,8 +6,6 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols" }
|
cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols" }
|
||||||
futures-channel = "0.3.25"
|
futures-channel = "0.3.25"
|
||||||
iced = { git = "https://github.com/pop-os/libcosmic", features = ["tokio", "wayland"] }
|
|
||||||
iced_native = { git = "https://github.com/pop-os/libcosmic" }
|
|
||||||
iced_sctk = { git = "https://github.com/pop-os/libcosmic" }
|
iced_sctk = { git = "https://github.com/pop-os/libcosmic" }
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic" }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["tokio", "wayland"] }
|
||||||
tokio = "1.23.0"
|
tokio = "1.23.0"
|
||||||
|
|
|
||||||
21
src/main.rs
21
src/main.rs
|
|
@ -11,14 +11,19 @@ use cctk::{
|
||||||
Connection, QueueHandle, WEnum,
|
Connection, QueueHandle, WEnum,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use iced::{
|
use cosmic::{
|
||||||
event::wayland::{Event as WaylandEvent, OutputEvent},
|
iced::{
|
||||||
keyboard::KeyCode,
|
self,
|
||||||
widget, Application, Command, Element, Subscription,
|
event::wayland::{Event as WaylandEvent, OutputEvent},
|
||||||
};
|
keyboard::KeyCode,
|
||||||
use iced_native::{
|
widget, Application, Command, Element, Subscription,
|
||||||
command::platform_specific::wayland::layer_surface::{IcedOutput, SctkLayerSurfaceSettings},
|
},
|
||||||
window::Id as SurfaceId,
|
iced_native::{
|
||||||
|
command::platform_specific::wayland::layer_surface::{
|
||||||
|
IcedOutput, SctkLayerSurfaceSettings,
|
||||||
|
},
|
||||||
|
window::Id as SurfaceId,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use iced_sctk::{
|
use iced_sctk::{
|
||||||
application::SurfaceIdWrapper,
|
application::SurfaceIdWrapper,
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,12 @@ use cctk::{
|
||||||
},
|
},
|
||||||
workspace::{WorkspaceHandler, WorkspaceState},
|
workspace::{WorkspaceHandler, WorkspaceState},
|
||||||
};
|
};
|
||||||
use futures_channel::mpsc;
|
use cosmic::iced::{
|
||||||
use iced::{
|
self,
|
||||||
futures::{executor::block_on, FutureExt, SinkExt},
|
futures::{executor::block_on, FutureExt, SinkExt},
|
||||||
widget::image,
|
widget::image,
|
||||||
};
|
};
|
||||||
|
use futures_channel::mpsc;
|
||||||
use std::{collections::HashMap, thread};
|
use std::{collections::HashMap, thread};
|
||||||
|
|
||||||
// TODO define subscription for a particular output/workspace/toplevel (but we want to rate limit?)
|
// TODO define subscription for a particular output/workspace/toplevel (but we want to rate limit?)
|
||||||
|
|
@ -292,6 +293,7 @@ impl ScreencopyHandler for AppData {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let buf_len = buffer_info.stride * buffer_info.height;
|
let buf_len = buffer_info.stride * buffer_info.height;
|
||||||
|
|
||||||
|
// TODO: reuse pool? swapping?
|
||||||
let mut pool = RawPool::new(buf_len as usize, &self.shm_state).unwrap();
|
let mut pool = RawPool::new(buf_len as usize, &self.shm_state).unwrap();
|
||||||
let buffer = pool.create_buffer(
|
let buffer = pool.create_buffer(
|
||||||
0,
|
0,
|
||||||
|
|
@ -325,6 +327,7 @@ impl ScreencopyHandler for AppData {
|
||||||
) {
|
) {
|
||||||
let frame = self.frames.get_mut(&session.id()).unwrap();
|
let frame = self.frames.get_mut(&session.id()).unwrap();
|
||||||
let (mut pool, buffer, buffer_info) = frame.buffer.take().unwrap();
|
let (mut pool, buffer, buffer_info) = frame.buffer.take().unwrap();
|
||||||
|
// XXX is this at all a performance issue?
|
||||||
let image =
|
let image =
|
||||||
image::Handle::from_pixels(buffer_info.width, buffer_info.height, pool.mmap().to_vec());
|
image::Handle::from_pixels(buffer_info.width, buffer_info.height, pool.mmap().to_vec());
|
||||||
let event = match &frame.source {
|
let event = match &frame.source {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue