Lagrange [work/v1.6]

Fixed issues with scrolling long popup windows

=> 583e15e912f672fe7a70fc8c43781f5ed9672ea0

diff --git a/src/ui/root.c b/src/ui/root.c
index 6f2868b7..3906b6e6 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -2159,10 +2159,12 @@ iRect visibleRect_Root(const iRoot *d) {
     visRect.size.y -= (int) (top + bottom);
 #endif
 #if defined (iPlatformDesktop)
+    /* Clamp to the actual window size. */
+    visRect = intersect_Rect(visRect, (iRect){ zero_I2(), d->window->size });
     /* Apply the usable bounds of the display. */
     SDL_Rect usable;
     /* TODO: Needs some investigation. With multiple monitors, at least on macOS, the bounds
-       returned here seem incorrect sometimes (infrequently). */
+       returned here seem incorrect sometimes (infrequently). */    
     if (iFalse) {
         const float ratio = d->window->pixelRatio;
         SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(d->window->win), &usable);
diff --git a/src/ui/widget.c b/src/ui/widget.c
index ef2ac868..d2ceb797 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -1289,7 +1289,7 @@ iBool scrollOverflow_Widget(iWidget *d, int delta) {
     if (!isOverflowScrollPossible_Widget_(d, delta)) {
         return iFalse;
     }
-    iRect       bounds        = boundsWithoutVisualOffset_Widget(d);
+    iRect       bounds        = boundsWithoutVisualOffset_Widget(d);  
     const iRect winRect       = visibleRect_Root(d->root);
     /* TODO: This needs some fixing on mobile, probably. */
 //    const int   yTop          = iMaxi(0, top_Rect(winRect));
@@ -1393,7 +1393,7 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) {
                 //SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(win->win),
                 //                           &usable);
                 const int bottomLimit =
-                /*iMin(*/ bottom_Rect(rect_Root(d->root)) /*, usable.h * win->pixelRatio) */
+                /*iMin(*/ bottom_Rect(visibleRect_Root(d->root)) /*, usable.h * win->pixelRatio) */
                     - hoverScrollLimit;
                 if (ev->motion.y > bottomLimit) {
                     speed = -(ev->motion.y - bottomLimit) / (float) hoverScrollLimit;
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.6/cdiff/583e15e912f672fe7a70fc8c43781f5ed9672ea0
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
55.45868 milliseconds
Gemini-to-HTML Time
0.226278 milliseconds

This content has been proxied by September (ba2dc).