=> e956dbda62a41fe1799e7e8af5ea42a53d8aebcd
[1mdiff --git a/src/android.c b/src/android.c[m [1mindex d4c4a512..e23244ac 100644[m [1m--- a/src/android.c[m [1m+++ b/src/android.c[m [36m@@ -26,6 +26,7 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m #include "ui/command.h"[m #include "ui/metrics.h"[m #include "ui/mobile.h"[m [32m+[m[32m#include "ui/window.h"[m [m #include[m #include [m [36m@@ -243,5 +244,12 @@[m [miBool handleCommand_Android(const char *cmd) {[m 0xff000000 | (top.r << 16) | (top.g << 8) | top.b,[m 0xff000000 | (btm.r << 16) | (btm.g << 8) | btm.b);[m }[m [32m+[m[32m else if (equal_Command(cmd, "android.keyboard.changed")) {[m [32m+[m[32m iMainWindow *mw = get_MainWindow();[m [32m+[m[32m if (mw) {[m [32m+[m[32m setKeyboardHeight_MainWindow(mw, arg_Command(cmd));[m [32m+[m[32m }[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m return iFalse;[m }[m [1mdiff --git a/src/ui/root.c b/src/ui/root.c[m [1mindex b8db1a4b..1d4f50d2 100644[m [1m--- a/src/ui/root.c[m [1m+++ b/src/ui/root.c[m [36m@@ -1244,14 +1244,15 @@[m [mstatic iBool handleToolBarCommands_(iWidget *toolBar, const char *cmd) {[m const int showSpan = 400;[m const int hideSpan = 350;[m const int animFlag = easeOut_AnimFlag | softer_AnimFlag;[m [32m+[m[32m int landscapeOffset = 5 * gap_UI; /* TODO: Why this amount? Something's funny here. */[m #else[m [31m- const int showSpan = 100;[m [31m- const int hideSpan = 200;[m [32m+[m[32m const int showSpan = 80;[m [32m+[m[32m const int hideSpan = 250;[m const int animFlag = easeOut_AnimFlag;[m [32m+[m[32m int landscapeOffset = 0;[m #endif[m if (focus_Widget() == findChild_Widget(navBar, "url") && height > 0) {[m [31m- int inputHeight = 5 * gap_UI; /* TODO: Why this amount? Something's funny here. */[m [31m- int keyboardPad = height - (isPortrait_App() ? height_Widget(toolBar) : inputHeight);[m [32m+[m[32m int keyboardPad = height - (isPortrait_App() ? height_Widget(toolBar) : landscapeOffset);[m bottomBar->padding[3] = keyboardPad;[m arrange_Widget(bottomBar);[m arrange_Widget(bottomBar);[m [1mdiff --git a/src/ui/touch.c b/src/ui/touch.c[m [1mindex 1de6c244..dacdbfef 100644[m [1m--- a/src/ui/touch.c[m [1m+++ b/src/ui/touch.c[m [36m@@ -271,24 +271,16 @@[m [mstatic uint32_t gestureSpan_Touch_(const iTouch *d) {[m return d->posTime[0] - d->posTime[lastIndex];[m }[m [m [31m-static void update_TouchState_(void *ptr) {[m [31m- iWindow *win = get_Window();[m [31m- const iWidget *oldHover = win->hover;[m [31m- iTouchState *d = ptr;[m [31m- /* Check for long presses to simulate right clicks. */[m [31m- const uint32_t nowTime = SDL_GetTicks();[m [31m- iForEach(Array, i, d->touches) {[m [31m- iTouch *touch = i.value;[m [31m- /* Post the next pending scroll. */[m [31m- if (touch->numPendingScroll > touch->pendingScrollThreshold) {[m [31m- const iInt2 pixels = touch->pendingScroll[0];[m [32m+[m[32mstatic void postPendingScroll_TouchState_(iTouchState *d, iTouch *touch) {[m [32m+[m[32m if (touch->numPendingScroll > touch->pendingScrollThreshold) {[m [32m+[m[32m const iInt2 pixels = touch->pendingScroll[0];[m // printf("%u :: (%d/%d) pending scroll %d,%d\n", nowTime, touch->numPendingScroll, touch->pendingScrollThreshold, pixels.x, pixels.y);[m [31m- memmove(touch->pendingScroll, touch->pendingScroll + 1,[m [31m- sizeof(touch->pendingScroll[0]) * (iElemCount(touch->pendingScroll) - 1));[m [31m- touch->numPendingScroll--;[m [31m- dispatchMotion_Touch_(touch->startPos, 0);[m [31m- setCurrent_Root(touch->affinity->root);[m [31m- dispatchEvent_Widget(touch->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){[m [32m+[m[32m memmove(touch->pendingScroll, touch->pendingScroll + 1,[m [32m+[m[32m sizeof(touch->pendingScroll[0]) * (iElemCount(touch->pendingScroll) - 1));[m [32m+[m[32m touch->numPendingScroll--;[m [32m+[m[32m dispatchMotion_Touch_(touch->startPos, 0);[m [32m+[m[32m setCurrent_Root(touch->affinity->root);[m [32m+[m[32m dispatchEvent_Widget(touch->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){[m .type = SDL_MOUSEWHEEL,[m .which = SDL_TOUCH_MOUSEID,[m .windowID = id_Window(window_Widget(touch->affinity)),[m [36m@@ -296,10 +288,21 @@[m [mstatic void update_TouchState_(void *ptr) {[m .x = pixels.x,[m .y = pixels.y,[m .direction = perPixel_MouseWheelFlag,[m [31m- });[m [31m- /* TODO: Keep increasing movement if the direction is the same. */[m [31m- clearWidgetMomentum_TouchState_(d, touch->affinity);[m [31m- }[m [32m+[m[32m });[m [32m+[m[32m /* TODO: Keep increasing movement if the direction is the same. */[m [32m+[m[32m clearWidgetMomentum_TouchState_(d, touch->affinity);[m [32m+[m[32m }[m [32m+[m[32m}[m [32m+[m [32m+[m[32mstatic void update_TouchState_(void *ptr) {[m [32m+[m[32m iWindow *win = get_Window();[m [32m+[m[32m const iWidget *oldHover = win->hover;[m [32m+[m[32m iTouchState *d = ptr;[m [32m+[m[32m /* Check for long presses to simulate right clicks. */[m [32m+[m[32m const uint32_t nowTime = SDL_GetTicks();[m [32m+[m[32m iForEach(Array, i, d->touches) {[m [32m+[m[32m iTouch *touch = i.value;[m [32m+[m[32m postPendingScroll_TouchState_(d, touch);[m if (touch->pinchId || touch->isTouchDrag) {[m continue;[m }[m [36m@@ -691,6 +694,10 @@[m [miBool processEvent_Touch(const SDL_Event *ev) {[m touch->pendingScrollThreshold = 0;[m #endif[m touch->numPendingScroll++;[m [32m+[m[32m#if defined (iPlatformAndroidMobile)[m [32m+[m[32m /* No need to wait. */[m [32m+[m[32m postPendingScroll_TouchState_(d, touch);[m [32m+[m[32m#endif[m }[m }[m }[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex 6803a108..ec720bae 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -2566,8 +2566,8 @@[m [miWidget *makePreferences_Widget(void) {[m { "toggle id:prefs.gemtext.ansi.fg" },[m { "toggle id:prefs.gemtext.ansi.bg" },[m { "toggle id:prefs.gemtext.ansi.fontstyle" },[m [31m- { "padding android:1" },[m [31m- { "dropdown android:1 id:prefs.font.ui", 0, 0, (const void *) constData_Array(makeFontItems_("ui")) },[m [32m+[m[32m// { "padding android:1" },[m [32m+[m[32m// { "dropdown android:1 id:prefs.font.ui", 0, 0, (const void *) constData_Array(makeFontItems_("ui")) },[m { "padding" },[m { "button text:" fontpack_Icon " " uiTextAction_ColorEscape "${menu.fonts}", 0, 0, "!open url:about:fonts" },[m { NULL } [m [1mdiff --git a/src/ui/window.c b/src/ui/window.c[m [1mindex 7186a484..f58d7b46 100644[m [1m--- a/src/ui/window.c[m [1m+++ b/src/ui/window.c[m [36m@@ -1058,6 +1058,7 @@[m [miBool processEvent_Window(iWindow *d, const SDL_Event *ev) {[m postCommand_App("media.player.update"); /* in case a player needs updating */[m return iFalse; /* unfreeze all frozen windows */[m }[m [32m+[m[32m#if 0[m if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.sysframe") && mw) {[m /* This command is sent on Android to update the keyboard height. */[m const char *cmd = command_UserEvent(ev);[m [36m@@ -1082,6 +1083,7 @@[m [miBool processEvent_Window(iWindow *d, const SDL_Event *ev) {[m setKeyboardHeight_MainWindow(mw, top + mw->maxDrawableHeight - bottom);[m return iTrue;[m }[m [32m+[m[32m#endif[m if (processEvent_Touch(&event)) {[m return iTrue;[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).