2026-10-13 20:36 BST

View Issue Details [ Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002841Buildsystem[All Projects] Generalpublic2026-10-05 23:43
ReporterCameron Cawley 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusacknowledgedResolutionopen 
Summary0002841: [PATCH] gtk: Fix the caret position when scrolling with GTK3
DescriptionWith GTK3, the caret would stay in the same place on the screen and wouldn't update its position when scrolling. The attached patch fixes that.
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files
  • patch file icon 0001-gtk-Fix-the-caret-position-when-scrolling-with-GTK3.patch (1,248 bytes) 2022-02-16 19:49 -
    From d4d18a01ced1a18adf567eb51ca0c294bae3e0eb Mon Sep 17 00:00:00 2001
    From: Cameron Cawley <ccawley2011@gmail.com>
    Date: Wed, 16 Feb 2022 19:36:55 +0000
    Subject: [PATCH] gtk: Fix the caret position when scrolling with GTK3
    
    ---
     frontends/gtk/window.c | 11 ++++++++---
     1 file changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
    index f5c87ef87..4a08510d0 100644
    --- a/frontends/gtk/window.c
    +++ b/frontends/gtk/window.c
    @@ -172,6 +172,8 @@ nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
     	double y1;
     	double x2;
     	double y2;
    +	double sx;
    +	double sy;
     
     	assert(gw);
     	assert(gw->bw);
    @@ -193,14 +195,17 @@ nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
     	clip.x1 = x2;
     	clip.y1 = y2;
     
    +	sx = gtk_adjustment_get_value(hscroll);
    +	sy = gtk_adjustment_get_value(vscroll);
    +
     	browser_window_redraw(gw->bw,
    -			      -gtk_adjustment_get_value(hscroll),
    -			      -gtk_adjustment_get_value(vscroll),
    +			      -sx,
    +			      -sy,
     			      &clip,
     			      &ctx);
     
     	if (gw->careth != 0) {
    -		nsgtk_plot_caret(gw->caretx, gw->carety, gw->careth);
    +		nsgtk_plot_caret(gw->caretx - sx, gw->carety -sy, gw->careth);
     	}
     
     	return FALSE;
    -- 
    2.30.2
    
    

-Relationships
has duplicate 0002773resolved NetSurf Text cursor does not follow the page scrolling 
+Relationships

-Notes
John-Mark Bell

~0002507

John-Mark Bell (administrator)

Looks like this is still relevant
+Notes

-Issue History
Date Modified Username Field Change
2022-02-16 19:49 Cameron Cawley New Issue
2022-02-16 19:49 Cameron Cawley File Added: 0001-gtk-Fix-the-caret-position-when-scrolling-with-GTK3.patch
2026-10-05 22:19 John-Mark Bell Status new => acknowledged
2026-10-05 22:19 John-Mark Bell Note Added: 0002507
2026-10-05 23:43 John-Mark Bell Relationship added has duplicate 0002773
+Issue History