Update to workspace v2, based on ext-workspace

Requires https://github.com/pop-os/cosmic-protocols/pull/51,
https://github.com/pop-os/cosmic-comp/pull/1225.

The new protocol version is a hard requirement, and this will panic
without it.
This commit is contained in:
Ian Douglas Scott 2025-02-20 14:28:56 -08:00 committed by Ian Douglas Scott
parent 7f877f72a3
commit 6b6bf454db
11 changed files with 63 additions and 68 deletions

View file

@ -192,19 +192,19 @@ impl ScreencopyHandler for AppData {
),
};
match &capture.source {
CaptureSource::CosmicToplevel(toplevel) => {
CaptureSource::Toplevel(toplevel) => {
let info = self
.toplevel_info_state
.toplevels()
.find(|info| info.cosmic_toplevel.as_ref() == Some(&toplevel));
.find(|info| info.foreign_toplevel == *toplevel);
if let Some(info) = info {
self.send_event(Event::ToplevelCapture(info.foreign_toplevel.clone(), image))
}
}
CaptureSource::CosmicWorkspace(workspace) => {
CaptureSource::Workspace(workspace) => {
self.send_event(Event::WorkspaceCapture(workspace.clone(), image));
}
CaptureSource::Output(_) | CaptureSource::Toplevel(_) => {
CaptureSource::Output(_) => {
unreachable!()
}
};