Format
This commit is contained in:
parent
59c2b53350
commit
8ff17aca1e
30 changed files with 222 additions and 244 deletions
|
|
@ -8,33 +8,31 @@ pub struct Tree {
|
||||||
pub shaders: &'static [&'static str],
|
pub shaders: &'static [&'static str],
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const TREES: &[Tree] = &[
|
pub const TREES: &[Tree] = &[Tree {
|
||||||
Tree {
|
root: "src/gfx_apis/vulkan/shaders",
|
||||||
root: "src/gfx_apis/vulkan/shaders",
|
hash: "src/gfx_apis/vulkan/shaders_hash.txt",
|
||||||
hash: "src/gfx_apis/vulkan/shaders_hash.txt",
|
bin: "src/gfx_apis/vulkan/shaders_bin",
|
||||||
bin: "src/gfx_apis/vulkan/shaders_bin",
|
shaders: &[
|
||||||
shaders: &[
|
"fill.frag",
|
||||||
"fill.frag",
|
"fill.vert",
|
||||||
"fill.vert",
|
"tex.vert",
|
||||||
"tex.vert",
|
"tex.frag",
|
||||||
"tex.frag",
|
"out.vert",
|
||||||
"out.vert",
|
"out.frag",
|
||||||
"out.frag",
|
"rounded_fill.frag",
|
||||||
"rounded_fill.frag",
|
"rounded_fill.vert",
|
||||||
"rounded_fill.vert",
|
"rounded_tex.frag",
|
||||||
"rounded_tex.frag",
|
"rounded_tex.vert",
|
||||||
"rounded_tex.vert",
|
"legacy/fill.frag",
|
||||||
"legacy/fill.frag",
|
"legacy/fill.vert",
|
||||||
"legacy/fill.vert",
|
"legacy/tex.vert",
|
||||||
"legacy/tex.vert",
|
"legacy/tex.frag",
|
||||||
"legacy/tex.frag",
|
"legacy/rounded_fill.frag",
|
||||||
"legacy/rounded_fill.frag",
|
"legacy/rounded_fill.vert",
|
||||||
"legacy/rounded_fill.vert",
|
"legacy/rounded_tex.frag",
|
||||||
"legacy/rounded_tex.frag",
|
"legacy/rounded_tex.vert",
|
||||||
"legacy/rounded_tex.vert",
|
],
|
||||||
],
|
}];
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
fn calculate_hash(tree: &Tree) -> anyhow::Result<String> {
|
fn calculate_hash(tree: &Tree) -> anyhow::Result<String> {
|
||||||
let dir = WalkDir::new(tree.root);
|
let dir = WalkDir::new(tree.root);
|
||||||
|
|
|
||||||
|
|
@ -437,4 +437,3 @@ pub fn on_unload(f: impl FnOnce() + 'static) {
|
||||||
pub fn set_middle_click_paste_enabled(enabled: bool) {
|
pub fn set_middle_click_paste_enabled(enabled: bool) {
|
||||||
get!().set_middle_click_paste_enabled(enabled);
|
get!().set_middle_click_paste_enabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,6 @@ impl BackendDrmDevice for MetalDrmDevice {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct HandleEvents {
|
pub struct HandleEvents {
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,8 @@ use {
|
||||||
tree::{
|
tree::{
|
||||||
DisplayNode, NodeIds, OutputNode, TearingMode, Transform, VrrMode,
|
DisplayNode, NodeIds, OutputNode, TearingMode, Transform, VrrMode,
|
||||||
WorkspaceDisplayOrder, WorkspaceNode, container_layout, container_render_positions,
|
WorkspaceDisplayOrder, WorkspaceNode, container_layout, container_render_positions,
|
||||||
float_layout, output_render_data,
|
container_tab_render_textures, float_layout, output_render_data,
|
||||||
placeholder_render_textures,
|
placeholder_render_textures,
|
||||||
container_tab_render_textures,
|
|
||||||
},
|
},
|
||||||
user_session::import_environment,
|
user_session::import_environment,
|
||||||
utils::{
|
utils::{
|
||||||
|
|
|
||||||
|
|
@ -3371,9 +3371,7 @@ impl ConfigProxyHandler {
|
||||||
.handle_set_bar_position(position)
|
.handle_set_bar_position(position)
|
||||||
.wrn("set_bar_position")?,
|
.wrn("set_bar_position")?,
|
||||||
ClientMessage::GetBarPosition => self.handle_get_bar_position(),
|
ClientMessage::GetBarPosition => self.handle_get_bar_position(),
|
||||||
ClientMessage::SetCornerRadius { radius } => {
|
ClientMessage::SetCornerRadius { radius } => self.handle_set_corner_radius(radius),
|
||||||
self.handle_set_corner_radius(radius)
|
|
||||||
}
|
|
||||||
ClientMessage::GetCornerRadius => self.handle_get_corner_radius(),
|
ClientMessage::GetCornerRadius => self.handle_get_corner_radius(),
|
||||||
ClientMessage::SeatFocusHistory { seat, timeline } => self
|
ClientMessage::SeatFocusHistory { seat, timeline } => self
|
||||||
.handle_seat_focus_history(seat, timeline)
|
.handle_seat_focus_history(seat, timeline)
|
||||||
|
|
@ -3393,13 +3391,12 @@ impl ConfigProxyHandler {
|
||||||
ClientMessage::SeatFocusTiles { seat } => {
|
ClientMessage::SeatFocusTiles { seat } => {
|
||||||
self.handle_seat_focus_tiles(seat).wrn("seat_focus_tiles")?
|
self.handle_seat_focus_tiles(seat).wrn("seat_focus_tiles")?
|
||||||
}
|
}
|
||||||
ClientMessage::SeatFocusFloats { seat } => {
|
ClientMessage::SeatFocusFloats { seat } => self
|
||||||
self.handle_seat_focus_floats(seat).wrn("seat_focus_floats")?
|
.handle_seat_focus_floats(seat)
|
||||||
}
|
.wrn("seat_focus_floats")?,
|
||||||
ClientMessage::SeatToggleFocusFloatTiled { seat } => {
|
ClientMessage::SeatToggleFocusFloatTiled { seat } => self
|
||||||
self.handle_seat_toggle_focus_float_tiled(seat)
|
.handle_seat_toggle_focus_float_tiled(seat)
|
||||||
.wrn("seat_toggle_focus_float_tiled")?
|
.wrn("seat_toggle_focus_float_tiled")?,
|
||||||
}
|
|
||||||
ClientMessage::SetMiddleClickPasteEnabled { enabled } => {
|
ClientMessage::SetMiddleClickPasteEnabled { enabled } => {
|
||||||
self.handle_set_middle_click_paste_enabled(enabled)
|
self.handle_set_middle_click_paste_enabled(enabled)
|
||||||
}
|
}
|
||||||
|
|
@ -3497,9 +3494,9 @@ impl ConfigProxyHandler {
|
||||||
} => self
|
} => self
|
||||||
.handle_window_resize(window, dx1, dy1, dx2, dy2)
|
.handle_window_resize(window, dx1, dy1, dx2, dy2)
|
||||||
.wrn("window_resize")?,
|
.wrn("window_resize")?,
|
||||||
ClientMessage::SeatToggleTab { seat } => self
|
ClientMessage::SeatToggleTab { seat } => {
|
||||||
.handle_seat_toggle_tab(seat)
|
self.handle_seat_toggle_tab(seat).wrn("seat_toggle_tab")?
|
||||||
.wrn("seat_toggle_tab")?,
|
}
|
||||||
ClientMessage::SeatMakeGroup {
|
ClientMessage::SeatMakeGroup {
|
||||||
seat,
|
seat,
|
||||||
axis,
|
axis,
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,6 @@ impl ClMatcherManager {
|
||||||
pub fn tag(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
|
pub fn tag(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
|
||||||
self.root(ClmMatchTag::new(string))
|
self.root(ClmMatchTag::new(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CritTarget for Rc<Client> {
|
impl CritTarget for Rc<Client> {
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,6 @@ impl CursorUserGroup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn output_center(&self, output: &Rc<OutputNode>) -> (Fixed, Fixed) {
|
fn output_center(&self, output: &Rc<OutputNode>) -> (Fixed, Fixed) {
|
||||||
let pos = output.global.pos.get();
|
let pos = output.global.pos.get();
|
||||||
let x = Fixed::from_int((pos.x1() + pos.x2()) / 2);
|
let x = Fixed::from_int((pos.x1() + pos.x2()) / 2);
|
||||||
|
|
|
||||||
|
|
@ -205,8 +205,7 @@ fn run_ops(fb: &Framebuffer, ops: &[GfxApiOpt]) -> Option<FdSync> {
|
||||||
Some(c) if c == fr.color => {}
|
Some(c) if c == fr.color => {}
|
||||||
_ => break,
|
_ => break,
|
||||||
}
|
}
|
||||||
let [top_right, top_left, bottom_right, bottom_left] =
|
let [top_right, top_left, bottom_right, bottom_left] = fr.rect.to_points();
|
||||||
fr.rect.to_points();
|
|
||||||
triangles.extend_from_slice(&[
|
triangles.extend_from_slice(&[
|
||||||
top_right,
|
top_right,
|
||||||
top_left,
|
top_left,
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,7 @@ impl VulkanRenderer {
|
||||||
format: pipelines.format,
|
format: pipelines.format,
|
||||||
vert: self.rounded_tex_vert_shader.clone(),
|
vert: self.rounded_tex_vert_shader.clone(),
|
||||||
frag: self.rounded_tex_frag_shader.clone(),
|
frag: self.rounded_tex_frag_shader.clone(),
|
||||||
blend: true, // always blend since corners are transparent
|
blend: true, // always blend since corners are transparent
|
||||||
src_has_alpha: true, // rounding makes everything have alpha
|
src_has_alpha: true, // rounding makes everything have alpha
|
||||||
has_alpha_mult,
|
has_alpha_mult,
|
||||||
alpha_mode: key.tex_alpha_mode,
|
alpha_mode: key.tex_alpha_mode,
|
||||||
|
|
@ -973,7 +973,9 @@ impl VulkanRenderer {
|
||||||
}
|
}
|
||||||
VulkanOp::RoundedFill(mut f) => {
|
VulkanOp::RoundedFill(mut f) => {
|
||||||
f.range_address = memory.data_buffer.len() as DeviceAddress;
|
f.range_address = memory.data_buffer.len() as DeviceAddress;
|
||||||
memory.data_buffer.extend_from_slice(uapi::as_bytes(&f.target));
|
memory
|
||||||
|
.data_buffer
|
||||||
|
.extend_from_slice(uapi::as_bytes(&f.target));
|
||||||
mops.push(VulkanOp::RoundedFill(f));
|
mops.push(VulkanOp::RoundedFill(f));
|
||||||
}
|
}
|
||||||
VulkanOp::RoundedTex(mut c) => {
|
VulkanOp::RoundedTex(mut c) => {
|
||||||
|
|
@ -1370,8 +1372,18 @@ impl VulkanRenderer {
|
||||||
for pass in RenderPass::variants() {
|
for pass in RenderPass::variants() {
|
||||||
for cmd in &mut memory.ops[pass] {
|
for cmd in &mut memory.ops[pass] {
|
||||||
let tex_data = match cmd {
|
let tex_data = match cmd {
|
||||||
VulkanOp::Tex(c) => Some((&c.tex, &mut c.buffer_resv, &mut c.acquire_sync, c.release_sync)),
|
VulkanOp::Tex(c) => Some((
|
||||||
VulkanOp::RoundedTex(c) => Some((&c.tex, &mut c.buffer_resv, &mut c.acquire_sync, c.release_sync)),
|
&c.tex,
|
||||||
|
&mut c.buffer_resv,
|
||||||
|
&mut c.acquire_sync,
|
||||||
|
c.release_sync,
|
||||||
|
)),
|
||||||
|
VulkanOp::RoundedTex(c) => Some((
|
||||||
|
&c.tex,
|
||||||
|
&mut c.buffer_resv,
|
||||||
|
&mut c.acquire_sync,
|
||||||
|
c.release_sync,
|
||||||
|
)),
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
if let Some((tex, buffer_resv, acquire_sync, release_sync)) = tex_data {
|
if let Some((tex, buffer_resv, acquire_sync, release_sync)) = tex_data {
|
||||||
|
|
@ -1623,8 +1635,7 @@ impl VulkanRenderer {
|
||||||
let memory = &*self.memory.borrow();
|
let memory = &*self.memory.borrow();
|
||||||
let fill_pl = self.get_or_create_fill_pipelines(target.format.vk_format)?;
|
let fill_pl = self.get_or_create_fill_pipelines(target.format.vk_format)?;
|
||||||
let tex_pl = self.get_or_create_tex_pipelines(target.format.vk_format, target_cd);
|
let tex_pl = self.get_or_create_tex_pipelines(target.format.vk_format, target_cd);
|
||||||
let rounded_fill_pl =
|
let rounded_fill_pl = self.get_or_create_rounded_fill_pipelines(target.format.vk_format)?;
|
||||||
self.get_or_create_rounded_fill_pipelines(target.format.vk_format)?;
|
|
||||||
let rounded_tex_pl =
|
let rounded_tex_pl =
|
||||||
self.get_or_create_rounded_tex_pipelines(target.format.vk_format, target_cd);
|
self.get_or_create_rounded_tex_pipelines(target.format.vk_format, target_cd);
|
||||||
let dev = &self.device.device;
|
let dev = &self.device.device;
|
||||||
|
|
@ -2416,9 +2427,7 @@ impl VulkanRenderer {
|
||||||
// but they do paint pixels and need paint regions.
|
// but they do paint pixels and need paint regions.
|
||||||
(false, rf.rect)
|
(false, rf.rect)
|
||||||
}
|
}
|
||||||
GfxApiOpt::RoundedCopyTexture(ct) => {
|
GfxApiOpt::RoundedCopyTexture(ct) => (false, ct.target),
|
||||||
(false, ct.target)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
if opaque || bb.is_none() {
|
if opaque || bb.is_none() {
|
||||||
tag |= 1;
|
tag |= 1;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ use {
|
||||||
wl_output::WlOutputGlobal,
|
wl_output::WlOutputGlobal,
|
||||||
wl_registry::WlRegistry,
|
wl_registry::WlRegistry,
|
||||||
wl_seat::{
|
wl_seat::{
|
||||||
WlSeatGlobal,
|
|
||||||
ext_transient_seat_manager_v1::ExtTransientSeatManagerV1Global,
|
ext_transient_seat_manager_v1::ExtTransientSeatManagerV1Global,
|
||||||
tablet::zwp_tablet_manager_v2::ZwpTabletManagerV2Global,
|
tablet::zwp_tablet_manager_v2::ZwpTabletManagerV2Global,
|
||||||
text_input::{
|
text_input::{
|
||||||
|
|
@ -41,6 +40,7 @@ use {
|
||||||
zwp_pointer_gestures_v1::ZwpPointerGesturesV1Global,
|
zwp_pointer_gestures_v1::ZwpPointerGesturesV1Global,
|
||||||
zwp_relative_pointer_manager_v1::ZwpRelativePointerManagerV1Global,
|
zwp_relative_pointer_manager_v1::ZwpRelativePointerManagerV1Global,
|
||||||
zwp_virtual_keyboard_manager_v1::ZwpVirtualKeyboardManagerV1Global,
|
zwp_virtual_keyboard_manager_v1::ZwpVirtualKeyboardManagerV1Global,
|
||||||
|
WlSeatGlobal,
|
||||||
},
|
},
|
||||||
wl_shm::WlShmGlobal,
|
wl_shm::WlShmGlobal,
|
||||||
wl_subcompositor::WlSubcompositorGlobal,
|
wl_subcompositor::WlSubcompositorGlobal,
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,14 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
client::{Client, ClientError},
|
client::{Client, ClientError},
|
||||||
ifs::wl_seat::SeatFocusGrab,
|
ifs::{wl_seat::SeatFocusGrab, wl_surface::WlSurface},
|
||||||
ifs::wl_surface::WlSurface,
|
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
tree::NodeId,
|
tree::NodeId,
|
||||||
wire::{HyprlandFocusGrabV1Id, hyprland_focus_grab_v1::*},
|
wire::{HyprlandFocusGrabV1Id, hyprland_focus_grab_v1::*},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
std::{
|
std::{cell::Cell, rc::Rc},
|
||||||
cell::Cell,
|
|
||||||
rc::Rc,
|
|
||||||
},
|
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -56,7 +52,8 @@ impl HyprlandFocusGrabV1 {
|
||||||
if let Some(old) = seat.focus_grab.get() {
|
if let Some(old) = seat.focus_grab.get() {
|
||||||
old.clear();
|
old.clear();
|
||||||
}
|
}
|
||||||
seat.focus_grab.set(Some(self.clone() as Rc<dyn SeatFocusGrab>));
|
seat.focus_grab
|
||||||
|
.set(Some(self.clone() as Rc<dyn SeatFocusGrab>));
|
||||||
if let Some(node) = focus_node.clone() {
|
if let Some(node) = focus_node.clone() {
|
||||||
seat.grab(node);
|
seat.grab(node);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,6 @@ impl JayCompositorRequestHandler for JayCompositor {
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object_base! {
|
object_base! {
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,9 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::{DeviceHandlerData, State},
|
state::{DeviceHandlerData, State},
|
||||||
tree::{
|
tree::{
|
||||||
ContainerNode, ContainerSplit, ChangeGroupAction, Direction, FoundNode, Node, NodeId, NodeLayer,
|
ChangeGroupAction, ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId,
|
||||||
NodeLayerLink, NodeLocation, OutputNode, StackedNode, ToplevelNode, WorkspaceNode,
|
NodeLayer, NodeLayerLink, NodeLocation, OutputNode, StackedNode, ToplevelNode,
|
||||||
generic_node_visitor, toplevel_create_split, toplevel_parent_container,
|
WorkspaceNode, generic_node_visitor, toplevel_create_split, toplevel_parent_container,
|
||||||
toplevel_set_floating, toplevel_set_workspace,
|
toplevel_set_floating, toplevel_set_workspace,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
|
|
@ -862,8 +862,7 @@ impl WlSeatGlobal {
|
||||||
&& let Some(c) = p.node_into_container()
|
&& let Some(c) = p.node_into_container()
|
||||||
{
|
{
|
||||||
c.move_focus_from_child(self, tl.deref(), direction);
|
c.move_focus_from_child(self, tl.deref(), direction);
|
||||||
} else if let Some(float) = data.float.get()
|
} else if let Some(float) = data.float.get() {
|
||||||
{
|
|
||||||
let ws = float.workspace.get();
|
let ws = float.workspace.get();
|
||||||
let floats: Vec<_> = ws
|
let floats: Vec<_> = ws
|
||||||
.stacked
|
.stacked
|
||||||
|
|
@ -1742,7 +1741,6 @@ impl WlSeatGlobal {
|
||||||
pub fn set_pointer_revert_key(&self, key: KeySym) {
|
pub fn set_pointer_revert_key(&self, key: KeySym) {
|
||||||
self.revert_key.set(key);
|
self.revert_key.set(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CursorUserOwner for WlSeatGlobal {
|
impl CursorUserOwner for WlSeatGlobal {
|
||||||
|
|
|
||||||
|
|
@ -1448,8 +1448,7 @@ impl WlSurface {
|
||||||
// already called damage() when removing the child, and for tiled windows the
|
// already called damage() when removing the child, and for tiled windows the
|
||||||
// deferred layout damage system handles repainting once siblings have resized.
|
// deferred layout damage system handles repainting once siblings have resized.
|
||||||
// Emitting damage here creates an intermediate frame showing an empty gap.
|
// Emitting damage here creates an intermediate frame showing an empty gap.
|
||||||
let becoming_invisible =
|
let becoming_invisible = was_visible && !self.visible.get() && self.buffer.is_none();
|
||||||
was_visible && !self.visible.get() && self.buffer.is_none();
|
|
||||||
if !becoming_invisible || self.toplevel.is_none() {
|
if !becoming_invisible || self.toplevel.is_none() {
|
||||||
let mut damage =
|
let mut damage =
|
||||||
buffer_abs_pos.with_size_saturating(max_surface_size.0, max_surface_size.1);
|
buffer_abs_pos.with_size_saturating(max_surface_size.0, max_surface_size.1);
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,9 @@ impl XdgToplevel {
|
||||||
self.min_height.get(),
|
self.min_height.get(),
|
||||||
self.max_height.get(),
|
self.max_height.get(),
|
||||||
) {
|
) {
|
||||||
(Some(min_w), Some(max_w), Some(min_h), Some(max_h)) if min_w == max_w && min_h == max_h => {
|
(Some(min_w), Some(max_w), Some(min_h), Some(max_h))
|
||||||
|
if min_w == max_w && min_h == max_h =>
|
||||||
|
{
|
||||||
Some((min_w, min_h))
|
Some((min_w, min_h))
|
||||||
}
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ impl KnownCursor {
|
||||||
};
|
};
|
||||||
Some(cursor)
|
Some(cursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object_base! {
|
object_base! {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::State,
|
state::State,
|
||||||
tree::ToplevelOpt,
|
tree::ToplevelOpt,
|
||||||
wire::{
|
wire::{XxForeignToplevelGeometryTrackerV1Id, xx_foreign_toplevel_geometry_tracker_v1::*},
|
||||||
XxForeignToplevelGeometryTrackerV1Id,
|
|
||||||
xx_foreign_toplevel_geometry_tracker_v1::*,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
|
|
@ -66,9 +63,7 @@ impl XxForeignToplevelGeometryTrackerV1 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XxForeignToplevelGeometryTrackerV1RequestHandler
|
impl XxForeignToplevelGeometryTrackerV1RequestHandler for XxForeignToplevelGeometryTrackerV1 {
|
||||||
for XxForeignToplevelGeometryTrackerV1
|
|
||||||
{
|
|
||||||
type Error = XxForeignToplevelGeometryTrackerV1Error;
|
type Error = XxForeignToplevelGeometryTrackerV1Error;
|
||||||
|
|
||||||
fn destroy(&self, _req: Destroy, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
fn destroy(&self, _req: Destroy, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ use {
|
||||||
client::{CAP_FOREIGN_TOPLEVEL_GEOMETRY_TRACKING, Client, ClientCaps, ClientError},
|
client::{CAP_FOREIGN_TOPLEVEL_GEOMETRY_TRACKING, Client, ClientCaps, ClientError},
|
||||||
globals::{Global, GlobalName},
|
globals::{Global, GlobalName},
|
||||||
ifs::{
|
ifs::{
|
||||||
xx_foreign_toplevel_geometry_tracker_v1::XxForeignToplevelGeometryTrackerV1,
|
|
||||||
ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,
|
ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,
|
||||||
|
xx_foreign_toplevel_geometry_tracker_v1::XxForeignToplevelGeometryTrackerV1,
|
||||||
},
|
},
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
|
|
|
||||||
|
|
@ -299,8 +299,7 @@ impl Renderer<'_> {
|
||||||
// RoundedFillRect z1 – rounded border ring (on top of bg)
|
// RoundedFillRect z1 – rounded border ring (on top of bg)
|
||||||
// RoundedCopyTexture – title text (on top of everything)
|
// RoundedCopyTexture – title text (on top of everything)
|
||||||
for entry in &tab_bar.entries {
|
for entry in &tab_bar.entries {
|
||||||
let (bg_color, border_color, _text_color) =
|
let (bg_color, border_color, _text_color) = TabBar::entry_colors(self.state, entry);
|
||||||
TabBar::entry_colors(self.state, entry);
|
|
||||||
let ex = entry.x.get();
|
let ex = entry.x.get();
|
||||||
let ew = entry.width.get();
|
let ew = entry.width.get();
|
||||||
let tab_rect = Rect::new_sized_saturating(ex, 0, ew, bar_height);
|
let tab_rect = Rect::new_sized_saturating(ex, 0, ew, bar_height);
|
||||||
|
|
@ -308,7 +307,12 @@ impl Renderer<'_> {
|
||||||
|
|
||||||
// Tiny FillRect strip to establish Vulkan paint regions (visually hidden
|
// Tiny FillRect strip to establish Vulkan paint regions (visually hidden
|
||||||
// behind the RoundedFillRect bg that renders later).
|
// behind the RoundedFillRect bg that renders later).
|
||||||
let strip = Rect::new_sized_saturating(ex + radius, bar_height / 2, (ew - 2 * radius).max(1), 1);
|
let strip = Rect::new_sized_saturating(
|
||||||
|
ex + radius,
|
||||||
|
bar_height / 2,
|
||||||
|
(ew - 2 * radius).max(1),
|
||||||
|
1,
|
||||||
|
);
|
||||||
self.base
|
self.base
|
||||||
.fill_boxes2(slice::from_ref(&strip), &bg_color, srgb, perceptual, x, y);
|
.fill_boxes2(slice::from_ref(&strip), &bg_color, srgb, perceptual, x, y);
|
||||||
|
|
||||||
|
|
@ -350,7 +354,10 @@ impl Renderer<'_> {
|
||||||
let text_x = match self.state.theme.tab_title_align.get() {
|
let text_x = match self.state.theme.tab_title_align.get() {
|
||||||
TabTitleAlign::Start => x + ex + text_padding + border_width,
|
TabTitleAlign::Start => x + ex + text_padding + border_width,
|
||||||
TabTitleAlign::Center => {
|
TabTitleAlign::Center => {
|
||||||
x + ex + border_width + (tab_inner.max(0) - tex_width).max(0) / 2 + text_padding.min(tab_inner.max(0) / 2)
|
x + ex
|
||||||
|
+ border_width
|
||||||
|
+ (tab_inner.max(0) - tex_width).max(0) / 2
|
||||||
|
+ text_padding.min(tab_inner.max(0) / 2)
|
||||||
}
|
}
|
||||||
TabTitleAlign::End => {
|
TabTitleAlign::End => {
|
||||||
let end_x = x + ex + ew - tex_width - text_padding - border_width;
|
let end_x = x + ex + ew - tex_width - text_padding - border_width;
|
||||||
|
|
@ -405,8 +412,7 @@ impl Renderer<'_> {
|
||||||
let srgb_srgb = self.state.color_manager.srgb_gamma22();
|
let srgb_srgb = self.state.color_manager.srgb_gamma22();
|
||||||
let bw = self.state.theme.sizes.border_width.get();
|
let bw = self.state.theme.sizes.border_width.get();
|
||||||
let border_color = self.state.theme.colors.border.get();
|
let border_color = self.state.theme.colors.border.get();
|
||||||
let focused_border_color =
|
let focused_border_color = self.state.theme.colors.focused_title_background.get();
|
||||||
self.state.theme.colors.focused_title_background.get();
|
|
||||||
let c = if child.active.get() {
|
let c = if child.active.get() {
|
||||||
&focused_border_color
|
&focused_border_color
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -423,10 +429,21 @@ impl Renderer<'_> {
|
||||||
let frame_rects = [
|
let frame_rects = [
|
||||||
Rect::new_sized_saturating(mb.x1() - bw, frame_y, bw, frame_h),
|
Rect::new_sized_saturating(mb.x1() - bw, frame_y, bw, frame_h),
|
||||||
Rect::new_sized_saturating(mb.x2(), frame_y, bw, frame_h),
|
Rect::new_sized_saturating(mb.x2(), frame_y, bw, frame_h),
|
||||||
Rect::new_sized_saturating(mb.x1() - bw, frame_y - bw, full_w + 2 * bw, bw),
|
Rect::new_sized_saturating(
|
||||||
Rect::new_sized_saturating(mb.x1() - bw, frame_y + frame_h, full_w + 2 * bw, bw),
|
mb.x1() - bw,
|
||||||
|
frame_y - bw,
|
||||||
|
full_w + 2 * bw,
|
||||||
|
bw,
|
||||||
|
),
|
||||||
|
Rect::new_sized_saturating(
|
||||||
|
mb.x1() - bw,
|
||||||
|
frame_y + frame_h,
|
||||||
|
full_w + 2 * bw,
|
||||||
|
bw,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
self.base.fill_boxes2(&frame_rects, c, srgb, perceptual, x, y);
|
self.base
|
||||||
|
.fill_boxes2(&frame_rects, c, srgb, perceptual, x, y);
|
||||||
} else {
|
} else {
|
||||||
let outer = Rect::new_sized_saturating(
|
let outer = Rect::new_sized_saturating(
|
||||||
mb.x1() - bw,
|
mb.x1() - bw,
|
||||||
|
|
@ -477,12 +494,7 @@ impl Renderer<'_> {
|
||||||
let bw = self.state.theme.sizes.border_width.get();
|
let bw = self.state.theme.sizes.border_width.get();
|
||||||
let border_color = self.state.theme.colors.border.get();
|
let border_color = self.state.theme.colors.border.get();
|
||||||
let focused_border_color = self.state.theme.colors.focused_title_background.get();
|
let focused_border_color = self.state.theme.colors.focused_title_background.get();
|
||||||
(
|
(Some(srgb_srgb), bw, border_color, focused_border_color)
|
||||||
Some(srgb_srgb),
|
|
||||||
bw,
|
|
||||||
border_color,
|
|
||||||
focused_border_color,
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
(None, 0, Color::SOLID_BLACK, Color::SOLID_BLACK)
|
(None, 0, Color::SOLID_BLACK, Color::SOLID_BLACK)
|
||||||
};
|
};
|
||||||
|
|
@ -507,10 +519,21 @@ impl Renderer<'_> {
|
||||||
let frame_rects = [
|
let frame_rects = [
|
||||||
Rect::new_sized_saturating(body.x1() - bw, body.y1(), bw, full_h),
|
Rect::new_sized_saturating(body.x1() - bw, body.y1(), bw, full_h),
|
||||||
Rect::new_sized_saturating(body.x2(), body.y1(), bw, full_h),
|
Rect::new_sized_saturating(body.x2(), body.y1(), bw, full_h),
|
||||||
Rect::new_sized_saturating(body.x1() - bw, body.y1() - bw, full_w + 2 * bw, bw),
|
Rect::new_sized_saturating(
|
||||||
Rect::new_sized_saturating(body.x1() - bw, body.y2(), full_w + 2 * bw, bw),
|
body.x1() - bw,
|
||||||
|
body.y1() - bw,
|
||||||
|
full_w + 2 * bw,
|
||||||
|
bw,
|
||||||
|
),
|
||||||
|
Rect::new_sized_saturating(
|
||||||
|
body.x1() - bw,
|
||||||
|
body.y2(),
|
||||||
|
full_w + 2 * bw,
|
||||||
|
bw,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
self.base.fill_boxes2(&frame_rects, c, srgb, perceptual, x, y);
|
self.base
|
||||||
|
.fill_boxes2(&frame_rects, c, srgb, perceptual, x, y);
|
||||||
} else {
|
} else {
|
||||||
let outer = Rect::new_sized_saturating(
|
let outer = Rect::new_sized_saturating(
|
||||||
body.x1() - bw,
|
body.x1() - bw,
|
||||||
|
|
@ -533,11 +556,12 @@ impl Renderer<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let content = child.content.get();
|
let content = child.content.get();
|
||||||
self.stretch = if content.width() != body.width() || content.height() != body.height() {
|
self.stretch =
|
||||||
Some(self.base.scale_point(body.width(), body.height()))
|
if content.width() != body.width() || content.height() != body.height() {
|
||||||
} else {
|
Some(self.base.scale_point(body.width(), body.height()))
|
||||||
None
|
} else {
|
||||||
};
|
None
|
||||||
|
};
|
||||||
if !cr.is_zero() && !child.node.node_is_container() && gap != 0 {
|
if !cr.is_zero() && !child.node.node_is_container() && gap != 0 {
|
||||||
let scalef = self.base.scalef as f32;
|
let scalef = self.base.scalef as f32;
|
||||||
let inner_cr = cr.expanded_by(-(bw as f32)).scaled_by(scalef);
|
let inner_cr = cr.expanded_by(-(bw as f32)).scaled_by(scalef);
|
||||||
|
|
@ -624,7 +648,6 @@ impl Renderer<'_> {
|
||||||
self.render_surface_scaled(surface, x, y, None, bounds, false);
|
self.render_surface_scaled(surface, x, y, None, bounds, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn render_surface_scaled(
|
pub fn render_surface_scaled(
|
||||||
&mut self,
|
&mut self,
|
||||||
surface: &WlSurface,
|
surface: &WlSurface,
|
||||||
|
|
@ -797,18 +820,8 @@ impl Renderer<'_> {
|
||||||
let borders = [
|
let borders = [
|
||||||
Rect::new_sized_saturating(x, y, pos.width(), bw),
|
Rect::new_sized_saturating(x, y, pos.width(), bw),
|
||||||
Rect::new_sized_saturating(x, y + bw, bw, pos.height() - bw),
|
Rect::new_sized_saturating(x, y + bw, bw, pos.height() - bw),
|
||||||
Rect::new_sized_saturating(
|
Rect::new_sized_saturating(x + pos.width() - bw, y + bw, bw, pos.height() - bw),
|
||||||
x + pos.width() - bw,
|
Rect::new_sized_saturating(x + bw, y + pos.height() - bw, pos.width() - 2 * bw, bw),
|
||||||
y + bw,
|
|
||||||
bw,
|
|
||||||
pos.height() - bw,
|
|
||||||
),
|
|
||||||
Rect::new_sized_saturating(
|
|
||||||
x + bw,
|
|
||||||
y + pos.height() - bw,
|
|
||||||
pos.width() - 2 * bw,
|
|
||||||
bw,
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
self.base.fill_boxes(&borders, &bc, srgb, perceptual);
|
self.base.fill_boxes(&borders, &bc, srgb, perceptual);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -825,12 +838,8 @@ impl Renderer<'_> {
|
||||||
bw as f32 * scalef,
|
bw as f32 * scalef,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let body = Rect::new_sized_saturating(
|
let body =
|
||||||
x + bw,
|
Rect::new_sized_saturating(x + bw, y + bw, pos.width() - 2 * bw, pos.height() - 2 * bw);
|
||||||
y + bw,
|
|
||||||
pos.width() - 2 * bw,
|
|
||||||
pos.height() - 2 * bw,
|
|
||||||
);
|
|
||||||
let scissor_body = self.base.scale_rect(body);
|
let scissor_body = self.base.scale_rect(body);
|
||||||
if !cr.is_zero() {
|
if !cr.is_zero() {
|
||||||
let scalef = self.base.scalef as f32;
|
let scalef = self.base.scalef as f32;
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,16 @@ impl RendererBase<'_> {
|
||||||
corner_radius: CornerRadius,
|
corner_radius: CornerRadius,
|
||||||
border_width: f32,
|
border_width: f32,
|
||||||
) {
|
) {
|
||||||
self.fill_rounded_rect_z(rect, color, alpha, cd, render_intent, corner_radius, border_width, 0)
|
self.fill_rounded_rect_z(
|
||||||
|
rect,
|
||||||
|
color,
|
||||||
|
alpha,
|
||||||
|
cd,
|
||||||
|
render_intent,
|
||||||
|
corner_radius,
|
||||||
|
border_width,
|
||||||
|
0,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fill_rounded_rect_z(
|
pub fn fill_rounded_rect_z(
|
||||||
|
|
@ -283,27 +292,26 @@ impl RendererBase<'_> {
|
||||||
let scale = self.scalef as f32;
|
let scale = self.scalef as f32;
|
||||||
let fitted = corner_radius.fit_to(width, height);
|
let fitted = corner_radius.fit_to(width, height);
|
||||||
let cr: [f32; 4] = fitted.into();
|
let cr: [f32; 4] = fitted.into();
|
||||||
self.ops
|
self.ops.push(GfxApiOpt::RoundedFillRect(RoundedFillRect {
|
||||||
.push(GfxApiOpt::RoundedFillRect(RoundedFillRect {
|
rect: FramebufferRect::new(
|
||||||
rect: FramebufferRect::new(
|
rect.x1() as f32,
|
||||||
rect.x1() as f32,
|
rect.y1() as f32,
|
||||||
rect.y1() as f32,
|
rect.x2() as f32,
|
||||||
rect.x2() as f32,
|
rect.y2() as f32,
|
||||||
rect.y2() as f32,
|
self.transform,
|
||||||
self.transform,
|
self.fb_width,
|
||||||
self.fb_width,
|
self.fb_height,
|
||||||
self.fb_height,
|
),
|
||||||
),
|
color: *color,
|
||||||
color: *color,
|
alpha,
|
||||||
alpha,
|
render_intent,
|
||||||
render_intent,
|
cd: cd.clone(),
|
||||||
cd: cd.clone(),
|
size: [width, height],
|
||||||
size: [width, height],
|
corner_radius: cr,
|
||||||
corner_radius: cr,
|
border_width,
|
||||||
border_width,
|
scale,
|
||||||
scale,
|
z_order,
|
||||||
z_order,
|
}));
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_rounded_texture(
|
pub fn render_rounded_texture(
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ use {
|
||||||
cursor_user::CursorUser,
|
cursor_user::CursorUser,
|
||||||
fixed::Fixed,
|
fixed::Fixed,
|
||||||
ifs::wl_seat::{
|
ifs::wl_seat::{
|
||||||
BTN_LEFT, NodeSeatState, SeatId, WlSeatGlobal, collect_kb_foci,
|
BTN_LEFT, NodeSeatState, SeatId, WlSeatGlobal, collect_kb_foci, collect_kb_foci2,
|
||||||
collect_kb_foci2,
|
|
||||||
tablet::{TabletTool, TabletToolChanges, TabletToolId},
|
tablet::{TabletTool, TabletToolChanges, TabletToolId},
|
||||||
wl_pointer::PendingScroll,
|
wl_pointer::PendingScroll,
|
||||||
},
|
},
|
||||||
|
|
@ -19,7 +18,9 @@ use {
|
||||||
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
||||||
NodeId, NodeLayerLink, NodeLocation, OutputNode, TddType, TileDragDestination,
|
NodeId, NodeLayerLink, NodeLocation, OutputNode, TddType, TileDragDestination,
|
||||||
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode,
|
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode,
|
||||||
default_tile_drag_bounds, tab_bar::{TabBar, TabBarEntry}, toplevel_set_workspace,
|
default_tile_drag_bounds,
|
||||||
|
tab_bar::{TabBar, TabBarEntry},
|
||||||
|
toplevel_set_workspace,
|
||||||
walker::NodeVisitor,
|
walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
|
|
@ -399,11 +400,7 @@ impl ContainerNode {
|
||||||
}
|
}
|
||||||
ContainerSplit::Vertical => {
|
ContainerSplit::Vertical => {
|
||||||
let spacing = gap.max(bw);
|
let spacing = gap.max(bw);
|
||||||
let content_h = self
|
let content_h = self.height.get().sub((nc - 1) * spacing).max(0);
|
||||||
.height
|
|
||||||
.get()
|
|
||||||
.sub((nc - 1) * spacing)
|
|
||||||
.max(0);
|
|
||||||
(self.width.get(), content_h / nc)
|
(self.width.get(), content_h / nc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -478,7 +475,6 @@ impl ContainerNode {
|
||||||
self.schedule_compute_render_positions();
|
self.schedule_compute_render_positions();
|
||||||
self.layout_complete.trigger();
|
self.layout_complete.trigger();
|
||||||
if self.all_children_match_body() {
|
if self.all_children_match_body() {
|
||||||
|
|
||||||
self.all_children_resized.trigger();
|
self.all_children_resized.trigger();
|
||||||
if self.toplevel_data.visible.get() {
|
if self.toplevel_data.visible.get() {
|
||||||
self.damage();
|
self.damage();
|
||||||
|
|
@ -574,11 +570,7 @@ impl ContainerNode {
|
||||||
}
|
}
|
||||||
ContainerSplit::Vertical => {
|
ContainerSplit::Vertical => {
|
||||||
let spacing = gap.max(border_width);
|
let spacing = gap.max(border_width);
|
||||||
let new_content_size = self
|
let new_content_size = self.height.get().sub((nc - 1) as i32 * spacing).max(0);
|
||||||
.height
|
|
||||||
.get()
|
|
||||||
.sub((nc - 1) as i32 * spacing)
|
|
||||||
.max(0);
|
|
||||||
self.content_height.set(new_content_size);
|
self.content_height.set(new_content_size);
|
||||||
self.content_width.set(self.width.get());
|
self.content_width.set(self.width.get());
|
||||||
}
|
}
|
||||||
|
|
@ -741,7 +733,8 @@ impl ContainerNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if self.toplevel_data.visible.get() {
|
if self.toplevel_data.visible.get() {
|
||||||
self.state.damage(Rect::new_sized_saturating(abs_x, abs_y, cwidth, cheight));
|
self.state
|
||||||
|
.damage(Rect::new_sized_saturating(abs_x, abs_y, cwidth, cheight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -936,7 +929,15 @@ impl ContainerNode {
|
||||||
let mono_ref = mono.as_ref().unwrap();
|
let mono_ref = mono.as_ref().unwrap();
|
||||||
let active_id = mono_ref.node.node_id();
|
let active_id = mono_ref.node.node_id();
|
||||||
let height = self.state.theme.sizes.tab_bar_height.get();
|
let height = self.state.theme.sizes.tab_bar_height.get();
|
||||||
let render_scale = self.workspace.get().output.get().global.persistent.scale.get();
|
let render_scale = self
|
||||||
|
.workspace
|
||||||
|
.get()
|
||||||
|
.output
|
||||||
|
.get()
|
||||||
|
.global
|
||||||
|
.persistent
|
||||||
|
.scale
|
||||||
|
.get();
|
||||||
let mut bar = TabBar::new(height, render_scale);
|
let mut bar = TabBar::new(height, render_scale);
|
||||||
for child in self.children.iter() {
|
for child in self.children.iter() {
|
||||||
let child_id = child.node.node_id();
|
let child_id = child.node.node_id();
|
||||||
|
|
@ -982,12 +983,7 @@ impl ContainerNode {
|
||||||
let was_ephemeral = self.ephemeral.replace(Ephemeral::Off);
|
let was_ephemeral = self.ephemeral.replace(Ephemeral::Off);
|
||||||
self.clone().cnode_remove_child2(&*focused_node, true);
|
self.clone().cnode_remove_child2(&*focused_node, true);
|
||||||
self.ephemeral.set(was_ephemeral);
|
self.ephemeral.set(was_ephemeral);
|
||||||
let sub = ContainerNode::new(
|
let sub = ContainerNode::new(&self.state, &self.workspace.get(), focused_node, split);
|
||||||
&self.state,
|
|
||||||
&self.workspace.get(),
|
|
||||||
focused_node,
|
|
||||||
split,
|
|
||||||
);
|
|
||||||
if ephemeral {
|
if ephemeral {
|
||||||
sub.ephemeral.set(Ephemeral::On);
|
sub.ephemeral.set(Ephemeral::On);
|
||||||
}
|
}
|
||||||
|
|
@ -1451,8 +1447,7 @@ impl ContainerNode {
|
||||||
};
|
};
|
||||||
break 'res (
|
break 'res (
|
||||||
SeatOpKind::Resize {
|
SeatOpKind::Resize {
|
||||||
dist_left: seat_data.x
|
dist_left: seat_data.x - prev.body.get().x2(),
|
||||||
- prev.body.get().x2(),
|
|
||||||
dist_right: child.body.get().x1() - seat_data.x,
|
dist_right: child.body.get().x1() - seat_data.x,
|
||||||
},
|
},
|
||||||
child,
|
child,
|
||||||
|
|
@ -1465,8 +1460,7 @@ impl ContainerNode {
|
||||||
};
|
};
|
||||||
break 'res (
|
break 'res (
|
||||||
SeatOpKind::Resize {
|
SeatOpKind::Resize {
|
||||||
dist_left: seat_data.y
|
dist_left: seat_data.y - prev.body.get().y2(),
|
||||||
- prev.body.get().y2(),
|
|
||||||
dist_right: child.body.get().y1() - seat_data.y,
|
dist_right: child.body.get().y1() - seat_data.y,
|
||||||
},
|
},
|
||||||
child,
|
child,
|
||||||
|
|
@ -1477,10 +1471,7 @@ impl ContainerNode {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
seat_data.op = Some(SeatOp {
|
seat_data.op = Some(SeatOp { child, kind })
|
||||||
child,
|
|
||||||
kind,
|
|
||||||
})
|
|
||||||
} else if !pressed {
|
} else if !pressed {
|
||||||
seat_data.op = None;
|
seat_data.op = None;
|
||||||
drop(seat_datas);
|
drop(seat_datas);
|
||||||
|
|
@ -1694,16 +1685,27 @@ pub async fn container_tab_render_textures(state: Rc<State>) {
|
||||||
impl ContainerNode {
|
impl ContainerNode {
|
||||||
fn update_tab_textures_phase1(
|
fn update_tab_textures_phase1(
|
||||||
self: &Rc<Self>,
|
self: &Rc<Self>,
|
||||||
) -> (Rc<crate::utils::asyncevent::AsyncEvent>, Vec<Rc<RefCell<Option<TextTexture>>>>) {
|
) -> (
|
||||||
|
Rc<crate::utils::asyncevent::AsyncEvent>,
|
||||||
|
Vec<Rc<RefCell<Option<TextTexture>>>>,
|
||||||
|
) {
|
||||||
let on_completed = Rc::new(OnDropEvent::default());
|
let on_completed = Rc::new(OnDropEvent::default());
|
||||||
let (entries, bar_height, render_scale) = {
|
let (entries, bar_height, render_scale) = {
|
||||||
let tab_bar = self.tab_bar.borrow();
|
let tab_bar = self.tab_bar.borrow();
|
||||||
let Some(tb) = tab_bar.as_ref() else {
|
let Some(tb) = tab_bar.as_ref() else {
|
||||||
return (on_completed.event(), vec![]);
|
return (on_completed.event(), vec![]);
|
||||||
};
|
};
|
||||||
let entries: Vec<_> = tb.entries.iter().map(|e| {
|
let entries: Vec<_> = tb
|
||||||
(e.title.clone(), TabBar::entry_colors(&self.state, e), e.title_texture.clone())
|
.entries
|
||||||
}).collect();
|
.iter()
|
||||||
|
.map(|e| {
|
||||||
|
(
|
||||||
|
e.title.clone(),
|
||||||
|
TabBar::entry_colors(&self.state, e),
|
||||||
|
e.title_texture.clone(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
(entries, tb.height, tb.render_scale)
|
(entries, tb.height, tb.render_scale)
|
||||||
};
|
};
|
||||||
let Some(ctx) = self.state.render_ctx.get() else {
|
let Some(ctx) = self.state.render_ctx.get() else {
|
||||||
|
|
@ -1864,7 +1866,6 @@ impl Node for ContainerNode {
|
||||||
self.update_child_size(node, width, height);
|
self.update_child_size(node, width, height);
|
||||||
}
|
}
|
||||||
if self.all_children_match_body() {
|
if self.all_children_match_body() {
|
||||||
|
|
||||||
self.all_children_resized.trigger();
|
self.all_children_resized.trigger();
|
||||||
if self.toplevel_data.visible.get() {
|
if self.toplevel_data.visible.get() {
|
||||||
self.damage();
|
self.damage();
|
||||||
|
|
@ -2280,12 +2281,8 @@ impl ContainingNode for ContainerNode {
|
||||||
ci = 1;
|
ci = 1;
|
||||||
}
|
}
|
||||||
let (new_delta, between) = match split {
|
let (new_delta, between) = match split {
|
||||||
ContainerSplit::Horizontal => {
|
ContainerSplit::Horizontal => (self.abs_x1.get(), gap.max(bw)),
|
||||||
(self.abs_x1.get(), gap.max(bw))
|
ContainerSplit::Vertical => (self.abs_y1.get(), gap.max(bw)),
|
||||||
}
|
|
||||||
ContainerSplit::Vertical => {
|
|
||||||
(self.abs_y1.get(), gap.max(bw))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
let new_i1 = new_i1.map(|v| v - new_delta);
|
let new_i1 = new_i1.map(|v| v - new_delta);
|
||||||
let new_i2 = new_i2.map(|v| v - new_delta);
|
let new_i2 = new_i2.map(|v| v - new_delta);
|
||||||
|
|
|
||||||
|
|
@ -515,12 +515,7 @@ impl FloatNode {
|
||||||
let theme = &self.state.theme.sizes;
|
let theme = &self.state.theme.sizes;
|
||||||
let bw = theme.border_width.get();
|
let bw = theme.border_width.get();
|
||||||
let pos = self.position.get();
|
let pos = self.position.get();
|
||||||
let body = Rect::new(
|
let body = Rect::new(pos.x1() + bw, pos.y1() + bw, pos.x2() - bw, pos.y2() - bw)?;
|
||||||
pos.x1() + bw,
|
|
||||||
pos.y1() + bw,
|
|
||||||
pos.x2() - bw,
|
|
||||||
pos.y2() - bw,
|
|
||||||
)?;
|
|
||||||
child.tl_tile_drag_destination(source, None, body, abs_x, abs_y)
|
child.tl_tile_drag_destination(source, None, body, abs_x, abs_y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{scale::Scale, state::State, text::TextTexture, theme::Color, tree::NodeId},
|
||||||
scale::Scale,
|
std::{
|
||||||
state::State,
|
cell::{Cell, RefCell},
|
||||||
text::TextTexture,
|
rc::Rc,
|
||||||
theme::Color,
|
|
||||||
tree::NodeId,
|
|
||||||
},
|
},
|
||||||
std::{cell::{Cell, RefCell}, rc::Rc},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A single entry (tab) within a tab bar.
|
/// A single entry (tab) within a tab bar.
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ impl DmaBuf {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DMA_BUF_BASE: u64 = b'b' as _;
|
const DMA_BUF_BASE: u64 = b'b' as _;
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,6 @@ impl UsrJayCompositor {
|
||||||
self.con.add_object(obj.clone());
|
self.con.add_object(obj.clone());
|
||||||
obj
|
obj
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JayCompositorEventHandler for UsrJayCompositor {
|
impl JayCompositorEventHandler for UsrJayCompositor {
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,7 @@ use {
|
||||||
object::Version,
|
object::Version,
|
||||||
utils::clonecell::CloneCell,
|
utils::clonecell::CloneCell,
|
||||||
wire::{WlDataDeviceId, wl_data_device::*},
|
wire::{WlDataDeviceId, wl_data_device::*},
|
||||||
wl_usr::{
|
wl_usr::{UsrCon, usr_ifs::usr_wl_data_offer::UsrWlDataOffer, usr_object::UsrObject},
|
||||||
UsrCon,
|
|
||||||
usr_ifs::usr_wl_data_offer::UsrWlDataOffer,
|
|
||||||
usr_object::UsrObject,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
std::{convert::Infallible, rc::Rc},
|
std::{convert::Infallible, rc::Rc},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,7 @@ use {
|
||||||
object::Version,
|
object::Version,
|
||||||
utils::clonecell::CloneCell,
|
utils::clonecell::CloneCell,
|
||||||
wire::{WlSeatId, wl_seat::*},
|
wire::{WlSeatId, wl_seat::*},
|
||||||
wl_usr::{
|
wl_usr::{UsrCon, usr_ifs::usr_wl_pointer::UsrWlPointer, usr_object::UsrObject},
|
||||||
UsrCon,
|
|
||||||
usr_ifs::usr_wl_pointer::UsrWlPointer,
|
|
||||||
usr_object::UsrObject,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
std::{cell::Cell, convert::Infallible, rc::Rc},
|
std::{cell::Cell, convert::Infallible, rc::Rc},
|
||||||
};
|
};
|
||||||
|
|
@ -46,7 +42,6 @@ impl UsrWlSeat {
|
||||||
});
|
});
|
||||||
ptr
|
ptr
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WlSeatEventHandler for UsrWlSeat {
|
impl WlSeatEventHandler for UsrWlSeat {
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ use {
|
||||||
},
|
},
|
||||||
jay_config::client::{
|
jay_config::client::{
|
||||||
CC_DATA_CONTROL, CC_DRM_LEASE, CC_FOREIGN_TOPLEVEL_GEOMETRY_TRACKING,
|
CC_DATA_CONTROL, CC_DRM_LEASE, CC_FOREIGN_TOPLEVEL_GEOMETRY_TRACKING,
|
||||||
CC_FOREIGN_TOPLEVEL_LIST, CC_FOREIGN_TOPLEVEL_MANAGER,
|
CC_FOREIGN_TOPLEVEL_LIST, CC_FOREIGN_TOPLEVEL_MANAGER, CC_GAMMA_CONTROL_MANAGER,
|
||||||
CC_GAMMA_CONTROL_MANAGER, CC_HEAD_MANAGER, CC_IDLE_NOTIFIER, CC_INPUT_METHOD,
|
CC_HEAD_MANAGER, CC_IDLE_NOTIFIER, CC_INPUT_METHOD, CC_LAYER_SHELL, CC_SCREENCOPY,
|
||||||
CC_LAYER_SHELL, CC_SCREENCOPY, CC_SEAT_MANAGER, CC_SESSION_LOCK, CC_VIRTUAL_KEYBOARD,
|
CC_SEAT_MANAGER, CC_SESSION_LOCK, CC_VIRTUAL_KEYBOARD, CC_VIRTUAL_POINTER,
|
||||||
CC_VIRTUAL_POINTER, CC_WORKSPACE_MANAGER, ClientCapabilities,
|
CC_WORKSPACE_MANAGER, ClientCapabilities,
|
||||||
},
|
},
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,13 @@ impl Parser for ThemeParser<'_> {
|
||||||
tab_bar_height,
|
tab_bar_height,
|
||||||
tab_bar_padding,
|
tab_bar_padding,
|
||||||
),
|
),
|
||||||
(tab_bar_radius, tab_bar_border_width, tab_bar_text_padding, tab_bar_gap, tab_title_align_val),
|
(
|
||||||
|
tab_bar_radius,
|
||||||
|
tab_bar_border_width,
|
||||||
|
tab_bar_text_padding,
|
||||||
|
tab_bar_gap,
|
||||||
|
tab_title_align_val,
|
||||||
|
),
|
||||||
) = ext.extract((
|
) = ext.extract((
|
||||||
(
|
(
|
||||||
opt(val("tab-active-bg-color")),
|
opt(val("tab-active-bg-color")),
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ use {
|
||||||
is_reload,
|
is_reload,
|
||||||
keyboard::Keymap,
|
keyboard::Keymap,
|
||||||
logging::{clean_logs_older_than, set_log_level},
|
logging::{clean_logs_older_than, set_log_level},
|
||||||
on_devices_enumerated, on_idle, on_unload, quit, reload,
|
on_devices_enumerated, on_idle, on_unload, quit, reload, set_autotile,
|
||||||
set_color_management_enabled, set_default_workspace_capture, set_explicit_sync_enabled,
|
set_color_management_enabled, set_corner_radius, set_default_workspace_capture,
|
||||||
set_float_above_fullscreen, set_idle, set_idle_grace_period,
|
set_explicit_sync_enabled, set_float_above_fullscreen, set_floating_titles, set_idle,
|
||||||
set_floating_titles, set_middle_click_paste_enabled, set_show_bar, set_show_float_pin_icon,
|
set_idle_grace_period, set_middle_click_paste_enabled, set_show_bar,
|
||||||
set_show_titles, set_corner_radius, set_autotile, set_tab_title_align,
|
set_show_float_pin_icon, set_show_titles, set_tab_title_align, set_ui_drag_enabled,
|
||||||
set_ui_drag_enabled, set_ui_drag_threshold,
|
set_ui_drag_threshold,
|
||||||
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
|
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
|
||||||
switch_to_vt,
|
switch_to_vt,
|
||||||
tasks::{self, JoinHandle},
|
tasks::{self, JoinHandle},
|
||||||
|
|
@ -256,28 +256,18 @@ impl Action {
|
||||||
b.new(move || persistent.seat.warp_mouse_to_focus())
|
b.new(move || persistent.seat.warp_mouse_to_focus())
|
||||||
}
|
}
|
||||||
SimpleCommand::ToggleTab => b.new(move || s.toggle_tab()),
|
SimpleCommand::ToggleTab => b.new(move || s.toggle_tab()),
|
||||||
SimpleCommand::MakeGroupH => {
|
SimpleCommand::MakeGroupH => b.new(move || s.make_group(Axis::Horizontal, true)),
|
||||||
b.new(move || s.make_group(Axis::Horizontal, true))
|
SimpleCommand::MakeGroupV => b.new(move || s.make_group(Axis::Vertical, true)),
|
||||||
}
|
SimpleCommand::MakeGroupTab => b.new(move || {
|
||||||
SimpleCommand::MakeGroupV => {
|
s.make_group(Axis::Horizontal, true);
|
||||||
b.new(move || s.make_group(Axis::Vertical, true))
|
s.toggle_tab();
|
||||||
}
|
}),
|
||||||
SimpleCommand::MakeGroupTab => {
|
SimpleCommand::ChangeGroupOpposite => b.new(move || s.change_group_opposite()),
|
||||||
b.new(move || {
|
|
||||||
s.make_group(Axis::Horizontal, true);
|
|
||||||
s.toggle_tab();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
SimpleCommand::ChangeGroupOpposite => {
|
|
||||||
b.new(move || s.change_group_opposite())
|
|
||||||
}
|
|
||||||
SimpleCommand::Equalize => b.new(move || s.equalize(false)),
|
SimpleCommand::Equalize => b.new(move || s.equalize(false)),
|
||||||
SimpleCommand::EqualizeRecursive => b.new(move || s.equalize(true)),
|
SimpleCommand::EqualizeRecursive => b.new(move || s.equalize(true)),
|
||||||
SimpleCommand::MoveTabLeft => b.new(move || s.move_tab(false)),
|
SimpleCommand::MoveTabLeft => b.new(move || s.move_tab(false)),
|
||||||
SimpleCommand::MoveTabRight => b.new(move || s.move_tab(true)),
|
SimpleCommand::MoveTabRight => b.new(move || s.move_tab(true)),
|
||||||
SimpleCommand::SetAutotile(enabled) => {
|
SimpleCommand::SetAutotile(enabled) => b.new(move || set_autotile(enabled)),
|
||||||
b.new(move || set_autotile(enabled))
|
|
||||||
}
|
|
||||||
SimpleCommand::ToggleAutotile => {
|
SimpleCommand::ToggleAutotile => {
|
||||||
b.new(move || {
|
b.new(move || {
|
||||||
// Toggle not directly supported; set to true
|
// Toggle not directly supported; set to true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue