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
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2011-06-28 18:23:27 +0000
+++ os/os-scrollbar.c 2011-06-28 21:57:31 +0000
@@ -31,6 +31,7 @@
31#include <X11/Xutil.h>31#include <X11/Xutil.h>
32#include <X11/extensions/XInput2.h>32#include <X11/extensions/XInput2.h>
33#include "math.h"33#include "math.h"
34#include <stdlib.h>
3435
35/* Size of the pager in pixels. */36/* Size of the pager in pixels. */
36#define PAGER_SIZE 337#define PAGER_SIZE 3
@@ -53,6 +54,9 @@
53/* Timeout before hiding in ms, after leaving the toplevel. */54/* Timeout before hiding in ms, after leaving the toplevel. */
54#define TIMEOUT_TOPLEVEL_HIDE 20055#define TIMEOUT_TOPLEVEL_HIDE 200
5556
57/* Number of tolerance pixels on pageup/down, while intercepting a motion-notify-event. */
58#define TOLERANCE_PIXELS 2
59
56typedef enum60typedef enum
57{61{
58 OS_SIDE_TOP,62 OS_SIDE_TOP,
@@ -1350,6 +1354,11 @@
1350 /* reconnect slider and overlay after key press */1354 /* reconnect slider and overlay after key press */
1351 if (priv->value_changed_event)1355 if (priv->value_changed_event)
1352 {1356 {
1357 /* return if the mouse movement is small. */
1358 if (abs (priv->pointer_x - event->x) <= TOLERANCE_PIXELS &&
1359 abs (priv->pointer_y - event->y) <= TOLERANCE_PIXELS)
1360 return FALSE;
1361
1353 if (priv->orientation == GTK_ORIENTATION_VERTICAL)1362 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
1354 {1363 {
1355 priv->slide_initial_slider_position = event->y_root - priv->win_y - event->y;1364 priv->slide_initial_slider_position = event->y_root - priv->win_y - event->y;
@@ -1361,8 +1370,6 @@
1361 priv->slide_initial_coordinate = event->x_root;1370 priv->slide_initial_coordinate = event->x_root;
1362 }1371 }
13631372
1364 /* FIXME(Cimi) seems useless. */
1365// capture_movement (scrollbar, event->x_root, event->y_root);
1366 priv->value_changed_event = FALSE;1373 priv->value_changed_event = FALSE;
1367 }1374 }
13681375
13691376
=== modified file 'os/os-thumb.c'
--- os/os-thumb.c 2011-06-27 17:03:25 +0000
+++ os/os-thumb.c 2011-06-28 21:57:31 +0000
@@ -37,7 +37,7 @@
37/* Timeout before the fade-out. */37/* Timeout before the fade-out. */
38#define TIMEOUT_FADE_OUT 25038#define TIMEOUT_FADE_OUT 250
3939
40/* Number of tolerance pixels. */40/* Number of tolerance pixels, before hiding the thumb. */
41#define TOLERANCE_PIXELS 341#define TOLERANCE_PIXELS 3
4242
43/* Thumb radius in pixels (higher values are automatically clamped). */43/* Thumb radius in pixels (higher values are automatically clamped). */

Subscribers

People subscribed via source and target branches