fix trust level of framebuffer canvas

this is some bit-rot that happened to the `ball` demo because
it's currently the only application that uses the framebuffer
canvas.

the trust level of the framebuffer canvas has to be lower than
that of the modals, otherwise a modals box is not allowed to
draw on top of the framebuffer.

in this case, a patch that was applied when trust levels were
refactored was missed on the framebuffer canvas, which caused
the trust level of the canvas to be higher than that of a modals.

Thus, when a modal attempts to pop up over the ball demo,
one just sees the defacement lines but no actal content.
This commit is contained in:
bunnie 2023-05-21 18:13:20 +08:00
parent cf06035dcd
commit d1af22f861
2 changed files with 5 additions and 1 deletions

View file

@ -53,6 +53,8 @@ impl ChatLayout {
let input_cr = input_canvas.clip_rect();
canvases.insert(input_canvas.gid(), input_canvas);
// trust level must be lower than "modals" otherwise a modal can't draw over the content
// dividing by 2 does the trick
let content_canvas = Canvas::new(
Rectangle::new_v_span(*status_cliprect, input_cr),
(MISC_CONTEXT_DEFAULT_TRUST - TRUST_OFFSET) / 2, &trng, None, crate::api::CanvasType::ChatContent

View file

@ -20,9 +20,11 @@ impl Framebuffer {
) -> Result<Framebuffer, xous::Error> {
let screensize = gfx.screen_size().expect("Couldn't get screen size");
// trust level must be lower than "modals" otherwise a modal can't draw over the content
// dividing by 2 does the trick
let fb_canvas = Canvas::new(
Rectangle::new(Point::new(0, status_cliprect.br().y + 1), screensize),
MISC_CONTEXT_DEFAULT_TRUST - TRUST_OFFSET, &trng, None, crate::api::CanvasType::Framebuffer
(MISC_CONTEXT_DEFAULT_TRUST - TRUST_OFFSET) / 2, &trng, None, crate::api::CanvasType::Framebuffer
).expect("couldn't create modal canvas");
let fb_gid = fb_canvas.gid();
canvases.insert(fb_canvas.gid(), fb_canvas);