1
0
Fork 0
forked from wry/wry

tree: add WorkspaceDisplayOrder

This commit is contained in:
Julian Orth 2026-02-24 20:26:57 +01:00
parent 8b0bb61ee0
commit 1677d481f9
6 changed files with 40 additions and 15 deletions

View file

@ -57,9 +57,10 @@ use {
tasks::{self, handle_const_40hz_latch, idle}, tasks::{self, handle_const_40hz_latch, idle},
tracy::enable_profiler, tracy::enable_profiler,
tree::{ tree::{
DisplayNode, NodeIds, OutputNode, TearingMode, Transform, VrrMode, WorkspaceNode, DisplayNode, NodeIds, OutputNode, TearingMode, Transform, VrrMode,
container_layout, container_render_positions, container_render_titles, float_layout, WorkspaceDisplayOrder, WorkspaceNode, container_layout, container_render_positions,
float_titles, output_render_data, placeholder_render_textures, container_render_titles, float_layout, float_titles, output_render_data,
placeholder_render_textures,
}, },
user_session::import_environment, user_session::import_environment,
utils::{ utils::{
@ -82,7 +83,7 @@ use {
}, },
ahash::AHashSet, ahash::AHashSet,
forker::ForkerProxy, forker::ForkerProxy,
jay_config::{_private::DEFAULT_SEAT_NAME, workspace::WorkspaceDisplayOrder}, jay_config::_private::DEFAULT_SEAT_NAME,
std::{ std::{
cell::{Cell, RefCell}, cell::{Cell, RefCell},
env, env,

View file

@ -1465,7 +1465,7 @@ impl ConfigProxyHandler {
} }
fn handle_set_workspace_display_order(&self, order: WorkspaceDisplayOrder) { fn handle_set_workspace_display_order(&self, order: WorkspaceDisplayOrder) {
self.state.workspace_display_order.set(order); self.state.workspace_display_order.set(order.into());
for output in self.state.root.outputs.lock().values() { for output in self.state.root.outputs.lock().values() {
output.handle_workspace_display_order_update(); output.handle_workspace_display_order_update();
} }

View file

@ -97,7 +97,8 @@ use {
ContainerNode, ContainerSplit, Direction, DisplayNode, FindTreeUsecase, FloatNode, ContainerNode, ContainerSplit, Direction, DisplayNode, FindTreeUsecase, FloatNode,
FoundNode, LatchListener, Node, NodeIds, NodeVisitorBase, OutputNode, PlaceholderNode, FoundNode, LatchListener, Node, NodeIds, NodeVisitorBase, OutputNode, PlaceholderNode,
TearingMode, TileState, ToplevelData, ToplevelNode, ToplevelNodeBase, Transform, TearingMode, TileState, ToplevelData, ToplevelNode, ToplevelNodeBase, Transform,
VrrMode, WorkspaceNode, WsMoveConfig, generic_node_visitor, move_ws_to_output, VrrMode, WorkspaceDisplayOrder, WorkspaceNode, WsMoveConfig, generic_node_visitor,
move_ws_to_output,
}, },
udmabuf::UdmabufHolder, udmabuf::UdmabufHolder,
utils::{ utils::{
@ -135,7 +136,7 @@ use {
}, },
ahash::AHashMap, ahash::AHashMap,
bstr::ByteSlice, bstr::ByteSlice,
jay_config::{PciId, workspace::WorkspaceDisplayOrder}, jay_config::PciId,
std::{ std::{
cell::{Cell, RefCell}, cell::{Cell, RefCell},
fmt::{Debug, Formatter}, fmt::{Debug, Formatter},

View file

@ -30,6 +30,7 @@ use {
jay_config::{ jay_config::{
Direction as JayDirection, video::Transform as ConfigTransform, Direction as JayDirection, video::Transform as ConfigTransform,
window::TileState as ConfigTileState, window::TileState as ConfigTileState,
workspace::WorkspaceDisplayOrder as ConfigWorkspaceDisplayOrder,
}, },
linearize::{Linearize, LinearizeExt}, linearize::{Linearize, LinearizeExt},
std::{ std::{
@ -53,6 +54,31 @@ mod toplevel;
mod walker; mod walker;
mod workspace; mod workspace;
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Default, Linearize)]
pub enum WorkspaceDisplayOrder {
#[default]
Manual,
Sorted,
}
impl From<ConfigWorkspaceDisplayOrder> for WorkspaceDisplayOrder {
fn from(value: ConfigWorkspaceDisplayOrder) -> Self {
match value {
ConfigWorkspaceDisplayOrder::Manual => WorkspaceDisplayOrder::Manual,
ConfigWorkspaceDisplayOrder::Sorted => WorkspaceDisplayOrder::Sorted,
}
}
}
impl Into<ConfigWorkspaceDisplayOrder> for WorkspaceDisplayOrder {
fn into(self) -> ConfigWorkspaceDisplayOrder {
match self {
WorkspaceDisplayOrder::Manual => ConfigWorkspaceDisplayOrder::Manual,
WorkspaceDisplayOrder::Sorted => ConfigWorkspaceDisplayOrder::Sorted,
}
}
}
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Default, Linearize)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Default, Linearize)]
pub enum Transform { pub enum Transform {
#[default] #[default]

View file

@ -47,7 +47,8 @@ use {
tree::{ tree::{
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLayerLink, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLayerLink,
NodeLocation, PinnedNode, StackedNode, TddType, TileDragDestination, Transform, NodeLocation, PinnedNode, StackedNode, TddType, TileDragDestination, Transform,
WorkspaceDragDestination, WorkspaceNode, WorkspaceNodeId, walker::NodeVisitor, WorkspaceDisplayOrder, WorkspaceDragDestination, WorkspaceNode, WorkspaceNodeId,
walker::NodeVisitor,
}, },
utils::{ utils::{
asyncevent::AsyncEvent, asyncevent::AsyncEvent,
@ -66,10 +67,7 @@ use {
}, },
}, },
ahash::AHashMap, ahash::AHashMap,
jay_config::{ jay_config::video::{TearingMode as ConfigTearingMode, VrrMode as ConfigVrrMode},
video::{TearingMode as ConfigTearingMode, VrrMode as ConfigVrrMode},
workspace::WorkspaceDisplayOrder,
},
smallvec::SmallVec, smallvec::SmallVec,
std::{ std::{
cell::{Cell, RefCell}, cell::{Cell, RefCell},

View file

@ -22,8 +22,8 @@ use {
tree::{ tree::{
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node, ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
NodeId, NodeLayerLink, NodeLocation, NodeVisitorBase, OutputNode, OutputNodeId, NodeId, NodeLayerLink, NodeLocation, NodeVisitorBase, OutputNode, OutputNodeId,
PlaceholderNode, StackedNode, ToplevelNode, container::ContainerNode, PlaceholderNode, StackedNode, ToplevelNode, WorkspaceDisplayOrder,
walker::NodeVisitor, container::ContainerNode, walker::NodeVisitor,
}, },
utils::{ utils::{
clonecell::CloneCell, clonecell::CloneCell,
@ -35,7 +35,6 @@ use {
}, },
wire::JayWorkspaceId, wire::JayWorkspaceId,
}, },
jay_config::workspace::WorkspaceDisplayOrder,
std::{ std::{
cell::{Cell, RefCell}, cell::{Cell, RefCell},
fmt::Debug, fmt::Debug,