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