Initial support for workspace pinning and moving

Adds support for cosmic-workspace-v2 pin, unpin, move_after, and
move_before requests.

Both features need some work with workspaces span displays mode, so that
will need more fixes later.

We also want to generate a unique id for pinned workspaces to send in
the ext-workspace-v1 protocol. But that isn't a strict requirement for
anything. So I haven't yet fully implemented that. We'll also want to
persist other things, like workspace naming when that's added.

Overall, though, with separate workspaces per display, this is working
pretty well.
This commit is contained in:
Ian Douglas Scott 2025-01-31 14:13:33 -08:00 committed by Victoria Brekenfeld
parent d1f4e7b12d
commit 96e9bf3b81
14 changed files with 622 additions and 118 deletions

View file

@ -43,6 +43,7 @@ pub use key_bindings::{Action, PrivateAction};
mod types;
pub use self::types::*;
use cosmic::config::CosmicTk;
pub use cosmic_comp_config::output::EdidProduct;
use cosmic_comp_config::{
input::InputConfig, workspace::WorkspaceConfig, CosmicCompConfig, KeyboardConfig, TileBehavior,
XkbConfig, XwaylandDescaling, XwaylandEavesdropping, ZoomConfig,
@ -94,29 +95,6 @@ impl From<Output> for OutputInfo {
}
}
#[derive(Debug, Deserialize, Serialize, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EdidProduct {
pub manufacturer: [char; 3],
pub product: u16,
pub serial: Option<u32>,
pub manufacture_week: i32,
pub manufacture_year: i32,
pub model_year: Option<i32>,
}
impl From<libdisplay_info::edid::VendorProduct> for EdidProduct {
fn from(vp: libdisplay_info::edid::VendorProduct) -> Self {
Self {
manufacturer: vp.manufacturer,
product: vp.product,
serial: vp.serial,
manufacture_week: vp.manufacture_week,
manufacture_year: vp.manufacture_year,
model_year: vp.model_year,
}
}
}
#[derive(Default, Debug, Deserialize, Serialize)]
pub struct NumlockStateConfig {
pub last_state: bool,