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]
|
||||
cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols" }
|
||||
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" }
|
||||
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"
|
||||
|
|
|
|||
21
src/main.rs
21
src/main.rs
|
|
@ -11,14 +11,19 @@ use cctk::{
|
|||
Connection, QueueHandle, WEnum,
|
||||
},
|
||||
};
|
||||
use iced::{
|
||||
event::wayland::{Event as WaylandEvent, OutputEvent},
|
||||
keyboard::KeyCode,
|
||||
widget, Application, Command, Element, Subscription,
|
||||
};
|
||||
use iced_native::{
|
||||
command::platform_specific::wayland::layer_surface::{IcedOutput, SctkLayerSurfaceSettings},
|
||||
window::Id as SurfaceId,
|
||||
use cosmic::{
|
||||
iced::{
|
||||
self,
|
||||
event::wayland::{Event as WaylandEvent, OutputEvent},
|
||||
keyboard::KeyCode,
|
||||
widget, Application, Command, Element, Subscription,
|
||||
},
|
||||
iced_native::{
|
||||
command::platform_specific::wayland::layer_surface::{
|
||||
IcedOutput, SctkLayerSurfaceSettings,
|
||||
},
|
||||
window::Id as SurfaceId,
|
||||
},
|
||||
};
|
||||
use iced_sctk::{
|
||||
application::SurfaceIdWrapper,
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@ use cctk::{
|
|||
},
|
||||
workspace::{WorkspaceHandler, WorkspaceState},
|
||||
};
|
||||
use futures_channel::mpsc;
|
||||
use iced::{
|
||||
use cosmic::iced::{
|
||||
self,
|
||||
futures::{executor::block_on, FutureExt, SinkExt},
|
||||
widget::image,
|
||||
};
|
||||
use futures_channel::mpsc;
|
||||
use std::{collections::HashMap, thread};
|
||||
|
||||
// TODO define subscription for a particular output/workspace/toplevel (but we want to rate limit?)
|
||||
|
|
@ -292,6 +293,7 @@ impl ScreencopyHandler for AppData {
|
|||
.unwrap();
|
||||
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 buffer = pool.create_buffer(
|
||||
0,
|
||||
|
|
@ -325,6 +327,7 @@ impl ScreencopyHandler for AppData {
|
|||
) {
|
||||
let frame = self.frames.get_mut(&session.id()).unwrap();
|
||||
let (mut pool, buffer, buffer_info) = frame.buffer.take().unwrap();
|
||||
// XXX is this at all a performance issue?
|
||||
let image =
|
||||
image::Handle::from_pixels(buffer_info.width, buffer_info.height, pool.mmap().to_vec());
|
||||
let event = match &frame.source {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue