Gentoo Archives: gentoo-commits

From: "Alexandre Rostovtsev (tetromino)" <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-libs/gtk+/files: gtk+-3.4.1-toolpalette-adjustment.patch gtk+-3.4.1-extraneous-events-scrolling.patch gtk+-3.4.1-toolpalette-rename.patch
Date: Wed, 02 May 2012 06:55:02
Message-Id: 20120502065442.C2DE42004B@flycatcher.gentoo.org
1 tetromino 12/05/02 06:54:42
2
3 Added: gtk+-3.4.1-toolpalette-adjustment.patch
4 gtk+-3.4.1-extraneous-events-scrolling.patch
5 gtk+-3.4.1-toolpalette-rename.patch
6 Log:
7 Fix annotation button in evince (bug #412751, thanks to Geraint Yang). Fix inefficient scrolling.
8
9 (Portage version: 2.2.0_alpha101/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.1 x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-adjustment.patch
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-adjustment.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-adjustment.patch?rev=1.1&content-type=text/plain
16
17 Index: gtk+-3.4.1-toolpalette-adjustment.patch
18 ===================================================================
19 From 67e2e41907add988746f59857ef86d6ea37b8392 Mon Sep 17 00:00:00 2001
20 From: Benjamin Otte <otte@××××××.com>
21 Date: Fri, 27 Apr 2012 03:33:57 +0200
22 Subject: [PATCH] toolpalette: Configure adjustment properly
23
24 https://bugzilla.gnome.org/show_bug.cgi?id=673650
25 ---
26 gtk/gtktoolpalette.c | 17 +++++++----------
27 1 files changed, 7 insertions(+), 10 deletions(-)
28
29 diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
30 index 0dd9b21..0655bff 100644
31 --- a/gtk/gtktoolpalette.c
32 +++ b/gtk/gtktoolpalette.c
33 @@ -665,30 +665,27 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
34 /* update the scrollbar to match the displayed adjustment */
35 if (adjustment)
36 {
37 - gdouble value, lower, upper;
38 + gdouble lower, upper;
39 +
40 + total_size = MAX (0, total_size);
41 + page_size = MIN (total_size, page_size);
42
43 if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation ||
44 GTK_TEXT_DIR_LTR == direction)
45 {
46 lower = 0;
47 - upper = MAX (0, total_size);
48 -
49 - value = MIN (offset, upper - page_size);
50 - gtk_adjustment_clamp_page (adjustment, value, offset + page_size);
51 + upper = total_size;
52 }
53 else
54 {
55 - lower = page_size - MAX (0, total_size);
56 + lower = page_size - total_size;
57 upper = page_size;
58
59 offset = -offset;
60 -
61 - value = MAX (offset, lower);
62 - gtk_adjustment_clamp_page (adjustment, offset, value + page_size);
63 }
64
65 gtk_adjustment_configure (adjustment,
66 - value,
67 + offset,
68 lower,
69 upper,
70 page_size * 0.1,
71 --
72 1.7.8.6
73
74
75
76
77 1.1 x11-libs/gtk+/files/gtk+-3.4.1-extraneous-events-scrolling.patch
78
79 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-extraneous-events-scrolling.patch?rev=1.1&view=markup
80 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-extraneous-events-scrolling.patch?rev=1.1&content-type=text/plain
81
82 Index: gtk+-3.4.1-extraneous-events-scrolling.patch
83 ===================================================================
84 From 37e3722d3a80be13bd8f7a4d3ac8edc923fc2750 Mon Sep 17 00:00:00 2001
85 From: Cosimo Cecchi <cosimoc@×××××.org>
86 Date: Fri, 20 Apr 2012 17:34:08 -0400
87 Subject: [PATCH] xi2: ignore extraneous events for smooth scroll
88
89 Since the event will be ignored anyway after it's translated (slave
90 devices are disabled), don't let it run in the smooth scroll code path,
91 as it will burn our caches for the actual event we're interested in.
92
93 https://bugzilla.gnome.org/show_bug.cgi?id=673644
94 ---
95 gdk/x11/gdkdevicemanager-xi2.c | 23 +++++++++++++++--------
96 1 files changed, 15 insertions(+), 8 deletions(-)
97
98 diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
99 index a34bd09..15f095b 100644
100 --- a/gdk/x11/gdkdevicemanager-xi2.c
101 +++ b/gdk/x11/gdkdevicemanager-xi2.c
102 @@ -1305,13 +1305,24 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
103 case XI_Motion:
104 {
105 XIDeviceEvent *xev = (XIDeviceEvent *) ev;
106 - GdkDevice *source_device;
107 + GdkDevice *source_device, *device;
108 gdouble delta_x, delta_y;
109
110 source_device = g_hash_table_lookup (device_manager->id_table,
111 GUINT_TO_POINTER (xev->sourceid));
112 + device = g_hash_table_lookup (device_manager->id_table,
113 + GUINT_TO_POINTER (xev->deviceid));
114
115 - if (scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
116 + /* When scrolling, X might send events twice here; once with both the
117 + * device and the source device set to the physical device, and once
118 + * with the device set to the master device.
119 + * Since we are only interested in the latter, and
120 + * scroll_valuators_changed() updates the valuator cache for the
121 + * source device, we need to explicitly ignore the first event in
122 + * order to get the correct delta for the second.
123 + */
124 + if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE &&
125 + scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
126 &xev->valuators, &delta_x, &delta_y))
127 {
128 event->scroll.type = GDK_SCROLL;
129 @@ -1333,9 +1344,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
130 event->scroll.delta_x = delta_x;
131 event->scroll.delta_y = delta_y;
132
133 - event->scroll.device = g_hash_table_lookup (device_manager->id_table,
134 - GUINT_TO_POINTER (xev->deviceid));
135 -
136 + event->scroll.device = device;
137 gdk_event_set_source_device (event, source_device);
138
139 event->scroll.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
140 @@ -1350,9 +1359,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
141 event->motion.x_root = (gdouble) xev->root_x;
142 event->motion.y_root = (gdouble) xev->root_y;
143
144 - event->motion.device = g_hash_table_lookup (device_manager->id_table,
145 - GINT_TO_POINTER (xev->deviceid));
146 -
147 + event->motion.device = device;
148 gdk_event_set_source_device (event, source_device);
149
150 event->motion.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
151 --
152 1.7.8.6
153
154
155
156
157 1.1 x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-rename.patch
158
159 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-rename.patch?rev=1.1&view=markup
160 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+/files/gtk+-3.4.1-toolpalette-rename.patch?rev=1.1&content-type=text/plain
161
162 Index: gtk+-3.4.1-toolpalette-rename.patch
163 ===================================================================
164 From 27ff5516cce371395c0e8c22ae3e25f91078771c Mon Sep 17 00:00:00 2001
165 From: Benjamin Otte <otte@××××××.com>
166 Date: Fri, 27 Apr 2012 03:28:22 +0200
167 Subject: [PATCH] toolpalette: Rename variable
168
169 The variable that holds the total size for all widget allocations
170 shouldn't be called page_start.
171 ---
172 gtk/gtktoolpalette.c | 10 +++++-----
173 1 files changed, 5 insertions(+), 5 deletions(-)
174
175 diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
176 index be6297a..0dd9b21 100644
177 --- a/gtk/gtktoolpalette.c
178 +++ b/gtk/gtktoolpalette.c
179 @@ -473,7 +473,7 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
180 gint remaining_space = 0;
181 gint expand_space = 0;
182
183 - gint page_start, page_size = 0;
184 + gint total_size, page_size;
185 gint offset = 0;
186 guint i;
187 guint border_width;
188 @@ -652,14 +652,14 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
189 child_allocation.y += border_width;
190 child_allocation.y += offset;
191
192 - page_start = child_allocation.y;
193 + total_size = child_allocation.y;
194 }
195 else
196 {
197 x += border_width;
198 x += offset;
199
200 - page_start = x;
201 + total_size = x;
202 }
203
204 /* update the scrollbar to match the displayed adjustment */
205 @@ -671,14 +671,14 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
206 GTK_TEXT_DIR_LTR == direction)
207 {
208 lower = 0;
209 - upper = MAX (0, page_start);
210 + upper = MAX (0, total_size);
211
212 value = MIN (offset, upper - page_size);
213 gtk_adjustment_clamp_page (adjustment, value, offset + page_size);
214 }
215 else
216 {
217 - lower = page_size - MAX (0, page_start);
218 + lower = page_size - MAX (0, total_size);
219 upper = page_size;
220
221 offset = -offset;
222 --
223 1.7.8.6