For backward compatibility this property can now be either 3 or 4
items. When we generate it, we generate 4 items, but we accept
setting only 3 items.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
ivals[0] = cfg->button_zones;
ivals[1] = cfg->button_move;
ivals[2] = cfg->button_expire;
ivals[0] = cfg->button_zones;
ivals[1] = cfg->button_move;
ivals[2] = cfg->button_expire;
- mprops.button_emulate_settings = atom_init_integer(local->dev, MTRACK_PROP_BUTTON_EMULATE_SETTINGS, 3, ivals, 16);
+ ivals[3] = cfg->bottom_edge_zones;
+ mprops.button_emulate_settings = atom_init_integer(local->dev, MTRACK_PROP_BUTTON_EMULATE_SETTINGS, 4, ivals, 16);
ivals[0] = cfg->button_1touch;
ivals[1] = cfg->button_2touch;
ivals[0] = cfg->button_1touch;
ivals[1] = cfg->button_2touch;
}
}
else if (property == mprops.button_emulate_settings) {
}
}
else if (property == mprops.button_emulate_settings) {
- if (prop->size != 3 || prop->format != 16 || prop->type != XA_INTEGER)
+ if (prop->size < 3 || prop->size > 4 || prop->format != 16 || prop->type != XA_INTEGER)
return BadMatch;
ivals16 = (uint16_t*)prop->data;
if (!VALID_BOOL(ivals16[0]) || !VALID_BOOL(ivals16[1]) || ivals16[2] < 0)
return BadMatch;
return BadMatch;
ivals16 = (uint16_t*)prop->data;
if (!VALID_BOOL(ivals16[0]) || !VALID_BOOL(ivals16[1]) || ivals16[2] < 0)
return BadMatch;
+ if (prop->size >= 4) {
+ if (!VALID_BOOL(ivals16[3]))
+ return BadMatch;
+ }
+
if (!checkonly) {
cfg->button_zones = ivals16[0];
cfg->button_move = ivals16[1];
cfg->button_expire = ivals16[2];
if (!checkonly) {
cfg->button_zones = ivals16[0];
cfg->button_move = ivals16[1];
cfg->button_expire = ivals16[2];
+ if (prop->size >= 4)
+ cfg->bottom_edge_zones = ivals16[3];
- xf86Msg(X_INFO, "mtrack: set button emulate settings to %d %d %d\n",
- cfg->button_zones, cfg->button_move, cfg->button_expire);
+ xf86Msg(X_INFO, "mtrack: set button emulate settings to %d %d %d %d\n",
+ cfg->button_zones, cfg->button_move, cfg->button_expire, cfg->bottom_edge_zones);
#define MTRACK_PROP_PRESSURE "Trackpad Touch Pressure"
// int, 2 values - enable buttons, has integrated button
#define MTRACK_PROP_BUTTON_SETTINGS "Trackpad Button Settings"
#define MTRACK_PROP_PRESSURE "Trackpad Touch Pressure"
// int, 2 values - enable buttons, has integrated button
#define MTRACK_PROP_BUTTON_SETTINGS "Trackpad Button Settings"
-// int, 3 values - enable button zones, button move emulation, emulation touch expiration
+// int, 3-4 values - enable button zones, button move emulation, emulation touch expiration[, enable bottom edge zones]
#define MTRACK_PROP_BUTTON_EMULATE_SETTINGS "Trackpad Button Emulation Settings"
// int, 3 values - button to emulate with 1 touch, 2 touches, 3 touches
#define MTRACK_PROP_BUTTON_EMULATE_VALUES "Trackpad Button Emulation Values"
#define MTRACK_PROP_BUTTON_EMULATE_SETTINGS "Trackpad Button Emulation Settings"
// int, 3 values - button to emulate with 1 touch, 2 touches, 3 touches
#define MTRACK_PROP_BUTTON_EMULATE_VALUES "Trackpad Button Emulation Values"