Merge lp:~cimi/overlay-scrollbar/various-namings-and-refactoring into lp:overlay-scrollbar
- various-namings-and-refactoring
- Merge into trunk
Proposed by
Andrea Cimitan
Status: | Merged |
---|---|
Approved by: | Ted Gould |
Approved revision: | 253 |
Merged at revision: | 253 |
Proposed branch: | lp:~cimi/overlay-scrollbar/various-namings-and-refactoring |
Merge into: | lp:overlay-scrollbar |
Diff against target: |
918 lines (+155/-206) 4 files modified
os/os-pager.c (+1/-1) os/os-private.h (+4/-4) os/os-scrollbar.c (+148/-193) os/os-thumb.c (+2/-8) |
To merge this branch: | bzr merge lp:~cimi/overlay-scrollbar/various-namings-and-refactoring |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Approve | ||
Review via email: mp+64671@code.launchpad.net |
Commit message
Description of the change
Various changes, trying to have nicer variable names and some optimization associated (apart from the change in move_pager and in proximity, which are slower as it has to access the memory for the dimensions instead using a fixed value, but looks easier to read)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'os/os-pager.c' | |||
2 | --- os/os-pager.c 2011-06-12 23:21:09 +0000 | |||
3 | +++ os/os-pager.c 2011-06-15 12:09:58 +0000 | |||
4 | @@ -315,7 +315,7 @@ | |||
5 | 315 | * | 315 | * |
6 | 316 | * Returns: the new #OsPager instance. | 316 | * Returns: the new #OsPager instance. |
7 | 317 | */ | 317 | */ |
9 | 318 | GObject* | 318 | OsPager* |
10 | 319 | os_pager_new (void) | 319 | os_pager_new (void) |
11 | 320 | { | 320 | { |
12 | 321 | return g_object_new (OS_TYPE_PAGER, NULL); | 321 | return g_object_new (OS_TYPE_PAGER, NULL); |
13 | 322 | 322 | ||
14 | === modified file 'os/os-private.h' | |||
15 | --- os/os-private.h 2011-06-10 10:32:53 +0000 | |||
16 | +++ os/os-private.h 2011-06-15 12:09:58 +0000 | |||
17 | @@ -30,9 +30,9 @@ | |||
18 | 30 | #pragma GCC visibility push(hidden) | 30 | #pragma GCC visibility push(hidden) |
19 | 31 | #endif /* __GNUC__ */ | 31 | #endif /* __GNUC__ */ |
20 | 32 | 32 | ||
24 | 33 | /* Default size of the thumb in pixels. */ | 33 | /* Size of the thumb in pixels. */ |
25 | 34 | #define DEFAULT_THUMB_WIDTH 17 | 34 | #define THUMB_WIDTH 17 |
26 | 35 | #define DEFAULT_THUMB_HEIGHT 69 | 35 | #define THUMB_HEIGHT 69 |
27 | 36 | 36 | ||
28 | 37 | G_BEGIN_DECLS | 37 | G_BEGIN_DECLS |
29 | 38 | 38 | ||
30 | @@ -208,7 +208,7 @@ | |||
31 | 208 | 208 | ||
32 | 209 | GType os_pager_get_type (void) G_GNUC_CONST; | 209 | GType os_pager_get_type (void) G_GNUC_CONST; |
33 | 210 | 210 | ||
35 | 211 | GObject* os_pager_new (void); | 211 | OsPager* os_pager_new (void); |
36 | 212 | 212 | ||
37 | 213 | void os_pager_hide (OsPager *overlay); | 213 | void os_pager_hide (OsPager *overlay); |
38 | 214 | 214 | ||
39 | 215 | 215 | ||
40 | === modified file 'os/os-scrollbar.c' | |||
41 | --- os/os-scrollbar.c 2011-06-14 17:20:10 +0000 | |||
42 | +++ os/os-scrollbar.c 2011-06-15 12:09:58 +0000 | |||
43 | @@ -32,14 +32,14 @@ | |||
44 | 32 | #include <X11/extensions/XInput2.h> | 32 | #include <X11/extensions/XInput2.h> |
45 | 33 | #include "math.h" | 33 | #include "math.h" |
46 | 34 | 34 | ||
49 | 35 | /* Default size of the pager in pixels. */ | 35 | /* Size of the pager in pixels. */ |
50 | 36 | #define DEFAULT_PAGER_WIDTH 3 | 36 | #define PAGER_SIZE 3 |
51 | 37 | 37 | ||
53 | 38 | /* Default thumb allocation shift in pixels. */ | 38 | /* Thumb allocation shift in pixels. */ |
54 | 39 | #define THUMB_ALLOCATION_SHIFT -3 | 39 | #define THUMB_ALLOCATION_SHIFT -3 |
55 | 40 | 40 | ||
58 | 41 | /* Width of the proximity effect in pixels. */ | 41 | /* Size of the proximity effect in pixels. */ |
59 | 42 | #define PROXIMITY_WIDTH 30 | 42 | #define PROXIMITY_SIZE 30 |
60 | 43 | 43 | ||
61 | 44 | /* Timeout assumed for PropertyNotify _NET_ACTIVE_WINDOW event. */ | 44 | /* Timeout assumed for PropertyNotify _NET_ACTIVE_WINDOW event. */ |
62 | 45 | #define TIMEOUT_PRESENT_WINDOW 400 | 45 | #define TIMEOUT_PRESENT_WINDOW 400 |
63 | @@ -55,13 +55,13 @@ | |||
64 | 55 | GdkRectangle trough; | 55 | GdkRectangle trough; |
65 | 56 | GdkRectangle overlay; | 56 | GdkRectangle overlay; |
66 | 57 | GdkRectangle slider; | 57 | GdkRectangle slider; |
68 | 58 | GtkAllocation overlay_all; | 58 | GtkAllocation pager_all; |
69 | 59 | GtkAllocation thumb_all; | 59 | GtkAllocation thumb_all; |
70 | 60 | GObject *pager; | ||
71 | 61 | GtkWidget *thumb; | 60 | GtkWidget *thumb; |
72 | 62 | GtkAdjustment *adjustment; | 61 | GtkAdjustment *adjustment; |
73 | 63 | GtkOrientation orientation; | 62 | GtkOrientation orientation; |
74 | 64 | GtkWindowGroup *window_group; | 63 | GtkWindowGroup *window_group; |
75 | 64 | OsPager *pager; | ||
76 | 65 | gboolean button_press_event; | 65 | gboolean button_press_event; |
77 | 66 | gboolean enter_notify_event; | 66 | gboolean enter_notify_event; |
78 | 67 | gboolean motion_notify_event; | 67 | gboolean motion_notify_event; |
79 | @@ -137,74 +137,56 @@ | |||
80 | 137 | 137 | ||
81 | 138 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 138 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
82 | 139 | { | 139 | { |
91 | 140 | gint y, bottom, top, height; | 140 | gint y, trough_length, height; |
92 | 141 | 141 | ||
93 | 142 | top = priv->trough.y; | 142 | trough_length = priv->trough.height; |
86 | 143 | bottom = priv->trough.y + priv->trough.height; | ||
87 | 144 | |||
88 | 145 | /* overlay height is the fraction (page_size / | ||
89 | 146 | * total_adjustment_range) times the trough height in pixels | ||
90 | 147 | */ | ||
94 | 148 | 143 | ||
95 | 149 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) | 144 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) |
99 | 150 | height = ((bottom - top) * (gtk_adjustment_get_page_size (priv->adjustment) / | 145 | height = (trough_length * (gtk_adjustment_get_page_size (priv->adjustment) / |
100 | 151 | (gtk_adjustment_get_upper (priv->adjustment) - | 146 | (gtk_adjustment_get_upper (priv->adjustment) - |
101 | 152 | gtk_adjustment_get_lower (priv->adjustment)))); | 147 | gtk_adjustment_get_lower (priv->adjustment)))); |
102 | 153 | else | 148 | else |
103 | 154 | height = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); | 149 | height = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); |
104 | 155 | 150 | ||
105 | 156 | height = MAX (height, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); | 151 | height = MAX (height, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); |
106 | 157 | 152 | ||
107 | 158 | height = MIN (height, priv->trough.height); | ||
108 | 159 | |||
109 | 160 | y = top; | ||
110 | 161 | |||
111 | 162 | if (gtk_adjustment_get_upper (priv->adjustment) - | 153 | if (gtk_adjustment_get_upper (priv->adjustment) - |
112 | 163 | gtk_adjustment_get_lower (priv->adjustment) - | 154 | gtk_adjustment_get_lower (priv->adjustment) - |
113 | 164 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 155 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
115 | 165 | y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 156 | y = (trough_length - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
116 | 166 | (gtk_adjustment_get_upper (priv->adjustment) - | 157 | (gtk_adjustment_get_upper (priv->adjustment) - |
117 | 167 | gtk_adjustment_get_lower (priv->adjustment) - | 158 | gtk_adjustment_get_lower (priv->adjustment) - |
118 | 168 | gtk_adjustment_get_page_size (priv->adjustment))); | 159 | gtk_adjustment_get_page_size (priv->adjustment))); |
119 | 169 | 160 | ||
121 | 170 | y = CLAMP (y, top, bottom); | 161 | y = CLAMP (y, 0, trough_length); |
122 | 171 | 162 | ||
123 | 172 | priv->overlay.y = y; | 163 | priv->overlay.y = y; |
124 | 173 | priv->overlay.height = height; | 164 | priv->overlay.height = height; |
125 | 174 | } | 165 | } |
126 | 175 | else | 166 | else |
127 | 176 | { | 167 | { |
136 | 177 | gint x, left, right, width; | 168 | gint x, trough_length, width; |
137 | 178 | 169 | ||
138 | 179 | left = priv->trough.x; | 170 | trough_length = priv->trough.width; |
131 | 180 | right = priv->trough.x + priv->trough.width; | ||
132 | 181 | |||
133 | 182 | /* overlay width is the fraction (page_size / | ||
134 | 183 | * total_adjustment_range) times the trough width in pixels | ||
135 | 184 | */ | ||
139 | 185 | 171 | ||
140 | 186 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) | 172 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) |
144 | 187 | width = ((right - left) * (gtk_adjustment_get_page_size (priv->adjustment) / | 173 | width = (trough_length * (gtk_adjustment_get_page_size (priv->adjustment) / |
145 | 188 | (gtk_adjustment_get_upper (priv->adjustment) - | 174 | (gtk_adjustment_get_upper (priv->adjustment) - |
146 | 189 | gtk_adjustment_get_lower (priv->adjustment)))); | 175 | gtk_adjustment_get_lower (priv->adjustment)))); |
147 | 190 | else | 176 | else |
148 | 191 | width = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); | 177 | width = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); |
149 | 192 | 178 | ||
150 | 193 | width = MAX (width, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); | 179 | width = MAX (width, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); |
151 | 194 | 180 | ||
152 | 195 | width = MIN (width, priv->trough.width); | ||
153 | 196 | |||
154 | 197 | x = left; | ||
155 | 198 | |||
156 | 199 | if (gtk_adjustment_get_upper (priv->adjustment) - | 181 | if (gtk_adjustment_get_upper (priv->adjustment) - |
157 | 200 | gtk_adjustment_get_lower (priv->adjustment) - | 182 | gtk_adjustment_get_lower (priv->adjustment) - |
158 | 201 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 183 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
160 | 202 | x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 184 | x = (trough_length - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
161 | 203 | (gtk_adjustment_get_upper (priv->adjustment) - | 185 | (gtk_adjustment_get_upper (priv->adjustment) - |
162 | 204 | gtk_adjustment_get_lower (priv->adjustment) - | 186 | gtk_adjustment_get_lower (priv->adjustment) - |
163 | 205 | gtk_adjustment_get_page_size (priv->adjustment))); | 187 | gtk_adjustment_get_page_size (priv->adjustment))); |
164 | 206 | 188 | ||
166 | 207 | x = CLAMP (x, left, right); | 189 | x = CLAMP (x, 0, trough_length); |
167 | 208 | 190 | ||
168 | 209 | priv->overlay.x = x; | 191 | priv->overlay.x = x; |
169 | 210 | priv->overlay.width = width; | 192 | priv->overlay.width = width; |
170 | @@ -222,52 +204,40 @@ | |||
171 | 222 | 204 | ||
172 | 223 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 205 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
173 | 224 | { | 206 | { |
179 | 225 | gint y, bottom, top, height; | 207 | gint y, trough_length, height; |
180 | 226 | 208 | ||
181 | 227 | top = priv->trough.y; | 209 | trough_length = priv->trough.height; |
177 | 228 | bottom = priv->trough.y + priv->trough.height; | ||
178 | 229 | |||
182 | 230 | height = priv->slider.height; | 210 | height = priv->slider.height; |
183 | 231 | 211 | ||
184 | 232 | height = MIN (height, priv->trough.height); | ||
185 | 233 | |||
186 | 234 | y = top; | ||
187 | 235 | |||
188 | 236 | if (gtk_adjustment_get_upper (priv->adjustment) - | 212 | if (gtk_adjustment_get_upper (priv->adjustment) - |
189 | 237 | gtk_adjustment_get_lower (priv->adjustment) - | 213 | gtk_adjustment_get_lower (priv->adjustment) - |
190 | 238 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 214 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
192 | 239 | y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 215 | y = (trough_length - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
193 | 240 | (gtk_adjustment_get_upper (priv->adjustment) - | 216 | (gtk_adjustment_get_upper (priv->adjustment) - |
194 | 241 | gtk_adjustment_get_lower (priv->adjustment) - | 217 | gtk_adjustment_get_lower (priv->adjustment) - |
195 | 242 | gtk_adjustment_get_page_size (priv->adjustment))); | 218 | gtk_adjustment_get_page_size (priv->adjustment))); |
196 | 243 | 219 | ||
198 | 244 | y = CLAMP (y, top, bottom); | 220 | y = CLAMP (y, 0, trough_length); |
199 | 245 | 221 | ||
200 | 246 | priv->slider.y = y; | 222 | priv->slider.y = y; |
201 | 247 | priv->slider.height = height; | 223 | priv->slider.height = height; |
202 | 248 | } | 224 | } |
203 | 249 | else | 225 | else |
204 | 250 | { | 226 | { |
210 | 251 | gint x, left, right, width; | 227 | gint x, trough_length, width; |
211 | 252 | 228 | ||
212 | 253 | left = priv->trough.x; | 229 | trough_length = priv->trough.width; |
208 | 254 | right = priv->trough.x + priv->trough.width; | ||
209 | 255 | |||
213 | 256 | width = priv->slider.width; | 230 | width = priv->slider.width; |
214 | 257 | 231 | ||
215 | 258 | width = MIN (width, priv->trough.width); | ||
216 | 259 | |||
217 | 260 | x = left; | ||
218 | 261 | |||
219 | 262 | if (gtk_adjustment_get_upper (priv->adjustment) - | 232 | if (gtk_adjustment_get_upper (priv->adjustment) - |
220 | 263 | gtk_adjustment_get_lower (priv->adjustment) - | 233 | gtk_adjustment_get_lower (priv->adjustment) - |
221 | 264 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 234 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
223 | 265 | x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 235 | x = (trough_length - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
224 | 266 | (gtk_adjustment_get_upper (priv->adjustment) - | 236 | (gtk_adjustment_get_upper (priv->adjustment) - |
225 | 267 | gtk_adjustment_get_lower (priv->adjustment) - | 237 | gtk_adjustment_get_lower (priv->adjustment) - |
226 | 268 | gtk_adjustment_get_page_size (priv->adjustment))); | 238 | gtk_adjustment_get_page_size (priv->adjustment))); |
227 | 269 | 239 | ||
229 | 270 | x = CLAMP (x, left, right); | 240 | x = CLAMP (x, 0, trough_length); |
230 | 271 | 241 | ||
231 | 272 | priv->slider.x = x; | 242 | priv->slider.x = x; |
232 | 273 | priv->slider.width = width; | 243 | priv->slider.width = width; |
233 | @@ -333,7 +303,7 @@ | |||
234 | 333 | priv = scrollbar->priv; | 303 | priv = scrollbar->priv; |
235 | 334 | 304 | ||
236 | 335 | if (priv->pager != NULL && priv->can_deactivate_pager) | 305 | if (priv->pager != NULL && priv->can_deactivate_pager) |
238 | 336 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 306 | os_pager_set_active (priv->pager, FALSE, TRUE); |
239 | 337 | } | 307 | } |
240 | 338 | 308 | ||
241 | 339 | /* timeout before deactivating the pager */ | 309 | /* timeout before deactivating the pager */ |
242 | @@ -365,7 +335,7 @@ | |||
243 | 365 | if (priv->can_hide) | 335 | if (priv->can_hide) |
244 | 366 | { | 336 | { |
245 | 367 | priv->value_changed_event = FALSE; | 337 | priv->value_changed_event = FALSE; |
247 | 368 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 338 | gtk_widget_hide (priv->thumb); |
248 | 369 | } | 339 | } |
249 | 370 | } | 340 | } |
250 | 371 | 341 | ||
251 | @@ -398,7 +368,7 @@ | |||
252 | 398 | { | 368 | { |
253 | 399 | mask.x = 0; | 369 | mask.x = 0; |
254 | 400 | mask.y = priv->overlay.y; | 370 | mask.y = priv->overlay.y; |
256 | 401 | mask.width = DEFAULT_PAGER_WIDTH; | 371 | mask.width = priv->pager_all.width; |
257 | 402 | mask.height = priv->overlay.height; | 372 | mask.height = priv->overlay.height; |
258 | 403 | } | 373 | } |
259 | 404 | else | 374 | else |
260 | @@ -406,10 +376,10 @@ | |||
261 | 406 | mask.x = priv->overlay.x; | 376 | mask.x = priv->overlay.x; |
262 | 407 | mask.y = 0; | 377 | mask.y = 0; |
263 | 408 | mask.width = priv->overlay.width; | 378 | mask.width = priv->overlay.width; |
265 | 409 | mask.height = DEFAULT_PAGER_WIDTH; | 379 | mask.height = priv->pager_all.height; |
266 | 410 | } | 380 | } |
267 | 411 | 381 | ||
269 | 412 | os_pager_move_resize (OS_PAGER (priv->pager), mask); | 382 | os_pager_move_resize (priv->pager, mask); |
270 | 413 | } | 383 | } |
271 | 414 | 384 | ||
272 | 415 | /* sanitize x coordinate of thumb window */ | 385 | /* sanitize x coordinate of thumb window */ |
273 | @@ -463,7 +433,7 @@ | |||
274 | 463 | 433 | ||
275 | 464 | if (priv->orientation == GTK_ORIENTATION_VERTICAL && | 434 | if (priv->orientation == GTK_ORIENTATION_VERTICAL && |
276 | 465 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x - 1 + priv->slider.width, y) || | 435 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x - 1 + priv->slider.width, y) || |
278 | 466 | (x - 1 + priv->slider.width) >= screen_width)) | 436 | x - 1 + priv->slider.width >= screen_width)) |
279 | 467 | { | 437 | { |
280 | 468 | priv->internal = TRUE; | 438 | priv->internal = TRUE; |
281 | 469 | return MAX (x - priv->slider.width, screen_width - priv->slider.width); | 439 | return MAX (x - priv->slider.width, screen_width - priv->slider.width); |
282 | @@ -526,7 +496,7 @@ | |||
283 | 526 | 496 | ||
284 | 527 | if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && | 497 | if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && |
285 | 528 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x, y - 1 + priv->slider.height) || | 498 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x, y - 1 + priv->slider.height) || |
287 | 529 | (y - 1 + priv->slider.height) >= screen_height)) | 499 | y - 1 + priv->slider.height >= screen_height)) |
288 | 530 | { | 500 | { |
289 | 531 | priv->internal = TRUE; | 501 | priv->internal = TRUE; |
290 | 532 | return MAX (y - priv->slider.height, screen_height - priv->slider.height); | 502 | return MAX (y - priv->slider.height, screen_height - priv->slider.height); |
291 | @@ -707,19 +677,19 @@ | |||
292 | 707 | * hidden a pager that is meant to be hidden/shown. | 677 | * hidden a pager that is meant to be hidden/shown. |
293 | 708 | * I don't want to see pagers reappearing because | 678 | * I don't want to see pagers reappearing because |
294 | 709 | * of a change in the adjustment of an invisible pager or viceversa. */ | 679 | * of a change in the adjustment of an invisible pager or viceversa. */ |
296 | 710 | if ((gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) > | 680 | if (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment) > |
297 | 711 | gtk_adjustment_get_page_size (adjustment)) | 681 | gtk_adjustment_get_page_size (adjustment)) |
298 | 712 | { | 682 | { |
299 | 713 | priv->fullsize = FALSE; | 683 | priv->fullsize = FALSE; |
300 | 714 | if (priv->proximity != FALSE) | 684 | if (priv->proximity != FALSE) |
302 | 715 | os_pager_show (OS_PAGER (priv->pager)); | 685 | os_pager_show (priv->pager); |
303 | 716 | } | 686 | } |
304 | 717 | else | 687 | else |
305 | 718 | { | 688 | { |
306 | 719 | priv->fullsize = TRUE; | 689 | priv->fullsize = TRUE; |
307 | 720 | if (priv->proximity != FALSE) | 690 | if (priv->proximity != FALSE) |
308 | 721 | { | 691 | { |
310 | 722 | os_pager_hide (OS_PAGER (priv->pager)); | 692 | os_pager_hide (priv->pager); |
311 | 723 | 693 | ||
312 | 724 | gtk_widget_hide (priv->thumb); | 694 | gtk_widget_hide (priv->thumb); |
313 | 725 | } | 695 | } |
314 | @@ -729,7 +699,7 @@ | |||
315 | 729 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); | 699 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); |
316 | 730 | 700 | ||
317 | 731 | if (!priv->motion_notify_event && !priv->enter_notify_event) | 701 | if (!priv->motion_notify_event && !priv->enter_notify_event) |
319 | 732 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 702 | gtk_widget_hide (priv->thumb); |
320 | 733 | 703 | ||
321 | 734 | move_pager (scrollbar); | 704 | move_pager (scrollbar); |
322 | 735 | } | 705 | } |
323 | @@ -748,20 +718,20 @@ | |||
324 | 748 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); | 718 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); |
325 | 749 | 719 | ||
326 | 750 | if (!priv->motion_notify_event && !priv->enter_notify_event) | 720 | if (!priv->motion_notify_event && !priv->enter_notify_event) |
328 | 751 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 721 | gtk_widget_hide (priv->thumb); |
329 | 752 | 722 | ||
331 | 753 | if (gtk_widget_get_mapped (GTK_WIDGET (priv->thumb))) | 723 | if (gtk_widget_get_mapped (priv->thumb)) |
332 | 754 | { | 724 | { |
333 | 755 | /* if we're dragging the thumb, it can't be detached. */ | 725 | /* if we're dragging the thumb, it can't be detached. */ |
334 | 756 | if (priv->motion_notify_event) | 726 | if (priv->motion_notify_event) |
335 | 757 | { | 727 | { |
337 | 758 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 728 | os_pager_set_detached (priv->pager, FALSE); |
338 | 759 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 729 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
339 | 760 | } | 730 | } |
340 | 761 | else | 731 | else |
341 | 762 | { | 732 | { |
342 | 763 | gint x_pos, y_pos; | 733 | gint x_pos, y_pos; |
344 | 764 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (priv->thumb)), &x_pos, &y_pos); | 734 | gdk_window_get_origin (gtk_widget_get_window (priv->thumb), &x_pos, &y_pos); |
345 | 765 | 735 | ||
346 | 766 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 736 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
347 | 767 | { | 737 | { |
348 | @@ -771,11 +741,11 @@ | |||
349 | 771 | 741 | ||
350 | 772 | mask.x = 0; | 742 | mask.x = 0; |
351 | 773 | mask.y = y_pos + priv->slider.height / 2 - priv->win_y; | 743 | mask.y = y_pos + priv->slider.height / 2 - priv->win_y; |
353 | 774 | mask.width = DEFAULT_PAGER_WIDTH; | 744 | mask.width = priv->pager_all.width; |
354 | 775 | mask.height = priv->overlay.y - mask.y; | 745 | mask.height = priv->overlay.y - mask.y; |
355 | 776 | 746 | ||
358 | 777 | os_pager_connect (OS_PAGER (priv->pager), mask); | 747 | os_pager_connect (priv->pager, mask); |
359 | 778 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 748 | os_pager_set_detached (priv->pager, TRUE); |
360 | 779 | 749 | ||
361 | 780 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 750 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
362 | 781 | } | 751 | } |
363 | @@ -785,17 +755,17 @@ | |||
364 | 785 | 755 | ||
365 | 786 | mask.x = 0; | 756 | mask.x = 0; |
366 | 787 | mask.y = priv->overlay.y + priv->overlay.height; | 757 | mask.y = priv->overlay.y + priv->overlay.height; |
368 | 788 | mask.width = DEFAULT_PAGER_WIDTH; | 758 | mask.width = priv->pager_all.width; |
369 | 789 | mask.height = y_pos + priv->slider.height / 2 - priv->win_y - mask.y; | 759 | mask.height = y_pos + priv->slider.height / 2 - priv->win_y - mask.y; |
370 | 790 | 760 | ||
373 | 791 | os_pager_connect (OS_PAGER (priv->pager), mask); | 761 | os_pager_connect (priv->pager, mask); |
374 | 792 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 762 | os_pager_set_detached (priv->pager, TRUE); |
375 | 793 | 763 | ||
376 | 794 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 764 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
377 | 795 | } | 765 | } |
378 | 796 | else | 766 | else |
379 | 797 | { | 767 | { |
381 | 798 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 768 | os_pager_set_detached (priv->pager, FALSE); |
382 | 799 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 769 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
383 | 800 | } | 770 | } |
384 | 801 | } | 771 | } |
385 | @@ -808,10 +778,10 @@ | |||
386 | 808 | mask.x = x_pos + priv->slider.width / 2 - priv->win_x; | 778 | mask.x = x_pos + priv->slider.width / 2 - priv->win_x; |
387 | 809 | mask.y = 0; | 779 | mask.y = 0; |
388 | 810 | mask.width = priv->overlay.x - mask.x; | 780 | mask.width = priv->overlay.x - mask.x; |
390 | 811 | mask.height = DEFAULT_PAGER_WIDTH; | 781 | mask.height = priv->pager_all.height; |
391 | 812 | 782 | ||
394 | 813 | os_pager_connect (OS_PAGER (priv->pager), mask); | 783 | os_pager_connect (priv->pager, mask); |
395 | 814 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 784 | os_pager_set_detached (priv->pager, TRUE); |
396 | 815 | 785 | ||
397 | 816 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 786 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
398 | 817 | } | 787 | } |
399 | @@ -822,14 +792,14 @@ | |||
400 | 822 | mask.x = priv->overlay.y + priv->overlay.height; | 792 | mask.x = priv->overlay.y + priv->overlay.height; |
401 | 823 | mask.y = 0; | 793 | mask.y = 0; |
402 | 824 | mask.width = x_pos + priv->slider.width / 2 - priv->win_x - mask.x; | 794 | mask.width = x_pos + priv->slider.width / 2 - priv->win_x - mask.x; |
404 | 825 | mask.height = DEFAULT_PAGER_WIDTH; | 795 | mask.height = priv->pager_all.height; |
405 | 826 | 796 | ||
408 | 827 | os_pager_connect (OS_PAGER (priv->pager), mask); | 797 | os_pager_connect (priv->pager, mask); |
409 | 828 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 798 | os_pager_set_detached (priv->pager, TRUE); |
410 | 829 | } | 799 | } |
411 | 830 | else | 800 | else |
412 | 831 | { | 801 | { |
414 | 832 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 802 | os_pager_set_detached (priv->pager, FALSE); |
415 | 833 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 803 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
416 | 834 | } | 804 | } |
417 | 835 | } | 805 | } |
418 | @@ -860,12 +830,12 @@ | |||
419 | 860 | (y > allocation.y && y < allocation.y + allocation.height)) | 830 | (y > allocation.y && y < allocation.y + allocation.height)) |
420 | 861 | { | 831 | { |
421 | 862 | priv->can_deactivate_pager = FALSE; | 832 | priv->can_deactivate_pager = FALSE; |
423 | 863 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 833 | os_pager_set_active (priv->pager, TRUE, TRUE); |
424 | 864 | } | 834 | } |
425 | 865 | else | 835 | else |
426 | 866 | { | 836 | { |
427 | 867 | priv->can_deactivate_pager = TRUE; | 837 | priv->can_deactivate_pager = TRUE; |
429 | 868 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 838 | os_pager_set_active (priv->pager, FALSE, TRUE); |
430 | 869 | } | 839 | } |
431 | 870 | } | 840 | } |
432 | 871 | 841 | ||
433 | @@ -899,7 +869,7 @@ | |||
434 | 899 | priv->active_window = TRUE; | 869 | priv->active_window = TRUE; |
435 | 900 | 870 | ||
436 | 901 | priv->can_deactivate_pager = FALSE; | 871 | priv->can_deactivate_pager = FALSE; |
438 | 902 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 872 | os_pager_set_active (priv->pager, TRUE, TRUE); |
439 | 903 | } | 873 | } |
440 | 904 | else if (priv->active_window) | 874 | else if (priv->active_window) |
441 | 905 | { | 875 | { |
442 | @@ -938,7 +908,7 @@ | |||
443 | 938 | { | 908 | { |
444 | 939 | /* if the pointer is outside of the window, set it inactive. */ | 909 | /* if the pointer is outside of the window, set it inactive. */ |
445 | 940 | priv->can_deactivate_pager = TRUE; | 910 | priv->can_deactivate_pager = TRUE; |
447 | 941 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 911 | os_pager_set_active (priv->pager, FALSE, TRUE); |
448 | 942 | } | 912 | } |
449 | 943 | 913 | ||
450 | 944 | if ((current_time > end_time) && priv->thumb != NULL) | 914 | if ((current_time > end_time) && priv->thumb != NULL) |
451 | @@ -1196,7 +1166,7 @@ | |||
452 | 1196 | 1166 | ||
453 | 1197 | /* immediately set the pager to be active. */ | 1167 | /* immediately set the pager to be active. */ |
454 | 1198 | priv->can_deactivate_pager = FALSE; | 1168 | priv->can_deactivate_pager = FALSE; |
456 | 1199 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, FALSE); | 1169 | os_pager_set_active (priv->pager, TRUE, FALSE); |
457 | 1200 | 1170 | ||
458 | 1201 | xid = GDK_WINDOW_XID (gtk_widget_get_window (widget)); | 1171 | xid = GDK_WINDOW_XID (gtk_widget_get_window (widget)); |
459 | 1202 | xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar))); | 1172 | xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar))); |
460 | @@ -1267,7 +1237,6 @@ | |||
461 | 1267 | gdouble frac; | 1237 | gdouble frac; |
462 | 1268 | gdouble value; | 1238 | gdouble value; |
463 | 1269 | gint trough_length; | 1239 | gint trough_length; |
464 | 1270 | gint trough_start; | ||
465 | 1271 | gint slider_length; | 1240 | gint slider_length; |
466 | 1272 | 1241 | ||
467 | 1273 | priv = scrollbar->priv; | 1242 | priv = scrollbar->priv; |
468 | @@ -1275,21 +1244,18 @@ | |||
469 | 1275 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1244 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
470 | 1276 | { | 1245 | { |
471 | 1277 | trough_length = priv->trough.height; | 1246 | trough_length = priv->trough.height; |
472 | 1278 | trough_start = priv->trough.y; | ||
473 | 1279 | slider_length = MAX (priv->slider.height, priv->overlay.height); | 1247 | slider_length = MAX (priv->slider.height, priv->overlay.height); |
474 | 1280 | } | 1248 | } |
475 | 1281 | else | 1249 | else |
476 | 1282 | { | 1250 | { |
477 | 1283 | trough_length = priv->trough.width; | 1251 | trough_length = priv->trough.width; |
478 | 1284 | trough_start = priv->trough.y; | ||
479 | 1285 | slider_length = MAX (priv->slider.width, priv->overlay.width); | 1252 | slider_length = MAX (priv->slider.width, priv->overlay.width); |
480 | 1286 | } | 1253 | } |
481 | 1287 | 1254 | ||
482 | 1288 | if (trough_length == slider_length) | 1255 | if (trough_length == slider_length) |
483 | 1289 | frac = 1.0; | 1256 | frac = 1.0; |
484 | 1290 | else | 1257 | else |
487 | 1291 | frac = (MAX (0, coord - trough_start) / | 1258 | frac = (MAX (0, coord) / (gdouble) (trough_length - slider_length)); |
486 | 1292 | (gdouble) (trough_length - slider_length)); | ||
488 | 1293 | 1259 | ||
489 | 1294 | value = gtk_adjustment_get_lower (priv->adjustment) + frac * (gtk_adjustment_get_upper (priv->adjustment) - | 1260 | value = gtk_adjustment_get_lower (priv->adjustment) + frac * (gtk_adjustment_get_upper (priv->adjustment) - |
490 | 1295 | gtk_adjustment_get_lower (priv->adjustment) - | 1261 | gtk_adjustment_get_lower (priv->adjustment) - |
491 | @@ -1357,7 +1323,7 @@ | |||
492 | 1357 | } | 1323 | } |
493 | 1358 | 1324 | ||
494 | 1359 | /* FIXME(Cimi) seems useless. */ | 1325 | /* FIXME(Cimi) seems useless. */ |
496 | 1360 | capture_movement (scrollbar, event->x_root, event->y_root); | 1326 | // capture_movement (scrollbar, event->x_root, event->y_root); |
497 | 1361 | priv->value_changed_event = FALSE; | 1327 | priv->value_changed_event = FALSE; |
498 | 1362 | } | 1328 | } |
499 | 1363 | 1329 | ||
500 | @@ -1379,9 +1345,9 @@ | |||
501 | 1379 | priv->slide_initial_slider_position = 0; | 1345 | priv->slide_initial_slider_position = 0; |
502 | 1380 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); | 1346 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); |
503 | 1381 | } | 1347 | } |
505 | 1382 | else if (priv->overlay.y + priv->overlay.height >= priv->trough.y + priv->trough.height) | 1348 | else if (priv->overlay.y + priv->overlay.height >= priv->trough.height) |
506 | 1383 | { | 1349 | { |
508 | 1384 | priv->slide_initial_slider_position = priv->trough.y + priv->trough.height - priv->overlay.height; | 1350 | priv->slide_initial_slider_position = priv->trough.height - priv->overlay.height; |
509 | 1385 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); | 1351 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); |
510 | 1386 | } | 1352 | } |
511 | 1387 | } | 1353 | } |
512 | @@ -1405,9 +1371,9 @@ | |||
513 | 1405 | priv->slide_initial_slider_position = 0; | 1371 | priv->slide_initial_slider_position = 0; |
514 | 1406 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); | 1372 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); |
515 | 1407 | } | 1373 | } |
517 | 1408 | else if (priv->overlay.x + priv->overlay.width >= priv->trough.x + priv->trough.width) | 1374 | else if (priv->overlay.x + priv->overlay.width >= priv->trough.width) |
518 | 1409 | { | 1375 | { |
520 | 1410 | priv->slide_initial_slider_position = priv->trough.x + priv->trough.width - priv->overlay.width; | 1376 | priv->slide_initial_slider_position = priv->trough.width - priv->overlay.width; |
521 | 1411 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); | 1377 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); |
522 | 1412 | } | 1378 | } |
523 | 1413 | } | 1379 | } |
524 | @@ -1482,7 +1448,7 @@ | |||
525 | 1482 | priv->motion_notify_event = FALSE; | 1448 | priv->motion_notify_event = FALSE; |
526 | 1483 | priv->enter_notify_event = FALSE; | 1449 | priv->enter_notify_event = FALSE; |
527 | 1484 | 1450 | ||
529 | 1485 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1451 | os_pager_set_detached (priv->pager, FALSE); |
530 | 1486 | } | 1452 | } |
531 | 1487 | 1453 | ||
532 | 1488 | /* toplevel functions */ | 1454 | /* toplevel functions */ |
533 | @@ -1492,24 +1458,16 @@ | |||
534 | 1492 | store_toplevel_position (OsScrollbar *scrollbar) | 1458 | store_toplevel_position (OsScrollbar *scrollbar) |
535 | 1493 | { | 1459 | { |
536 | 1494 | OsScrollbarPrivate *priv; | 1460 | OsScrollbarPrivate *priv; |
538 | 1495 | gint win_x, win_y; | 1461 | gint x_pos, y_pos; |
539 | 1496 | 1462 | ||
540 | 1497 | priv = scrollbar->priv; | 1463 | priv = scrollbar->priv; |
541 | 1498 | 1464 | ||
542 | 1499 | /* In reality, I'm storing widget's window, not the toplevel. | 1465 | /* In reality, I'm storing widget's window, not the toplevel. |
543 | 1500 | * Is that the same with gdk_window_get_origin? */ | 1466 | * Is that the same with gdk_window_get_origin? */ |
545 | 1501 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (scrollbar)), &win_x, &win_y); | 1467 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (scrollbar)), &x_pos, &y_pos); |
546 | 1502 | 1468 | ||
557 | 1503 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1469 | priv->win_x = x_pos + priv->thumb_all.x; |
558 | 1504 | { | 1470 | priv->win_y = y_pos + priv->thumb_all.y; |
549 | 1505 | priv->win_x = win_x + priv->thumb_all.x; | ||
550 | 1506 | priv->win_y = win_y + priv->thumb_all.y; | ||
551 | 1507 | } | ||
552 | 1508 | else | ||
553 | 1509 | { | ||
554 | 1510 | priv->win_x = win_x + priv->thumb_all.x; | ||
555 | 1511 | priv->win_y = win_y + priv->thumb_all.y; | ||
556 | 1512 | } | ||
559 | 1513 | } | 1471 | } |
560 | 1514 | 1472 | ||
561 | 1515 | static gboolean | 1473 | static gboolean |
562 | @@ -1560,12 +1518,12 @@ | |||
563 | 1560 | else | 1518 | else |
564 | 1561 | { | 1519 | { |
565 | 1562 | priv->can_deactivate_pager = FALSE; | 1520 | priv->can_deactivate_pager = FALSE; |
567 | 1563 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 1521 | os_pager_set_active (priv->pager, TRUE, TRUE); |
568 | 1564 | } | 1522 | } |
569 | 1565 | } | 1523 | } |
570 | 1566 | 1524 | ||
571 | 1567 | if (current_time > end_time) | 1525 | if (current_time > end_time) |
573 | 1568 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 1526 | gtk_widget_hide (priv->thumb); |
574 | 1569 | 1527 | ||
575 | 1570 | priv->lock_position = FALSE; | 1528 | priv->lock_position = FALSE; |
576 | 1571 | 1529 | ||
577 | @@ -1619,10 +1577,10 @@ | |||
578 | 1619 | /* proximity area */ | 1577 | /* proximity area */ |
579 | 1620 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1578 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
580 | 1621 | { | 1579 | { |
585 | 1622 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH && | 1580 | if ((xiev->event_x >= priv->pager_all.x + priv->pager_all.width - PROXIMITY_SIZE && |
586 | 1623 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) && | 1581 | xiev->event_x <= priv->pager_all.x + priv->pager_all.width) && |
587 | 1624 | (xiev->event_y >= priv->overlay_all.y + priv->overlay.y && | 1582 | (xiev->event_y >= priv->pager_all.y + priv->overlay.y && |
588 | 1625 | xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | 1583 | xiev->event_y <= priv->pager_all.y + priv->overlay.y + priv->overlay.height)) |
589 | 1626 | { | 1584 | { |
590 | 1627 | priv->can_hide = FALSE; | 1585 | priv->can_hide = FALSE; |
591 | 1628 | 1586 | ||
592 | @@ -1647,15 +1605,15 @@ | |||
593 | 1647 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1605 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
594 | 1648 | } | 1606 | } |
595 | 1649 | 1607 | ||
597 | 1650 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1608 | gtk_widget_show (priv->thumb); |
598 | 1651 | } | 1609 | } |
599 | 1652 | } | 1610 | } |
600 | 1653 | else | 1611 | else |
601 | 1654 | { | 1612 | { |
606 | 1655 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH && | 1613 | if ((xiev->event_y >= priv->pager_all.y + priv->pager_all.height - PROXIMITY_SIZE && |
607 | 1656 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) && | 1614 | xiev->event_y <= priv->pager_all.y + priv->pager_all.height) && |
608 | 1657 | (xiev->event_x >= priv->overlay_all.x + priv->overlay.x && | 1615 | (xiev->event_x >= priv->pager_all.x + priv->overlay.x && |
609 | 1658 | xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | 1616 | xiev->event_x <= priv->pager_all.x + priv->overlay.x + priv->overlay.width)) |
610 | 1659 | { | 1617 | { |
611 | 1660 | priv->can_hide = FALSE; | 1618 | priv->can_hide = FALSE; |
612 | 1661 | 1619 | ||
613 | @@ -1680,7 +1638,7 @@ | |||
614 | 1680 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1638 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
615 | 1681 | } | 1639 | } |
616 | 1682 | 1640 | ||
618 | 1683 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1641 | gtk_widget_show (priv->thumb); |
619 | 1684 | } | 1642 | } |
620 | 1685 | } | 1643 | } |
621 | 1686 | } | 1644 | } |
622 | @@ -1746,10 +1704,10 @@ | |||
623 | 1746 | /* proximity area */ | 1704 | /* proximity area */ |
624 | 1747 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1705 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
625 | 1748 | { | 1706 | { |
630 | 1749 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH && | 1707 | if ((xiev->event_x >= priv->pager_all.x + priv->pager_all.width - PROXIMITY_SIZE && |
631 | 1750 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) && | 1708 | xiev->event_x <= priv->pager_all.x + priv->pager_all.width) && |
632 | 1751 | (xiev->event_y >= priv->overlay_all.y + priv->overlay.y && | 1709 | (xiev->event_y >= priv->pager_all.y + priv->overlay.y && |
633 | 1752 | xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | 1710 | xiev->event_y <= priv->pager_all.y + priv->overlay.y + priv->overlay.height)) |
634 | 1753 | { | 1711 | { |
635 | 1754 | priv->can_hide = FALSE; | 1712 | priv->can_hide = FALSE; |
636 | 1755 | 1713 | ||
637 | @@ -1774,9 +1732,9 @@ | |||
638 | 1774 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1732 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
639 | 1775 | } | 1733 | } |
640 | 1776 | 1734 | ||
642 | 1777 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1735 | os_pager_set_detached (priv->pager, FALSE); |
643 | 1778 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 1736 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
645 | 1779 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1737 | gtk_widget_show (priv->thumb); |
646 | 1780 | } | 1738 | } |
647 | 1781 | else | 1739 | else |
648 | 1782 | { | 1740 | { |
649 | @@ -1787,10 +1745,10 @@ | |||
650 | 1787 | } | 1745 | } |
651 | 1788 | else | 1746 | else |
652 | 1789 | { | 1747 | { |
657 | 1790 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH && | 1748 | if ((xiev->event_y >= priv->pager_all.y + priv->pager_all.height - PROXIMITY_SIZE && |
658 | 1791 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) && | 1749 | xiev->event_y <= priv->pager_all.y + priv->pager_all.height) && |
659 | 1792 | (xiev->event_x >= priv->overlay_all.x + priv->overlay.x && | 1750 | (xiev->event_x >= priv->pager_all.x + priv->overlay.x && |
660 | 1793 | xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | 1751 | xiev->event_x <= priv->pager_all.x + priv->overlay.x + priv->overlay.width)) |
661 | 1794 | { | 1752 | { |
662 | 1795 | priv->can_hide = FALSE; | 1753 | priv->can_hide = FALSE; |
663 | 1796 | 1754 | ||
664 | @@ -1815,9 +1773,9 @@ | |||
665 | 1815 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); | 1773 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); |
666 | 1816 | } | 1774 | } |
667 | 1817 | 1775 | ||
669 | 1818 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1776 | os_pager_set_detached (priv->pager, FALSE); |
670 | 1819 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 1777 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
672 | 1820 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1778 | gtk_widget_show (priv->thumb); |
673 | 1821 | } | 1779 | } |
674 | 1822 | else | 1780 | else |
675 | 1823 | { | 1781 | { |
676 | @@ -1867,10 +1825,10 @@ | |||
677 | 1867 | /* proximity area */ | 1825 | /* proximity area */ |
678 | 1868 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1826 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
679 | 1869 | { | 1827 | { |
684 | 1870 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x <= PROXIMITY_WIDTH && | 1828 | if ((xev->xbutton.x >= priv->pager_all.x + priv->pager_all.width - PROXIMITY_SIZE && |
685 | 1871 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x >= 0) && | 1829 | xev->xbutton.x <= priv->pager_all.x + priv->pager_all.width) && |
686 | 1872 | (xev->xbutton.y >= priv->overlay_all.y + priv->overlay.y && | 1830 | (xev->xbutton.y >= priv->pager_all.y + priv->overlay.y && |
687 | 1873 | xev->xbutton.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | 1831 | xev->xbutton.y <= priv->pager_all.y + priv->overlay.y + priv->overlay.height)) |
688 | 1874 | { | 1832 | { |
689 | 1875 | priv->can_hide = FALSE; | 1833 | priv->can_hide = FALSE; |
690 | 1876 | 1834 | ||
691 | @@ -1895,15 +1853,15 @@ | |||
692 | 1895 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1853 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
693 | 1896 | } | 1854 | } |
694 | 1897 | 1855 | ||
696 | 1898 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1856 | gtk_widget_show (priv->thumb); |
697 | 1899 | } | 1857 | } |
698 | 1900 | } | 1858 | } |
699 | 1901 | else | 1859 | else |
700 | 1902 | { | 1860 | { |
705 | 1903 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y <= PROXIMITY_WIDTH && | 1861 | if ((xev->xbutton.y >= priv->pager_all.y + priv->pager_all.height - PROXIMITY_SIZE && |
706 | 1904 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y >= 0) && | 1862 | xev->xbutton.y <= priv->pager_all.y + priv->pager_all.height) && |
707 | 1905 | (xev->xbutton.x >= priv->overlay_all.x + priv->overlay.x && | 1863 | (xev->xbutton.x >= priv->pager_all.x + priv->overlay.x && |
708 | 1906 | xev->xbutton.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | 1864 | xev->xbutton.x <= priv->pager_all.x + priv->overlay.x + priv->overlay.width)) |
709 | 1907 | { | 1865 | { |
710 | 1908 | priv->can_hide = FALSE; | 1866 | priv->can_hide = FALSE; |
711 | 1909 | 1867 | ||
712 | @@ -1928,7 +1886,7 @@ | |||
713 | 1928 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1886 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
714 | 1929 | } | 1887 | } |
715 | 1930 | 1888 | ||
717 | 1931 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1889 | gtk_widget_show (priv->thumb); |
718 | 1932 | } | 1890 | } |
719 | 1933 | } | 1891 | } |
720 | 1934 | } | 1892 | } |
721 | @@ -1991,10 +1949,10 @@ | |||
722 | 1991 | /* proximity area */ | 1949 | /* proximity area */ |
723 | 1992 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1950 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
724 | 1993 | { | 1951 | { |
729 | 1994 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x <= PROXIMITY_WIDTH && | 1952 | if ((xev->xmotion.x >= priv->pager_all.x + priv->pager_all.width - PROXIMITY_SIZE && |
730 | 1995 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x >= 0) && | 1953 | xev->xmotion.x <= priv->pager_all.x + priv->pager_all.width) && |
731 | 1996 | (xev->xmotion.y >= priv->overlay_all.y + priv->overlay.y && | 1954 | (xev->xmotion.y >= priv->pager_all.y + priv->overlay.y && |
732 | 1997 | xev->xmotion.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | 1955 | xev->xmotion.y <= priv->pager_all.y + priv->overlay.y + priv->overlay.height)) |
733 | 1998 | { | 1956 | { |
734 | 1999 | priv->can_hide = FALSE; | 1957 | priv->can_hide = FALSE; |
735 | 2000 | 1958 | ||
736 | @@ -2019,9 +1977,9 @@ | |||
737 | 2019 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1977 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
738 | 2020 | } | 1978 | } |
739 | 2021 | 1979 | ||
741 | 2022 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1980 | os_pager_set_detached (priv->pager, FALSE); |
742 | 2023 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 1981 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
744 | 2024 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1982 | gtk_widget_show (priv->thumb); |
745 | 2025 | } | 1983 | } |
746 | 2026 | else | 1984 | else |
747 | 2027 | { | 1985 | { |
748 | @@ -2032,10 +1990,10 @@ | |||
749 | 2032 | } | 1990 | } |
750 | 2033 | else | 1991 | else |
751 | 2034 | { | 1992 | { |
756 | 2035 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y <= PROXIMITY_WIDTH && | 1993 | if ((xev->xmotion.y >= priv->pager_all.y + priv->pager_all.height - PROXIMITY_SIZE && |
757 | 2036 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y >= 0) && | 1994 | xev->xmotion.y <= priv->pager_all.y + priv->pager_all.height) && |
758 | 2037 | (xev->xmotion.x >= priv->overlay_all.x + priv->overlay.x && | 1995 | (xev->xmotion.x >= priv->pager_all.x + priv->overlay.x && |
759 | 2038 | xev->xmotion.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | 1996 | xev->xmotion.x <= priv->pager_all.x + priv->overlay.x + priv->overlay.width)) |
760 | 2039 | { | 1997 | { |
761 | 2040 | priv->can_hide = FALSE; | 1998 | priv->can_hide = FALSE; |
762 | 2041 | 1999 | ||
763 | @@ -2060,9 +2018,9 @@ | |||
764 | 2060 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); | 2018 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); |
765 | 2061 | } | 2019 | } |
766 | 2062 | 2020 | ||
768 | 2063 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 2021 | os_pager_set_detached (priv->pager, FALSE); |
769 | 2064 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 2022 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
771 | 2065 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 2023 | gtk_widget_show (priv->thumb); |
772 | 2066 | } | 2024 | } |
773 | 2067 | else | 2025 | else |
774 | 2068 | { | 2026 | { |
775 | @@ -2347,11 +2305,11 @@ | |||
776 | 2347 | /* on map-event of an active window, | 2305 | /* on map-event of an active window, |
777 | 2348 | * the pager should be active. */ | 2306 | * the pager should be active. */ |
778 | 2349 | priv->can_deactivate_pager = FALSE; | 2307 | priv->can_deactivate_pager = FALSE; |
780 | 2350 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, FALSE); | 2308 | os_pager_set_active (priv->pager, TRUE, FALSE); |
781 | 2351 | } | 2309 | } |
782 | 2352 | 2310 | ||
783 | 2353 | if (priv->fullsize == FALSE) | 2311 | if (priv->fullsize == FALSE) |
785 | 2354 | os_pager_show (OS_PAGER (priv->pager)); | 2312 | os_pager_show (priv->pager); |
786 | 2355 | 2313 | ||
787 | 2356 | if (gtk_widget_get_realized (widget) && priv->filter == FALSE) | 2314 | if (gtk_widget_get_realized (widget) && priv->filter == FALSE) |
788 | 2357 | { | 2315 | { |
789 | @@ -2388,7 +2346,7 @@ | |||
790 | 2388 | 2346 | ||
791 | 2389 | calc_layout_pager (scrollbar, gtk_adjustment_get_value (priv->adjustment)); | 2347 | calc_layout_pager (scrollbar, gtk_adjustment_get_value (priv->adjustment)); |
792 | 2390 | 2348 | ||
794 | 2391 | os_pager_set_parent (OS_PAGER (priv->pager), widget); | 2349 | os_pager_set_parent (priv->pager, widget); |
795 | 2392 | 2350 | ||
796 | 2393 | store_toplevel_position (scrollbar); | 2351 | store_toplevel_position (scrollbar); |
797 | 2394 | } | 2352 | } |
798 | @@ -2403,46 +2361,43 @@ | |||
799 | 2403 | os_scrollbar_size_allocate (GtkWidget *widget, | 2361 | os_scrollbar_size_allocate (GtkWidget *widget, |
800 | 2404 | GdkRectangle *allocation) | 2362 | GdkRectangle *allocation) |
801 | 2405 | { | 2363 | { |
802 | 2406 | GdkRectangle rect; | ||
803 | 2407 | OsScrollbar *scrollbar; | 2364 | OsScrollbar *scrollbar; |
804 | 2408 | OsScrollbarPrivate *priv; | 2365 | OsScrollbarPrivate *priv; |
805 | 2409 | 2366 | ||
806 | 2410 | scrollbar = OS_SCROLLBAR (widget); | 2367 | scrollbar = OS_SCROLLBAR (widget); |
807 | 2411 | priv = scrollbar->priv; | 2368 | priv = scrollbar->priv; |
808 | 2412 | 2369 | ||
811 | 2413 | priv->trough.x = 0; | 2370 | priv->trough.x = allocation->x; |
812 | 2414 | priv->trough.y = 0; | 2371 | priv->trough.y = allocation->y; |
813 | 2415 | priv->trough.width = allocation->width; | 2372 | priv->trough.width = allocation->width; |
814 | 2416 | priv->trough.height = allocation->height; | 2373 | priv->trough.height = allocation->height; |
815 | 2417 | 2374 | ||
817 | 2418 | priv->overlay_all = *allocation; | 2375 | priv->pager_all = *allocation; |
818 | 2419 | priv->thumb_all = *allocation; | 2376 | priv->thumb_all = *allocation; |
819 | 2420 | 2377 | ||
820 | 2421 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 2378 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
821 | 2422 | { | 2379 | { |
825 | 2423 | priv->slider.width = DEFAULT_THUMB_WIDTH; | 2380 | priv->slider.width = THUMB_WIDTH; |
826 | 2424 | priv->slider.height = DEFAULT_THUMB_HEIGHT; | 2381 | priv->slider.height = THUMB_HEIGHT; |
827 | 2425 | priv->overlay_all.x = allocation->x - DEFAULT_PAGER_WIDTH; | 2382 | |
828 | 2383 | priv->pager_all.x = allocation->x - PAGER_SIZE; | ||
829 | 2384 | priv->pager_all.width = PAGER_SIZE; | ||
830 | 2385 | |||
831 | 2426 | priv->thumb_all.x = allocation->x + THUMB_ALLOCATION_SHIFT; | 2386 | priv->thumb_all.x = allocation->x + THUMB_ALLOCATION_SHIFT; |
837 | 2427 | 2387 | priv->thumb_all.width = THUMB_WIDTH; | |
833 | 2428 | rect.x = priv->overlay_all.x; | ||
834 | 2429 | rect.y = priv->overlay_all.y; | ||
835 | 2430 | rect.width = DEFAULT_PAGER_WIDTH; | ||
836 | 2431 | rect.height = priv->overlay_all.height; | ||
838 | 2432 | 2388 | ||
839 | 2433 | allocation->width = 0; | 2389 | allocation->width = 0; |
840 | 2434 | } | 2390 | } |
841 | 2435 | else | 2391 | else |
842 | 2436 | { | 2392 | { |
846 | 2437 | priv->slider.width = DEFAULT_THUMB_HEIGHT; | 2393 | priv->slider.width = THUMB_HEIGHT; |
847 | 2438 | priv->slider.height = DEFAULT_THUMB_WIDTH; | 2394 | priv->slider.height = THUMB_WIDTH; |
848 | 2439 | priv->overlay_all.y = allocation->y - DEFAULT_PAGER_WIDTH; | 2395 | |
849 | 2396 | priv->pager_all.y = allocation->y - PAGER_SIZE; | ||
850 | 2397 | priv->pager_all.height = PAGER_SIZE; | ||
851 | 2398 | |||
852 | 2440 | priv->thumb_all.y = allocation->y + THUMB_ALLOCATION_SHIFT; | 2399 | priv->thumb_all.y = allocation->y + THUMB_ALLOCATION_SHIFT; |
858 | 2441 | 2400 | priv->thumb_all.height = THUMB_HEIGHT; | |
854 | 2442 | rect.x = priv->overlay_all.x; | ||
855 | 2443 | rect.y = priv->overlay_all.y; | ||
856 | 2444 | rect.width = priv->overlay_all.width; | ||
857 | 2445 | rect.height = DEFAULT_PAGER_WIDTH; | ||
859 | 2446 | 2401 | ||
860 | 2447 | allocation->height = 0; | 2402 | allocation->height = 0; |
861 | 2448 | } | 2403 | } |
862 | @@ -2453,7 +2408,7 @@ | |||
863 | 2453 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (priv->adjustment)); | 2408 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (priv->adjustment)); |
864 | 2454 | } | 2409 | } |
865 | 2455 | 2410 | ||
867 | 2456 | os_pager_size_allocate (OS_PAGER (priv->pager), rect); | 2411 | os_pager_size_allocate (priv->pager, priv->pager_all); |
868 | 2457 | 2412 | ||
869 | 2458 | move_pager (scrollbar); | 2413 | move_pager (scrollbar); |
870 | 2459 | 2414 | ||
871 | @@ -2496,7 +2451,7 @@ | |||
872 | 2496 | 2451 | ||
873 | 2497 | priv->proximity = FALSE; | 2452 | priv->proximity = FALSE; |
874 | 2498 | 2453 | ||
876 | 2499 | os_pager_hide (OS_PAGER (priv->pager)); | 2454 | os_pager_hide (priv->pager); |
877 | 2500 | 2455 | ||
878 | 2501 | gtk_widget_hide (priv->thumb); | 2456 | gtk_widget_hide (priv->thumb); |
879 | 2502 | 2457 | ||
880 | @@ -2517,7 +2472,7 @@ | |||
881 | 2517 | scrollbar = OS_SCROLLBAR (widget); | 2472 | scrollbar = OS_SCROLLBAR (widget); |
882 | 2518 | priv = scrollbar->priv; | 2473 | priv = scrollbar->priv; |
883 | 2519 | 2474 | ||
885 | 2520 | os_pager_hide (OS_PAGER (priv->pager)); | 2475 | os_pager_hide (priv->pager); |
886 | 2521 | 2476 | ||
887 | 2522 | gtk_widget_hide (priv->thumb); | 2477 | gtk_widget_hide (priv->thumb); |
888 | 2523 | 2478 | ||
889 | @@ -2527,7 +2482,7 @@ | |||
890 | 2527 | g_signal_handlers_disconnect_by_func (G_OBJECT (gtk_widget_get_toplevel (widget)), | 2482 | g_signal_handlers_disconnect_by_func (G_OBJECT (gtk_widget_get_toplevel (widget)), |
891 | 2528 | G_CALLBACK (toplevel_configure_event_cb), scrollbar); | 2483 | G_CALLBACK (toplevel_configure_event_cb), scrollbar); |
892 | 2529 | 2484 | ||
894 | 2530 | os_pager_set_parent (OS_PAGER (priv->pager), NULL); | 2485 | os_pager_set_parent (priv->pager, NULL); |
895 | 2531 | 2486 | ||
896 | 2532 | window_group_list = gtk_window_group_list_windows (priv->window_group); | 2487 | window_group_list = gtk_window_group_list_windows (priv->window_group); |
897 | 2533 | 2488 | ||
898 | 2534 | 2489 | ||
899 | === modified file 'os/os-thumb.c' | |||
900 | --- os/os-thumb.c 2011-06-09 11:19:20 +0000 | |||
901 | +++ os/os-thumb.c 2011-06-15 12:09:58 +0000 | |||
902 | @@ -828,15 +828,9 @@ | |||
903 | 828 | { | 828 | { |
904 | 829 | priv->orientation = g_value_get_enum (value); | 829 | priv->orientation = g_value_get_enum (value); |
905 | 830 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 830 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
910 | 831 | { | 831 | gtk_window_resize (GTK_WINDOW (object), THUMB_WIDTH, THUMB_HEIGHT); |
907 | 832 | gtk_window_resize (GTK_WINDOW (object), DEFAULT_THUMB_WIDTH, | ||
908 | 833 | DEFAULT_THUMB_HEIGHT); | ||
909 | 834 | } | ||
911 | 835 | else | 832 | else |
916 | 836 | { | 833 | gtk_window_resize (GTK_WINDOW (object), THUMB_HEIGHT, THUMB_WIDTH); |
913 | 837 | gtk_window_resize (GTK_WINDOW (object), DEFAULT_THUMB_HEIGHT, | ||
914 | 838 | DEFAULT_THUMB_WIDTH); | ||
915 | 839 | } | ||
917 | 840 | break; | 834 | break; |
918 | 841 | } | 835 | } |
919 | 842 | 836 |
Hard patch to read, but I can't see anything odd.