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

@ -22,10 +22,9 @@ impl ToplevelInfoHandler for AppData {
toplevel: &ExtForeignToplevelHandleV1,
) {
let info = self.toplevel_info_state.info(toplevel).unwrap();
let cosmic_toplevel = info.cosmic_toplevel.clone().unwrap();
self.send_event(Event::NewToplevel(toplevel.clone(), info.clone()));
self.add_capture_source(CaptureSource::CosmicToplevel(cosmic_toplevel));
self.add_capture_source(CaptureSource::Toplevel(toplevel.clone()));
}
fn update_toplevel(
@ -44,11 +43,9 @@ impl ToplevelInfoHandler for AppData {
_qh: &QueueHandle<Self>,
toplevel: &ExtForeignToplevelHandleV1,
) {
let info = self.toplevel_info_state.info(toplevel).unwrap();
let cosmic_toplevel = info.cosmic_toplevel.clone().unwrap();
self.send_event(Event::CloseToplevel(toplevel.clone()));
self.remove_capture_source(CaptureSource::CosmicToplevel(cosmic_toplevel));
self.remove_capture_source(CaptureSource::Toplevel(toplevel.clone()));
}
}