You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pan View: Severe image shifting/ghosting artifacts during smooth scrolling (touchpad/mouse) at some zoom levels #2512
Describe the bug
Pan View exhibits severe visual artifacts (images shifting by 5-20+ pixels, ghosting, and misalignment) when scrolling smoothly using a touchpad or drag with mouse.
The bug is highly reproducible and has specific triggers:
It occurs at some zoom levels, including powers of two (2:1, 4:1, 8:1) if smooth scrolling is used.
It is especially severe at fractional zoom levels (3:1, 1.5:1).
Crucially: The artifacts do not occur when scrolling via keyboard arrows (which scroll in large discrete steps, e.g., 75px). This proves the issue is not strictly in the tile coordinate math, but in how RendererTiles handles incremental dirty regions during micro-scrolling.
Expected behavior
Smooth scrolling without artifacts, identical to the result of keyboard scrolling.
To reproduce
Open a folder with ~200 images in Pan View.
Zoom to 2:1.
Use a touchpad or drag with mouse to scroll diagonally (X and Y simultaneously) in small smooth steps.
Observe images shifting inside their grid cells, tearing, and ghosting
Screenshots
Additional context
Investigation & Root Cause Analysis
I have spent significant time debugging src/renderer-tiles.cc and src/pan-view/pan-view.cc. Here are the findings:
Dirty Region / Surface Shift Bug:
When pixbuf_renderer_scroll() receives tiny deltas (1-5px), rt_tile_render() takes the "SKIP (reusing old content)" path for cached it->surface. It shifts the old surface and only renders the newly exposed L-shaped edge.
I guess, that when calculating the source region for this edge in rt_source_tile_render(), the coordinate mapping becomes desynchronized from the shifted cache. This results in massive pixel offsets that accumulate as scrolling continues.
I attempted to fix the math using floor/ceil and mapping everything to Screen space (st_screen_x = st->x * scale_x), which mathematically corrects the gdk_pixbuf_scale inputs, but the visual artifacts persist because the underlying issue is the cached it->surface reuse logic mentioned above.
Also I tried to create the pan_view_scroll_idle_cb() idle callback function and move pixbuf_renderer_scroll() call there. But artifacts remain the same.
HiDPI Factor:
It seems that the artifacts are are not related to the DPI scale.
Activity