X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=xf86-input-mtrack.git;a=blobdiff_plain;f=driver%2Fmprops.c;fp=driver%2Fmprops.c;h=59bc993dd369fd90a099039bfb9cee4f0900fc62;hp=3ded861f3255058efc70213873860325f1815f15;hb=70cf2dcd96a95258c646573c3ed0cd14bdb8096e;hpb=898a7d315ac511bbdc3c1d424cb7ae23e71bc191 diff --git a/driver/mprops.c b/driver/mprops.c index 3ded861..59bc993 100644 --- a/driver/mprops.c +++ b/driver/mprops.c @@ -105,7 +105,8 @@ void mprops_init(struct MConfig* cfg, InputInfoPtr local) { 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; @@ -271,20 +272,27 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop } } 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; + 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 (prop->size >= 4) + cfg->bottom_edge_zones = ivals16[3]; #ifdef DEBUG_PROPS - 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); #endif } }