mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
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:
parent
cf06035dcd
commit
d1af22f861
2 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue