diff options
author | Ulf Brosziewski <bru@cvs.openbsd.org> | 2017-07-27 20:25:28 +0000 |
---|---|---|
committer | Ulf Brosziewski <bru@cvs.openbsd.org> | 2017-07-27 20:25:28 +0000 |
commit | 18da0be638efd67279878bd341e61b815001cc8d (patch) | |
tree | bb024b93fd9d2e00612a807ff812a2c8eeae962d /sys/dev/wscons | |
parent | 6cea0a5f5bb8f39bb09d9f6d50c31d640058d577 (diff) |
Use variable edge masks (again).
The properties of edge areas will be more consistent even though
in some cases the driver remains in the dark about the exact
coordinate limits.
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r-- | sys/dev/wscons/wstpad.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/wscons/wstpad.c b/sys/dev/wscons/wstpad.c index f22d6a34855..3c901eee096 100644 --- a/sys/dev/wscons/wstpad.c +++ b/sys/dev/wscons/wstpad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wstpad.c,v 1.9 2017/07/26 20:25:15 bru Exp $ */ +/* $OpenBSD: wstpad.c,v 1.10 2017/07/27 20:25:27 bru Exp $ */ /* * Copyright (c) 2015, 2016 Ulf Brosziewski @@ -1320,17 +1320,24 @@ wstpad_configure(struct wsmouseinput *input) tp->tap.maxdist = 3 * h_unit; } + /* A touch with a flag set in this mask does not move the pointer. */ + tp->freeze = 0; + if ((ratio = tp->params.left_edge) == 0 && (tp->features & WSTPAD_EDGESCROLL) && (tp->features & WSTPAD_SWAPSIDES)) ratio = EDGERATIO_DEFAULT; tp->edge.left = input->hw.x_min + width * ratio / 4096; + if (ratio) + tp->freeze |= L_EDGE; if ((ratio = tp->params.right_edge) == 0 && (tp->features & WSTPAD_EDGESCROLL) && !(tp->features & WSTPAD_SWAPSIDES)) ratio = EDGERATIO_DEFAULT; tp->edge.right = input->hw.x_max - width * ratio / 4096; + if (ratio) + tp->freeze |= R_EDGE; if ((ratio = tp->params.bottom_edge) == 0 && ((tp->features & WSTPAD_SOFTBUTTONS) @@ -1338,11 +1345,15 @@ wstpad_configure(struct wsmouseinput *input) && (tp->features & WSTPAD_HORIZSCROLL)))) ratio = EDGERATIO_DEFAULT; tp->edge.bottom = input->hw.y_min + height * ratio / 4096; + if (ratio) + tp->freeze |= B_EDGE; if ((ratio = tp->params.top_edge) == 0 && (tp->features & WSTPAD_TOPBUTTONS)) ratio = EDGERATIO_DEFAULT; tp->edge.top = input->hw.y_max - height * ratio / 4096; + if (ratio) + tp->freeze |= T_EDGE; if ((ratio = abs(tp->params.center_width)) == 0) ratio = CENTERWIDTH_DEFAULT; @@ -1351,12 +1362,6 @@ wstpad_configure(struct wsmouseinput *input) tp->edge.center_right = tp->edge.center + width * ratio / 8192; tp->edge.middle = (input->hw.y_max - input->hw.y_min) / 2; - /* - * A touch with a flag that is also set in this mask does not - * move the pointer. For now, it only contains the edge flags. - */ - tp->freeze = EDGES; - tp->handlers = 0; if (tp->features & WSTPAD_SOFTBUTTONS) |