Merge pull request #380 from mahkoh/jorth/more-damage-fixes
Fix damage tracking of bar
This commit is contained in:
commit
33718340f7
4 changed files with 21 additions and 35 deletions
|
|
@ -85,15 +85,11 @@ impl Renderer<'_> {
|
||||||
let non_exclusive_rect = output.non_exclusive_rect_rel.get();
|
let non_exclusive_rect = output.non_exclusive_rect_rel.get();
|
||||||
let (x, y) = non_exclusive_rect.translate_inv(x, y);
|
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();
|
let c = theme.colors.bar_background.get();
|
||||||
self.base.fill_boxes2(
|
self.base
|
||||||
slice::from_ref(
|
.fill_boxes3(slice::from_ref(&bar_bg), &c, x, y, true);
|
||||||
&Rect::new_sized(0, 0, non_exclusive_rect.width(), th).unwrap(),
|
|
||||||
),
|
|
||||||
&c,
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
);
|
|
||||||
let rd = output.render_data.borrow_mut();
|
let rd = output.render_data.borrow_mut();
|
||||||
if let Some(aw) = &rd.active_workspace {
|
if let Some(aw) = &rd.active_workspace {
|
||||||
let c = match aw.captured {
|
let c = match aw.captured {
|
||||||
|
|
@ -124,7 +120,7 @@ impl Renderer<'_> {
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
scale,
|
scale,
|
||||||
None,
|
Some(&bar_bg),
|
||||||
None,
|
None,
|
||||||
AcquireSync::None,
|
AcquireSync::None,
|
||||||
ReleaseSync::None,
|
ReleaseSync::None,
|
||||||
|
|
@ -141,7 +137,7 @@ impl Renderer<'_> {
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
scale,
|
scale,
|
||||||
None,
|
Some(&bar_bg),
|
||||||
None,
|
None,
|
||||||
AcquireSync::None,
|
AcquireSync::None,
|
||||||
ReleaseSync::None,
|
ReleaseSync::None,
|
||||||
|
|
@ -219,7 +215,7 @@ impl Renderer<'_> {
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
self.base.scale,
|
self.base.scale,
|
||||||
None,
|
bounds,
|
||||||
None,
|
None,
|
||||||
AcquireSync::None,
|
AcquireSync::None,
|
||||||
ReleaseSync::None,
|
ReleaseSync::None,
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ impl RendererBase<'_> {
|
||||||
self.fill_boxes3(boxes, color, dx, dy, false);
|
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 {
|
if boxes.is_empty() || *color == Color::TRANSPARENT {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,10 @@ use {
|
||||||
},
|
},
|
||||||
output_schedule::OutputSchedule,
|
output_schedule::OutputSchedule,
|
||||||
state::{ConnectorData, OutputData, State},
|
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},
|
utils::{asyncevent::AsyncEvent, clonecell::CloneCell, hash_map_ext::HashMapExt},
|
||||||
},
|
},
|
||||||
std::{
|
std::{cell::Cell, collections::VecDeque, rc::Rc},
|
||||||
cell::{Cell, RefCell},
|
|
||||||
collections::VecDeque,
|
|
||||||
rc::Rc,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
|
pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
|
||||||
|
|
@ -166,15 +162,7 @@ impl ConnectorHandler {
|
||||||
workspace_rect: Default::default(),
|
workspace_rect: Default::default(),
|
||||||
non_exclusive_rect: Default::default(),
|
non_exclusive_rect: Default::default(),
|
||||||
non_exclusive_rect_rel: Default::default(),
|
non_exclusive_rect_rel: Default::default(),
|
||||||
render_data: RefCell::new(OutputRenderData {
|
render_data: Default::default(),
|
||||||
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,
|
|
||||||
}),
|
|
||||||
state: self.state.clone(),
|
state: self.state.clone(),
|
||||||
is_dummy: false,
|
is_dummy: false,
|
||||||
status: self.state.status.clone(),
|
status: self.state.status.clone(),
|
||||||
|
|
|
||||||
|
|
@ -594,15 +594,16 @@ impl OutputNode {
|
||||||
status.tex_x = pos;
|
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() {
|
if self.title_visible.get() {
|
||||||
let title_rect = Rect::new_sized(
|
self.state.damage(rd.full_area.union(old_full_area));
|
||||||
non_exclusive_rect.x1(),
|
|
||||||
non_exclusive_rect.y1(),
|
|
||||||
non_exclusive_rect.width(),
|
|
||||||
th,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
self.state.damage(title_rect);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1246,6 +1247,7 @@ pub struct OutputWorkspaceRenderData {
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct OutputRenderData {
|
pub struct OutputRenderData {
|
||||||
|
pub full_area: Rect,
|
||||||
pub active_workspace: Option<OutputWorkspaceRenderData>,
|
pub active_workspace: Option<OutputWorkspaceRenderData>,
|
||||||
pub underline: Rect,
|
pub underline: Rect,
|
||||||
pub inactive_workspaces: Vec<Rect>,
|
pub inactive_workspaces: Vec<Rect>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue