commit
03c02be34c
4 changed files with 33 additions and 4 deletions
|
|
@ -368,7 +368,8 @@ impl Renderer<'_> {
|
|||
return;
|
||||
};
|
||||
let color = self.state.theme.colors.highlight.get();
|
||||
self.base.fill_boxes(slice::from_ref(bounds), &color);
|
||||
self.base.ops.push(GfxApiOpt::Sync);
|
||||
self.base.fill_scaled_boxes(slice::from_ref(bounds), &color);
|
||||
}
|
||||
|
||||
pub fn render_surface(&mut self, surface: &WlSurface, x: i32, y: i32, bounds: Option<&Rect>) {
|
||||
|
|
|
|||
|
|
@ -66,17 +66,28 @@ impl RendererBase<'_> {
|
|||
rect
|
||||
}
|
||||
|
||||
pub fn fill_scaled_boxes(&mut self, boxes: &[Rect], color: &Color) {
|
||||
self.fill_boxes3(boxes, color, 0, 0, true);
|
||||
}
|
||||
|
||||
pub fn fill_boxes(&mut self, boxes: &[Rect], color: &Color) {
|
||||
self.fill_boxes2(boxes, color, 0, 0);
|
||||
self.fill_boxes3(boxes, color, 0, 0, false);
|
||||
}
|
||||
|
||||
pub fn fill_boxes2(&mut self, boxes: &[Rect], color: &Color, dx: i32, dy: i32) {
|
||||
self.fill_boxes3(boxes, color, dx, dy, false);
|
||||
}
|
||||
|
||||
fn fill_boxes3(&mut self, boxes: &[Rect], color: &Color, dx: i32, dy: i32, scaled: bool) {
|
||||
if boxes.is_empty() || *color == Color::TRANSPARENT {
|
||||
return;
|
||||
}
|
||||
let (dx, dy) = self.scale_point(dx, dy);
|
||||
for bx in boxes {
|
||||
let bx = self.scale_rect(*bx);
|
||||
let bx = match scaled {
|
||||
false => self.scale_rect(*bx),
|
||||
true => *bx,
|
||||
};
|
||||
self.ops.push(GfxApiOpt::FillRect(FillRect {
|
||||
rect: FramebufferRect::new(
|
||||
(bx.x1() + dx) as f32,
|
||||
|
|
|
|||
|
|
@ -621,7 +621,12 @@ impl State {
|
|||
}
|
||||
Rect::new_sized(x1, y1, width, height).unwrap()
|
||||
};
|
||||
FloatNode::new(self, workspace, position, node);
|
||||
FloatNode::new(self, workspace, position, node.clone());
|
||||
if node.node_visible() {
|
||||
if let Some(seat) = self.seat_queue.last() {
|
||||
node.node_do_focus(&seat, Direction::Unspecified);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn show_workspace(&self, seat: &Rc<WlSeatGlobal>, name: &str) {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,16 @@ impl UsrWlSurface {
|
|||
let _ev: Leave = self.con.parse(self, parser)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn preferred_buffer_scale(&self, parser: MsgParser<'_, '_>) -> Result<(), MsgParserError> {
|
||||
let _ev: PreferredBufferScale = self.con.parse(self, parser)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn preferred_buffer_transform(&self, parser: MsgParser<'_, '_>) -> Result<(), MsgParserError> {
|
||||
let _ev: PreferredBufferTransform = self.con.parse(self, parser)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
usr_object_base! {
|
||||
|
|
@ -58,6 +68,8 @@ usr_object_base! {
|
|||
|
||||
ENTER => enter,
|
||||
LEAVE => leave,
|
||||
PREFERRED_BUFFER_SCALE => preferred_buffer_scale,
|
||||
PREFERRED_BUFFER_TRANSFORM => preferred_buffer_transform,
|
||||
}
|
||||
|
||||
impl UsrObject for UsrWlSurface {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue