Merge pull request #757 from mahkoh/jorth/no-config-enum
Don't use enums from jay_config in the compositor
This commit is contained in:
commit
e063b7c14b
41 changed files with 379 additions and 222 deletions
|
|
@ -9,7 +9,7 @@ use {
|
||||||
drm_feedback::DrmFeedback,
|
drm_feedback::DrmFeedback,
|
||||||
fixed::Fixed,
|
fixed::Fixed,
|
||||||
format::Format,
|
format::Format,
|
||||||
gfx_api::{GfxFramebuffer, SyncFile},
|
gfx_api::{GfxApi, GfxFramebuffer, SyncFile},
|
||||||
ifs::{
|
ifs::{
|
||||||
wl_output::OutputId,
|
wl_output::OutputId,
|
||||||
wl_seat::{
|
wl_seat::{
|
||||||
|
|
@ -28,7 +28,7 @@ use {
|
||||||
HDMI_EOTF_TRADITIONAL_GAMMA_SDR,
|
HDMI_EOTF_TRADITIONAL_GAMMA_SDR,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
jay_config::{input::SwitchEvent, video::GfxApi},
|
jay_config::input::SwitchEvent,
|
||||||
linearize::Linearize,
|
linearize::Linearize,
|
||||||
std::{
|
std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use {
|
||||||
time::Time,
|
time::Time,
|
||||||
tracy::FrameName,
|
tracy::FrameName,
|
||||||
tree::OutputNode,
|
tree::OutputNode,
|
||||||
utils::{errorfmt::ErrorFmt, oserror::OsError, transform_ext::TransformExt},
|
utils::{errorfmt::ErrorFmt, oserror::OsError},
|
||||||
video::{
|
video::{
|
||||||
dmabuf::DmaBufId,
|
dmabuf::DmaBufId,
|
||||||
drm::{
|
drm::{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ use {
|
||||||
drm_feedback::DrmFeedback,
|
drm_feedback::DrmFeedback,
|
||||||
edid::{CtaDataBlock, Descriptor, EdidExtension},
|
edid::{CtaDataBlock, Descriptor, EdidExtension},
|
||||||
format::{Format, XRGB8888},
|
format::{Format, XRGB8888},
|
||||||
gfx_api::{GfxContext, GfxFramebuffer, SyncFile},
|
gfx_api::{GfxApi, GfxContext, GfxFramebuffer, SyncFile},
|
||||||
ifs::{
|
ifs::{
|
||||||
wl_output::OutputId,
|
wl_output::OutputId,
|
||||||
wp_presentation_feedback::{KIND_HW_COMPLETION, KIND_VSYNC, KIND_ZERO_COPY},
|
wp_presentation_feedback::{KIND_HW_COMPLETION, KIND_VSYNC, KIND_ZERO_COPY},
|
||||||
|
|
@ -57,7 +57,6 @@ use {
|
||||||
bstr::{BString, ByteSlice},
|
bstr::{BString, ByteSlice},
|
||||||
indexmap::{IndexSet, indexset},
|
indexmap::{IndexSet, indexset},
|
||||||
isnt::std_1::collections::IsntHashMapExt,
|
isnt::std_1::collections::IsntHashMapExt,
|
||||||
jay_config::video::GfxApi,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, OnceCell, RefCell},
|
cell::{Cell, OnceCell, RefCell},
|
||||||
collections::hash_map::Entry,
|
collections::hash_map::Entry,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ use {
|
||||||
cmm::cmm_primaries::Primaries,
|
cmm::cmm_primaries::Primaries,
|
||||||
fixed::Fixed,
|
fixed::Fixed,
|
||||||
format::{Format, XRGB8888},
|
format::{Format, XRGB8888},
|
||||||
gfx_api::{AcquireSync, GfxContext, GfxError, GfxFramebuffer, GfxTexture, ReleaseSync},
|
gfx_api::{
|
||||||
|
AcquireSync, GfxApi, GfxContext, GfxError, GfxFramebuffer, GfxTexture, ReleaseSync,
|
||||||
|
},
|
||||||
ifs::wl_output::OutputId,
|
ifs::wl_output::OutputId,
|
||||||
state::State,
|
state::State,
|
||||||
time::Time,
|
time::Time,
|
||||||
|
|
@ -57,7 +59,6 @@ use {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::video::GfxApi,
|
|
||||||
std::{
|
std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ use {
|
||||||
ifs::wl_output::BlendSpace,
|
ifs::wl_output::BlendSpace,
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
tools::tool_client::{Handle, ToolClient, with_tool_client},
|
tools::tool_client::{Handle, ToolClient, with_tool_client},
|
||||||
utils::{errorfmt::ErrorFmt, ordered_float::F64, transform_ext::TransformExt},
|
tree::Transform,
|
||||||
|
utils::{errorfmt::ErrorFmt, ordered_float::F64},
|
||||||
wire::{JayRandrId, jay_compositor, jay_randr},
|
wire::{JayRandrId, jay_compositor, jay_randr},
|
||||||
},
|
},
|
||||||
clap::{
|
clap::{
|
||||||
|
|
@ -15,7 +16,7 @@ use {
|
||||||
builder::{PossibleValue, PossibleValuesParser},
|
builder::{PossibleValue, PossibleValuesParser},
|
||||||
},
|
},
|
||||||
isnt::std_1::vec::IsntVecExt,
|
isnt::std_1::vec::IsntVecExt,
|
||||||
jay_config::video::{TearingMode, Transform, VrrMode},
|
jay_config::video::{TearingMode, VrrMode},
|
||||||
linearize::LinearizeExt,
|
linearize::LinearizeExt,
|
||||||
std::{
|
std::{
|
||||||
cell::RefCell,
|
cell::RefCell,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ use {
|
||||||
ei::ei_client::EiClients,
|
ei::ei_client::EiClients,
|
||||||
forker,
|
forker,
|
||||||
format::XRGB8888,
|
format::XRGB8888,
|
||||||
|
gfx_api::GfxApi,
|
||||||
globals::Globals,
|
globals::Globals,
|
||||||
ifs::{
|
ifs::{
|
||||||
head_management::{
|
head_management::{
|
||||||
|
|
@ -56,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, 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::{
|
||||||
|
|
@ -81,11 +83,7 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashSet,
|
ahash::AHashSet,
|
||||||
forker::ForkerProxy,
|
forker::ForkerProxy,
|
||||||
jay_config::{
|
jay_config::_private::DEFAULT_SEAT_NAME,
|
||||||
_private::DEFAULT_SEAT_NAME,
|
|
||||||
video::{GfxApi, Transform},
|
|
||||||
workspace::WorkspaceDisplayOrder,
|
|
||||||
},
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
env,
|
env,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use {
|
||||||
config::handler::ConfigProxyHandler,
|
config::handler::ConfigProxyHandler,
|
||||||
ifs::wl_seat::SeatId,
|
ifs::wl_seat::SeatId,
|
||||||
state::State,
|
state::State,
|
||||||
tree::ToplevelData,
|
tree::{TileState, ToplevelData},
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
nice::{JAY_NO_REALTIME, dont_allow_config_so},
|
nice::{JAY_NO_REALTIME, dont_allow_config_so},
|
||||||
|
|
@ -29,7 +29,7 @@ use {
|
||||||
input::{InputDevice, Seat, SwitchEvent},
|
input::{InputDevice, Seat, SwitchEvent},
|
||||||
keyboard::{mods::Modifiers, syms::KeySym},
|
keyboard::{mods::Modifiers, syms::KeySym},
|
||||||
video::{Connector, DrmDevice},
|
video::{Connector, DrmDevice},
|
||||||
window::{self, TileState},
|
window::{self},
|
||||||
},
|
},
|
||||||
libloading::Library,
|
libloading::Library,
|
||||||
std::{cell::Cell, io, mem, path::Path, ptr, rc::Rc},
|
std::{cell::Cell, io, mem, path::Path, ptr, rc::Rc},
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,9 @@ use {
|
||||||
theme::{Color, ThemeSized},
|
theme::{Color, ThemeSized},
|
||||||
tree::{
|
tree::{
|
||||||
ContainerNode, ContainerSplit, FloatNode, Node, NodeVisitorBase, OutputNode,
|
ContainerNode, ContainerSplit, FloatNode, Node, NodeVisitorBase, OutputNode,
|
||||||
TearingMode, ToplevelData, ToplevelNode, VrrMode, WorkspaceNode, toplevel_create_split,
|
TearingMode, TileState, ToplevelData, ToplevelNode, VrrMode, WorkspaceNode,
|
||||||
toplevel_parent_container, toplevel_set_floating, toplevel_set_workspace,
|
toplevel_create_split, toplevel_parent_container, toplevel_set_floating,
|
||||||
|
toplevel_set_workspace,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent,
|
asyncevent::AsyncEvent,
|
||||||
|
|
@ -72,7 +73,7 @@ use {
|
||||||
Format as ConfigFormat, GfxApi, TearingMode as ConfigTearingMode, Transform,
|
Format as ConfigFormat, GfxApi, TearingMode as ConfigTearingMode, Transform,
|
||||||
VrrMode as ConfigVrrMode,
|
VrrMode as ConfigVrrMode,
|
||||||
},
|
},
|
||||||
window::{TileState, Window, WindowMatcher},
|
window::{TileState as ConfigTileState, Window, WindowMatcher},
|
||||||
workspace::WorkspaceDisplayOrder,
|
workspace::WorkspaceDisplayOrder,
|
||||||
xwayland::XScalingMode,
|
xwayland::XScalingMode,
|
||||||
},
|
},
|
||||||
|
|
@ -523,6 +524,9 @@ impl ConfigProxyHandler {
|
||||||
seat: Seat,
|
seat: Seat,
|
||||||
mode: FallbackOutputMode,
|
mode: FallbackOutputMode,
|
||||||
) -> Result<(), CphError> {
|
) -> Result<(), CphError> {
|
||||||
|
let Ok(mode) = mode.try_into() else {
|
||||||
|
return Err(CphError::UnknownFallbackOutputMode(mode));
|
||||||
|
};
|
||||||
let seat = self.get_seat(seat)?;
|
let seat = self.get_seat(seat)?;
|
||||||
seat.set_fallback_output_mode(mode);
|
seat.set_fallback_output_mode(mode);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -954,6 +958,9 @@ impl ConfigProxyHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_set_gfx_api(&self, device: Option<DrmDevice>, api: GfxApi) -> Result<(), CphError> {
|
fn handle_set_gfx_api(&self, device: Option<DrmDevice>, api: GfxApi) -> Result<(), CphError> {
|
||||||
|
let Ok(api) = api.try_into() else {
|
||||||
|
return Err(CphError::UnknownGfxApi(api));
|
||||||
|
};
|
||||||
match device {
|
match device {
|
||||||
Some(dev) => self.get_drm_device(dev)?.dev.set_gfx_api(api),
|
Some(dev) => self.get_drm_device(dev)?.dev.set_gfx_api(api),
|
||||||
_ => self.state.default_gfx_api.set(api),
|
_ => self.state.default_gfx_api.set(api),
|
||||||
|
|
@ -1433,14 +1440,18 @@ impl ConfigProxyHandler {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_set_bar_position(&self, position: BarPosition) {
|
fn handle_set_bar_position(&self, position: BarPosition) -> Result<(), CphError> {
|
||||||
|
let Ok(position) = position.try_into() else {
|
||||||
|
return Err(CphError::UnknownBarPosition(position));
|
||||||
|
};
|
||||||
self.state.theme.bar_position.set(position);
|
self.state.theme.bar_position.set(position);
|
||||||
self.spaces_change();
|
self.spaces_change();
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_get_bar_position(&self) {
|
fn handle_get_bar_position(&self) {
|
||||||
self.respond(Response::GetBarPosition {
|
self.respond(Response::GetBarPosition {
|
||||||
position: self.state.theme.bar_position.get(),
|
position: self.state.theme.bar_position.get().into(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1454,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();
|
||||||
}
|
}
|
||||||
|
|
@ -1550,7 +1561,7 @@ impl ConfigProxyHandler {
|
||||||
transform: Transform,
|
transform: Transform,
|
||||||
) -> Result<(), CphError> {
|
) -> Result<(), CphError> {
|
||||||
let connector = self.get_output_node(connector)?;
|
let connector = self.get_output_node(connector)?;
|
||||||
connector.update_transform(transform);
|
connector.update_transform(transform.into());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2279,8 +2290,11 @@ impl ConfigProxyHandler {
|
||||||
fn handle_set_window_matcher_initial_tile_state(
|
fn handle_set_window_matcher_initial_tile_state(
|
||||||
&self,
|
&self,
|
||||||
matcher: WindowMatcher,
|
matcher: WindowMatcher,
|
||||||
tile_state: TileState,
|
tile_state: ConfigTileState,
|
||||||
) -> Result<(), CphError> {
|
) -> Result<(), CphError> {
|
||||||
|
let Ok(tile_state) = tile_state.try_into() else {
|
||||||
|
return Err(CphError::UnknownTileState(tile_state));
|
||||||
|
};
|
||||||
let m = self.get_window_matcher(matcher)?;
|
let m = self.get_window_matcher(matcher)?;
|
||||||
self.window_matcher_initial_tile_state
|
self.window_matcher_initial_tile_state
|
||||||
.set(matcher, (m, tile_state));
|
.set(matcher, (m, tile_state));
|
||||||
|
|
@ -3289,7 +3303,9 @@ impl ConfigProxyHandler {
|
||||||
ClientMessage::GetShowBar => self.handle_get_show_bar(),
|
ClientMessage::GetShowBar => self.handle_get_show_bar(),
|
||||||
ClientMessage::SetShowTitles { show } => self.handle_set_show_titles(show),
|
ClientMessage::SetShowTitles { show } => self.handle_set_show_titles(show),
|
||||||
ClientMessage::GetShowTitles => self.handle_get_show_titles(),
|
ClientMessage::GetShowTitles => self.handle_get_show_titles(),
|
||||||
ClientMessage::SetBarPosition { position } => self.handle_set_bar_position(position),
|
ClientMessage::SetBarPosition { position } => self
|
||||||
|
.handle_set_bar_position(position)
|
||||||
|
.wrn("set_bar_position")?,
|
||||||
ClientMessage::GetBarPosition => self.handle_get_bar_position(),
|
ClientMessage::GetBarPosition => self.handle_get_bar_position(),
|
||||||
ClientMessage::SeatFocusHistory { seat, timeline } => self
|
ClientMessage::SeatFocusHistory { seat, timeline } => self
|
||||||
.handle_seat_focus_history(seat, timeline)
|
.handle_seat_focus_history(seat, timeline)
|
||||||
|
|
@ -3524,6 +3540,14 @@ enum CphError {
|
||||||
ModifyConnectorState(#[source] BackendConnectorTransactionError),
|
ModifyConnectorState(#[source] BackendConnectorTransactionError),
|
||||||
#[error("Unknown blend space {0:?}")]
|
#[error("Unknown blend space {0:?}")]
|
||||||
UnknownBlendSpace(ConfigBlendSpace),
|
UnknownBlendSpace(ConfigBlendSpace),
|
||||||
|
#[error("Unknown bar position {0:?}")]
|
||||||
|
UnknownBarPosition(BarPosition),
|
||||||
|
#[error("Unknown gfx API {0:?}")]
|
||||||
|
UnknownGfxApi(GfxApi),
|
||||||
|
#[error("Unknown fallback output mode {0:?}")]
|
||||||
|
UnknownFallbackOutputMode(FallbackOutputMode),
|
||||||
|
#[error("Unknown tile state {0:?}")]
|
||||||
|
UnknownTileState(ConfigTileState),
|
||||||
}
|
}
|
||||||
|
|
||||||
trait WithRequestName {
|
trait WithRequestName {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ use {
|
||||||
tree::OutputNode,
|
tree::OutputNode,
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell, copyhashmap::CopyHashMap, errorfmt::ErrorFmt,
|
clonecell::CloneCell, copyhashmap::CopyHashMap, errorfmt::ErrorFmt,
|
||||||
hash_map_ext::HashMapExt, rc_eq::rc_eq, transform_ext::TransformExt,
|
hash_map_ext::HashMapExt, rc_eq::rc_eq,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
std::{cell::Cell, ops::Deref, rc::Rc},
|
std::{cell::Cell, ops::Deref, rc::Rc},
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,10 @@ use {
|
||||||
state::State,
|
state::State,
|
||||||
theme::Color,
|
theme::Color,
|
||||||
time::Time,
|
time::Time,
|
||||||
utils::{
|
tree::Transform,
|
||||||
asyncevent::AsyncEvent, errorfmt::ErrorFmt, timer::TimerFd, transform_ext::TransformExt,
|
utils::{asyncevent::AsyncEvent, errorfmt::ErrorFmt, timer::TimerFd},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
isnt::std_1::primitive::IsntSliceExt,
|
isnt::std_1::primitive::IsntSliceExt,
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
collections::VecDeque,
|
collections::VecDeque,
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,14 @@ use {
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::State,
|
state::State,
|
||||||
theme::Color,
|
theme::Color,
|
||||||
tree::{Node, OutputNode},
|
tree::{Node, OutputNode, Transform},
|
||||||
utils::{clonecell::UnsafeCellCloneSafe, transform_ext::TransformExt},
|
utils::clonecell::UnsafeCellCloneSafe,
|
||||||
video::{Modifier, dmabuf::DmaBuf, drm::sync_obj::SyncObjCtx},
|
video::{Modifier, dmabuf::DmaBuf, drm::sync_obj::SyncObjCtx},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
indexmap::{IndexMap, IndexSet},
|
indexmap::{IndexMap, IndexSet},
|
||||||
jay_config::video::{GfxApi, Transform},
|
jay_config::video::GfxApi as ConfigGfxApi,
|
||||||
|
linearize::Linearize,
|
||||||
std::{
|
std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
cell::Cell,
|
cell::Cell,
|
||||||
|
|
@ -33,6 +34,51 @@ use {
|
||||||
uapi::OwnedFd,
|
uapi::OwnedFd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Linearize)]
|
||||||
|
pub enum GfxApi {
|
||||||
|
OpenGl,
|
||||||
|
Vulkan,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<ConfigGfxApi> for GfxApi {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(value: ConfigGfxApi) -> Result<Self, Self::Error> {
|
||||||
|
let v = match value {
|
||||||
|
ConfigGfxApi::OpenGl => GfxApi::OpenGl,
|
||||||
|
ConfigGfxApi::Vulkan => GfxApi::Vulkan,
|
||||||
|
_ => return Err(()),
|
||||||
|
};
|
||||||
|
Ok(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<ConfigGfxApi> for GfxApi {
|
||||||
|
fn into(self) -> ConfigGfxApi {
|
||||||
|
match self {
|
||||||
|
GfxApi::OpenGl => ConfigGfxApi::OpenGl,
|
||||||
|
GfxApi::Vulkan => ConfigGfxApi::Vulkan,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl GfxApi {
|
||||||
|
pub fn to_str(&self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
GfxApi::OpenGl => "OpenGl",
|
||||||
|
GfxApi::Vulkan => "Vulkan",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_str_lossy(s: &str) -> Option<Self> {
|
||||||
|
match &*s.to_ascii_lowercase() {
|
||||||
|
"opengl" => Some(Self::OpenGl),
|
||||||
|
"vulkan" => Some(Self::Vulkan),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum GfxApiOpt {
|
pub enum GfxApiOpt {
|
||||||
Sync,
|
Sync,
|
||||||
FillRect(FillRect),
|
FillRect(FillRect),
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,12 @@ pub use vulkan::create_vulkan_allocator;
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
async_engine::AsyncEngine,
|
async_engine::AsyncEngine,
|
||||||
gfx_api::{GfxContext, GfxError},
|
gfx_api::{GfxApi, GfxContext, GfxError},
|
||||||
io_uring::IoUring,
|
io_uring::IoUring,
|
||||||
pr_caps::PrCapsThread,
|
pr_caps::PrCapsThread,
|
||||||
utils::errorfmt::ErrorFmt,
|
utils::errorfmt::ErrorFmt,
|
||||||
video::drm::Drm,
|
video::drm::Drm,
|
||||||
},
|
},
|
||||||
jay_config::video::GfxApi,
|
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -57,6 +56,5 @@ fn create_gfx_context_(
|
||||||
match api {
|
match api {
|
||||||
GfxApi::OpenGl => gl::create_gfx_context(drm, software),
|
GfxApi::OpenGl => gl::create_gfx_context(drm, software),
|
||||||
GfxApi::Vulkan => vulkan::create_graphics_context(eng, ring, drm, caps_thread, software),
|
GfxApi::Vulkan => vulkan::create_graphics_context(eng, ring, drm, caps_thread, software),
|
||||||
_ => unreachable!(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ use {
|
||||||
cpu_worker::CpuWorker,
|
cpu_worker::CpuWorker,
|
||||||
format::{Format, XRGB8888},
|
format::{Format, XRGB8888},
|
||||||
gfx_api::{
|
gfx_api::{
|
||||||
AsyncShmGfxTexture, BufferResvUser, GfxBlendBuffer, GfxContext, GfxError, GfxFormat,
|
AsyncShmGfxTexture, BufferResvUser, GfxApi, GfxBlendBuffer, GfxContext, GfxError,
|
||||||
GfxFramebuffer, GfxImage, GfxInternalFramebuffer, ResetStatus, ShmGfxTexture,
|
GfxFormat, GfxFramebuffer, GfxImage, GfxInternalFramebuffer, ResetStatus,
|
||||||
|
ShmGfxTexture,
|
||||||
},
|
},
|
||||||
gfx_apis::gl::{
|
gfx_apis::gl::{
|
||||||
GfxGlState, RenderError, Texture,
|
GfxGlState, RenderError, Texture,
|
||||||
|
|
@ -24,7 +25,6 @@ use {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::video::GfxApi,
|
|
||||||
linearize::{Linearize, StaticMap, static_map},
|
linearize::{Linearize, StaticMap, static_map},
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use {
|
||||||
cpu_worker::{CpuWorker, jobs::read_write::ReadWriteJobError},
|
cpu_worker::{CpuWorker, jobs::read_write::ReadWriteJobError},
|
||||||
format::Format,
|
format::Format,
|
||||||
gfx_api::{
|
gfx_api::{
|
||||||
AsyncShmGfxTexture, GfxBlendBuffer, GfxBuffer, GfxContext, GfxError, GfxFormat,
|
AsyncShmGfxTexture, GfxApi, GfxBlendBuffer, GfxBuffer, GfxContext, GfxError, GfxFormat,
|
||||||
GfxImage, GfxInternalFramebuffer, GfxStagingBuffer, GfxTexture, ResetStatus,
|
GfxImage, GfxInternalFramebuffer, GfxStagingBuffer, GfxTexture, ResetStatus,
|
||||||
STAGING_DOWNLOAD, STAGING_UPLOAD, ShmGfxTexture, StagingBufferUsecase,
|
STAGING_DOWNLOAD, STAGING_UPLOAD, ShmGfxTexture, StagingBufferUsecase,
|
||||||
},
|
},
|
||||||
|
|
@ -51,7 +51,6 @@ use {
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
ash::vk,
|
ash::vk,
|
||||||
gpu_alloc::{AllocationError, MapError},
|
gpu_alloc::{AllocationError, MapError},
|
||||||
jay_config::video::GfxApi,
|
|
||||||
log::Level,
|
log::Level,
|
||||||
std::{
|
std::{
|
||||||
cell::Cell,
|
cell::Cell,
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ use {
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::Object,
|
object::Object,
|
||||||
rect::Region,
|
rect::Region,
|
||||||
tree::{Node, OutputNode},
|
tree::{self, Node, OutputNode},
|
||||||
utils::{cell_ext::CellExt, errorfmt::ErrorFmt, transform_ext::TransformExt},
|
utils::{cell_ext::CellExt, errorfmt::ErrorFmt},
|
||||||
wire::{ExtImageCopyCaptureFrameV1Id, ext_image_copy_capture_frame_v1::*},
|
wire::{ExtImageCopyCaptureFrameV1Id, ext_image_copy_capture_frame_v1::*},
|
||||||
},
|
},
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
|
|
@ -216,7 +216,7 @@ impl ExtImageCopyCaptureFrameV1 {
|
||||||
&fb,
|
&fb,
|
||||||
aq,
|
aq,
|
||||||
re,
|
re,
|
||||||
jay_config::video::Transform::None,
|
tree::Transform::None,
|
||||||
self.client.state.color_manager.srgb_gamma22(),
|
self.client.state.color_manager.srgb_gamma22(),
|
||||||
on.global.pos.get(),
|
on.global.pos.get(),
|
||||||
render_hardware_cursors,
|
render_hardware_cursors,
|
||||||
|
|
@ -244,7 +244,7 @@ impl ExtImageCopyCaptureFrameV1 {
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
jay_config::video::Transform::None,
|
tree::Transform::None,
|
||||||
None,
|
None,
|
||||||
self.client.state.color_manager.srgb_linear(),
|
self.client.state.color_manager.srgb_linear(),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ use {
|
||||||
},
|
},
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::OutputData,
|
state::OutputData,
|
||||||
tree::OutputNode,
|
tree::{OutputNode, Transform},
|
||||||
utils::{copyhashmap::CopyHashMap, hash_map_ext::HashMapExt, rc_eq::RcEq},
|
utils::{copyhashmap::CopyHashMap, hash_map_ext::HashMapExt, rc_eq::RcEq},
|
||||||
wire::JayHeadManagerSessionV1Id,
|
wire::JayHeadManagerSessionV1Id,
|
||||||
},
|
},
|
||||||
jay_config::video::{TearingMode, Transform, VrrMode},
|
jay_config::video::{TearingMode, VrrMode},
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
rc::Rc,
|
rc::Rc,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
ifs::head_management::HeadState,
|
ifs::head_management::HeadState,
|
||||||
utils::transform_ext::TransformExt,
|
|
||||||
wire::{
|
wire::{
|
||||||
jay_head_ext_compositor_space_info_v1::{
|
jay_head_ext_compositor_space_info_v1::{
|
||||||
Disabled, Enabled, Inside, JayHeadExtCompositorSpaceInfoV1RequestHandler, Outside,
|
Disabled, Enabled, Inside, JayHeadExtCompositorSpaceInfoV1RequestHandler, Outside,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
ifs::head_management::{HeadOp, HeadState},
|
ifs::head_management::{HeadOp, HeadState},
|
||||||
utils::transform_ext::TransformExt,
|
tree::Transform,
|
||||||
wire::{
|
wire::{
|
||||||
jay_head_ext_compositor_space_transformer_v1::{
|
jay_head_ext_compositor_space_transformer_v1::{
|
||||||
JayHeadExtCompositorSpaceTransformerV1RequestHandler, SetTransform,
|
JayHeadExtCompositorSpaceTransformerV1RequestHandler, SetTransform,
|
||||||
|
|
@ -10,7 +10,6 @@ use {
|
||||||
jay_head_manager_ext_compositor_space_transformer_v1::JayHeadManagerExtCompositorSpaceTransformerV1RequestHandler,
|
jay_head_manager_ext_compositor_space_transformer_v1::JayHeadManagerExtCompositorSpaceTransformerV1RequestHandler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
jay_config::video::Transform,
|
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,17 @@ use {
|
||||||
client::{Client, ClientError},
|
client::{Client, ClientError},
|
||||||
compositor::MAX_EXTENTS,
|
compositor::MAX_EXTENTS,
|
||||||
format::named_formats,
|
format::named_formats,
|
||||||
|
gfx_api::GfxApi,
|
||||||
ifs::wl_output,
|
ifs::wl_output,
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::{ConnectorData, DrmDevData, OutputData, State},
|
state::{ConnectorData, DrmDevData, OutputData, State},
|
||||||
tree::{OutputNode, TearingMode, VrrMode},
|
tree::{OutputNode, TearingMode, Transform, VrrMode},
|
||||||
utils::{errorfmt::ErrorFmt, gfx_api_ext::GfxApiExt, transform_ext::TransformExt},
|
utils::errorfmt::ErrorFmt,
|
||||||
wire::{JayRandrId, jay_randr::*},
|
wire::{JayRandrId, jay_randr::*},
|
||||||
},
|
},
|
||||||
jay_config::video::{
|
jay_config::video::{TearingMode as ConfigTearingMode, VrrMode as ConfigVrrMode},
|
||||||
GfxApi, TearingMode as ConfigTearingMode, Transform, VrrMode as ConfigVrrMode,
|
|
||||||
},
|
|
||||||
linearize::LinearizeExt,
|
linearize::LinearizeExt,
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ use {
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::State,
|
state::State,
|
||||||
tree::{LatchListener, OutputNode, ToplevelNode, WorkspaceNode, WorkspaceNodeId},
|
tree::{
|
||||||
|
LatchListener, OutputNode, ToplevelNode, Transform, WorkspaceNode, WorkspaceNodeId,
|
||||||
|
},
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::{CloneCell, UnsafeCellCloneSafe},
|
clonecell::{CloneCell, UnsafeCellCloneSafe},
|
||||||
errorfmt::ErrorFmt,
|
errorfmt::ErrorFmt,
|
||||||
|
|
@ -24,7 +26,6 @@ use {
|
||||||
wire::{JayScreencastId, jay_screencast::*},
|
wire::{JayScreencastId, jay_screencast::*},
|
||||||
},
|
},
|
||||||
ahash::AHashSet,
|
ahash::AHashSet,
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
ops::DerefMut,
|
ops::DerefMut,
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,14 @@ use {
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::{ConnectorData, State},
|
state::{ConnectorData, State},
|
||||||
tree::{OutputNode, TearingMode, VrrMode, calculate_logical_size},
|
tree::{OutputNode, TearingMode, Transform, VrrMode, calculate_logical_size},
|
||||||
utils::{
|
utils::{
|
||||||
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap, ordered_float::F64,
|
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap, ordered_float::F64,
|
||||||
rc_eq::rc_eq, transform_ext::TransformExt,
|
rc_eq::rc_eq,
|
||||||
},
|
},
|
||||||
wire::{WlOutputId, WpColorManagementOutputV1Id, ZxdgOutputV1Id, wl_output::*},
|
wire::{WlOutputId, WpColorManagementOutputV1Id, ZxdgOutputV1Id, wl_output::*},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::video::Transform,
|
|
||||||
linearize::Linearize,
|
linearize::Linearize,
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
|
|
|
||||||
|
|
@ -106,10 +106,11 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::{
|
jay_config::{
|
||||||
input::FallbackOutputMode,
|
input::FallbackOutputMode as ConfigFallbackOutputMode,
|
||||||
keyboard::syms::{KeySym, SYM_Escape},
|
keyboard::syms::{KeySym, SYM_Escape},
|
||||||
},
|
},
|
||||||
kbvm::Keycode,
|
kbvm::Keycode,
|
||||||
|
linearize::Linearize,
|
||||||
run_on_drop::on_drop,
|
run_on_drop::on_drop,
|
||||||
smallvec::SmallVec,
|
smallvec::SmallVec,
|
||||||
std::{
|
std::{
|
||||||
|
|
@ -258,6 +259,34 @@ enum MarkMode {
|
||||||
Jump,
|
Jump,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Linearize)]
|
||||||
|
pub enum FallbackOutputMode {
|
||||||
|
Cursor,
|
||||||
|
Focus,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<ConfigFallbackOutputMode> for FallbackOutputMode {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(value: ConfigFallbackOutputMode) -> Result<Self, Self::Error> {
|
||||||
|
let v = match value {
|
||||||
|
ConfigFallbackOutputMode::Cursor => FallbackOutputMode::Cursor,
|
||||||
|
ConfigFallbackOutputMode::Focus => FallbackOutputMode::Focus,
|
||||||
|
_ => return Err(()),
|
||||||
|
};
|
||||||
|
Ok(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<ConfigFallbackOutputMode> for FallbackOutputMode {
|
||||||
|
fn into(self) -> ConfigFallbackOutputMode {
|
||||||
|
match self {
|
||||||
|
FallbackOutputMode::Cursor => ConfigFallbackOutputMode::Cursor,
|
||||||
|
FallbackOutputMode::Focus => ConfigFallbackOutputMode::Focus,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CHANGE_CURSOR_MOVED: u32 = 1 << 0;
|
const CHANGE_CURSOR_MOVED: u32 = 1 << 0;
|
||||||
const CHANGE_TREE: u32 = 1 << 1;
|
const CHANGE_TREE: u32 = 1 << 1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,13 @@ use {
|
||||||
tree::{
|
tree::{
|
||||||
BeforeLatchListener, BeforeLatchResult, ContainerNode, FindTreeResult, FoundNode,
|
BeforeLatchListener, BeforeLatchResult, ContainerNode, FindTreeResult, FoundNode,
|
||||||
LatchListener, Node, NodeId, NodeLayerLink, NodeLocation, NodeVisitor, NodeVisitorBase,
|
LatchListener, Node, NodeId, NodeLayerLink, NodeLocation, NodeVisitor, NodeVisitorBase,
|
||||||
OutputNode, PlaceholderNode, PresentationListener, ToplevelNode, VblankListener,
|
OutputNode, PlaceholderNode, PresentationListener, ToplevelNode, Transform,
|
||||||
|
VblankListener,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
||||||
double_buffered::DoubleBuffered, errorfmt::ErrorFmt, event_listener::EventListener,
|
double_buffered::DoubleBuffered, errorfmt::ErrorFmt, event_listener::EventListener,
|
||||||
linkedlist::LinkedList, numcell::NumCell, smallmap::SmallMap,
|
linkedlist::LinkedList, numcell::NumCell, smallmap::SmallMap,
|
||||||
transform_ext::TransformExt,
|
|
||||||
},
|
},
|
||||||
video::{
|
video::{
|
||||||
dmabuf::DMA_BUF_SYNC_READ,
|
dmabuf::DMA_BUF_SYNC_READ,
|
||||||
|
|
@ -99,7 +99,6 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
isnt::std_1::{primitive::IsntSliceExt, vec::IsntVecExt},
|
isnt::std_1::{primitive::IsntSliceExt, vec::IsntVecExt},
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
collections::hash_map::{Entry, OccupiedEntry},
|
collections::hash_map::{Entry, OccupiedEntry},
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ use {
|
||||||
},
|
},
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
|
theme::BarPosition,
|
||||||
tree::NodeVisitor,
|
tree::NodeVisitor,
|
||||||
utils::copyhashmap::CopyHashMap,
|
utils::copyhashmap::CopyHashMap,
|
||||||
wire::{JayTrayItemV1Id, XdgPopupId, jay_tray_item_v1::*},
|
wire::{JayTrayItemV1Id, XdgPopupId, jay_tray_item_v1::*},
|
||||||
},
|
},
|
||||||
jay_config::theme::BarPosition,
|
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
@ -64,7 +64,7 @@ impl JayTrayItemV1 {
|
||||||
fn send_preferred_anchor(&self) {
|
fn send_preferred_anchor(&self) {
|
||||||
let anchor = match self.data.client.state.theme.bar_position.get() {
|
let anchor = match self.data.client.state.theme.bar_position.get() {
|
||||||
BarPosition::Bottom => ANCHOR_TOP_RIGHT,
|
BarPosition::Bottom => ANCHOR_TOP_RIGHT,
|
||||||
BarPosition::Top | _ => ANCHOR_BOTTOM_RIGHT,
|
BarPosition::Top => ANCHOR_BOTTOM_RIGHT,
|
||||||
};
|
};
|
||||||
self.data.client.event(PreferredAnchor {
|
self.data.client.event(PreferredAnchor {
|
||||||
self_id: self.id,
|
self_id: self.id,
|
||||||
|
|
@ -75,7 +75,7 @@ impl JayTrayItemV1 {
|
||||||
fn send_preferred_gravity(&self) {
|
fn send_preferred_gravity(&self) {
|
||||||
let gravity = match self.data.client.state.theme.bar_position.get() {
|
let gravity = match self.data.client.state.theme.bar_position.get() {
|
||||||
BarPosition::Bottom => ANCHOR_TOP_LEFT,
|
BarPosition::Bottom => ANCHOR_TOP_LEFT,
|
||||||
BarPosition::Top | _ => ANCHOR_BOTTOM_LEFT,
|
BarPosition::Top => ANCHOR_BOTTOM_LEFT,
|
||||||
};
|
};
|
||||||
self.data.client.event(PreferredGravity {
|
self.data.client.event(PreferredGravity {
|
||||||
self_id: self.id,
|
self_id: self.id,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use {
|
||||||
tree::{
|
tree::{
|
||||||
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
NodeLayerLink, NodeLocation, NodeVisitor, OutputNode, StackedNode, TileDragDestination,
|
NodeLayerLink, NodeLocation, NodeVisitor, OutputNode, StackedNode, TileDragDestination,
|
||||||
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode,
|
TileState, ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode,
|
||||||
default_tile_drag_destination,
|
default_tile_drag_destination,
|
||||||
},
|
},
|
||||||
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
|
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
|
||||||
|
|
@ -22,7 +22,6 @@ use {
|
||||||
xwayland::XWaylandEvent,
|
xwayland::XWaylandEvent,
|
||||||
},
|
},
|
||||||
bstr::BString,
|
bstr::BString,
|
||||||
jay_config::window::TileState,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
ops::{Deref, Not},
|
ops::{Deref, Not},
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ use {
|
||||||
state::State,
|
state::State,
|
||||||
tree::{
|
tree::{
|
||||||
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
NodeLayerLink, NodeLocation, NodeVisitor, OutputNode, TileDragDestination,
|
NodeLayerLink, NodeLocation, NodeVisitor, OutputNode, TileDragDestination, TileState,
|
||||||
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelNodeId, ToplevelType,
|
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelNodeId, ToplevelType,
|
||||||
WorkspaceNode, default_tile_drag_destination,
|
WorkspaceNode, default_tile_drag_destination,
|
||||||
},
|
},
|
||||||
|
|
@ -37,7 +37,6 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
arrayvec::ArrayVec,
|
arrayvec::ArrayVec,
|
||||||
jay_config::window::TileState,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
fmt::{Debug, Formatter},
|
fmt::{Debug, Formatter},
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,9 @@ use {
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
tree::VrrMode,
|
tree::{Transform, VrrMode},
|
||||||
utils::transform_ext::TransformExt,
|
|
||||||
wire::{ZwlrOutputConfigurationHeadV1Id, zwlr_output_configuration_head_v1::*},
|
wire::{ZwlrOutputConfigurationHeadV1Id, zwlr_output_configuration_head_v1::*},
|
||||||
},
|
},
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{cell::RefCell, rc::Rc},
|
std::{cell::RefCell, rc::Rc},
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,10 @@ use {
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
scale,
|
scale,
|
||||||
state::OutputData,
|
state::OutputData,
|
||||||
tree::VrrMode,
|
tree::{self, VrrMode},
|
||||||
utils::transform_ext::TransformExt,
|
|
||||||
wire::{ZwlrOutputHeadV1Id, zwlr_output_head_v1::*},
|
wire::{ZwlrOutputHeadV1Id, zwlr_output_head_v1::*},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::video,
|
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
@ -111,7 +109,7 @@ impl ZwlrOutputHeadV1 {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_transform(&self, transform: video::Transform) {
|
pub fn send_transform(&self, transform: tree::Transform) {
|
||||||
self.client.event(Transform {
|
self.client.event(Transform {
|
||||||
self_id: self.id,
|
self_id: self.id,
|
||||||
transform: transform.to_wl(),
|
transform: transform.to_wl(),
|
||||||
|
|
@ -173,7 +171,7 @@ impl ZwlrOutputHeadV1 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hande_transform_change(&self, transform: video::Transform) {
|
pub fn hande_transform_change(&self, transform: tree::Transform) {
|
||||||
self.send_transform(transform);
|
self.send_transform(transform);
|
||||||
self.manager.schedule_done();
|
self.manager.schedule_done();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use {
|
||||||
format::{ARGB8888, Format, XRGB8888},
|
format::{ARGB8888, Format, XRGB8888},
|
||||||
gfx_api::{
|
gfx_api::{
|
||||||
AcquireSync, AsyncShmGfxTexture, AsyncShmGfxTextureCallback, CopyTexture, FillRect,
|
AcquireSync, AsyncShmGfxTexture, AsyncShmGfxTextureCallback, CopyTexture, FillRect,
|
||||||
FramebufferRect, GfxApiOpt, GfxBlendBuffer, GfxContext, GfxError, GfxFormat,
|
FramebufferRect, GfxApi, GfxApiOpt, GfxBlendBuffer, GfxContext, GfxError, GfxFormat,
|
||||||
GfxFramebuffer, GfxImage, GfxInternalFramebuffer, GfxStagingBuffer, GfxTexture,
|
GfxFramebuffer, GfxImage, GfxInternalFramebuffer, GfxStagingBuffer, GfxTexture,
|
||||||
GfxWriteModifier, PendingShmTransfer, ReleaseSync, ResetStatus, ShmGfxTexture,
|
GfxWriteModifier, PendingShmTransfer, ReleaseSync, ResetStatus, ShmGfxTexture,
|
||||||
ShmMemory, SyncFile,
|
ShmMemory, SyncFile,
|
||||||
|
|
@ -17,7 +17,6 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
indexmap::IndexSet,
|
indexmap::IndexSet,
|
||||||
jay_config::video::GfxApi,
|
|
||||||
std::{
|
std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
gfx_api::{GfxFormat, cross_intersect_formats},
|
gfx_api::{GfxApi, GfxFormat, cross_intersect_formats},
|
||||||
gfx_apis::create_gfx_context,
|
gfx_apis::create_gfx_context,
|
||||||
ifs::wl_seat::POINTER,
|
ifs::wl_seat::POINTER,
|
||||||
object::Version,
|
object::Version,
|
||||||
|
|
@ -46,7 +46,6 @@ use {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::video::GfxApi,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
ops::Deref,
|
ops::Deref,
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
theme::Color,
|
theme::Color,
|
||||||
utils::transform_ext::TransformExt,
|
tree::Transform,
|
||||||
},
|
},
|
||||||
jay_config::video::Transform,
|
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ use {
|
||||||
gfx_api::{AcquireSync, GfxError, ReleaseSync, needs_render_usage},
|
gfx_api::{AcquireSync, GfxError, ReleaseSync, needs_render_usage},
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::State,
|
state::State,
|
||||||
|
tree::Transform,
|
||||||
video::drm::DrmError,
|
video::drm::DrmError,
|
||||||
},
|
},
|
||||||
indexmap::IndexMap,
|
indexmap::IndexMap,
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{ops::Deref, rc::Rc},
|
std::{ops::Deref, rc::Rc},
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
uapi::OwnedFd,
|
uapi::OwnedFd,
|
||||||
|
|
|
||||||
14
src/state.rs
14
src/state.rs
|
|
@ -31,7 +31,7 @@ use {
|
||||||
forker::ForkerProxy,
|
forker::ForkerProxy,
|
||||||
format::Format,
|
format::Format,
|
||||||
gfx_api::{
|
gfx_api::{
|
||||||
AcquireSync, AlphaMode, BufferResv, GfxBlendBuffer, GfxContext, GfxError,
|
AcquireSync, AlphaMode, BufferResv, GfxApi, GfxBlendBuffer, GfxContext, GfxError,
|
||||||
GfxFramebuffer, GfxTexture, PendingShmTransfer, ReleaseSync, STAGING_DOWNLOAD,
|
GfxFramebuffer, GfxTexture, PendingShmTransfer, ReleaseSync, STAGING_DOWNLOAD,
|
||||||
SampleRect, SyncFile,
|
SampleRect, SyncFile,
|
||||||
},
|
},
|
||||||
|
|
@ -96,8 +96,9 @@ use {
|
||||||
tree::{
|
tree::{
|
||||||
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, ToplevelData, ToplevelNode, ToplevelNodeBase, VrrMode, WorkspaceNode,
|
TearingMode, TileState, ToplevelData, ToplevelNode, ToplevelNodeBase, Transform,
|
||||||
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,12 +136,7 @@ use {
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
bstr::ByteSlice,
|
bstr::ByteSlice,
|
||||||
jay_config::{
|
jay_config::PciId,
|
||||||
PciId,
|
|
||||||
video::{GfxApi, Transform},
|
|
||||||
window::TileState,
|
|
||||||
workspace::WorkspaceDisplayOrder,
|
|
||||||
},
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
fmt::{Debug, Formatter},
|
fmt::{Debug, Formatter},
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,11 @@ use {
|
||||||
},
|
},
|
||||||
output_schedule::OutputSchedule,
|
output_schedule::OutputSchedule,
|
||||||
state::{ConnectorData, OutputData, State},
|
state::{ConnectorData, OutputData, State},
|
||||||
tree::{OutputNode, WsMoveConfig, move_ws_to_output},
|
tree::{OutputNode, Transform, WsMoveConfig, move_ws_to_output},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent, clonecell::CloneCell, hash_map_ext::HashMapExt, rc_eq::RcEq,
|
asyncevent::AsyncEvent, clonecell::CloneCell, hash_map_ext::HashMapExt, rc_eq::RcEq,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
jay_config::video::Transform,
|
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
collections::VecDeque,
|
collections::VecDeque,
|
||||||
|
|
|
||||||
32
src/theme.rs
32
src/theme.rs
|
|
@ -6,7 +6,8 @@ use {
|
||||||
gfx_api::AlphaMode,
|
gfx_api::AlphaMode,
|
||||||
utils::clonecell::CloneCell,
|
utils::clonecell::CloneCell,
|
||||||
},
|
},
|
||||||
jay_config::theme::BarPosition,
|
jay_config::theme::BarPosition as ConfigBarPosition,
|
||||||
|
linearize::Linearize,
|
||||||
num_traits::Float,
|
num_traits::Float,
|
||||||
std::{cell::Cell, cmp::Ordering, ops::Mul, sync::Arc},
|
std::{cell::Cell, cmp::Ordering, ops::Mul, sync::Arc},
|
||||||
};
|
};
|
||||||
|
|
@ -515,6 +516,35 @@ sizes! {
|
||||||
|
|
||||||
pub const DEFAULT_FONT: &str = "monospace 8";
|
pub const DEFAULT_FONT: &str = "monospace 8";
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Default, Linearize)]
|
||||||
|
pub enum BarPosition {
|
||||||
|
#[default]
|
||||||
|
Top,
|
||||||
|
Bottom,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<ConfigBarPosition> for BarPosition {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(value: ConfigBarPosition) -> Result<Self, Self::Error> {
|
||||||
|
let v = match value {
|
||||||
|
ConfigBarPosition::Top => Self::Top,
|
||||||
|
ConfigBarPosition::Bottom => Self::Bottom,
|
||||||
|
_ => return Err(()),
|
||||||
|
};
|
||||||
|
Ok(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<ConfigBarPosition> for BarPosition {
|
||||||
|
fn into(self) -> ConfigBarPosition {
|
||||||
|
match self {
|
||||||
|
BarPosition::Top => ConfigBarPosition::Top,
|
||||||
|
BarPosition::Bottom => ConfigBarPosition::Bottom,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Theme {
|
pub struct Theme {
|
||||||
pub colors: ThemeColors,
|
pub colors: ThemeColors,
|
||||||
pub sizes: ThemeSizes,
|
pub sizes: ThemeSizes,
|
||||||
|
|
|
||||||
166
src/tree.rs
166
src/tree.rs
|
|
@ -4,6 +4,10 @@ use {
|
||||||
client::{Client, ClientId},
|
client::{Client, ClientId},
|
||||||
fixed::Fixed,
|
fixed::Fixed,
|
||||||
ifs::{
|
ifs::{
|
||||||
|
wl_output::{
|
||||||
|
TF_90, TF_180, TF_270, TF_FLIPPED, TF_FLIPPED_90, TF_FLIPPED_180, TF_FLIPPED_270,
|
||||||
|
TF_NORMAL,
|
||||||
|
},
|
||||||
wl_seat::{
|
wl_seat::{
|
||||||
Dnd, NodeSeatState, WlSeatGlobal,
|
Dnd, NodeSeatState, WlSeatGlobal,
|
||||||
tablet::{
|
tablet::{
|
||||||
|
|
@ -23,7 +27,11 @@ use {
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
utils::{linkedlist::NodeRef, numcell::NumCell},
|
utils::{linkedlist::NodeRef, numcell::NumCell},
|
||||||
},
|
},
|
||||||
jay_config::Direction as JayDirection,
|
jay_config::{
|
||||||
|
Direction as JayDirection, video::Transform as ConfigTransform,
|
||||||
|
window::TileState as ConfigTileState,
|
||||||
|
workspace::WorkspaceDisplayOrder as ConfigWorkspaceDisplayOrder,
|
||||||
|
},
|
||||||
linearize::{Linearize, LinearizeExt},
|
linearize::{Linearize, LinearizeExt},
|
||||||
std::{
|
std::{
|
||||||
fmt::{Debug, Display},
|
fmt::{Debug, Display},
|
||||||
|
|
@ -46,6 +54,162 @@ 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)]
|
||||||
|
pub enum Transform {
|
||||||
|
#[default]
|
||||||
|
None,
|
||||||
|
Rotate90,
|
||||||
|
Rotate180,
|
||||||
|
Rotate270,
|
||||||
|
Flip,
|
||||||
|
FlipRotate90,
|
||||||
|
FlipRotate180,
|
||||||
|
FlipRotate270,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<ConfigTransform> for Transform {
|
||||||
|
fn from(value: ConfigTransform) -> Self {
|
||||||
|
match value {
|
||||||
|
ConfigTransform::None => Transform::None,
|
||||||
|
ConfigTransform::Rotate90 => Transform::Rotate90,
|
||||||
|
ConfigTransform::Rotate180 => Transform::Rotate180,
|
||||||
|
ConfigTransform::Rotate270 => Transform::Rotate270,
|
||||||
|
ConfigTransform::Flip => Transform::Flip,
|
||||||
|
ConfigTransform::FlipRotate90 => Transform::FlipRotate90,
|
||||||
|
ConfigTransform::FlipRotate180 => Transform::FlipRotate180,
|
||||||
|
ConfigTransform::FlipRotate270 => Transform::FlipRotate270,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<ConfigTransform> for Transform {
|
||||||
|
fn into(self) -> ConfigTransform {
|
||||||
|
match self {
|
||||||
|
Transform::None => ConfigTransform::None,
|
||||||
|
Transform::Rotate90 => ConfigTransform::Rotate90,
|
||||||
|
Transform::Rotate180 => ConfigTransform::Rotate180,
|
||||||
|
Transform::Rotate270 => ConfigTransform::Rotate270,
|
||||||
|
Transform::Flip => ConfigTransform::Flip,
|
||||||
|
Transform::FlipRotate90 => ConfigTransform::FlipRotate90,
|
||||||
|
Transform::FlipRotate180 => ConfigTransform::FlipRotate180,
|
||||||
|
Transform::FlipRotate270 => ConfigTransform::FlipRotate270,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Transform {
|
||||||
|
pub fn maybe_swap<T>(self, (left, right): (T, T)) -> (T, T) {
|
||||||
|
match self {
|
||||||
|
Self::None | Self::Rotate180 | Self::Flip | Self::FlipRotate180 => (left, right),
|
||||||
|
Self::Rotate90 | Self::Rotate270 | Self::FlipRotate90 | Self::FlipRotate270 => {
|
||||||
|
(right, left)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn to_wl(self) -> i32 {
|
||||||
|
match self {
|
||||||
|
Self::None => TF_NORMAL,
|
||||||
|
Self::Rotate90 => TF_90,
|
||||||
|
Self::Rotate180 => TF_180,
|
||||||
|
Self::Rotate270 => TF_270,
|
||||||
|
Self::Flip => TF_FLIPPED,
|
||||||
|
Self::FlipRotate90 => TF_FLIPPED_90,
|
||||||
|
Self::FlipRotate180 => TF_FLIPPED_180,
|
||||||
|
Self::FlipRotate270 => TF_FLIPPED_270,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_wl(wl: i32) -> Option<Self> {
|
||||||
|
let tf = match wl {
|
||||||
|
TF_NORMAL => Self::None,
|
||||||
|
TF_90 => Self::Rotate90,
|
||||||
|
TF_180 => Self::Rotate180,
|
||||||
|
TF_270 => Self::Rotate270,
|
||||||
|
TF_FLIPPED => Self::Flip,
|
||||||
|
TF_FLIPPED_90 => Self::FlipRotate90,
|
||||||
|
TF_FLIPPED_180 => Self::FlipRotate180,
|
||||||
|
TF_FLIPPED_270 => Self::FlipRotate270,
|
||||||
|
_ => return None,
|
||||||
|
};
|
||||||
|
Some(tf)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn apply_point(self, width: i32, height: i32, (x, y): (i32, i32)) -> (i32, i32) {
|
||||||
|
match self {
|
||||||
|
Self::None => (x, y),
|
||||||
|
Self::Rotate90 => (y, height - x),
|
||||||
|
Self::Rotate180 => (width - x, height - y),
|
||||||
|
Self::Rotate270 => (width - y, x),
|
||||||
|
Self::Flip => (width - x, y),
|
||||||
|
Self::FlipRotate90 => (y, x),
|
||||||
|
Self::FlipRotate180 => (x, height - y),
|
||||||
|
Self::FlipRotate270 => (width - y, height - x),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn inverse(self) -> Self {
|
||||||
|
match self {
|
||||||
|
Self::Rotate90 => Self::Rotate270,
|
||||||
|
Self::Rotate270 => Self::Rotate90,
|
||||||
|
_ => self,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Linearize)]
|
||||||
|
pub enum TileState {
|
||||||
|
Tiled,
|
||||||
|
Floating,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<ConfigTileState> for TileState {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(value: ConfigTileState) -> Result<Self, Self::Error> {
|
||||||
|
let v = match value {
|
||||||
|
ConfigTileState::Tiled => TileState::Tiled,
|
||||||
|
ConfigTileState::Floating => TileState::Floating,
|
||||||
|
_ => return Err(()),
|
||||||
|
};
|
||||||
|
Ok(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<ConfigTileState> for TileState {
|
||||||
|
fn into(self) -> ConfigTileState {
|
||||||
|
match self {
|
||||||
|
TileState::Tiled => ConfigTileState::Tiled,
|
||||||
|
TileState::Floating => ConfigTileState::Floating,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
Unspecified,
|
Unspecified,
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,12 @@ use {
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
state::State,
|
state::State,
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
|
theme::BarPosition,
|
||||||
tree::{
|
tree::{
|
||||||
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLayerLink,
|
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLayerLink,
|
||||||
NodeLocation, PinnedNode, StackedNode, TddType, TileDragDestination,
|
NodeLocation, PinnedNode, StackedNode, TddType, TileDragDestination, Transform,
|
||||||
WorkspaceDragDestination, WorkspaceNode, WorkspaceNodeId, walker::NodeVisitor,
|
WorkspaceDisplayOrder, WorkspaceDragDestination, WorkspaceNode, WorkspaceNodeId,
|
||||||
|
walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent,
|
asyncevent::AsyncEvent,
|
||||||
|
|
@ -59,18 +61,13 @@ use {
|
||||||
linkedlist::{LinkedList, NodeRef},
|
linkedlist::{LinkedList, NodeRef},
|
||||||
on_drop_event::OnDropEvent,
|
on_drop_event::OnDropEvent,
|
||||||
scroller::Scroller,
|
scroller::Scroller,
|
||||||
transform_ext::TransformExt,
|
|
||||||
},
|
},
|
||||||
wire::{
|
wire::{
|
||||||
ExtImageCopyCaptureSessionV1Id, JayOutputId, JayScreencastId, ZwlrScreencopyFrameV1Id,
|
ExtImageCopyCaptureSessionV1Id, JayOutputId, JayScreencastId, ZwlrScreencopyFrameV1Id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
jay_config::{
|
jay_config::video::{TearingMode as ConfigTearingMode, VrrMode as ConfigVrrMode},
|
||||||
theme::BarPosition,
|
|
||||||
video::{TearingMode as ConfigTearingMode, Transform, VrrMode as ConfigVrrMode},
|
|
||||||
workspace::WorkspaceDisplayOrder,
|
|
||||||
},
|
|
||||||
smallvec::SmallVec,
|
smallvec::SmallVec,
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
|
|
@ -794,7 +791,7 @@ impl OutputNode {
|
||||||
Rect::new_sized_saturating(x1, y1 + height - bh - bsw, width, bsw);
|
Rect::new_sized_saturating(x1, y1 + height - bh - bsw, width, bsw);
|
||||||
bar_rect = Rect::new_sized_saturating(x1, y1 + height - bh, width, bh);
|
bar_rect = Rect::new_sized_saturating(x1, y1 + height - bh, width, bh);
|
||||||
}
|
}
|
||||||
BarPosition::Top | _ => {
|
BarPosition::Top => {
|
||||||
bar_rect = Rect::new_sized_saturating(x1, y1, width, bh);
|
bar_rect = Rect::new_sized_saturating(x1, y1, width, bh);
|
||||||
bar_separator_rect = Rect::new_sized_saturating(x1, y1 + bh, width, bsw);
|
bar_separator_rect = Rect::new_sized_saturating(x1, y1 + bh, width, bsw);
|
||||||
bar_rect_with_separator = Rect::new_sized_saturating(x1, y1, width, bh + bsw);
|
bar_rect_with_separator = Rect::new_sized_saturating(x1, y1, width, bh + bsw);
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ pub mod event_listener;
|
||||||
pub mod fdcloser;
|
pub mod fdcloser;
|
||||||
pub mod free_list;
|
pub mod free_list;
|
||||||
pub mod geometric_decay;
|
pub mod geometric_decay;
|
||||||
pub mod gfx_api_ext;
|
|
||||||
pub mod hash_map_ext;
|
pub mod hash_map_ext;
|
||||||
pub mod line_logger;
|
pub mod line_logger;
|
||||||
pub mod linkedlist;
|
pub mod linkedlist;
|
||||||
|
|
@ -59,7 +58,6 @@ pub mod syncqueue;
|
||||||
pub mod threshold_counter;
|
pub mod threshold_counter;
|
||||||
pub mod timer;
|
pub mod timer;
|
||||||
pub mod toplevel_identifier;
|
pub mod toplevel_identifier;
|
||||||
pub mod transform_ext;
|
|
||||||
pub mod tri;
|
pub mod tri;
|
||||||
pub mod unlink_on_drop;
|
pub mod unlink_on_drop;
|
||||||
pub mod vec_ext;
|
pub mod vec_ext;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
use jay_config::video::GfxApi;
|
|
||||||
|
|
||||||
pub trait GfxApiExt: Sized {
|
|
||||||
fn to_str(&self) -> &'static str;
|
|
||||||
|
|
||||||
fn from_str_lossy(s: &str) -> Option<Self>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl GfxApiExt for GfxApi {
|
|
||||||
fn to_str(&self) -> &'static str {
|
|
||||||
match self {
|
|
||||||
GfxApi::OpenGl => "OpenGl",
|
|
||||||
GfxApi::Vulkan => "Vulkan",
|
|
||||||
_ => "unknown",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn from_str_lossy(s: &str) -> Option<Self> {
|
|
||||||
match &*s.to_ascii_lowercase() {
|
|
||||||
"opengl" => Some(Self::OpenGl),
|
|
||||||
"vulkan" => Some(Self::Vulkan),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
use {
|
|
||||||
crate::ifs::wl_output::{
|
|
||||||
TF_90, TF_180, TF_270, TF_FLIPPED, TF_FLIPPED_90, TF_FLIPPED_180, TF_FLIPPED_270, TF_NORMAL,
|
|
||||||
},
|
|
||||||
jay_config::video::{
|
|
||||||
Transform,
|
|
||||||
Transform::{
|
|
||||||
Flip, FlipRotate90, FlipRotate180, FlipRotate270, None, Rotate90, Rotate180, Rotate270,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
pub trait TransformExt: Sized {
|
|
||||||
fn maybe_swap<T>(self, args: (T, T)) -> (T, T);
|
|
||||||
|
|
||||||
fn to_wl(self) -> i32;
|
|
||||||
|
|
||||||
fn from_wl(wl: i32) -> Option<Self>;
|
|
||||||
|
|
||||||
fn apply_point(self, width: i32, height: i32, point: (i32, i32)) -> (i32, i32);
|
|
||||||
|
|
||||||
fn inverse(self) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl TransformExt for Transform {
|
|
||||||
fn maybe_swap<T>(self, (left, right): (T, T)) -> (T, T) {
|
|
||||||
match self {
|
|
||||||
None | Rotate180 | Flip | FlipRotate180 => (left, right),
|
|
||||||
Rotate90 | Rotate270 | FlipRotate90 | FlipRotate270 => (right, left),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn to_wl(self) -> i32 {
|
|
||||||
match self {
|
|
||||||
None => TF_NORMAL,
|
|
||||||
Rotate90 => TF_90,
|
|
||||||
Rotate180 => TF_180,
|
|
||||||
Rotate270 => TF_270,
|
|
||||||
Flip => TF_FLIPPED,
|
|
||||||
FlipRotate90 => TF_FLIPPED_90,
|
|
||||||
FlipRotate180 => TF_FLIPPED_180,
|
|
||||||
FlipRotate270 => TF_FLIPPED_270,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn from_wl(wl: i32) -> Option<Self> {
|
|
||||||
let tf = match wl {
|
|
||||||
TF_NORMAL => None,
|
|
||||||
TF_90 => Rotate90,
|
|
||||||
TF_180 => Rotate180,
|
|
||||||
TF_270 => Rotate270,
|
|
||||||
TF_FLIPPED => Flip,
|
|
||||||
TF_FLIPPED_90 => FlipRotate90,
|
|
||||||
TF_FLIPPED_180 => FlipRotate180,
|
|
||||||
TF_FLIPPED_270 => FlipRotate270,
|
|
||||||
_ => return Option::None,
|
|
||||||
};
|
|
||||||
Some(tf)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn apply_point(self, width: i32, height: i32, (x, y): (i32, i32)) -> (i32, i32) {
|
|
||||||
match self {
|
|
||||||
None => (x, y),
|
|
||||||
Rotate90 => (y, height - x),
|
|
||||||
Rotate180 => (width - x, height - y),
|
|
||||||
Rotate270 => (width - y, x),
|
|
||||||
Flip => (width - x, y),
|
|
||||||
FlipRotate90 => (y, x),
|
|
||||||
FlipRotate180 => (x, height - y),
|
|
||||||
FlipRotate270 => (width - y, height - x),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn inverse(self) -> Self {
|
|
||||||
match self {
|
|
||||||
Rotate90 => Rotate270,
|
|
||||||
Rotate270 => Rotate90,
|
|
||||||
_ => self,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue