Commit Graph

9428 Commits

Author SHA1 Message Date
Jeremy Huddleston
a911292c85 XQuartz: Don't trust deltaXY for middle mouse clicks.
The middle mouse clicks return erroneous values after returning from
Fast User Switching.

<rdar://problem/7979468>
http://xquartz.macosforge.org/trac/ticket/389

Signed-off-by: Martin Otte <otte@duke.edu>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Edward Moy <emoy@apple.com>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-16 13:12:15 -07:00
Keith Packard
345eb17126 Remove dbe screen private privates.
Each DBE Screen private structure could have nested privates. Oddly,
no code ever used them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-15 19:57:48 -07:00
Keith Packard
87ea5760f8 Check pixmap allocation return value when creating glyphs
The driver may decide that the pixmap is too large or something and
fail to allocate a pixmap; not checking would lead to a segfault.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-15 19:51:05 -07:00
Alan Coopersmith
03f7e92a6c Update list of supported platforms in configure.ac error message
Adds DragonFly BSD, OpenSolaris, & GNU Hurd.
Drops MacOS X, since this is in the section specific to the Xorg/XFree86 DDX.
(Matches the OS patterns the configure script checks for.)

Also uses m4 macros to fix the spacing/formatting of the resulting message.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
2010-05-14 19:49:00 -07:00
Alan Coopersmith
e42a29d269 Fix compiler issues with getifaddrs() call on OpenSolaris
OpenSolaris recently added support for the getifaddrs() API.

Building with that uncovered two compiler issues (one warning, one error)
in the code that was now being built for the first time in our builds:

"access.c", line 768: warning: argument #1 is incompatible with prototype:
        prototype: pointer to struct sockaddr {unsigned short sa_family, array[14] of char sa_data} : "access.c", line 213
        argument : pointer to struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2}

"access.c", line 838: assignment type mismatch:
        struct sockaddr {unsigned short sa_family, array[14] of char sa_data} "=" struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-14 19:48:01 -07:00
Jamey Sharp
c6613cfc26 test/xi2: Initialize predefined atoms before XInputExtensionInit.
XInputExtensionInit calls MakeAtom, which doesn't work without the atoms
table initialized.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-14 17:33:50 -07:00
Pauli Nieminen
1461b31e40 dri2: Fix xserver crash if dri2 buffer allocation fails.
If driver fails to allocate memory for dri2 buffer server would crash
in send_buffers_reply.

Solution is to handle the allocation failure and return BadAlloc to
client.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-14 12:26:38 -07:00
Keith Packard
f87002cb7d Merge remote branch 'jamey/for-keith' 2010-05-14 11:46:29 -07:00
Jamey Sharp
890f536f8d Bugfix for "Pre-validate ChangeGC XIDs": off-by-one in loop index.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2010-05-14 10:38:29 -07:00
Oliver McFadden
a4fbc0feda scrnintstr.h: removed unused PaintWindow function pointers.
Please note this patch breaks the ABI.

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-14 08:27:10 +03:00
Oliver McFadden
71296885b0 mi: removed unused PointerNonInterestBox functions.
Please note this patch breaks the ABI.

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-14 07:50:49 +03:00
Keith Packard
795432d4a9 Merge remote branch 'jamey/cleanups' 2010-05-13 18:22:49 -07:00
Jamey Sharp
92ed75ac59 Eliminate boilerplate around client->noClientException.
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13 17:14:07 -07:00
Jamey Sharp
11c69880c7 Quit using clientErrorValue in dix/colormap.c.
And that's it! No more clientErrorValue kludge.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
a3d948ddbb clientErrorValue is never used outside dix. Stop importing it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
653e4878c4 Quit using clientErrorValue in dix/gc.c.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
5193f25ea3 Define GCAllBits as the union of all valid CreateGC masks.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
6a84cd9434 Replace dixChangeGC with calls directly to the right variant.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
2d7eb4a19b Pre-validate ChangeGC XIDs.
In order to execute a wire-level ChangeGC request, we need to look up
the resources named by any XIDs in the value-list. Various places in the
server already have pointers to the resources they want to set into the
GC, though, so over time the interface has evolved to accept either XIDs
or pointers, with several different function call signatures used in
different eras.

This patch makes the existing code require pointers to resources rather
than XIDs, and adds a simple wrapper that looks up any XIDs. The old
dixChangeGC API is preserved by delegating to whichever implementation
is appropriate.

This affects error-handling: If any of the XIDs are invalid, then the GC
is unchanged, and its ChangeGC callback is not invoked. This change is
allowed by the protocol spec, which says, "The order in which components
are verified and altered is server-dependent. If an error is generated,
a subset of the components may have been altered."

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
e2929db7b7 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:13:48 -07:00
Jamey Sharp
95728ca09d Don't statically allocate the ChangeGC parameter array.
Because that's insane.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 16:24:54 -07:00
Jamey Sharp
bff8525f84 Simplify miFillPolyHelper and miLineArc.
Both functions compute a set of spans and either fill them immediately
or accumulate them into a caller-provided buffer.

Computing the spans used only the miTranslate and lineWidth fields of
pGC, and neither could have been changed by the initial
ChangeGC/ValidateGC pair, so it's safe to compute the spans first.

Then both functions consume the spans the same way, so factor that into
a new fillSpans function.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 16:24:54 -07:00
Jamey Sharp
83f7ec9727 miwideline: Factor out span buffer allocation.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13 16:24:54 -07:00
Keith Packard
f2a0c324e3 Remove devPrivates init and delete callback lists.
XSELinux was the only consumer of these interfaces and it no longer
needs them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-13 14:16:32 -07:00
Eamon Walsh
c9e7ca4404 xselinux: Remove use of devPrivates init/free callbacks.
Commit eb9210097e removed the
sidget/sidput calls which were the major reason for using the
callbacks.  The remaining operations can be skipped or worked
around.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 10:07:31 -07:00
Jeremy Huddleston
bca85e2e12 Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN
Use the values from xproto rather than duplicating the effort

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 10:03:23 -07:00
Kristian Høgsberg
421606a8ef dri2: Send out event when auxillary buffers are invalidated
This lets the DRI2 clients rely on the server to notify them when they
need to get new buffers.  Without this, OpenGL clients poll the server
in glViewport() which can be a performance problems and also isn't
completely correct behaviour.

We bump the DRI2 protocol minor to indicate the availability of the
event, which the DRI2 clients can use to avoid polling.  This speeds up
various piglit and oglc test cases as well as real applications.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:32:04 -07:00
Alan Coopersmith
f281db9a5e Remove ResNoAvoid definition, missed in the RAC removal
ResNoAvoid is #defined to ResBios, but ResBios was removed
from xf86str.h in 4b42448a23

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 04:20:34 -07:00
Jamey Sharp
3150417623 CreateGC: Pass current client on to ChangeGC.
Otherwise we can't check that the XIDs this GC is being initialized with
are accessible to this client.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-05-12 18:16:37 -07:00
Jamey Sharp
04bad1b8a1 Kill ChangeGC in favor of dixChangeGC.
This doesn't change any behavior, but it isn't clear whether NullClient
is correct in all cases. As ajax says,

> For most of these changes, I think it's correct to use NullClient,
> since they are server-initiated changes and should not fail for (eg)
> xace reasons. ... At any rate, you're certainly not changing any
> semantics by leaving them all as NullClient, so this patch can't be
> more wrong than before.

The call in CreateGC is particularly questionable.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-12 18:10:01 -07:00
Jamey Sharp
65cedf3905 Kill DoChangeGC in favor of dixChangeGC.
This doesn't change any behavior, but it isn't clear whether NullClient
is correct in all cases. As ajax says,

> For most of these changes, I think it's correct to use NullClient,
> since they are server-initiated changes and should not fail for (eg)
> xace reasons. ... At any rate, you're certainly not changing any
> semantics by leaving them all as NullClient, so this patch can't be
> more wrong than before.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-12 18:09:55 -07:00
Jamey Sharp
afcbbd6dfe doPolyText needs UseAccess to each font, not ReadAccess.
In commit 42d6112ec2, Eamon changed
dixChangeGC to require DixUseAccess on any GCFont XID. I think
doPolyText needs to require the same level of access. Otherwise
dixChangeGC could fail when it does the same lookup, which doPolyText
doesn't check for.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-05-12 18:00:29 -07:00
Keith Packard
59857ee5da Merge remote branch 'dottedmag/for-keithp' 2010-05-12 16:48:08 -07:00
Mikhail Gusarov
432cbbec19 Misc coding style cleanup
Use a[b] instead of *(a+b), fix whitespace.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:16:48 +07:00
Mikhail Gusarov
816b79dd06 Remove useless casts
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:16:43 +07:00
Mikhail Gusarov
63a647abd5 Fix code style: extra whitespace before ()
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:16:38 +07:00
Mikhail Gusarov
28211c443c Fix warning: it's safe to pass atom strings > XA_LAST_PREDEFINED to free(3)
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:16:31 +07:00
Mikhail Gusarov
8b5326aa98 Mark OsAbort as noreturn function to make gcc happier.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:54:44 +07:00
Mikhail Gusarov
868e372a73 Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gcc
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:54:34 +07:00
Mikhail Gusarov
5a8e2f2745 Do not jump through the hoops to deallocate xkbbasedirflag variable
Fixes gcc warning as well.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:54:29 +07:00
Mikhail Gusarov
ff2b4cf832 Turn sprintf argument into literaral string, shutting up gcc warning
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:53:57 +07:00
Mikhail Gusarov
f62ba192c2 Do not use deprecated Xalloc function
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13 04:53:30 +07:00
Jamey Sharp
21ceae9002 SetFontPath: set client->errorValue on failure.
Previously the callers were only setting errorValue on Success, when
it's ignored, and leaving it alone on failure, when it's sent to the
client.

Since SetFontPath takes the ClientPtr, let it set client->errorValue
instead of letting the callers continue to get it wrong.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-12 12:08:38 -07:00
Mikhail Gusarov
801162919d Removed outdated comments obsoleted by documentation in headers
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:38 +07:00
Mikhail Gusarov
4d55c8c4ff Use lowercase variant of XNFalloc and Xstrdup
Using one variant of function/macro makes it easier to fix the code
later.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Mikhail Gusarov
96c7ab27c3 Deprecate allocation functions which are plain wrappers for C stdlib
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Mikhail Gusarov
a5dba0f5ca Document allocation functions, noting deviations from C library
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Mikhail Gusarov
e983848ab4 Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage
C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so
stop fiddling with alignment manually and just pass the arguments to library
functions.

Also convert silent error when negative size is passed into function into
warning in log file.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Kristian Høgsberg
4f0006c220 dri2: Copy front to fake front in swapbuffer
If we don't have a fake front, nothing will happen.  The fix was extracted
from a bigger patch from Francisco Jerez.

https://bugs.freedesktop.org/show_bug.cgi?id=27305
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Pauli Nieminen <suokkos@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-12 10:00:15 -07:00