From 47513bd32c256c4f35e3a8ced7d9fd7e15903530 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 16 Feb 2021 20:38:53 -0500 Subject: terminal application with ipc, shift+pause state dumper, hello world for terminal, meminfo popup program --- src/kernel/window.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/kernel/window.c') diff --git a/src/kernel/window.c b/src/kernel/window.c index 28798d1..078a194 100644 --- a/src/kernel/window.c +++ b/src/kernel/window.c @@ -99,7 +99,8 @@ got_window: return w; } -void del_window(struct window *w) { +static void del_no_paint(struct window *w) { +//logf(LOG_INFO, "-- deleting window 0x%h", w); if (w == top_window) top_window = w->below; if (w == bottom_window) @@ -109,17 +110,37 @@ void del_window(struct window *w) { if (w->above) w->above->below = w->below; +//logf(LOG_INFO, " -- action buffer was 0x%h", w->action_buffer); free_pages(w->action_buffer, ACTION_BUFFER_PAGES); w->pixel_buffer_pma = 0; +} +void del_window(struct window *w) { + del_no_paint(w); paint_all(); } -void resize_window(struct window *w, uint16_t width, uint16_t height) { +void delete_any_windows_from(struct task_state *tstate) { +//logf(LOG_INFO, "-- deleting windows from 0x%h", tstate); + bool need_to_paint = false; + for (struct window *w = windows; w < windows + MAX_WINDOWS; ++w) + if (w->pixel_buffer_pma && (w->from_task == tstate)) { + //logf(LOG_INFO, " -- found match at 0x%h", w); + del_no_paint(w); + need_to_paint = true; + } + if (need_to_paint) { + //logf(LOG_INFO, "-- trying to paint after deleting windows"); + paint_all(); + } +} + +void resize_window(struct window *w, uint16_t width, uint16_t height, const void *pixel_buffer) { const bool smaller = (width < w->width) || (height < w->height); w->width = width; w->height = height; + reassign_pixel_buffer(w, pixel_buffer); if (smaller) paint_all(); -- cgit v1.2.3