[PATCH:xf86-input-mouse 4/4] Add settable properties for middle mouse button emulation

Alan Coopersmith alan.coopersmith at oracle.com
Mon Apr 30 16:03:52 PDT 2012


On 04/29/12 08:54 AM, Alexandr Shadchin wrote:
> On Fri, Apr 27, 2012 at 05:43:52PM -0700, Alan Coopersmith wrote:
>> Based on evdev's similar properties, including using the name "middle"
>> button, to avoid confusion with evdev's 3rd button emulation for
>> emulating the right button on a single button mouse.
>>
>> Allows manual enable & disable at runtime.
>>
>> Exports new xf86-mouse.pc & xf86-mouse-properties.h for property name
>> definitions.
>>
>> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
>> ---
>>  Makefile.am                     |    5 ++-
>>  configure.ac                    |   12 +++++
>>  include/Makefile.am             |    1 +
>>  include/xf86-mouse-properties.h |   33 ++++++++++++++
>>  man/mousedrv.man                |    4 +-
>>  src/Makefile.am                 |    2 +-
>>  src/mouse.c                     |   94 ++++++++++++++++++++++++++++++++++++---
>>  xf86-mouse.pc.in                |    6 +++
>>  8 files changed, 146 insertions(+), 11 deletions(-)
>>  create mode 100644 include/Makefile.am
>>  create mode 100644 include/xf86-mouse-properties.h
>>  create mode 100644 xf86-mouse.pc.in
>>
> 
> Lot of mixing tabs and spaces. Also see below.

The existing code is unfortunately inconsistent, and I tried to match context,
but probably messed a few places up.   Will go back and check.

>> index 927d530..0d65131 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -19,7 +19,7 @@
>>  #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>>  
>>  AM_CFLAGS = $(CWARNFLAGS) 
>> -AM_CPPFLAGS = $(XORG_CFLAGS)
> 
>> +AM_CPPFLAGS = -I../include $(XORG_CFLAGS)
> 
> s/../$(top_srcdir)/

Right, will fix.

>> +/* Properties that can be set at runtime via xinput */
>> +static Atom prop_mbemu     = 0; /* Middle button emulation on/off property */
>> +static Atom prop_mbtimeout = 0; /* Middle button timeout property */
>> +
> 
> Static atoms don't need to be initialized to 0.

True.   That's a copy/paste from evdev and I didn't really think about if
it was necessary or not.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list