diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-06 09:17:57 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-10 15:23:59 +1000 |
commit | afb60a0b2497c5d08cbd1739fa8ae6585c428881 (patch) | |
tree | 2a0bcca5111c32a2b9359f4d6c458e86982a148f /src/synapticsstr.h | |
parent | 24d8919e7052b950ddde85c6dc45552faa4cb30f (diff) |
Auto-adjust edges if values fall outside queried min/max ranges. (#21001)
The kernel provides min/max for x/y values but still allows devices to send
coordinates outside this range. If the edges are autodetected, re-adjust the
edge settings to fit within the new effective min/max range.
When the edges change the property needs to be updated accordingly. This
can't be done immediately as changing properties requires mallocs and
HandleState is called during the signal handler.
Instead, set a timer to be called when the server isn't busy and update the
property then. The delay between setting the timer and sending the property
notify event also reduces the number of events sent, the property event
includes the latest state only.
If the edges were configured by the user, don't re-adjust.
This obsoletes the SpecialScrollAreaRight option as it provides the same
functionality, without the side-effects triggering 21001.
X.Org Bug 21001 <http://bugs.freedesktop.org/show_bug.cgi?id=21001>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/synapticsstr.h')
-rw-r--r-- | src/synapticsstr.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/synapticsstr.h b/src/synapticsstr.h index d2ff57c..87af600 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -86,6 +86,23 @@ enum TouchpadModel { MODEL_APPLETOUCH }; +typedef enum { + BOTTOM_EDGE = 1, + TOP_EDGE = 2, + LEFT_EDGE = 4, + RIGHT_EDGE = 8, + LEFT_BOTTOM_EDGE = BOTTOM_EDGE | LEFT_EDGE, + RIGHT_BOTTOM_EDGE = BOTTOM_EDGE | RIGHT_EDGE, + RIGHT_TOP_EDGE = TOP_EDGE | RIGHT_EDGE, + LEFT_TOP_EDGE = TOP_EDGE | LEFT_EDGE, + + /* EDGE_CHANGED and EDGE_CHANGED_WAITING are flags to signal that there + * at least one edge has changed and that there is a property notify + * event waiting to be sent, respectively. */ + EDGE_CHANGED = 16, + EDGE_CHANGE_WAITING = 32 +} edge_type; + typedef struct _SynapticsParameters { /* Parameter data */ @@ -169,7 +186,6 @@ typedef struct _SynapticsPrivateRec SynapticsMoveHistRec move_hist[SYNAPTICS_MOVE_HISTORY]; /* movement history */ int hist_index; /* Last added entry in move_hist[] */ - int largest_valid_x; /* Largest valid X coordinate seen so far */ int scroll_y; /* last y-scroll position */ int scroll_x; /* last x-scroll position */ double scroll_a; /* last angle-scroll position */ @@ -219,6 +235,12 @@ typedef struct _SynapticsPrivateRec Bool has_pressure; /* device reports pressure */ enum TouchpadModel model; /* The detected model */ + + /* edges_forces is set to RIGHT_EDGE | LEFT_EDGE | ... when the matching + * edge is specified in the xorg.conf. When the edges are auto-adjusted, + * edges_forces may be flagged EDGE_CHANGED and EDGE_CHANGED_WAITING */ + int edges_forced; /* edges set manually? RIGHT_EDGE | LEFT_EDGE | ... */ + OsTimerPtr property_notify_timer; /* For sending off property notify events */ } SynapticsPrivate; #endif /* _SYNAPTICSSTR_H_ */ |