[maemo-commits] [maemo-commits] r9690 - projects/haf/trunk/gtkhtml/upstream/patches
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Feb 6 17:06:08 EET 2007
- Previous message: [maemo-commits] r9689 - in projects/haf/branches/hildon-libs/hildon-1: . examples src
- Next message: [maemo-commits] r9691 - projects/haf/branches/maemo-af-desktop/hildon-desktop/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: schulhof
Date: 2007-02-06 17:06:07 +0200 (Tue, 06 Feb 2007)
New Revision: 9690
Modified:
projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_dont_click_link_when_panning.diff
Log:
Fixed snap-back problem and partially fixed pan-via-link-click bug
Modified: projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_dont_click_link_when_panning.diff
===================================================================
--- projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_dont_click_link_when_panning.diff 2007-02-06 14:15:16 UTC (rev 9689)
+++ projects/haf/trunk/gtkhtml/upstream/patches/gtkhtml_dont_click_link_when_panning.diff 2007-02-06 15:06:07 UTC (rev 9690)
@@ -1,46 +1,110 @@
diff -ru gtkhtml-3.9.1/src/gtkhtml.c gtkhtml-3.9.1.mod/src/gtkhtml.c
---- gtkhtml-3.9.1/src/gtkhtml.c 2007-01-24 17:13:28.000000000 +0200
-+++ gtkhtml-3.9.1.mod/src/gtkhtml.c 2007-01-29 17:27:12.000000000 +0200
-@@ -1654,6 +1654,8 @@
+--- gtkhtml-3.9.1/src/gtkhtml.c 2007-02-06 16:30:17.000000000 +0200
++++ gtkhtml-3.9.1.mod/src/gtkhtml.c 2007-02-06 16:53:03.000000000 +0200
+@@ -1600,6 +1600,7 @@
+ gint x, y;
+ guint mouse_double_click_threshold = MOUSE_DBLCLK_THRESHOLD ;
+ GtkSettings *gtk_settings = gtk_widget_get_settings (widget) ;
++ GtkHTML *html = NULL ;
+
+ if (NULL != gtk_settings)
+ g_object_get (G_OBJECT (gtk_settings), "gtk-double-click-distance", &mouse_double_click_threshold, NULL) ;
+@@ -1619,11 +1620,11 @@
+ if (event->is_hint)
+ gdk_device_get_state (event->device, GTK_LAYOUT (widget)->bin_window, NULL, NULL) ;
+
++ html = GTK_HTML (widget) ;
++
+ /* If there is only a small motion from the origin and simple
+ doubleclick is active, abort the motion, otherwise clear simple_dblclick flag */
+- if (GTK_HTML (widget)->simple_dblclick) {
+- GtkHTML *html = GTK_HTML (widget);
+-
++ if (html->simple_dblclick) {
+ if (abs(x - html->selection_x1) <= mouse_double_click_threshold &&
+ abs(y - html->selection_y1) <= mouse_double_click_threshold)
+ return TRUE;
+@@ -1634,18 +1635,18 @@
+ if (!mouse_change_pos (widget, window, x, y, event->state))
+ return FALSE;
+
+- engine = GTK_HTML (widget)->engine;
+- if (GTK_HTML (widget)->in_selection_drag && html_engine_get_editable (engine))
++ engine = html->engine;
++ if (html->in_selection_drag && html_engine_get_editable (engine))
+ html_engine_jump_at (engine, x, y);
+
+ /* (TL 18-Nov-05) Added panning feature */
+- if (GTK_HTML (widget)->panning) {
++ if (html->panning) {
+ GtkAdjustment *adj;
+ gint dx, dy;
+ gdouble value;
+
+- dx = x - GTK_HTML (widget)->lastx;
+- dy = y - GTK_HTML (widget)->lasty;
++ dx = x - html->lastx;
++ dy = y - html->lasty;
+
+ /* Vertical panning */
+ adj = gtk_layout_get_vadjustment(GTK_LAYOUT(widget));
+@@ -1654,6 +1655,8 @@
value = adj->lower;
else if (value > (adj->upper - adj->page_size))
value = adj->upper - adj->page_size;
-+ if (GTK_HTML (widget)->y_amount_panned < mouse_double_click_threshold)
-+ GTK_HTML (widget)->y_amount_panned += (gint)(value - adj->value) ;
++ if (ABS (html->y_amount_panned) < mouse_double_click_threshold)
++ html->y_amount_panned += (gint)(value - adj->value) ;
gtk_adjustment_set_value(adj, value);
/* Horizontal panning */
-@@ -1663,8 +1665,14 @@
+@@ -1663,7 +1666,10 @@
value = adj->lower;
else if (value > (adj->upper - adj->page_size))
value = adj->upper - adj->page_size;
-+ if (GTK_HTML (widget)->x_amount_panned < mouse_double_click_threshold)
-+ GTK_HTML (widget)->x_amount_panned += (gint)(value - adj->value) ;
++ if (ABS (html->x_amount_panned) < mouse_double_click_threshold)
++ html->x_amount_panned += (gint)(value - adj->value) ;
gtk_adjustment_set_value(adj, value);
-- }
+
-+ /* g_print ("GtkHTML::motion_notify_event: total pan so far: [%dx%d]\n", GTK_HTML (widget)->x_amount_panned, GTK_HTML (widget)->y_amount_panned) ; */
-+ } /*else {
-+ g_print ("GtkHTML::motion_notify_event: Not panning\n") ;
-+ }*/
+ }
return TRUE;
- }
-@@ -1783,6 +1791,8 @@
+@@ -1718,14 +1724,16 @@
+ GtkHTML *html;
+ GtkWidget *orig_widget = widget;
+ HTMLEngine *engine;
+- gint value, x, y;
++ gint value, x, y, xWnd, yWnd;
+
+ /* printf ("button_press_event\n"); */
+
+ x = event->x;
+ y = event->y;
+
++ gdk_window_get_pointer (widget->window, &xWnd, &yWnd, NULL) ;
+ widget = shift_to_iframe_parent (widget, &x, &y);
++ shift_to_iframe_parent (orig_widget, &xWnd, &yWnd) ;
+ html = GTK_HTML (widget);
+ engine = html->engine;
+
+@@ -1783,8 +1791,10 @@
/* (TL 18-Nov-05) First click starts panning, not selection */
html->in_selection_drag = FALSE;
html->panning = TRUE;
+- html->lastx = x;
+- html->lasty = y;
+ html->x_amount_panned =
+ html->y_amount_panned = 0 ;
- html->lastx = x;
- html->lasty = y;
++ html->lastx = xWnd + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget)));
++ html->lasty = yWnd + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget)));
+ if (html_engine_get_editable (engine)) {
+ HTMLObject *obj;
@@ -1854,6 +1864,8 @@
/* (TL 18-Nov-05) Second click starts selection and stops panning */
html->in_selection_drag = TRUE;
html->panning = FALSE;
-+ html->x_amount_panned =
-+ html->y_amount_panned = 0 ;
++ html->x_amount_panned =
++ html->y_amount_panned = 0 ;
html->in_selection = TRUE;
/* Check for simple double click, for selecting a word */
html->simple_dblclick = TRUE;
@@ -48,8 +112,8 @@
/* (TL 18-Nov-05) Third click starts selection and stops panning */
html->in_selection_drag = TRUE;
html->panning = FALSE;
-+ html->x_amount_panned =
-+ html->y_amount_panned = 0 ;
++ html->x_amount_panned =
++ html->y_amount_panned = 0 ;
html->in_selection = TRUE;
}
}
@@ -70,8 +134,8 @@
html->panning = FALSE;
if (!html->priv->dnd_in_progress
-+ && html->x_amount_panned < mouse_double_click_threshold
-+ && html->y_amount_panned < mouse_double_click_threshold
++ && ABS (html->x_amount_panned) < mouse_double_click_threshold
++ && ABS (html->y_amount_panned) < mouse_double_click_threshold
&& html->pointer_url != NULL && ! html->in_selection) {
g_signal_emit (widget, signals[LINK_CLICKED], 0, html->pointer_url);
focus_object = html_engine_get_focus_object (html->engine, &focus_object_offset);
@@ -97,8 +161,8 @@
html->lasty = 0;
diff -ru gtkhtml-3.9.1/src/gtkhtml.h gtkhtml-3.9.1.mod/src/gtkhtml.h
---- gtkhtml-3.9.1/src/gtkhtml.h 2007-01-24 17:13:28.000000000 +0200
-+++ gtkhtml-3.9.1.mod/src/gtkhtml.h 2007-01-29 17:52:28.000000000 +0200
+--- gtkhtml-3.9.1/src/gtkhtml.h 2007-02-06 16:30:17.000000000 +0200
++++ gtkhtml-3.9.1.mod/src/gtkhtml.h 2007-02-06 16:31:08.000000000 +0200
@@ -66,6 +66,8 @@
gboolean panning;
gint lastx;
- Previous message: [maemo-commits] r9689 - in projects/haf/branches/hildon-libs/hildon-1: . examples src
- Next message: [maemo-commits] r9691 - projects/haf/branches/maemo-af-desktop/hildon-desktop/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
