Update the MD's position when a touch event is received

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't use GetTouchEvents when replaying events

GetTouchEvents has plenty of side effects such as moving the pointer or
updating the master device, which we don't want to happen when
replaying.  The only reason for calling it was to generate a DCCE event,
but GetTouchEvents doesn't even do that right (we might need a DCCE
event even when replaying a master event, or clients could interpret
valuator data incorrectly).

This discussion is moot at the moment anyway, since DeliverTouchEvents
doesn't appear to deliver DCCE events.

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

[Added call to processInputProc instead of direct call to DeliverTouchEvents]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't use GetTouchEvents in EmitTouchEnd

As before GetTouchEvents causes unwanted side effects.  Add a new
function GetDixTouchEnd, which generates a touch event from the touch
point.  We fill in the event's screen coordinates from the MD's current
sprite position.

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Simplify GetTouchEvents

With only one callee left, we are free to assume that
!(flags & TOUCH_CLIENT_ID)

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
dix: Save touchpoint last coordinates before transform. #49347

DDXTouchPointInfoRec.valuators used to store axis values after transform.
This resulted in Coordinate Transformation Matrix
being applied multiple times to the last coordinates,
in the case when only pressure changes in the last touch event.

Changed DDXTouchPointInfoRec.valuators to store values before transform.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347

Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Constify argument to LoadExtension

Since we never modify it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Constify extensions in LoadExtension users

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
DMX: Add DMX and GLX extensions

Unfortunately this also got lost in the extmod fallout, leaving the DMX
server not exposing the DMX or GLX extensions.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
vfb: Initialize the GLX extension again.

This should fix a regression in the 1.13.0 release: commit
5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86 removed a code path used by Xvfb
and made it use the default one when initializing extensions. However, this
meant the GLX extension was not initialized anymore since it is not part of
the `staticExtensions' array.

Since it is not possible to just add it to that array after commit
aad428b8e21c77397c623b78706eb64b1fea77c9, adopt an approach similar to
xwin's and xquartz's and initialize the extension from vfb's `InitOutput'.

Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Ephyr: Find the right host screen when embedded

When Xephyr is embedded into another application (e.g. in xoo), the
input events may come from the parent Window instead of our own. So make
sure we find the host screen in that case as well instead of crashing.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
hw/xwin: Show any fatal error message

Report the fatal error message in the dialog we pop up, rather than just
referring the user to the logfile.

v2: Do this a better way since the "Pass the FatalError message to
OsVendorFatalError" patch has landed, and OsVendorFatalError() now gets passed
the fatal error message

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Report which drawing engines are being enabled when checking for support

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Avoid logging an extra blank line if BUILDERSTRING is empty

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Allow XScreenSaverSuspend() to effect Windows screen saver or monitor power off

Reset the idle timer in the block handler if screenSaverSuspended is set.

This isn't quite a complete solution.  We should also set the block timeout to
something less than the idle timer timeout to ensure we will reset the idle
timer before it times out if we are blocking.

The idle timer timeout is presumably the first one to expire of the screen saver
activation or monitor low power or power down timeout, depending on
configuration.

Unfortunately this is probably not straightforward to do. Whilst
SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT) is portable, apparently
SPI_GETLOWPOWERTIMEOUT and SPI_GETPOWEROFFTIMEOUT are not supported by Windows
versions 6.0 or later, and the interface for discovering equivalent value is
complex.

This doesn't matter in the case where a media player or similar application is
the one making the XScreenSaverSuspend() requests, as it will be continuously
drawing, causing the X server to become unblocked often.

In the case where slide show presentation application or similar is the one
making the XScreenSaverSuspend() request, this might be a problem.

Since "Powerpoint is Evil" [1], I think we'll leave it like this till someone
complains :-)

[1] http://www.edwardtufte.com/tufte/books_pp

v2: conditionalize on SCREENSAVER

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix function name in log message

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Add correct taskbar grouping of X windows on Windows 7

I created a small patch for XWin that adds correct grouping of taskbar icons
when 'Always combine, hide labels' is set in the taskbar properties. It uses the
new taskbar APIs introduced in Windows 7 to set an application id for each
window. The id is based on the X11 class hints.

v2: Add file to _SOURCES to fix distcheck

v3 : Fix compilation with mingw-w64 w32api headers
Include propkey.h, propsys.h rather than defining necessary stuff ourselves

v4: Fix up names taskbar->propertystore, AppID->AppUserModelID, etc.
Link directly with ole32 for PropVariantClear(), prototyping it if neccessary.

v5: Put winSetAppUserModelID()-related code in a separate file.
Drop a superfluous assign to hr of ignored HRESULT of SetValue()

Signed-off-by: Tobias Häußler <tobias.haeussler@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Give our logical xor operator a more logical name

Also, rather than a comment about why we need a logical operator, let's have a
comment about what we are doing to the keyboard state...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Restore non-latching modifier key state when an X window gains focus

In multiwindow mode, the state of the modifier keys was lost when a window is
created (or raised) and focus moved to that window.

For example: In window A Ctrl + some key opens a window B, then in window B Ctrl
+ some other key triggers the next action. However after the opening of window B
the Ctrl key has to be released and pressed again. If the user keeps the Ctrl
key held down when the window B is opened, the next key press X will be
interpreted as X and not as Ctrl+X.

Extended the function winRestoreModeKeyStates in winkeybd.c to consider not only
the latching modifier keys but also the modifiers Ctrl, Shift, Alt/AltGr by
using the Windows function GetAsyncKeyState.

A combined Ctrl+AltGr modifier state cannot be restored correctly, as Windows
always fakes a Ctrl-L when AltGr is pressed.

Signed-off-by: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Enable AIGLX by default

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Enable RANDR resize by default

Also fix erroneous use of '--resize' not '-resize', and document '-noresize' in man page

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>