summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.c12
-rw-r--r--src/ui/root.c2
-rw-r--r--src/ui/root.h1
-rw-r--r--src/ui/widget.c5
4 files changed, 17 insertions, 3 deletions
diff --git a/src/app.c b/src/app.c
index 52072d39..5a76ba45 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1484,7 +1484,9 @@ static void runTickers_App_(iApp *d) {
1484 } 1484 }
1485 iForIndices(i, d->window->base.roots) { 1485 iForIndices(i, d->window->base.roots) {
1486 iRoot *root = d->window->base.roots[i]; 1486 iRoot *root = d->window->base.roots[i];
1487 notifyVisualOffsetChange_Root(root); 1487 if (root) {
1488 notifyVisualOffsetChange_Root(root);
1489 }
1488 } 1490 }
1489} 1491}
1490 1492
@@ -1558,6 +1560,14 @@ void refresh_App(void) {
1558 iConstForEach(PtrArray, j, &windows) { 1560 iConstForEach(PtrArray, j, &windows) {
1559 iWindow *win = j.ptr; 1561 iWindow *win = j.ptr;
1560 setCurrent_Window(win); 1562 setCurrent_Window(win);
1563 iForIndices(i, win->roots) {
1564 iRoot *root = win->roots[i];
1565 if (root && root->didOverflowScroll) {
1566 /* Some widgets may need a just-in-time visual update. */
1567 notifyVisualOffsetChange_Root(root);
1568 root->didOverflowScroll = iFalse;
1569 }
1570 }
1561 switch (win->type) { 1571 switch (win->type) {
1562 case main_WindowType: 1572 case main_WindowType:
1563 // iTime draw; 1573 // iTime draw;
diff --git a/src/ui/root.c b/src/ui/root.c
index e2706898..28aa4b92 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -661,7 +661,7 @@ void updateToolbarColors_Root(iRoot *d) {
661} 661}
662 662
663void notifyVisualOffsetChange_Root(iRoot *d) { 663void notifyVisualOffsetChange_Root(iRoot *d) {
664 if (d && d->didAnimateVisualOffsets) { 664 if (d && (d->didAnimateVisualOffsets || d->didOverflowScroll)) {
665 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged); 665 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged);
666 } 666 }
667} 667}
diff --git a/src/ui/root.h b/src/ui/root.h
index 2419b599..2f0d72c9 100644
--- a/src/ui/root.h
+++ b/src/ui/root.h
@@ -19,6 +19,7 @@ struct Impl_Root {
19 iBool pendingArrange; 19 iBool pendingArrange;
20 int loadAnimTimer; 20 int loadAnimTimer;
21 iBool didAnimateVisualOffsets; 21 iBool didAnimateVisualOffsets;
22 iBool didOverflowScroll;
22 iAudience *visualOffsetsChanged; /* called after running tickers */ 23 iAudience *visualOffsetsChanged; /* called after running tickers */
23 iColor tmPalette[tmMax_ColorId]; /* theme-specific palette */ 24 iColor tmPalette[tmMax_ColorId]; /* theme-specific palette */
24}; 25};
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 225c0480..bb3a39f1 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -1203,6 +1203,9 @@ iBool scrollOverflow_Widget(iWidget *d, int delta) {
1203 bounds.pos.y = iMin(bounds.pos.y, validPosRange.end); 1203 bounds.pos.y = iMin(bounds.pos.y, validPosRange.end);
1204 } 1204 }
1205// printf("range: %d ... %d\n", range.start, range.end); 1205// printf("range: %d ... %d\n", range.start, range.end);
1206 if (delta) {
1207 d->root->didOverflowScroll = iTrue; /* ensure that widgets update if needed */
1208 }
1206 } 1209 }
1207 else { 1210 else {
1208 bounds.pos.y = iClamp(bounds.pos.y, validPosRange.start, validPosRange.end); 1211 bounds.pos.y = iClamp(bounds.pos.y, validPosRange.start, validPosRange.end);
@@ -1871,7 +1874,7 @@ iAny *findParentClass_Widget(const iWidget *d, const iAnyClass *class) {
1871} 1874}
1872 1875
1873iAny *findOverflowScrollable_Widget(iWidget *d) { 1876iAny *findOverflowScrollable_Widget(iWidget *d) {
1874 const iRect rootRect = rect_Root(d->root); 1877 const iRect rootRect = visibleRect_Root(d->root);
1875 for (iWidget *w = d; w; w = parent_Widget(w)) { 1878 for (iWidget *w = d; w; w = parent_Widget(w)) {
1876 if (flags_Widget(w) & overflowScrollable_WidgetFlag) { 1879 if (flags_Widget(w) & overflowScrollable_WidgetFlag) {
1877 const iRect bounds = boundsWithoutVisualOffset_Widget(w); 1880 const iRect bounds = boundsWithoutVisualOffset_Widget(w);