jcs
/wallops
/amendments
/78
chatter: Fix issue with lists not scrolling after switching tabs
jcs made amendment 78 2 months ago
--- chatter.c Tue Sep 10 09:32:08 2024
+++ chatter.c Tue Sep 10 19:31:34 2024
@@ -369,8 +369,10 @@ chatter_focus_tab(struct chatter *chatter, struct chat
EraseRect(&r);
TEDeactivate(chatter->current_tab->messages_te);
- if (chatter->current_tab->nick_list)
+ if (chatter->current_tab->nick_list) {
+ LActivate(false, chatter->current_tab->nick_list);
LDoDraw(false, chatter->current_tab->nick_list);
+ }
/* HideControl will flash, clip it out */
r.right = 0;
@@ -393,11 +395,13 @@ chatter_focus_tab(struct chatter *chatter, struct chat
HLock(tab->nick_list);
EraseRect(&(*(tab->nick_list))->rView);
LDoDraw(true, tab->nick_list);
+ LActivate(true, tab->nick_list);
LUpdate(chatter->win->visRgn, tab->nick_list);
HUnlock(tab->nick_list);
}
HLock(chatter->input_te);
+ EraseRect(&(*(chatter->input_te))->viewRect);
TEUpdate(&(*(chatter->input_te))->viewRect, chatter->input_te);
HUnlock(chatter->input_te);
@@ -774,17 +778,18 @@ chatter_mouse_down(struct focusable *focusable, EventR
GlobalToLocal(&p);
if (tab->nick_list) {
+ HLock(tab->nick_list);
r = (*(tab->nick_list))->rView;
+ HUnlock(tab->nick_list);
r.right += SCROLLBAR_WIDTH;
if (PtInRect(p, &r)) {
/* store what is selected now */
LGetSelect(true, &selected, tab->nick_list);
- /* possibly highlight a new cell */
+ /* possibly highlight a new cell or scroll */
dclick = LClick(p, event->modifiers, tab->nick_list);
LGetSelect(true, &now, tab->nick_list);
-
if (selected.v != now.v)
LSetSelect(false, selected, tab->nick_list);