Merge lp:~cimi/overlay-scrollbar/tolerance-pageupdown into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Approved by: Ted Gould
Approved revision: 270
Merged at revision: 271
Proposed branch: lp:~cimi/overlay-scrollbar/tolerance-pageupdown
Merge into: lp:overlay-scrollbar
Diff against target: 55 lines (+10/-3)
2 files modified
os/os-scrollbar.c (+9/-2)
os/os-thumb.c (+1/-1)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/tolerance-pageupdown
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+66210@code.launchpad.net

Description of the change

See comment

To post a comment you must log in.
270. By Andrea Cimitan

Added comment

Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'os/os-scrollbar.c'
2--- os/os-scrollbar.c 2011-06-28 18:23:27 +0000
3+++ os/os-scrollbar.c 2011-06-28 21:57:31 +0000
4@@ -31,6 +31,7 @@
5 #include <X11/Xutil.h>
6 #include <X11/extensions/XInput2.h>
7 #include "math.h"
8+#include <stdlib.h>
9
10 /* Size of the pager in pixels. */
11 #define PAGER_SIZE 3
12@@ -53,6 +54,9 @@
13 /* Timeout before hiding in ms, after leaving the toplevel. */
14 #define TIMEOUT_TOPLEVEL_HIDE 200
15
16+/* Number of tolerance pixels on pageup/down, while intercepting a motion-notify-event. */
17+#define TOLERANCE_PIXELS 2
18+
19 typedef enum
20 {
21 OS_SIDE_TOP,
22@@ -1350,6 +1354,11 @@
23 /* reconnect slider and overlay after key press */
24 if (priv->value_changed_event)
25 {
26+ /* return if the mouse movement is small. */
27+ if (abs (priv->pointer_x - event->x) <= TOLERANCE_PIXELS &&
28+ abs (priv->pointer_y - event->y) <= TOLERANCE_PIXELS)
29+ return FALSE;
30+
31 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
32 {
33 priv->slide_initial_slider_position = event->y_root - priv->win_y - event->y;
34@@ -1361,8 +1370,6 @@
35 priv->slide_initial_coordinate = event->x_root;
36 }
37
38- /* FIXME(Cimi) seems useless. */
39-// capture_movement (scrollbar, event->x_root, event->y_root);
40 priv->value_changed_event = FALSE;
41 }
42
43
44=== modified file 'os/os-thumb.c'
45--- os/os-thumb.c 2011-06-27 17:03:25 +0000
46+++ os/os-thumb.c 2011-06-28 21:57:31 +0000
47@@ -37,7 +37,7 @@
48 /* Timeout before the fade-out. */
49 #define TIMEOUT_FADE_OUT 250
50
51-/* Number of tolerance pixels. */
52+/* Number of tolerance pixels, before hiding the thumb. */
53 #define TOLERANCE_PIXELS 3
54
55 /* Thumb radius in pixels (higher values are automatically clamped). */

Subscribers

People subscribed via source and target branches