1
0
Fork 0
forked from wry/wry

Merge pull request #380 from mahkoh/jorth/more-damage-fixes

Fix damage tracking of bar
This commit is contained in:
mahkoh 2025-02-24 11:31:15 +01:00 committed by GitHub
commit 33718340f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 35 deletions

View file

@ -85,15 +85,11 @@ impl Renderer<'_> {
let non_exclusive_rect = output.non_exclusive_rect_rel.get();
let (x, y) = non_exclusive_rect.translate_inv(x, y);
{
let bar_bg = Rect::new_sized(0, 0, non_exclusive_rect.width(), th).unwrap();
let bar_bg = self.base.scale_rect(bar_bg);
let c = theme.colors.bar_background.get();
self.base.fill_boxes2(
slice::from_ref(
&Rect::new_sized(0, 0, non_exclusive_rect.width(), th).unwrap(),
),
&c,
x,
y,
);
self.base
.fill_boxes3(slice::from_ref(&bar_bg), &c, x, y, true);
let rd = output.render_data.borrow_mut();
if let Some(aw) = &rd.active_workspace {
let c = match aw.captured {
@ -124,7 +120,7 @@ impl Renderer<'_> {
None,
None,
scale,
None,
Some(&bar_bg),
None,
AcquireSync::None,
ReleaseSync::None,
@ -141,7 +137,7 @@ impl Renderer<'_> {
None,
None,
scale,
None,
Some(&bar_bg),
None,
AcquireSync::None,
ReleaseSync::None,
@ -219,7 +215,7 @@ impl Renderer<'_> {
None,
None,
self.base.scale,
None,
bounds,
None,
AcquireSync::None,
ReleaseSync::None,

View file

@ -76,7 +76,7 @@ impl RendererBase<'_> {
self.fill_boxes3(boxes, color, dx, dy, false);
}
fn fill_boxes3(&mut self, boxes: &[Rect], color: &Color, dx: i32, dy: i32, scaled: bool) {
pub fn fill_boxes3(&mut self, boxes: &[Rect], color: &Color, dx: i32, dy: i32, scaled: bool) {
if boxes.is_empty() || *color == Color::TRANSPARENT {
return;
}

View file

@ -8,14 +8,10 @@ use {
},
output_schedule::OutputSchedule,
state::{ConnectorData, OutputData, State},
tree::{OutputNode, OutputRenderData, WsMoveConfig, move_ws_to_output},
tree::{OutputNode, WsMoveConfig, move_ws_to_output},
utils::{asyncevent::AsyncEvent, clonecell::CloneCell, hash_map_ext::HashMapExt},
},
std::{
cell::{Cell, RefCell},
collections::VecDeque,
rc::Rc,
},
std::{cell::Cell, collections::VecDeque, rc::Rc},
};
pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
@ -166,15 +162,7 @@ impl ConnectorHandler {
workspace_rect: Default::default(),
non_exclusive_rect: Default::default(),
non_exclusive_rect_rel: Default::default(),
render_data: RefCell::new(OutputRenderData {
active_workspace: None,
underline: Default::default(),
inactive_workspaces: Default::default(),
attention_requested_workspaces: Default::default(),
captured_inactive_workspaces: Default::default(),
titles: Default::default(),
status: None,
}),
render_data: Default::default(),
state: self.state.clone(),
is_dummy: false,
status: self.state.status.clone(),

View file

@ -594,15 +594,16 @@ impl OutputNode {
status.tex_x = pos;
}
}
let old_full_area = rd.full_area;
rd.full_area = Rect::new_sized(
non_exclusive_rect.x1(),
non_exclusive_rect.y1(),
non_exclusive_rect.width(),
th + 1,
)
.unwrap();
if self.title_visible.get() {
let title_rect = Rect::new_sized(
non_exclusive_rect.x1(),
non_exclusive_rect.y1(),
non_exclusive_rect.width(),
th,
)
.unwrap();
self.state.damage(title_rect);
self.state.damage(rd.full_area.union(old_full_area));
}
}
@ -1246,6 +1247,7 @@ pub struct OutputWorkspaceRenderData {
#[derive(Default)]
pub struct OutputRenderData {
pub full_area: Rect,
pub active_workspace: Option<OutputWorkspaceRenderData>,
pub underline: Rect,
pub inactive_workspaces: Vec<Rect>,