platform/upstream/xorg-server.git
10 years agoglx: Compute number of attributes in GetDrawableAttributes on the fly
Adam Jackson [Fri, 9 Nov 2012 22:07:20 +0000 (17:07 -0500)]
glx: Compute number of attributes in GetDrawableAttributes on the fly

This doesn't have any effect yet, but is needed to properly build the
reply for pbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoglx: Style fixes
Adam Jackson [Fri, 9 Nov 2012 21:48:16 +0000 (16:48 -0500)]
glx: Style fixes

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoglx: Pull GLX vendor string out of __GLXscreen
Adam Jackson [Fri, 9 Nov 2012 21:33:54 +0000 (16:33 -0500)]
glx: Pull GLX vendor string out of __GLXscreen

Given how we're currently implementing GLX this can't meaningfully vary
per-screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoglx: Remove unused bits from the context struct
Adam Jackson [Wed, 31 Oct 2012 14:05:24 +0000 (10:05 -0400)]
glx: Remove unused bits from the context struct

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoglxproxy: Don't track GLCLientm{aj,in}orVersion
Adam Jackson [Thu, 4 Jul 2013 14:08:40 +0000 (10:08 -0400)]
glxproxy: Don't track GLCLientm{aj,in}orVersion

Basically just a port of 62f06b0d to glxproxy.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodmx/glx: Remove unused __glXNop
Adam Jackson [Tue, 30 Oct 2012 22:20:43 +0000 (18:20 -0400)]
dmx/glx: Remove unused __glXNop

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamageext: Style fix
Adam Jackson [Thu, 22 Aug 2013 20:42:23 +0000 (16:42 -0400)]
damageext: Style fix

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Remove "post-rendering" hooks
Adam Jackson [Wed, 21 Aug 2013 15:57:24 +0000 (11:57 -0400)]
damage: Remove "post-rendering" hooks

This is a revert of 974db58f5b730c3770ee461665a02dd4334d1dea.  There are
no consumers of this API, we must not need it.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Don't rewrite Text ops to GlyphBlt ops
Adam Jackson [Wed, 21 Aug 2013 15:13:11 +0000 (11:13 -0400)]
damage: Don't rewrite Text ops to GlyphBlt ops

There's no particularly good reason to, and it breaks Xnest.

Bugzilla: http://bugs.freedesktop.org/2454
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Simplify DamageUnregister
Adam Jackson [Mon, 26 Aug 2013 18:03:51 +0000 (14:03 -0400)]
damage: Simplify DamageUnregister

You can only register one drawable on a given damage, so there's no
reason to require the caller to specify the drawable, the damage is
enough.  The implementation would do something fairly horrible if you
_did_ pass mismatched drawable and damage, so let's avoid the problem
entirely.

v2: Simplify xf86RotateDestroy even more [anholt]

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Implicitly unregister on destroy
Adam Jackson [Mon, 26 Aug 2013 17:52:14 +0000 (13:52 -0400)]
damage: Implicitly unregister on destroy

There's no reason not to, and it simplifies quite a few callers.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agofb: Remove unused compatibility wrappers
Adam Jackson [Thu, 18 Oct 2012 18:24:23 +0000 (14:24 -0400)]
fb: Remove unused compatibility wrappers

Originally added in early 2009, not being used elsewhere anymore.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agomipointer: Remove deprecated miPointerCurrentScreen
Adam Jackson [Thu, 18 Oct 2012 18:24:22 +0000 (14:24 -0400)]
mipointer: Remove deprecated miPointerCurrentScreen

The only remaining use was in some debugging code in DMX.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoxfree86: Remove deprecated unimplemented xf86MapReadSideEffects
Adam Jackson [Thu, 18 Oct 2012 18:24:21 +0000 (14:24 -0400)]
xfree86: Remove deprecated unimplemented xf86MapReadSideEffects

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodix: FIXES is not optional
Adam Jackson [Thu, 18 Oct 2012 18:24:20 +0000 (14:24 -0400)]
dix: FIXES is not optional

It's already not optional at configure time, this just makes it so at
build time too.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agovbe: Don't try to load the ddc submodule
Adam Jackson [Thu, 18 Oct 2012 18:24:19 +0000 (14:24 -0400)]
vbe: Don't try to load the ddc submodule

DDC is built into the server now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agomisprite: Delete some dead private storage
Adam Jackson [Thu, 18 Oct 2012 18:24:18 +0000 (14:24 -0400)]
misprite: Delete some dead private storage

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodri2: Don't bother with xf86LoaderCheckSymbol("DRI2Connect")
Adam Jackson [Tue, 16 Oct 2012 18:56:25 +0000 (14:56 -0400)]
dri2: Don't bother with xf86LoaderCheckSymbol("DRI2Connect")

The DRI2 code is now built-in to the server, even for Xorg.  The only
thing this could protect against is trying to run a libglx built with
DRI2 support against an Xorg built without it, which is firmly in
"doctor it hurts when I do this" territory.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agolist: Avoid using X types
Adam Jackson [Tue, 16 Oct 2012 18:56:23 +0000 (14:56 -0400)]
list: Avoid using X types

In particular, Bool.  This is not an ABI break:

/usr/include/X11/Xdefs.h:typedef int Bool;

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodbe: Fold the window private private into the window private
Adam Jackson [Tue, 16 Oct 2012 18:56:22 +0000 (14:56 -0400)]
dbe: Fold the window private private into the window private

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodbe: Fold midbe reset into dix
Adam Jackson [Tue, 16 Oct 2012 18:56:21 +0000 (14:56 -0400)]
dbe: Fold midbe reset into dix

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodbe: Drop the unused idiom support
Adam Jackson [Tue, 16 Oct 2012 18:56:20 +0000 (14:56 -0400)]
dbe: Drop the unused idiom support

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodamage: Remove the 'damage window' resource type.
Adam Jackson [Tue, 16 Oct 2012 18:56:19 +0000 (14:56 -0400)]
damage: Remove the 'damage window' resource type.

Note that the existing code never actually creates a resource of this
type, so it can't possibly do anything.  This is clearly meant to track
window destruction and clean up any associated Damages, but that's
already handled by miext/damage's DestroyWindow wrapper.

Previous discussion:
http://lists.freedesktop.org/archives/xorg-devel/2011-March/020847.html

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodmx: Remove ShadowFB support
Adam Jackson [Tue, 16 Oct 2012 18:56:18 +0000 (14:56 -0400)]
dmx: Remove ShadowFB support

This has been listed as deprecated ever since DMX was merged.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agodix: Remove a dead parameter from DoGetImage
Adam Jackson [Tue, 16 Oct 2012 18:56:17 +0000 (14:56 -0400)]
dix: Remove a dead parameter from DoGetImage

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agomipointer: Remove EnqueueEvent from miPointerScreenFuncRec
Adam Jackson [Tue, 16 Oct 2012 18:56:16 +0000 (14:56 -0400)]
mipointer: Remove EnqueueEvent from miPointerScreenFuncRec

No DDX overrode this, and we never actually called through that slot
anyway.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agomipointer: Flatten calls to mieqSwitchScreen
Adam Jackson [Tue, 16 Oct 2012 18:56:15 +0000 (14:56 -0400)]
mipointer: Flatten calls to mieqSwitchScreen

No DDX was overriding this.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoos: Factor out some common code in input buffer handling
Adam Jackson [Tue, 16 Oct 2012 18:56:14 +0000 (14:56 -0400)]
os: Factor out some common code in input buffer handling

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoxnest: Ignore GetImage() error in xnestGetImage()
Radek Doulik [Tue, 13 Aug 2013 06:45:47 +0000 (08:45 +0200)]
xnest: Ignore GetImage() error in xnestGetImage()

When an Xnest instance is not viewable it will crash when a client in
that instance calls GetImage. This is because the Xnest server will
itself receives a BadMatch error.
This patch ignores the error. The application which has requested the
image will receive garbage - this however is fully legal according
to the specs as obscured areas will always contain garbage if there
isn't some sort of backing store as discussed in
https://bugs.freedesktop.org/show_bug.cgi?id=9488
The applied patch is a version from Dadek Doulik.

v2: Call XSync() before changing error handlers as suggested by
    Daniel Stone <daniel@fooishbar.org>.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Egbert Eich <eich@freedesktop.org>
10 years agoXnest: Implement xnestModifyPixmapHeader
Michal Srb [Tue, 6 Aug 2013 14:56:53 +0000 (16:56 +0200)]
Xnest: Implement xnestModifyPixmapHeader

Xnest variant of ModifyPixmapHeader that creates new Pixmap in parent X
server if it's size is modified from 0x0 to anything bigger.

xnestCreatePixmap doesn't create pixmap in parent X server if it has
dimensions 0x0. If it is later resized and accessed, Xnest will be
aborted with BadDrawable error from parent X server because it will
use XID 0. This happens with ScratchPixmap, for example as used from
XaceCensorImage. Applications using XACE crash Xnest.

Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agosecurity: Don't count RetainPermanent clients twice
Peter Harris [Mon, 15 Jul 2013 23:44:45 +0000 (19:44 -0400)]
security: Don't count RetainPermanent clients twice

If a RetainPermanent client is subsequently killed by a KillClient
request, the reference count is decremented twice. This can cause the
server to prematurely kill other clients using the same Authorization.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
10 years agomi: Avoid stack smash when drawing dashed lines
Peter Harris [Mon, 15 Jul 2013 23:44:29 +0000 (19:44 -0400)]
mi: Avoid stack smash when drawing dashed lines

X.org Bug 54013 <https://bugs.freedesktop.org/show_bug.cgi?id=54013>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
10 years agoos: Immediately queue initial WriteToClient
Chris Wilson [Fri, 21 Jun 2013 21:58:31 +0000 (22:58 +0100)]
os: Immediately queue initial WriteToClient

If we immediately put the WriteToClient() buffer into the socket's write
queue, not only do we benefit from sending the response back to client
earlier, but we also avoid the overhead of copying the data into our own
staging buffer and causing extra work in the next select(). The write is
effectively free as typically we may only send one reply per client per
select() call, so the cost of the FlushClient() is the same.

shmget10:   26400 -> 110000
getimage10: 25000 -> 108000

shmget500:   3160 -> 13500
getimage500: 1000 -> 1010

The knock-on effect is that on a mostly idle composited desktop, the CPU
overhead is dominated by the memmove in WriteToClient, which is in turn
eliminated by this patch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoephyr: restore GLX support
Laurent Carlier [Fri, 7 Jun 2013 22:43:56 +0000 (00:43 +0200)]
ephyr: restore GLX support

It was removed since version 1.13

Signed-off-by: Sebastien Bacher <seb128@ubuntu.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
10 years agomiext/sync: Fix multi-screen support in SyncFence initialization
Keith Packard [Wed, 24 Apr 2013 21:58:27 +0000 (14:58 -0700)]
miext/sync: Fix multi-screen support in SyncFence initialization

miSyncSetup was checking to see if the screen private key had been
registered, and if so, skipping the setup of the provided screen.

Instead, it should register the private index only once, but then
initialize the screen unless it has already been initialized. This
latter step allows drivers to initialize the sync private structures
before the Sync extension itself is initialized.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agorandr: Fix a copypasta bug in CRTC confinement
Adam Jackson [Wed, 21 Aug 2013 18:12:52 +0000 (14:12 -0400)]
randr: Fix a copypasta bug in CRTC confinement

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
10 years agoMerge remote-tracking branch 'jturney/master'
Keith Packard [Mon, 9 Sep 2013 22:13:42 +0000 (15:13 -0700)]
Merge remote-tracking branch 'jturney/master'

11 years agoFix typo in configure warning.
Thomas Klausner [Wed, 4 Sep 2013 18:06:07 +0000 (20:06 +0200)]
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>
11 years agoFix bug in cursor handling.
Thomas Klausner [Wed, 4 Sep 2013 18:05:51 +0000 (20:05 +0200)]
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>
11 years agokdrive: fix build error on gcc 4.8 for out-of-bounds array access
Chris Clayton [Wed, 4 Sep 2013 05:42:04 +0000 (15:42 +1000)]
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>
11 years agohw/xwin: Remove unnecessary and incorrect HWND casts
Marc Haesen [Sat, 10 Aug 2013 16:38:38 +0000 (17:38 +0100)]
hw/xwin: Remove unnecessary and incorrect HWND casts

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
Jon TURNEY [Mon, 1 Apr 2013 12:43:00 +0000 (13:43 +0100)]
hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration

/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function â€˜MitGenerateCookie’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function â€˜MitAddCookie’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c
Jon TURNEY [Mon, 17 Jun 2013 22:54:01 +0000 (23:54 +0100)]
hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()
Jon TURNEY [Mon, 17 Jun 2013 17:37:26 +0000 (18:37 +0100)]
hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()

Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual
definition immediately follows.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Remove prototype for non-existent winDeinitClipboard()
Jon TURNEY [Mon, 17 Jun 2013 15:58:47 +0000 (16:58 +0100)]
hw/xwin: Remove prototype for non-existent winDeinitClipboard()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Remove unused externs from winclipboardwrappers.c
Jon TURNEY [Sun, 16 Jun 2013 23:40:13 +0000 (00:40 +0100)]
hw/xwin: Remove unused externs from winclipboardwrappers.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Remove unused winProcQueryTreeOrig variable
Jon TURNEY [Mon, 10 Jun 2013 16:31:12 +0000 (17:31 +0100)]
hw/xwin: Remove unused winProcQueryTreeOrig variable

Unused since 47c7b6d3e626497747ae2780f259a15b8e6c846f "Remove no-longer needed
tricks used to prevent the clipboard client from being killed"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Fix ARGB cursor conversion on x86_64
Jon TURNEY [Sat, 10 Aug 2013 11:41:07 +0000 (12:41 +0100)]
hw/xwin: Fix ARGB cursor conversion on x86_64

Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
leads to ARGB cursors being vertically streched on x86_64 by interleaving blank
rows of pixels.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds
Jon TURNEY [Sun, 7 Apr 2013 22:59:44 +0000 (23:59 +0100)]
hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds

The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we
access two (black and white for a mono-color DIB).  Fix by changing to a dynamic
allocation big enough for a BITMAPINFO and a RGBQUAD.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
Jon TURNEY [Sat, 10 Aug 2013 10:55:23 +0000 (11:55 +0100)]
hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()

Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
trigger an -Warray-bounds warning.

Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.

wincursor.c: In function 'winSetCursor':
wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64
Marc Haesen [Fri, 2 Aug 2013 17:19:22 +0000 (18:19 +0100)]
hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64

Use the correct size of a HWND on x86_64 in XChangeProperty() and
XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property.

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Correct winprefs.c function signatures for x64.
Colin Harrison [Fri, 9 Aug 2013 15:48:12 +0000 (16:48 +0100)]
hw/xwin: Correct winprefs.c function signatures for x64.

Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
where just a specific HWND or HMENU handle type should have been used.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agoMove pseudoramiX code where it can be shared between Xwin and Xquartz
Jon TURNEY [Sat, 31 Mar 2012 13:42:45 +0000 (14:42 +0100)]
Move pseudoramiX code where it can be shared between Xwin and Xquartz

Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
with libPseudoramiX

I'm not sure moving this to a top-level directory is appropriate, but I'm not
sure where else it fits.

Future work: pseudoramiX can probably be consolidated with the rrxinerama code
(which I think provides fake xinerama data when real XINERAMA is disabled and we
only have one screen)

v2: fix distcheck

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Fix winglobals.h for MinGW64 build
Jon TURNEY [Sat, 10 Aug 2013 11:35:55 +0000 (12:35 +0100)]
hw/xwin: Fix winglobals.h for MinGW64 build

Include pthread.h in winglobals.h to fix build with latest MinGW64 headers

In file included from
winmultiwindowicons.c:47:0:
winglobals.h:92:1: error: unknown type name â€˜pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agohw/xwin: Fix inclusion of shlobj.h in MinGW64 build
Jon TURNEY [Sun, 11 Aug 2013 11:15:11 +0000 (12:15 +0100)]
hw/xwin: Fix inclusion of shlobj.h in MinGW64 build

Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well

In file included from InitOutput.c:51:0:
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or â€˜(’ before â€˜int’
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or â€˜(’ before â€˜int’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
11 years agoXi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)
Peter Hutterer [Mon, 26 Aug 2013 05:51:46 +0000 (15:51 +1000)]
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>
11 years agodix: check for grab type before checking XI2 mask
Peter Hutterer [Fri, 16 Aug 2013 05:30:59 +0000 (15:30 +1000)]
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>
11 years agoXi: replace loop with memset
Peter Hutterer [Fri, 16 Aug 2013 00:55:09 +0000 (10:55 +1000)]
Xi: replace loop with memset

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoinclude: wrap EMASKSIZE in parentheses
Peter Hutterer [Fri, 16 Aug 2013 01:05:49 +0000 (11:05 +1000)]
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>
11 years agotest: fix the gcc diagnostics pragma
Peter Hutterer [Thu, 22 Aug 2013 23:04:01 +0000 (09:04 +1000)]
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>
11 years agoDIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()
Egbert Eich [Fri, 16 Aug 2013 17:52:16 +0000 (19:52 +0200)]
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>
11 years agoephyr: Fix warning about XID vs unsigned long * by changing function args
Eric Anholt [Sat, 17 Aug 2013 12:50:37 +0000 (14:50 +0200)]
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>
11 years agoephyr: Drop is_ok logging.
Eric Anholt [Sat, 17 Aug 2013 12:38:08 +0000 (14:38 +0200)]
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>
11 years agokdrive: Fix const cast warnings in arguments processing.
Eric Anholt [Sat, 17 Aug 2013 12:36:09 +0000 (14:36 +0200)]
kdrive: Fix const cast warnings in arguments processing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Fix const cast warnings in driver name handling.
Eric Anholt [Sat, 17 Aug 2013 11:11:17 +0000 (13:11 +0200)]
kdrive: Fix const cast warnings in driver name handling.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Fix a few easy cast warnings.
Eric Anholt [Sat, 17 Aug 2013 11:07:23 +0000 (13:07 +0200)]
kdrive: Fix a few easy cast warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Drop dead code.
Eric Anholt [Sat, 17 Aug 2013 11:06:23 +0000 (13:06 +0200)]
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>
11 years agoephyr: Fix dead code warning.
Eric Anholt [Sat, 17 Aug 2013 11:01:57 +0000 (13:01 +0200)]
ephyr: Fix dead code warning.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Fix const-cast warnings for setting window title.
Eric Anholt [Sat, 17 Aug 2013 11:01:32 +0000 (13:01 +0200)]
ephyr: Fix const-cast warnings for setting window title.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Fix const cast warnings in ephyrhostvideo.
Eric Anholt [Sat, 17 Aug 2013 10:54:33 +0000 (12:54 +0200)]
ephyr: Fix const cast warnings in ephyrhostvideo.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agodix: add missing include for DeleteWindowFromAnySelections
Julien Cristau [Sat, 27 Jul 2013 10:09:07 +0000 (12:09 +0200)]
dix: add missing include for DeleteWindowFromAnySelections

Fixes build error with XACE disabled:
window.c:886:5: error: implicit declaration of function 'DeleteWindowFromAnySelections' [-Werror=implicit-function-declaration]
     DeleteWindowFromAnySelections(pWin);
     ^

Debian bug#701372

Reported-by: Matthias Klose <doko@debian.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoAdd .dir-locals.el
Keith Packard [Sat, 17 Aug 2013 10:17:36 +0000 (12:17 +0200)]
Add .dir-locals.el

Enforce X.org style with an emacs configuration file

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge commit '9680f6a12d642c2e4bfa09bf459d678214059d74'
Keith Packard [Tue, 6 Aug 2013 05:12:12 +0000 (07:12 +0200)]
Merge commit '9680f6a12d642c2e4bfa09bf459d678214059d74'

11 years agoAllow disabling XFree86-DGA, DRI, VidModeExtension extensions
Alan Coopersmith [Tue, 6 Aug 2013 03:46:45 +0000 (20:46 -0700)]
Allow disabling XFree86-DGA, DRI, VidModeExtension extensions

Code to recognize these in extension enable/disable options was wrapped
in #ifdef XorgLoader, but that's not defined when building miinitext.c
since the great module merge of 1.13.  Change to an #ifdef that is defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Robert Hooker <robert.hooker@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: de-duplicate some AM_CPPFLAGS
Peter Hutterer [Tue, 6 Aug 2013 03:14:56 +0000 (13:14 +1000)]
xfree86: de-duplicate some AM_CPPFLAGS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoReplace INCLUDES with AM_CPPFLAGS
Peter Hutterer [Tue, 6 Aug 2013 03:08:13 +0000 (13:08 +1000)]
Replace INCLUDES with AM_CPPFLAGS

newer automake gets quite noisy about this.
hw/xfree86/ddc/Makefile.am:7: warning:
'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
and many more of these.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoxfree86: improve check for posix saved ids
Julien Cristau [Fri, 2 Aug 2013 18:07:36 +0000 (20:07 +0200)]
xfree86: improve check for posix saved ids

Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and
the _POSIX_SAVED_IDS macro.

Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agotest: include dix-config.h in hashtabletest.c
Julien Cristau [Fri, 2 Aug 2013 21:46:00 +0000 (23:46 +0200)]
test: include dix-config.h in hashtabletest.c

Missing _XSERVER64 define caused inconsistent sizeof(XID) between the
test and hashtable code, leading to test failures on 64bit big endian
archs like s390x or ppc64.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agotest/xi2: fix protocol-xiqueryversion test
Maarten Lankhorst [Tue, 30 Jul 2013 13:31:24 +0000 (15:31 +0200)]
test/xi2: fix protocol-xiqueryversion test

The old code was broken and allowed setting client version >= XIVersion,
this was fixed in the previous patch, but updating the value for XIVersion
broke the tests, so fix the tests too.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXi: Clamp XIClient maximal version to XIVersion
Maarten Lankhorst [Tue, 30 Jul 2013 12:45:21 +0000 (14:45 +0200)]
Xi: Clamp XIClient maximal version to XIVersion

Do not allow setting client version to an arbitrary value >= XIVersion.
Fixes a test error with test/xi2/protocol-xiqueryversion.c, introduced by
commit 4360514d1c "Xi: Allow clients to ask for 2.3 and then 2.2 without failing"

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86/man: document AutoAddGPU
Dave Airlie [Wed, 31 Jul 2013 01:35:44 +0000 (11:35 +1000)]
xfree86/man: document AutoAddGPU

This at least mentions AutoAddGPU and hints at when you might
want to disable it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Fri, 26 Jul 2013 05:50:27 +0000 (22:50 -0700)]
Merge remote-tracking branch 'whot/for-keith'

11 years agoXi: Allow clients to ask for 2.3 and then 2.2 without failing
Keith Packard [Thu, 11 Jul 2013 05:42:55 +0000 (22:42 -0700)]
Xi: Allow clients to ask for 2.3 and then 2.2 without failing

This allows different sub-systems within the same application to
request different Xi versions without either getting old behaviour
everywhere or simply failing with a BadValue.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86: detach scanout pixmaps when detaching output GPUs
Aaron Plattner [Tue, 30 Apr 2013 21:14:23 +0000 (14:14 -0700)]
xfree86: detach scanout pixmaps when detaching output GPUs

Commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agodix: set the valuator mask to ensure XI 1.x events have data
Peter Hutterer [Mon, 22 Jul 2013 03:43:07 +0000 (13:43 +1000)]
dix: set the valuator mask to ensure XI 1.x events have data

XI 1.x only allows for first + num valuators, so if a device sends data for
valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get
the data for that from somewhere.
XI 1.x uses the hack of an unset valuator mask to get the right coordinates,
i.e. we set the value but don't set the mask for it so XI2 events have the
right mask.

For an absolute device in relative mode, this broke in b28a1af55cf, the
value was now always 0. This wasn't visible on the cursor, only in an XI 1.x
client. The GIMP e.g. sees jumps to x/0 every few events.

Drop the condition introduced in b28a1af55cf, data in valuators is always
absolute, regardless of the mode.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: check the xi2mask, not the grab type for touch listeners
Peter Hutterer [Wed, 24 Jul 2013 01:50:00 +0000 (11:50 +1000)]
dix: check the xi2mask, not the grab type for touch listeners

grab->type is only non-zero for passive grabs. We're checking an active grab
here, so we need to check if the touch mask is set on the grab.

Test case: grab the device, then start two simultaneous touches. The
grabbing client won't see the second touchpoints because grab->type is 0
and the second touch is not an emulating pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agohw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers
Jon TURNEY [Mon, 8 Apr 2013 00:28:36 +0000 (01:28 +0100)]
hw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers

Numerous pieces of debug output cast a pointer to an int and then use a "%08x"
printf format.

Use "%p" format for 64-bit portability.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix possible crash in winMultiWindowGetClassHint
Colin Harrison [Tue, 25 Jun 2013 20:34:43 +0000 (21:34 +0100)]
hw/xwin: Fix possible crash in winMultiWindowGetClassHint

Fix a possible crash in winMultiWindowGetClassHint() when an application doesn't
null terminate the WM_CLASS property class name (which is an ICCCM conformance
bug in the application)

(Reported for running the contiki cooja simulator in multiwindow mode, although
it seems that many Java clients may have this problem, see [1])

Based on a patch by Marc Haesen.

v2: Avoid using strnlen() which is missing on MinGW
v3: Align with Xming patch

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
11 years agohw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN
Jon TURNEY [Tue, 18 Jun 2013 18:21:02 +0000 (19:21 +0100)]
hw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN

Remove obsolete WIN_XEVENTS_SHUTDOWN.  This event is never generated.

(I think the idea was to listen for WM_DELETE_WINDOW, but that's not a very
useful thing to do for a hidden window.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoconfigure.ac: Check for python at configure time when building XWin with AIGLX
Jon TURNEY [Tue, 18 Jun 2013 17:03:05 +0000 (18:03 +0100)]
configure.ac: Check for python at configure time when building XWin with AIGLX

Check for python at configure time when building XWin with AIGLX, it's used to
generate the wrapper code for native GL functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()
Jon TURNEY [Sat, 15 Jun 2013 23:07:57 +0000 (00:07 +0100)]
hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()

Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in
NetWMToWinIconAlpha()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Handle WM_MOUSEHWHEEL
Jon TURNEY [Thu, 21 Feb 2013 17:12:17 +0000 (17:12 +0000)]
hw/xwin: Handle WM_MOUSEHWHEEL

Handle WM_MOUSEHWHEEL tilt wheel messages, similarly to WM_MOUSEWHEEL scroll
wheel messages, to generate X button 6 and 7 presses and releases.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9
Jon TURNEY [Thu, 21 Feb 2013 17:10:45 +0000 (17:10 +0000)]
hw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9

Map extra mouse buttons 1 and 2 to X buttons 8 and 9, as conventional, leaving X
buttons 6 and 7 for tilt wheel.

Also add button labels for buttons 6, 7, 8 and 9 and change btn_labels in from a
dynamic allocation to a fixed one of the required size for all the labels we
use.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Remove unneeded WM_XBUTTON message defines
Jon TURNEY [Tue, 19 Feb 2013 14:38:40 +0000 (14:38 +0000)]
hw/xwin: Remove unneeded WM_XBUTTON message defines

Remove unneeded WM_XBUTTON message defines, they have been provided by w32api
for a long time now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Change winTranslateKey() to return it's result as it's return value
Jon TURNEY [Mon, 17 Dec 2012 22:38:00 +0000 (22:38 +0000)]
hw/xwin: Change winTranslateKey() to return it's result as it's return value

Change winTranslateKey() to return it's result as it's return value, and change
it's uses as well.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Consider left and right modifier keys independently on gaining focus
Oliver Schmidt [Mon, 5 Nov 2012 15:05:32 +0000 (15:05 +0000)]
hw/xwin: Consider left and right modifier keys independently on gaining focus

Handle left and right ctrl and shift keys independently

Assume that all modifiers are cleared when all keys are released on focus lost,
as internalKeyState doesn't record which modifier key was pressed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Remove an extra '\n' from some log messages
Jon TURNEY [Mon, 5 Apr 2010 13:22:39 +0000 (14:22 +0100)]
hw/xwin: Remove an extra '\n' from some log messages

Remove an extra '\n' from internal client IOError log messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: _NET_WM_STATE is ATOM[] not ATOM
Jon TURNEY [Sat, 4 Feb 2012 17:04:11 +0000 (17:04 +0000)]
hw/xwin: _NET_WM_STATE is ATOM[] not ATOM

_NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of
the atoms, not just the first one

See EWMH specifcation, section "Application Window Properties"

v2: Actually use [] on the returned atom data

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread
Jon TURNEY [Wed, 31 Aug 2011 20:35:14 +0000 (21:35 +0100)]
hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread

Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But
for the X server to exit cleanly, we also need the X server dispatch loop to be
unblocked so it can notice that DE_TERMINATE has been set and exit, removing
it's lock file and any unix domain socket.

It appears that the system will terminate the process when the last UI thread in
that process returns from processing WM_ENDSESSION for the last top-level
window.

Since WM_ENDSESSION appears to sent by the system via SendMessage()
(synchronously) and the wndproc is called to process it in the message thread
for that window (the X server thread), we can't easily terminate the X server
dispatch loop from inside the WM_ENDSESSION message processing.

So, create a messaging window, a hidden, top-level window, with a separate
thread to catch this message, and process it by calling GiveUp() and then
blocking on a mutex until the X server dispatch loop exits.

Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no
action.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoAllow DDX to provide a main()
Jon TURNEY [Mon, 3 Sep 2012 14:19:43 +0000 (15:19 +0100)]
Allow DDX to provide a main()

XQuartz already conditionally renames main() as dix_main() so it can provide
it's own main().  This isn't the ideal way of doing this, as it prevents libdix
built this way from being useful with any other DDX.

So instead, always name that function dix_main(), and also provide a stub main()
which just calls dix_main(), which can be overriden in the DDX.

Add a main() to XWin (XQuartz already has one, of course).

It's no longer neccessary to link XWin and XQuartz with libmain.

v2: Remove unneeded stub main hw/xwin/InitOutput.c

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