diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
commit | 5fcf57739e68a8b5053e03778aaee0eed445babd (patch) | |
tree | e7a8bab18668d112e58b1b48190195035c71fa8a /src/kernel/window.c | |
parent | 0f2398d1f622cce37925f52d978d92e6cce1c7a9 (diff) | |
download | portland-os-5fcf57739e68a8b5053e03778aaee0eed445babd.tar.gz |
settings editor, and lots of changes in service of that
Diffstat (limited to 'src/kernel/window.c')
-rw-r--r-- | src/kernel/window.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel/window.c b/src/kernel/window.c index 4b01bc4..69babe4 100644 --- a/src/kernel/window.c +++ b/src/kernel/window.c @@ -330,9 +330,15 @@ got_window: } static void del_no_paint(struct window *w) { + if ((w < windows) || (w >= windows + MAX_WINDOWS) || (((void *)w - (void *)windows) % sizeof(struct window))) { + logf(LOG_WARN, "Refusing to delete bad window pointer 0x%h", w); + return; + } + if (w == top_window) { top_window = w->below; - send_action(top_window, (struct window_action){.action_type = FOCUS_ENTER}); + if (top_window) + send_action(top_window, (struct window_action){.action_type = FOCUS_ENTER}); } if (w == bottom_window) bottom_window = w->above; |