summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
commit852689943bfbbbb933ba617cb0a971f82923a2f3 (patch)
tree11f7b934e5ea0fdd4f96efabbb213eb3189d6863 /src/ui/inputwidget.c
parent379c1f8befcc30b72f0b50dcbd653704348e4761 (diff)
Refactor: Update event processing to not assume a single UI root
Most actions should occur in the context of the current UI root.
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 52cb9805..9d360f47 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -338,7 +338,7 @@ void setText_InputWidget(iInputWidget *d, const iString *text) {
338 text = enc; 338 text = enc;
339 } 339 }
340 /* Omit the default (Gemini) scheme if there isn't much space. */ 340 /* Omit the default (Gemini) scheme if there isn't much space. */
341 if (isNarrow_Root(get_Root())) { // flags_Widget(as_Widget(d)) & tight_WidgetFlag) { 341 if (isNarrow_Root(as_Widget(d)->root)) {
342 text = omitDefaultScheme_(collect_String(copy_String(text))); 342 text = omitDefaultScheme_(collect_String(copy_String(text)));
343 } 343 }
344 } 344 }
@@ -733,7 +733,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
733 if (isFocused_Widget(d) && arg_Command(command_UserEvent(ev))) { 733 if (isFocused_Widget(d) && arg_Command(command_UserEvent(ev))) {
734 iRect rect = bounds_Widget(w); 734 iRect rect = bounds_Widget(w);
735 rect.pos.y -= value_Anim(&get_Window()->rootOffset); 735 rect.pos.y -= value_Anim(&get_Window()->rootOffset);
736 const iInt2 visRoot = visibleSize_Root(get_Root()); 736 const iInt2 visRoot = visibleSize_Root(w->root);
737 if (bottom_Rect(rect) > visRoot.y) { 737 if (bottom_Rect(rect) > visRoot.y) {
738 setValue_Anim(&get_Window()->rootOffset, -(bottom_Rect(rect) - visRoot.y), 250); 738 setValue_Anim(&get_Window()->rootOffset, -(bottom_Rect(rect) - visRoot.y), 250);
739 } 739 }