From 4dee43aa5c460850268c1acea263d4ff510e7c15 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 14 Dec 2021 21:43:08 +0200 Subject: iOS: Fixed input positioning (non-animated widget) If there were no entry animation, the native UI control would not be correctly placed. --- src/ui/root.c | 2 +- src/ui/root.h | 2 +- src/ui/widget.c | 3 ++- src/ui/window.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui/root.c b/src/ui/root.c index a9bc7feb..04586bac 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -688,7 +688,7 @@ void updateToolbarColors_Root(iRoot *d) { } void notifyVisualOffsetChange_Root(iRoot *d) { - if (d && (d->didAnimateVisualOffsets || d->didOverflowScroll)) { + if (d && (d->didAnimateVisualOffsets || d->didChangeArrangement)) { iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged); } } diff --git a/src/ui/root.h b/src/ui/root.h index 2f0d72c9..7e831be3 100644 --- a/src/ui/root.h +++ b/src/ui/root.h @@ -19,7 +19,7 @@ struct Impl_Root { iBool pendingArrange; int loadAnimTimer; iBool didAnimateVisualOffsets; - iBool didOverflowScroll; + iBool didChangeArrangement; iAudience *visualOffsetsChanged; /* called after running tickers */ iColor tmPalette[tmMax_ColorId]; /* theme-specific palette */ }; diff --git a/src/ui/widget.c b/src/ui/widget.c index 8cb2cf02..df74a744 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -901,6 +901,7 @@ void arrange_Widget(iWidget *d) { resetArrangement_Widget_(d); /* back to initial default sizes */ arrange_Widget_(d); notifySizeChanged_Widget_(d); + d->root->didChangeArrangement = iTrue; } } @@ -1218,7 +1219,7 @@ iBool scrollOverflow_Widget(iWidget *d, int delta) { } // printf("range: %d ... %d\n", range.start, range.end); if (delta) { - d->root->didOverflowScroll = iTrue; /* ensure that widgets update if needed */ + d->root->didChangeArrangement = iTrue; /* ensure that widgets update if needed */ } } else { diff --git a/src/ui/window.c b/src/ui/window.c index 76dd1105..a4929f51 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1265,7 +1265,7 @@ void draw_MainWindow(iMainWindow *d) { if (root) { /* Some widgets may need a just-in-time visual update. */ notifyVisualOffsetChange_Root(root); - root->didOverflowScroll = iFalse; + root->didChangeArrangement = iFalse; } } if (isExposed_Window(w)) { -- cgit v1.2.3