AmendHub

Download:

jcs

/

wallops

/

amendments

/

110

chatter: Revert need_downscroll, we just weren't setting the port


jcs made amendment 110 about 1 month ago
--- chatter.c Mon Sep 16 11:56:02 2024 +++ chatter.c Mon Sep 16 16:43:39 2024 @@ -404,12 +404,6 @@ chatter_focus_tab(struct chatter *chatter, struct chat chatter->current_tab = tab; - if (tab->need_downscroll) { - chatter_autoscroll(chatter, tab->messages_te, - tab->messages_scroller, true); - tab->need_downscroll = false; - } - HLock(tab->messages_te); EraseRect(&(*(tab->messages_te))->viewRect); TEActivate(tab->messages_te); @@ -921,7 +915,8 @@ chatter_resize(struct focusable *focusable, EventRecor HLock(ttab->messages_te); TEUpdate(&(*(ttab->messages_te))->viewRect, ttab->messages_te); HUnlock(ttab->messages_te); - ttab->need_downscroll = true; + chatter_autoscroll(chatter, ttab->messages_te, + ttab->messages_scroller, true); } /* resume normal drawing */ @@ -1243,6 +1238,9 @@ te_overflow: DisposeRgn(savergn); no_overflow: + GetPort(&old_port); + SetPort(chatter->win); + if (chatter->current_tab != tab) { savergn = NewRgn(); GetClip(savergn); @@ -1255,11 +1253,8 @@ no_overflow: HUnlock(scrp_rec_h); HUnlock(tab->messages_te); - if (chatter->current_tab == tab && chatter->win == FrontWindow()) - chatter_autoscroll(chatter, tab->messages_te, - tab->messages_scroller, false); - else - tab->need_downscroll = true; + chatter_autoscroll(chatter, tab->messages_te, tab->messages_scroller, + false); if (chatter->current_tab == tab) { tab->have_activity = false; @@ -1270,16 +1265,10 @@ no_overflow: if (!had_activity) { tab->have_activity = true; - if (chatter->win == FrontWindow()) { - chatter_draw_tab_bar(chatter); - } else { - GetPort(&old_port); - SetPort(chatter->win); - InvalRect(&chatter->win->portRect); - SetPort(old_port); - } + chatter_draw_tab_bar(chatter); } } + SetPort(old_port); return buf_out_len; } --- chatter.h Mon Sep 16 11:20:22 2024 +++ chatter.h Mon Sep 16 16:37:58 2024 @@ -80,7 +80,6 @@ struct chatter_tab { ListHandle nick_list; Rect label_rect; bool have_activity; - bool need_downscroll; }; SLIST_HEAD(chatter_tabs_head, chatter_tab); --- main.c Fri Sep 13 20:39:49 2024 +++ main.c Mon Sep 16 16:41:28 2024 @@ -135,7 +135,7 @@ main(void) event_in = FindWindow(event.where, &event_win); found_focusable = focusable_find(event_win); - if (event_win != FrontWindow() && found_focusable) { + if (found_focusable) { cancel_notification(); focusable_show(found_focusable); }