diff options
author | Benji Dial <benji6283@gmail.com> | 2021-02-16 20:38:53 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-02-16 20:38:53 -0500 |
commit | 47513bd32c256c4f35e3a8ced7d9fd7e15903530 (patch) | |
tree | cafdf75d52a954814726e07445063c41bb6599f9 /src/kernel/window.c | |
parent | bd7facc4b5f53481dc85a15ba123361b2758655b (diff) | |
download | portland-os-47513bd32c256c4f35e3a8ced7d9fd7e15903530.tar.gz |
terminal application with ipc, shift+pause state dumper, hello world for terminal, meminfo popup program
Diffstat (limited to 'src/kernel/window.c')
-rw-r--r-- | src/kernel/window.c | 25 |
1 files changed, 23 insertions, 2 deletions
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(); |