platform/upstream/xorg-server.git
11 years agoXext: if a root window is given in XTestFakeInput, move to that
Peter Hutterer [Sat, 26 Jan 2013 05:53:08 +0000 (15:53 +1000)]
Xext: if a root window is given in XTestFakeInput, move to that

For absolute events, if the client specifies a screen number offset the
coordinates by that. And add a new flag so we know when _not_ to add the
screen offset in GPE.

Without this offset and the flag, GPE would simply add the offset of the
current screen if POINTER_SCREEN is set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoXext: pass the current screen to miProcessDeviceEvent() from xtest calls
Peter Hutterer [Tue, 29 Jan 2013 05:13:44 +0000 (15:13 +1000)]
Xext: pass the current screen to miProcessDeviceEvent() from xtest calls

Not passing in a screen means we skip the screen crossing updates, so a
xtest event that changes between ScreenRecs won't do so until the next
physical event comes in or never, whichever comes earlier.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: when scaling from desktop coord, take the total desktop size (#51904)
Sybren van Elderen [Tue, 29 Jan 2013 05:43:57 +0000 (15:43 +1000)]
dix: when scaling from desktop coord, take the total desktop size (#51904)

Scaled is already in desktop coordinates, take the total width into account,
not just the current screen's width.

Fixes Xdmx pointer position calculation.

X.Org Bug 51904 <http://bugs.freedesktop.org/show_bug.cgi?id=51904>

Signed-off-by: Sybren van Elderen <sowmestno@msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoinclude: fix typo in list description
Peter Hutterer [Tue, 29 Jan 2013 02:51:15 +0000 (12:51 +1000)]
include: fix typo in list description

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86: bail on misformed acpi strings (#73227)
Ted Felix [Tue, 29 Jan 2013 06:36:48 +0000 (16:36 +1000)]
xfree86: bail on misformed acpi strings (#73227)

If acpid sends a string in a format that we can't parse, bail out instead of
potentially dereferencing a NULL-pointer.

X.Org Bug 73227 <http://bugs.freedesktop.org/show_bug.cgi?id=73227>

Signed-off-by: Ted Felix <ted@tedfelix.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXi: limit valuator copy to valuator array size (#59939)
Peter Hutterer [Tue, 29 Jan 2013 01:01:29 +0000 (11:01 +1000)]
Xi: limit valuator copy to valuator array size (#59939)

mask[(MAX_VALUATORS + 7)/8] is larger than data[MAX_VALUATORS], so static
code checkers think we may be running OOB on the data array. Mask is
initialized to 0, so this should not happen, but change it anyway to shut up
code analyzer noise.

X.Org Bug 59939 <http://bugs.freedesktop.org/show_bug.cgi?id=59939>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoXext: avoid null-pointer dereference in XTestFakeInput (#59937)
Alan Coopersmith [Tue, 29 Jan 2013 00:24:32 +0000 (10:24 +1000)]
Xext: avoid null-pointer dereference in XTestFakeInput (#59937)

dv is still NULL at this point, so return firstValuator instead (which is
the same value dv->firstValuator would be once initialized)

X.Org Bug 59937 <http://bugs.freedesktop.org/show_bug.cgi?id=59937>

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodmx: don't include dmx-config.h from xdmxconfig (#37502)
Peter Hutterer [Sat, 26 Jan 2013 04:13:33 +0000 (14:13 +1000)]
dmx: don't include dmx-config.h from xdmxconfig (#37502)

dmx-config.h is a server header which includes dix-config.h. That again
defines a bunch of server-specifics, including setting the size of XID to
32 bit.

libX11 uses unsigned long (8 bits on x86_64). XGCValues thus ends up being
16 bytes smaller in xdmxconfig than in the library, causing garbage to be
sent to the server.

X.Org Bug 37502 <http://bugs.freedesktop.org/show_bug.cgi?id=37502>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoprotocol-versions: Bump minor version of XI
Jasper St. Pierre [Wed, 23 Jan 2013 18:11:55 +0000 (13:11 -0500)]
protocol-versions: Bump minor version of XI

This was accidentally excluded when we added barriers.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoconfig/udev: fix "removing GPU device" format string mistake
Aaron Plattner [Fri, 11 Jan 2013 01:01:17 +0000 (17:01 -0800)]
config/udev: fix "removing GPU device" format string mistake

 udev.c: In function 'device_removed':
 udev.c:270:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'const char *' [-Wformat]

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxserver: fix build regression since 91ab237358c6e33da854914d3de493a9cbea7637
Dave Airlie [Mon, 21 Jan 2013 21:39:53 +0000 (07:39 +1000)]
xserver: fix build regression since 91ab237358c6e33da854914d3de493a9cbea7637

inputstr, double defines TouchListener typedef, maybe some gcc handles it,
but not all.

fixes tinderbox

Reported-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'jturney/xserver-next'
Keith Packard [Sun, 20 Jan 2013 23:58:38 +0000 (15:58 -0800)]
Merge remote-tracking branch 'jturney/xserver-next'

11 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Sun, 20 Jan 2013 23:52:26 +0000 (15:52 -0800)]
Merge remote-tracking branch 'whot/for-keith'

11 years agohw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW
Jon TURNEY [Sat, 11 Feb 2012 12:22:17 +0000 (12:22 +0000)]
hw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly
Jon TURNEY [Wed, 9 Jan 2013 20:15:01 +0000 (20:15 +0000)]
hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly

Use ITaskBarList interface to ensure that the taskbar notices if the window has
changed it's style in a way which affects if the taskbar shows it or not.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Ensure full styling is applied when the window is mapped
Jon TURNEY [Thu, 10 Jan 2013 14:35:56 +0000 (14:35 +0000)]
hw/xwin: Ensure full styling is applied when the window is mapped

Move styling update code from WM_WM_HINTS_EVENT to a function UpdateStyle(),
which is also invoked from WM_WM_MAP3, so everything which needs to be done
to style the window happens when it is mapped

(Otherwise, the appearance of the window is sensitive to the timing of the
notification of the windows appearance hint properties being set relative to
window creation. e.g. see [1])

[1] http://sourceware.org/ml/cygwin-xfree/2012-06/msg00004.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Make sure that WM_WM_HINTS_EVENT does nothing for override-redirect windows
Jon TURNEY [Sat, 31 Mar 2012 17:45:28 +0000 (18:45 +0100)]
hw/xwin: Make sure that WM_WM_HINTS_EVENT does nothing for override-redirect windows

Future work: It looks like this code could be rationalized quite a lot: It might
make sense to pull the checking for override-redirect up out of UpdateIcon() and
UpdateName() and consolidate WM_WM_MAP2 and WM_WM_MAP3

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Add a new WM_WM_HINTS_EVENT event to update window style
Jon TURNEY [Sun, 5 Feb 2012 11:25:39 +0000 (11:25 +0000)]
hw/xwin: Add a new WM_WM_HINTS_EVENT event to update window style

Add a new WM_WM_HINTS_EVENT event to update window style if any of the
properties which affect window style change

Check PropertyNotify events for any of the window properties which we consider
to decide on the window style, and update the window style by sending a
WM_WM_HINTS_EVENT message to the WM.

This allows the styling of the window to change during it's lifetime.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler
Jon TURNEY [Thu, 10 Jan 2013 14:37:45 +0000 (14:37 +0000)]
hw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler

Move reshape code, which was only used when handling a map event, from
winUpdateWindowPosition(), to put it explicitly in the map event handler.

Remove 'reshape' parameter from winUpdatePosition().

(Note that there's no handling of the ShapeNotify event to notice when the
window shape changes, instead we hook the screen SetShape procedure and reshape
the native window then)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Add missing include xwin-config.h to winglobals.h
Ryan Pavlik [Sat, 1 Dec 2012 16:58:40 +0000 (16:58 +0000)]
hw/xwin: Add missing include xwin-config.h to winglobals.h

winglobals.h checks if RELOCATE_PROJECTROOT is defined to see if a declaration
of g_fLogFileChanged is needed, so must include xwin-config.h

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoinclude: Add RELOCATE_PROJECTROOT to xwin-config.h header
Ryan Pavlik [Wed, 26 Oct 2011 22:03:25 +0000 (17:03 -0500)]
include: Add RELOCATE_PROJECTROOT to xwin-config.h header

RELOCATE_PROJECTROOT is AC_DEFINED in configure.ac, but currently has no effect
as it doesn't appear in any AC_CONFIG_HEADER header.

When packaged for Windows, we do not have a unix-style filesystem tree, where
file needed by the X server can be found in fixed, absolute paths under the
prefix (PROJECTROOT).

Instead, the filesystem tree containing files needed by the X server and clients
will be installed with the directory containing the X server executable as the
root directory of that tree.

(Typically, this will be in the Program Files directory, which does not have a
fixed name, as it can be moved, localized, or added to to indicate x86 or x64
binaries)

So, RELOCATE_PROJECTROOT is used to make a native Windows build of the X server
look for various files (fonts, xkb data) in locations relative to the X server
rather than at absolute paths, by translating those paths at run-time.

Additionally the XKEYSYMDB, XERRORDB, XLOCALEDIR env vars checked by libX11 are
set appropriately for clients started by the X server.

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoMerge branch 'pointer-emulation-fixes-56558-v2' into for-keith
Peter Hutterer [Fri, 11 Jan 2013 04:58:17 +0000 (14:58 +1000)]
Merge branch 'pointer-emulation-fixes-56558-v2' into for-keith

11 years agodix: typo fix in comment
Peter Hutterer [Thu, 10 Jan 2013 00:33:05 +0000 (10:33 +1000)]
dix: typo fix in comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: fix error logging occuring in signal context of GetTouchEvents
Benjamin Tissoires [Wed, 9 Jan 2013 18:32:19 +0000 (19:32 +0100)]
dix: fix error logging occuring in signal context of GetTouchEvents

GetTouchEvents is usually called in a signal context.
Calling ErrorF for the error messages leads to X complaining about log:

(EE) BUG: triggered 'if (inSignalContext)'
(EE) BUG: log.c:484 in LogVMessageVerb()
(EE) Warning: attempting to log data in a signal unsafe manner while in signal context.
Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or ErrorFSigSafe().
The offending log format message is:
%s: Attempted to start touch without x/y (driver bug)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86: don't access the old input handler after freeing it
Peter Hutterer [Wed, 9 Jan 2013 03:58:56 +0000 (13:58 +1000)]
xfree86: don't access the old input handler after freeing it

Introduced in 323869f3298cbbfe864af9404a8aed1bf7995d79

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
11 years agoxf86: bump input ABI version to 19
Dave Airlie [Sat, 5 Jan 2013 08:35:42 +0000 (18:35 +1000)]
xf86: bump input ABI version to 19

The changes to miPointerSetPosition interface from int->double breaks
the SIS driver build, so time to bump this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86: update the device state for all DGA events (#59100)
Peter Hutterer [Tue, 8 Jan 2013 01:19:09 +0000 (11:19 +1000)]
xfree86: update the device state for all DGA events (#59100)

DGA only handles master devices but it does intercept slave device events as
well (since the event handlers are per event type, not per device).

The DGA code must thus call into UpdateDeviceState to reset the button/key
state on the slave device before it discards the remainder of the event.

Test case:
- Passive GrabModeSync on VCP
- Press button
- Enable DGA after ButtonPress
- AllowEvents(SyncPointer)
- Release button

The button release is handled by DGAProcessPointerEvent but the device state
is never updated, so the slave ends up with the button permanently down.
And since the master's button state is the union of the slave states, the
master has the button permanently down.

X.Org Bug 59100 <http://bugs.freedesktop.org/show_bug.cgi?id=59100>

Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
11 years agoxfree86: set event->detail for DGA pointer events
Peter Hutterer [Tue, 8 Jan 2013 00:13:53 +0000 (10:13 +1000)]
xfree86: set event->detail for DGA pointer events

Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
11 years agoFix two typos "requires an string value"
Peter Hutterer [Mon, 7 Jan 2013 00:44:33 +0000 (10:44 +1000)]
Fix two typos "requires an string value"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: don't filter RawEvents if the grab window is not the root window (#53897)
Peter Hutterer [Wed, 22 Aug 2012 00:34:07 +0000 (10:34 +1000)]
dix: don't filter RawEvents if the grab window is not the root window (#53897)

If a XI2.1+ client has a grab on a non-root window, it  must still receive
raw events on the root window.

Test case: register for XI_ButtonPress on window and XI_RawMotion on root.
No raw events are received once the press activates an implicit grab on the
window.

X.Org Bug 53897 <http://bugs.freedesktop.org/show_bug.cgi?id=53897>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agohw/xwin: Fix MinGW build of winSetAppModelID.c
Jon TURNEY [Wed, 28 Nov 2012 22:25:35 +0000 (22:25 +0000)]
hw/xwin: Fix MinGW build of winSetAppModelID.c

Add missing #include <pthread.h>

In file included from /jhbuild/checkout/xorg/xserver/hw/xwin/winSetAppUserModelID.c:31:0:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:140:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:141:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:142:11: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Process one Windows message per wakeup, rather than all of them.
Jon TURNEY [Tue, 23 Feb 2010 13:38:48 +0000 (13:38 +0000)]
hw/xwin: Process one Windows message per wakeup, rather than all of them.

De-queuing Windows messages and X events happens in the same thread of
execution.  Draining the windows message queue can lead to the X event queue
overflowing if lots of those windows messages cause X events (e.g. if a keyboard
macro program has just dumped thousands of keypresses into the Windows message
queue).  See the mailing list thread [1] for more details.

Processing one Windows message per wakeup, rather than all of them gives the X
server a chance to do stuff as well after each message.

[1] http://cygwin.com/ml/cygwin-xfree/2010-01/msg00056.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix some comments in winkeybd.c
Jon TURNEY [Mon, 17 Dec 2012 22:38:25 +0000 (22:38 +0000)]
hw/xwin: Fix some comments in winkeybd.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Bring the X screen window to the front on a single left-click on the tray...
Jon TURNEY [Thu, 1 Apr 2010 14:08:26 +0000 (15:08 +0100)]
hw/xwin: Bring the X screen window to the front on a single left-click on the tray icon

Bring the X screen window to the front on a single left click on the tray icon,
like the comment says we do

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xfree86: Require only one working CRTC to start the server.
Keith Packard [Wed, 9 Jan 2013 04:24:32 +0000 (20:24 -0800)]
hw/xfree86: Require only one working CRTC to start the server.

Instead of requiring every mode set to complete successfully, start up
as long as at least one CRTC is working. This avoids failures when one
or more CRTCs can't start due to mode setting conflicts.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
11 years agodix: remove already-moved hunk
Peter Hutterer [Fri, 4 Jan 2013 02:26:58 +0000 (12:26 +1000)]
dix: remove already-moved hunk

Should've been removed in bc1f90a615018c05994fae3e678dd2341256cd82a, but got
left here due to a botched rebase.

Fixes stray button events sent to clients after deactivating an async
pointer grab on a pointer-emulating-touch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: check for the right device's xi2 mask
Peter Hutterer [Thu, 20 Dec 2012 06:25:43 +0000 (16:25 +1000)]
dix: check for the right device's xi2 mask

events.c: In function 'DeactivatePointerGrab':
events.c:1524:51: warning: 'dev' may be used uninitialized in this function
[-Wuninitialized

dev is unset when we get here, the device to check is "mouse".
Introduced in ece8157a59751b3ed492fb2e1eb8d5f20221e195.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: add resource type to touch listeners
Peter Hutterer [Tue, 30 Oct 2012 02:44:08 +0000 (12:44 +1000)]
dix: add resource type to touch listeners

Instead of guessing what resource type the listener is and what property to
retrieve, store the resource type in the listener directly.

Breaks XIT test cases:
TouchGrabTestMultipleTaps.PassiveGrabPointerEmulationMultipleTouchesFastSuccession

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
11 years agoinput: Record grab pointer in TouchListener
Keith Packard [Tue, 27 Nov 2012 19:21:17 +0000 (11:21 -0800)]
input: Record grab pointer in TouchListener

This places a pointer to the grab related to a TouchListener directly
in the TouchListener structure rather than hoping to find the grab
later on using the resource ID.

Passive grabs have resource ID in the resource DB so they can be
removed when a client exits, and those resource IDs get copied when
activated, but implicit grabs are constructed on-the-fly and have no
resource DB entry.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoinput: Pull TouchListener declaration to top-level
Keith Packard [Tue, 27 Nov 2012 19:21:16 +0000 (11:21 -0800)]
input: Pull TouchListener declaration to top-level

No reason to have a struct declared inside another struct

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxkb: Do not use base group as an array index.
Andreas Wettstein [Wed, 19 Dec 2012 17:13:21 +0000 (18:13 +0100)]
xkb: Do not use base group as an array index.

The base group is not brought into range and, therefore, using it as an array
index crashed the X server.  Also, at this place, we should ignore locked
groups, but not latched groups.  Therefore, use sum of base and latched groups,
brought into range.

Reproducible with:
key <FK07> {
    type= "ONE_LEVEL",
    symbols[Group1]= [              NoSymbol ],
    actions[Group1]= [ LatchGroup(group=-1, clearLocks) ]
};

And hitting F7 will exceed the group level and access arbitrary memory.

Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agorender: Unwrap early on the animated cursor BlockHandler
Carlos Garnacho [Wed, 19 Dec 2012 17:42:39 +0000 (18:42 +0100)]
render: Unwrap early on the animated cursor BlockHandler

The loop above the previous call may end up triggering other
handlers attaching to the same function slot, so unwrapping
the handler after that could leave the just attached handler
in a dangling but not unset state.

This issue was most visible on the XO, where destroying a
window with an animated cursor set and running  would trigger
this inconsistent state, never calling the miSpriteBlockHandler
again after the animated cursor is unset.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agomi: Ensure pointer emulating touch events update the sprite
Carlos Garnacho [Wed, 19 Dec 2012 17:42:38 +0000 (18:42 +0100)]
mi: Ensure pointer emulating touch events update the sprite

Different miPointerSpriteFuncRec implementations do a varying
business at ultimately calling miPointerUpdateSprite(), this
particularly fails when using the plain mi sprite on touch events,
where the sprite is just moved/updated on cursor changes.

So, ensure miPointerUpdateSprite() is called generically for
pointer emulating touch events as with regular motion events.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: Make small bitfields that store enums unsigned
Aaron Plattner [Fri, 21 Dec 2012 15:37:33 +0000 (07:37 -0800)]
dix: Make small bitfields that store enums unsigned

Commit 31bf81772e146af79b0c456aae2159eba8b0280f changed the clientState field
from a signed int to a signed int 2-bit bitfield.  The ClientState enum that is
expected to be assigned to this field has four values: ClientStateInitial (0),
ClientStateRunning (1), ClientStateRetained (2), and ClientStateGone (3).
However, because this bitfield is signed, ClientStateRetained becomes -2 when
assigned, and ClientStateGone becomes -1.  This causes warnings:

 test.c:54:10: error: case label value exceeds maximum value for type [-Werror]
 test.c:55:10: error: case label value exceeds maximum value for type [-Werror]

The code here is a switch statement:

 53     switch (client->clientState) {
 54     case ClientStateGone:
 55     case ClientStateRetained:
 56         [...]
 57         break;
 58
 59     default:
 60         [...]
 61         break;
 62     }

It also causes bizarre problems like this:

 client->clientState = ClientStateGone;
 assert(client->clientState == ClientStateGone); // this assert fails

Also change the signedness of nearby bitfields to match.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agotest/xi2: fix compiler warning
Peter Hutterer [Thu, 20 Dec 2012 02:44:16 +0000 (12:44 +1000)]
test/xi2: fix compiler warning

protocol-xiwarppointer.c: In function ‘ScreenSetCursorPosition’:
protocol-xiwarppointer.c:71:53: warning: declaration of ‘screen’ shadows a
global declaration [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoUpdate to version 1.13.99.901 (1.14 RC1) xorg-server-1.13.99.901
Keith Packard [Wed, 19 Dec 2012 20:47:35 +0000 (12:47 -0800)]
Update to version 1.13.99.901 (1.14 RC1)

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'jeremyhu/master'
Keith Packard [Wed, 19 Dec 2012 20:26:00 +0000 (12:26 -0800)]
Merge remote-tracking branch 'jeremyhu/master'

11 years agoMerge remote-tracking branch 'yselkowitz/master'
Keith Packard [Wed, 19 Dec 2012 20:21:31 +0000 (12:21 -0800)]
Merge remote-tracking branch 'yselkowitz/master'

I checked this patch with diff -w to check that it only affected
whitespace.

11 years agoMerge remote-tracking branch 'alanc/master'
Keith Packard [Wed, 19 Dec 2012 20:17:59 +0000 (12:17 -0800)]
Merge remote-tracking branch 'alanc/master'

11 years agoMerge remote-tracking branch 'whot/barriers'
Keith Packard [Wed, 19 Dec 2012 20:09:31 +0000 (12:09 -0800)]
Merge remote-tracking branch 'whot/barriers'

Conflicts:
Xi/xichangehierarchy.c

Small conflict with the patch from

Xi: don't use devices after removing them

Was easily resolved by hand.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoEnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel
Alan Coopersmith [Tue, 18 Dec 2012 08:41:08 +0000 (00:41 -0800)]
EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel

d785368e0e converted the other miinitext functions to use ARRAY_SIZE,
and removed the sentinel, but missed EnableDisableExtensionError so
passing an invalid extension name could cause the server to walk off
the end off the list looking for a sentinel that wasn't there.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXQuartz: Don't add the 15bit visual any more
Jeremy Huddleston Sequoia [Tue, 18 Dec 2012 09:29:12 +0000 (01:29 -0800)]
XQuartz: Don't add the 15bit visual any more

Mountain Lion only supports 32bit backing stores, so don't use 15bit visuals until libXplugin adapts

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
11 years agoXQuartz: Revert some unfortunate auto-indenting mishaps with our super-nested for...
Jeremy Huddleston Sequoia [Tue, 18 Dec 2012 09:28:02 +0000 (01:28 -0800)]
XQuartz: Revert some unfortunate auto-indenting mishaps with our super-nested for-loops

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
11 years agohw/dmx: fix build without GLX
Rob Clark [Wed, 5 Dec 2012 23:21:27 +0000 (23:21 +0000)]
hw/dmx: fix build without GLX

Fixes this compile break that showed up on arm recently:

dmxinit.c:746:26: error: 'glxSupported' undeclared (first use in this function)
dmxinit.c:746:26: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoSupport compilers with alternate spellings of typeof
Alan Coopersmith [Fri, 7 Dec 2012 00:15:50 +0000 (16:15 -0800)]
Support compilers with alternate spellings of typeof

The AC_C_TYPEOF adds a #undef typeof to its autogenerated config.h.in
template, but b8ab93dfbc7f292 didn't copy that to dix-config.h.in
when HAVE_TYPEOF was, so the macro could claim typeof support but not
make it work, when used with compilers like Solaris Studio 12.1 which
only recognize it as __typeof__.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: don't copy the wrong event mask when activating a passive grab
Peter Hutterer [Tue, 11 Dec 2012 03:36:02 +0000 (13:36 +1000)]
dix: don't copy the wrong event mask when activating a passive grab

GrabMask is a union of core, XI1 and XI2 masks. If a XI2 grab is activated,
the value is a random pointer value, using it as mask has unpredictable
effects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: don't allow overriding a grab with a different type of grab (#58255)
Peter Hutterer [Fri, 14 Dec 2012 01:34:15 +0000 (11:34 +1000)]
dix: don't allow overriding a grab with a different type of grab (#58255)

If a client has a core grab, don't allow re-grabbing with type XI2, etc.
This was the intent of the original commit
xorg-server-1.5.99.1-782-g09f9a86, but ineffective.

X.Org Bug 58255 <http://bugs.freedesktop.org/show_bug.cgi?id=58255>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoXi: if a MD is removed, send a barrier leave event (if applicable)
Peter Hutterer [Thu, 13 Dec 2012 04:42:32 +0000 (14:42 +1000)]
Xi: if a MD is removed, send a barrier leave event (if applicable)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: don't store the window pointer in barriers, store the window ID
Peter Hutterer [Thu, 13 Dec 2012 04:04:13 +0000 (14:04 +1000)]
Xi: don't store the window pointer in barriers, store the window ID

When a client shuts down and resources are being freed, the window may have
been freed already, so accessing it to get the window ID is bad. Plus, we
never care about the window anyway other than for stuffing it into the
event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: fix per-device barrier handling
Peter Hutterer [Wed, 12 Dec 2012 05:41:32 +0000 (15:41 +1000)]
Xi: fix per-device barrier handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: don't use devices after removing them
Peter Hutterer [Thu, 13 Dec 2012 01:49:54 +0000 (11:49 +1000)]
Xi: don't use devices after removing them

RemoveDevice() frees the DeviceIntPtr, we shouldn't use the pointer after
that

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: print message to the log when zapping the server
Peter Hutterer [Wed, 12 Dec 2012 01:02:19 +0000 (11:02 +1000)]
xfree86: print message to the log when zapping the server

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Mon, 17 Dec 2012 19:45:45 +0000 (11:45 -0800)]
Merge remote-tracking branch 'whot/for-keith'

I've looked at these patches, but I can't say I've actually
reviewed them...

11 years agoMerge remote-tracking branch 'airlied/for-keithp'
Keith Packard [Mon, 17 Dec 2012 18:56:12 +0000 (10:56 -0800)]
Merge remote-tracking branch 'airlied/for-keithp'

11 years agoglx/dri2: initialise api to avoid indirect rendering failing randomly
Dave Airlie [Mon, 17 Dec 2012 05:40:17 +0000 (15:40 +1000)]
glx/dri2: initialise api to avoid indirect rendering failing randomly

Running glxinfo under indirect rendering would randomly fail against the
intel driver, as it would create a context with no attribs, and then the
api value would be passed to the driver uninitialised.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoXi: fix swapping for barrier events
Peter Hutterer [Mon, 10 Dec 2012 01:00:46 +0000 (11:00 +1000)]
Xi: fix swapping for barrier events

Protocol events don't contain pointers, so it's easier to copy everything
over, then swap in-place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: swap sequence number and evtype in barrier events
Peter Hutterer [Mon, 10 Dec 2012 00:53:49 +0000 (10:53 +1000)]
Xi: swap sequence number and evtype in barrier events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agotests/xi2: at protocol conversion test for barrier events
Peter Hutterer [Mon, 10 Dec 2012 01:02:32 +0000 (11:02 +1000)]
tests/xi2: at protocol conversion test for barrier events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoRequire inputproto 2.2.99.1
Peter Hutterer [Fri, 7 Dec 2012 05:55:59 +0000 (15:55 +1000)]
Require inputproto 2.2.99.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agomi: rename mipointer's internal event list
Peter Hutterer [Thu, 6 Dec 2012 23:26:13 +0000 (09:26 +1000)]
mi: rename mipointer's internal event list

Avoid name shadowing warnings, change the event list to a more specific
name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: if the device is currently grabbed, flag the barrier event
Peter Hutterer [Thu, 6 Dec 2012 23:11:13 +0000 (09:11 +1000)]
Xi: if the device is currently grabbed, flag the barrier event

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: deliver barrier events as grabbed events where necessary
Peter Hutterer [Thu, 6 Dec 2012 05:09:27 +0000 (15:09 +1000)]
Xi: deliver barrier events as grabbed events where necessary

If the grab_window is the barrier window and the client owns the grab,
deliver as normal grabbed event (respecting owner_events). Otherwise,
deliver as usual.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agodix: ignore barrier events in FixUpEventFromWindow
Peter Hutterer [Thu, 6 Dec 2012 04:13:26 +0000 (14:13 +1000)]
dix: ignore barrier events in FixUpEventFromWindow

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agodix: handle barrier events properly when converting to core/XI 1.x
Peter Hutterer [Thu, 6 Dec 2012 03:25:29 +0000 (13:25 +1000)]
dix: handle barrier events properly when converting to core/XI 1.x

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agodix: skip delivery if it's not the right pointer barrier client
Peter Hutterer [Thu, 6 Dec 2012 02:39:04 +0000 (12:39 +1000)]
dix: skip delivery if it's not the right pointer barrier client

Only deliver to the client that created the barrier, not to other clients.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXi: fill in barrier root x/y after clamping to RandR outputs
Peter Hutterer [Thu, 6 Dec 2012 02:58:55 +0000 (12:58 +1000)]
Xi: fill in barrier root x/y after clamping to RandR outputs

x/y for barrier events should contain the actual pointer position.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoPass the event list through to the pointer barrier code to return it
Peter Hutterer [Mon, 3 Dec 2012 00:41:16 +0000 (10:41 +1000)]
Pass the event list through to the pointer barrier code to return it

Instead of having the pointer barrier code enqueue events separately from
GetPointerEvents, pass the event list through and let it add to it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Support line and ray barriers
Jasper St. Pierre [Tue, 27 Nov 2012 20:31:52 +0000 (15:31 -0500)]
barriers: Support line and ray barriers

This allows clients to add barriers that extend to the edge of the
screen. Clients are encouraged to use these instead of precise coordinates
in these cases to help prevent pointer leaks.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Replace complex intersection test with simpler math
Jasper St. Pierre [Tue, 27 Nov 2012 19:29:52 +0000 (14:29 -0500)]
barriers: Replace complex intersection test with simpler math

Since barriers are axis-aligned, we can do the intersection test with
simple interpolation rather than line-segment intersection. This also
helps us out in the future when we want the barriers to extend to be
rays and lines rather than just segments.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Send an XI_BarrierLeave event when a barrier is destroyed
Jasper St. Pierre [Mon, 10 Dec 2012 00:45:48 +0000 (19:45 -0500)]
barriers: Send an XI_BarrierLeave event when a barrier is destroyed

This ensures that we always complete an event sequence.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Clean up code
Jasper St. Pierre [Mon, 10 Dec 2012 00:44:13 +0000 (19:44 -0500)]
barriers: Clean up code

Rename a variable. This is to make the diff in the next commit cleaner.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Send a BarrierLeave event when we leave the hitbox
Jasper St. Pierre [Thu, 6 Dec 2012 00:58:05 +0000 (19:58 -0500)]
barriers: Send a BarrierLeave event when we leave the hitbox

Additionally, add flags when the pointer is released.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Increment event ID on hit box leave
Jasper St. Pierre [Tue, 27 Nov 2012 01:37:56 +0000 (20:37 -0500)]
barriers: Increment event ID on hit box leave

We eventually want to send a new notify event on hitbox leave,
which signifies the dawn of a new barrier event ID, so it's
convenient if we can put the code here.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Add a couple pixels of elbow room for the hit detection
Jasper St. Pierre [Sun, 25 Nov 2012 02:42:56 +0000 (21:42 -0500)]
barriers: Add a couple pixels of elbow room for the hit detection

Pointers (and the hands that drive them) aren't very precise, and the
slightest amount of nudging to either side might be enough to reset
the event ID, making clients think they have an entirely new hit. Allow
for a slightly bigger "hit box" before these barriers get reset.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Add support for edge cases when releasing barriers
Jasper St. Pierre [Thu, 8 Nov 2012 06:17:40 +0000 (01:17 -0500)]
barriers: Add support for edge cases when releasing barriers

If we release a barrier, we want to ensure that we block all
other barriers afterwards, rather than capping the limit to
the two nearest barriers.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Don't allow releasing the pointer on other client's barriers
Peter Hutterer [Thu, 6 Dec 2012 02:06:28 +0000 (12:06 +1000)]
barriers: Don't allow releasing the pointer on other client's barriers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agobarriers: Don't allow destroying other client's barriers
Peter Hutterer [Thu, 6 Dec 2012 01:59:53 +0000 (11:59 +1000)]
barriers: Don't allow destroying other client's barriers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoAdd support for XI2.3: Pointer barrier events and releases.
Jasper St. Pierre [Thu, 1 Nov 2012 20:06:40 +0000 (16:06 -0400)]
Add support for XI2.3: Pointer barrier events and releases.

This adds support for clients that would like to get a notification
every time a barrier is hit, and allows clients to temporarily release
a barrier so that pointers can go through them, without having to
destroy and recreate barriers.

Based on work by Chris Halse Rogers <chris.halse.rogers@canonical.com>

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Reindent the constrainment hook
Jasper St. Pierre [Mon, 10 Dec 2012 03:48:18 +0000 (22:48 -0500)]
barriers: Reindent the constrainment hook

This is to make future diffs much cleaner. Best viewed with -w.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Switch to finding the nearest barrier client
Jasper St. Pierre [Mon, 10 Dec 2012 03:19:14 +0000 (22:19 -0500)]
barriers: Switch to finding the nearest barrier client

When we add events, we eventually want to add more state to the
PointerBarrierClient, so return one of these instead of the dummy
public structure that's not very interesting.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Switch to an explicit hook for barrier constrainment
Jasper St. Pierre [Sun, 25 Nov 2012 00:39:47 +0000 (19:39 -0500)]
barriers: Switch to an explicit hook for barrier constrainment

Rather than riding on the ConstrainCursorHarder hook, which has
several issues, move to an explicit hook, which will help us with
some RANDR interaction issues.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agobarriers: Don't loop over the server to destroy a barrier
Jasper St. Pierre [Sun, 9 Dec 2012 23:41:52 +0000 (18:41 -0500)]
barriers: Don't loop over the server to destroy a barrier

This is completely pointless as far as I can tell.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agocursor: Move pointer barrier code over to XI
Jasper St. Pierre [Thu, 1 Nov 2012 18:14:13 +0000 (14:14 -0400)]
cursor: Move pointer barrier code over to XI

In order to send events to specific windows associated with the barrier,
we need to move the code that handles barriers to somewhere where it's
easier to construct and send events. Rather than duplicating XSync with
its XSyncSelectAlarm, re-use the existing XI infrastructure.

For now, just move a bunch of code over, rename some things, and initialize
the new structures, but still consider it a separate codebase. Pointer barrier
requests are still handled by XFixes, so this is a weird intermediate state.
It's unknown whether we'll add explicit requests to pointer barriers inside
XI.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoMerge branch 'stack-smash-on-touchpoint' into for-keith
Peter Hutterer [Wed, 12 Dec 2012 07:25:28 +0000 (17:25 +1000)]
Merge branch 'stack-smash-on-touchpoint' into for-keith

11 years agoMerge branch 'touch-selection-conflict-fixes' into for-keith
Peter Hutterer [Wed, 12 Dec 2012 07:25:23 +0000 (17:25 +1000)]
Merge branch 'touch-selection-conflict-fixes' into for-keith

11 years agoXi: fix touch event selction conflicts (#57301)
Peter Hutterer [Tue, 20 Nov 2012 01:48:31 +0000 (11:48 +1000)]
Xi: fix touch event selction conflicts (#57301)

There are limits on which client may select for touch events on a given
window, with restrictions being that no two clients can select on the same
device, but narrower selections are allowed, i.e. if one client has
XIAllDevices, a second client may still select for device X.

The current code had a dependency on which client selected first and which
device, resulting in inconsistencies when selecting for events. Fix that,
responding with the right errors regardless of who selected what first.

X.Org Bug 57301 <http://bugs.freedesktop.org/show_bug.cgi?id=57301>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: split xi2_mask_isset into a per-device function
Peter Hutterer [Tue, 20 Nov 2012 01:38:39 +0000 (11:38 +1000)]
dix: split xi2_mask_isset into a per-device function

For touch selection conflicts, we need to check not only if the mask is set
for the device, but if it is set for only that specific device (regardless
of XIAll*Devices)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: add FIXME, TouchRemovePointerGrab does nothing
Peter Hutterer [Mon, 26 Nov 2012 02:33:29 +0000 (12:33 +1000)]
dix: add FIXME, TouchRemovePointerGrab does nothing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXi: if a TouchEnd appears on a actively grabbing client, always accept
Peter Hutterer [Mon, 26 Nov 2012 04:55:13 +0000 (14:55 +1000)]
Xi: if a TouchEnd appears on a actively grabbing client, always accept

Once the TouchEnd appears on the device, the touch is done. If the client
still has a pointer grab, accept it to avoid clients with TouchOwnership
selections to wait indefinitely for the actual touch event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: when deactivating pointer-only grabs, don't emulate TouchEnd events
Peter Hutterer [Mon, 26 Nov 2012 05:14:19 +0000 (15:14 +1000)]
dix: when deactivating pointer-only grabs, don't emulate TouchEnd events

A client with a pointer grab on a touch device must reject the touch when
detactivating the grab while the touch is active. However, such a rejecting
must not trigger a ButtonRelease event to be emulated and sent to the
client.
Set the grabbing listener's state to HAS_END, so we simply skip delivery to
that client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>