Graham Gower wrote:
> Hi,
> I'm playing with netsurf-2.1 on a mipsel touchscreen device (64mb ram,
> 380MHz). I'm happy to say that netsurf performs quite well on these
> resources,
> although more ram would be nice for larger pages. However, the gtk
> frontend
> appears to not work very well in conjunction with a touchscreen.
>
> The first chunk below makes drag scrolling usable. Without it, small
> movements
> cause netsurf to scroll far too much.
>
> The second chunk inhibits propagation of motion events when they are very
> small. Small motion events occur all the time when making touches on a
> touchscreen and as a result, the BROWSER_MOUSE_CLICK_* states were very
> difficult to trigger. This made tapping on links virtually impossible.
>
> -Graham
>
> --- netsurf.orig/gtk/gtk_window.c
> +++ netsurf/gtk/gtk_window.c
> @@ -220,6 +220,7 @@
> GDK_BUTTON_PRESS_MASK |
> GDK_BUTTON_RELEASE_MASK |
> GDK_POINTER_MOTION_MASK |
> + GDK_POINTER_MOTION_HINT_MASK |
> GDK_KEY_PRESS_MASK |
> GDK_KEY_RELEASE_MASK);
> GTK_WIDGET_SET_FLAGS(GTK_WIDGET(g->drawing_area), GTK_CAN_FOCUS);
> @@ -344,6 +345,11 @@
> bool shift = event->state & GDK_SHIFT_MASK;
> bool ctrl = event->state & GDK_CONTROL_MASK;
>
> +#define DIFF(a,b) (a>b?a-b:b-a)
> + if (DIFF(event->x, g->last_x) < 5.0
> + && DIFF(event->y, g->last_y) < 5.0)
> + return;
> +
> if (g->mouse->state & BROWSER_MOUSE_PRESS_1){
> /* Start button 1 drag */
> browser_window_mouse_click(g->bw, BROWSER_MOUSE_DRAG_1,
>
Hi Graham,
thanks for the patch;
I'll confirm that there are no immediate obvious adverse effects in
desktop mode;
it seems to me that, as the nsgtk_window_motion_notify_event() function
should return a gboolean, perhaps return TRUE is marginally less smooth
than return FALSE;
you would need to confirm that return FALSE has the necessary effect in
the touchscreen environment;
aside from that, I've implemented the change in the gtkmain branch at least
Best regards
Mark
http://www.halloit.com
Key ID 046B65CF