From 329280f4a0a6b2c5d88a88ee8a90ad243cc2fb6b Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Tue, 4 Jul 2023 00:18:26 +0300 Subject: [PATCH] handle framebuffer invalidation of windows with frames correctly --- src/rtk.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/rtk.c b/src/rtk.c index fe1c649..bc35881 100644 --- a/src/rtk.c +++ b/src/rtk.c @@ -941,5 +941,19 @@ void rtk_rect_union(rtk_rect *a, const rtk_rect *b) static void invalfb(rtk_widget *w) { - app_redisplay(w->any.x, w->any.y, w->any.width, w->any.height); + rtk_rect rect; + + rect.x = w->any.x; + rect.y = w->any.y; + rect.width = w->any.width; + rect.height = w->any.height; + + if(w->type == RTK_WIN && (w->any.flags & FRAME)) { + rect.x -= WINFRM_SZ; + rect.y -= WINFRM_SZ + WINFRM_TBAR; + rect.width += WINFRM_SZ * 2; + rect.height += WINFRM_SZ * 2 + WINFRM_TBAR; + } + + app_redisplay(rect.x, rect.y, rect.width, rect.height); } -- 1.7.10.4