xf86Crtc: include "xf86xv.h" only if XV

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Cygwin/X: disable all unused or unapplicable extensions in configure

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
xfree86: allow modules to be built without undefined symbols

This will be necessary to port Xorg to Cygwin, but other platforms may
find this useful as well.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
os-support: add Cygwin support

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
loader: add Cygwin support

Cygwin libraries use the .dll extension and "cyg" prefix in place of "lib".

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
xf86Init: provide ddxBeforeReset ifdef DDXBEFORERESET

This is necessary when building Xorg and XWin simultaneously, otherwise
undefined symbol errors result in sdksyms.c.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
xf86Config: load DIX libraries before drivers on Cygwin

Cygwin doesn't have ELF rpath capabilities, so these libraries need
to be loaded before the drivers (namely dummy and nested) which
depend on their symbols.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
xfree86: link modules against Xorg symbols on Cygwin

As a PE platform, all symbols in both EXEs and DLLs must be resolved
at link time.  As Xorg modules depend on symbols in the Xorg
executable, we must build Xorg before its modules, creating an implib
from the former which is used to link the latter.  This implib must
then be installed in order to build the drivers.

Currently only two drivers are supported on Cygwin: xf86-video-dummy
(to replace Xvfb/Xfake) and xf86-video-nested (to replace Xnest/Xephyr).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Xi: fix XITouchClass sourceid assignment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
hw/xfree86: Spurious ');' in xf86vmode.c messed up indentation badly

Inside the unfinished XF86VIDMODE_EVENTS #ifdef block the
function definition for xf86VidModeNotifyEvent had an extra ');'
before the prototype argument declarations. This was harmless for the
compiler as the code never gets used, but completely messed up the
file re-indentation. This patch removes the spurious characters in
preparation for re-indenting the file.

Signed-off-by: Keith Packard <keithp@keithp.com>
hw/xfree86: Re-indent xf86vmode.c

This is the result of re-running the 'x-indent.sh' script over
xf86vmode.c to clean up the disaster caused by broken syntax in the
file.

Signed-off-by: Keith Packard <keithp@keithp.com>
dix: don't BUG_WARN for button events from button-only device

Events from button-only devices still need coordinates, and they get them
from scale_to_desktop().  Therefore, a dev without valuators is not a bug.
However, a dev with valuators, but less than two of them still is a bug.

This was noticed when unplugging a "Creative Technology SB Arena Headset",
which has some BTNs and some KEYs, but no REL or ABS valuators.
It emits [BTN_3] = 0 on unplug, which would trigger the BUG_WARN.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xfree86: after VT switching back, only enable previously enabled devices

If a device was enabled before the VT switch, re-enabled it. Otherwise leave
it as is, there was probably a reason why it was disabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Don't update listener after deactivating implicit pointer grab

After the pointer grab is deactivated, the touch listener record is
updated at the end of DeliverTouchEmulatedEvent. However, the touch
record is ended when the grab is deactivated, so the update to the
listener record is in an array of memory that has been freed.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Update event type when delivering end event to a pointer listener

Just like when we deliver to a touch listener, we must convert a touch
end event to an update event for further clients. This also ensures that
the touch record is not deleted at the end of ProcessTouchEvent().

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ensure sequential touches are pointer emulated sequentially

Issue:
* Two sequential touches (i.e. down, up, down, up)
* Both are grabbed by a touch grab
* Both have a second listener in the form of a pointer grab or selection
* The second and first touches are rejected in that order

The first touch must be pointer emulated before the second touch, so the
second touch must be paused until the first touch is rejected or
accepted and all events are delivered to pointer clients.

This change ensures all pointer emulated events are emitted
sequentially. It necessarily imposes a delay on further touch events
when pointer grabs and selections are used, but there is no way around
it.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Use touch state when querying pointer through core protocol

QueryPointer is part of the core protocol. As such, it knows nothing
about touch devices. Touches are converted to button 1 press, pointer
motion, and button 1 release for core clients, so we should ensure the
pointer state mask has button 1 set when XQueryPointer is used.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Merge remote-tracking branch 'whot/for-keith'
dix: indentation fix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Implemented first part of XResource extension v1.2: X_XResQueryClientIds

This patch implements a part of the XResource extension v1.2 (as specified in
http://patchwork.freedesktop.org/patch/2720/ ). The request implemented is
X_XResQueryClientIds.

This patch depends on the feature introduced by
1e933665bef26c74196bb7c59910e6a78bcacf0e "dix: Add facilities for
client ID tracking." .

This latest version also adds Doxygen-formatted comments and takes a better
notice of coding conventions (as in http://www.x.org/wiki/CodingStyle ).

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>