ephyr: Fix const cast warnings in ephyrhostvideo.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
ephyr: Fix const-cast warnings for setting window title.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
ephyr: Fix dead code warning.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
kdrive: Drop dead code.

This is unused as of the introduction of a helper in
e7150db5350bc2113ff4126019b489847a4dc217

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
kdrive: Fix a few easy cast warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
kdrive: Fix const cast warnings in driver name handling.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
kdrive: Fix const cast warnings in arguments processing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
ephyr: Drop is_ok logging.

The only cases that lead to !is_ok are already EPHYR_LOG_ERROR, and it
fixes set-but-unused compiler warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
ephyr: Fix warning about XID vs unsigned long * by changing function args

There's no reason to pass the data back out to the caller, since the
caller was dropping it on the floor.  The original data is a CARD32,
so no need to mess with weird unsigned longs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
DIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()

If we have a client which has registered for a DeviceButton grab
be sure to pass this to CheckDeviceGrabAndHintWindow(). Since the
order of clients is arbitrary there is no guarantee that the last
client in the list is the one that belongs to this class.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: fix the gcc diagnostics pragma

pop without push restores the commandline options. The proper way is to
push, then ignore, then pop.

And while we're at it, change the pop argument to a comment - pop ignores
the argument, but be proper about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
include: wrap EMASKSIZE in parentheses

Otherwise things like EMASKSIZE * foo will yield interesting results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Xi: replace loop with memset

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
dix: check for grab type before checking XI2 mask

if the grab type isn't XI2, grab->xi2mask is random. That random data may
have the enter/leave mask set, leading to events sent to the client that the
client can't handler.

Source of these errors:
  _xgeWireToEvent: Unknown extension 131, this should never happen.

Simplest reproducer:
   Start Xephyr, press button inside window, move out. As the pointer leaves
   the Xephyr window, the errors appear.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)

XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi
causes libXi to always use the new request length if the server supports
2.2, regardless of the client's XIQueryVersion request.

The server takes the client's XIQueryVersion request into account though,
resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a
XI 2.2+ server.

Can't fix this in libXi, so work around this in the server.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
kdrive: fix build error on gcc 4.8 for out-of-bounds array access

I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot
of gcc-4.8:

input.c:225:43: error: array subscript is above array bounds
[-Werror=array-bounds]

This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in
KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can
be beyond the end of the array.

Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix bug in cursor handling.

CreateCursor (Xlib call XCreatePixmapCursor) with a non-bitmap
source pixmap and a None mask is supposed to error out with BadMatch,
but didn't.

From der Mouse <mouse@Rodents-Montreal.ORG>, changed following
comments by Alan Coopersmith <alan.coopersmith@oracle.com>.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix typo in configure warning.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
dbe: Cleanup in CloseScreen hook not ext CloseDown

Instead of registering an extension CloseDownProc when adding the dbe
extension this patch hooks into pScreen->CloseScreen so that the chain
of pScreen->DestroyWindow hooks remains valid until all windows have
been destroyed. Previously it was possible for DbeResetProc to be called
before the root window had been destroyed and the unwrapping of
pScreen->DestroyWindow would clobber the chain of callbacks.

This is needed for xwayland to be able to know when the root window is
destroyed so it can unredirect root sub-windows.
xkb: Add struct XkbCompContext

This commit adds a struct that contains most of the context for starting,
running and cleaning up after xkbcomp.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>