Commit Graph

818 Commits

Author SHA1 Message Date
Matthieu Herrb
552c78592c Xext: fix test on extension number for the swapped case.
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-04-02 09:14:47 +02:00
Keith Packard
03f45df934 Merge remote-tracking branch 'airlied/xinerama-cleanup' 2011-03-23 13:38:37 +09:00
Dave Airlie
5fb329a04a panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2)
This converts all the remaining 1->num loops to the macro,
this removes nearly all the panoramiXNumScreens usage in
loops, and is a step to replacing it.

v2: move some from the other patch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:01:51 +10:00
Dave Airlie
0bccfcc97b panoramiX: convert 0->panoramiXNumScreens loops to macro (v3)
This just uses the FOR_NSCREENS macro instead.

v2: remove some of the 1->x loops.
v3: drop the 1->0 loop, will rework later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:01:09 +10:00
Dave Airlie
5a94934487 panoramiX: consolidate common id assignment code.
This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first
element and is a common idiom throughout panoramiX code.

It then adds a new inline function to hide id assignment to a
panoramiX resource and cleans up lots of common repeated code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:00:48 +10:00
Dave Airlie
c48c530e54 panoramiX: macro checking if drawable is root (v2)
this code appears in quite a few places, consolidate it into
a macro in a header.

v2: align braces with macro just above it, and with
lines removed

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-10 09:08:56 +10:00
Adam Jackson
2413702aa0 xvmc: Use RESTYPE consistently
Also mark these static since they're not used externally.

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:20:19 -05:00
Adam Jackson
cd58924d29 xinerama: Use RESTYPE consistently
No functional change

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:20:08 -05:00
Adam Jackson
9a6a9971b0 xv: Use RESTYPE where appropriate
No functional change.

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:19:40 -05:00
Keith Packard
6c90e839d9 Merge remote branch 'whot/for-keith' 2011-03-03 14:41:44 -08:00
Keith Packard
8e4c3ce55b Merge remote branch 'rjy/clientids' 2011-03-03 13:42:07 -08:00
Adam Jackson
edcceedbd3 xext: Remove XCALIBRATE extension
Nobody can have been using this, it's never called from extension init.
XI2 device properties should now be a functional replacement.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-01 10:56:17 +10:00
Keith Packard
70f2d39fbd Merge remote branch 'jturney/master' 2011-02-02 14:43:19 -08:00
Adam Jackson
ac0a00a840 xselinux: Fix GetDrawableContext
M_DRAWABLE_PIXMAP is the lookup mask to dixLookupDrawable, and _not_ the
type value in the drawable itself.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-02-02 14:33:01 -08:00
Jon TURNEY
a9d3c43a57 Fix compilation of xf86bigfont.c
xf86bigfont.c: In function 'XFree86BigfontExtensionInit':
xf86bigfont.c:146: error: 'ProcXF86BigfontDispatch' undeclared (first use in this function)
xf86bigfont.c:147: error: 'SProcXF86BigfontDispatch' undeclared (first use in this function)

It seems this has been broken since commit cbd4d5dbb7
"delete pervasively use of DISPATCH_PROC" (2010-09-28), which is a bit worrying as
that presumably indicates that no tinderbox is configuring with --enable-xf86bigfont.

In a similar fashion to that commit, fix by moving XFree86BigfontExtensionInit()
below the definitions of the static dispatch functions it references.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-01-25 14:41:02 +00:00
James Jones
02e18c9fb5 X Sync Cleanups
Various cleanups identified during review of the
X Sync Fence Object patches.

-Correctly handle failure of AddResource()

-Don't assert when data structures are corrupt.  Instead,
 use a new helper function to check for counter sync
 objects when they're expected, and warn if the type is
 wrong.

-Use the default switch label rather than reimplementing
 it.

-Re-introduce cast of result of dixAllocateObjectWithPrivate()
 to kill an incompatible pointer type warning.

-Remove comments claiming protocol updates are needed.  One
 wasn't true and the other was addressed with a xextproto
 change.

-Return BadFence, not BadCounter from XSyncAwaitFence()

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 08:41:30 -08:00
Daniel Stone
f7d8ade3c5 Resources: Move rClient to resource.h
The definition of rClient was duplicated across three source files, so
move it to resource.h.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-31 12:36:44 +00:00
Rami Ylimäki
296561506a Xext: Use general OS functions to determine client command string in SELinux.
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-12-23 13:53:25 +02:00
Adam Jackson
f28e48834e Remove SCO support
This has never been buildable in any modular server release.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-20 12:11:11 -05:00
Christopher James Halse Rogers
a2e67a6412 IDLETIME: Fix edge-case in IdleTimeBlockHandler
Ensure that if we're called exactly on the threshold of a
NegativeTransition trigger that we reshedule to pick up
an idle time over the threshold.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19 16:43:42 -08:00
Christopher James Halse Rogers
b55bf24858 Xext: Fix edge case with {Positive, Negative}Transition triggers.
The {Positive,Negative}Transition triggers only fire when the counter
goes from strictly {below,above} the threshold.  If
SyncComputeBracketValues gets called exactly at this threshold we may update
the bracket values so that the counter is not updated past the threshold.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19 16:43:14 -08:00
Keith Packard
435361bd73 sync: syncObject may be None in SyncInitTrigger
And often is, especially when called from ProcSyncCreateAlarm.
Crashing in this case seems unwise.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-06 20:38:14 -08:00
James Jones
8127c83c81 Expose Sync Fence Object protocol
Add the new protocol handlers for XSync 3.1 to the
dispatch tables and report support for Sync protocol
version 3.1.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:15:38 -08:00
James Jones
9c0c7cc9a7 Add XSyncAwaitFence() handler
-Add the actual ProcSyncAwaitFence() dispatch func

-Add support for fence sync triggers.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:15:38 -08:00
James Jones
397dfd9f87 Create/Destroy/Trigger/Reset/Query Fence Sync objs
Initial server side implementation of fence sync
objects.  Allows creation, management, and state
queries of binary state objects.  Currently they
are not very useful as there is no way to wait for
them efficiently.

The basic trigger operation added here triggers
relative to a given X screen's rendering operations.
To perform this operation, fence sync objects must
be tied to a screen.  As Aaron Plattner pointed out,
screens are identified but a drawable in X protocol,
so a drawable argument is included in
XSyncCreateFence().  The screen also could have been
specified as part of the trigger operation.  However,
it is also desireable to associate a screen with
fence sync objects at creation time so that the
associated screen's driver can allocate any HW-
specific resources needed by the fence object up
front.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:15:38 -08:00
James Jones
1c4a0db2c6 Add fence sync driver interface
-Add fence sync objects

-Add fence sync devPrivates

-Add a X sync module screen private

-Add wrappable functions to create and destroy
 fence sync objects

-Give fence sync objects wrappable functions to
 trigger, test, and reset their 'triggered' value.

-Give fence sync objects wrappable functions to
 notify driver when adding/removing triggers to/
 from the sync object.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:15:26 -08:00
James Jones
af0f9f9133 Move some sync code to miext
As a precursor to the fence sync object video driver
and extension API, move some code from Xext to
miext/sync.  Most of this is just code to set up the
build system to include the new directory.  No
functional code is added in this change.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:12:46 -08:00
James Jones
12b65de7db Factor out generic code from ProcSyncAwait()
In preparation for adding more sync object types
that will need Await requests of their own, factor
out some setup and finalization code from
ProcSyncAwait() into SyncAwaitPrologue() and
SyncAwaitEpilogue()

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:11:39 -08:00
James Jones
c66a410d37 Make Await SyncTrigger functions generic
Update all the functions dealing with Await
sync triggers handle generic sync objects
instead of just counters.  This will
facilitate code sharing between the counter
sync waits and the fence sync waits.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:11:34 -08:00
James Jones
99daf419a3 Create SyncObject base type.
SyncObject is now the base type for SyncCounter.
Data to be used by all sync types is stored in
the base object.  SyncCounter can be safely cast
to SyncObject, and a SyncObject can be cast to
the correct type based on SyncObject::type.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:07:06 -08:00
James Jones
27593eea7e Add and use SERVER_SYNC_*_VERSION
Most extensions have a version defined
in the protocol headers, and also in the
server's protocol-versions.h.  The latter
defines which version the server advertises
support for.  Sync wasn't included in
protocol-versions.h, and was advertising
support for whatever was in the protocol
headers the server was built against.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06 19:07:00 -08:00
David Reveman
84a14fab8f composite: add panoramix support
Taken from:
50d2d8c896
dbffd0d44a
9b5b102163
75f9b98af3
07fba8b1f7

With minor style fixes, ported to dixLookupResourceByType, and ported
away from client->noClientException and xalloc/xfree.

v2: Fix a memory leak in PanoramiXCompositeNameWindowPixmap, spotted by
James Jones.
v3: Fix a buglet in PanoramiXCompositeUnredirectSubwindows, spotted by
Dave Airlie.
v4: Fix a style issue with resource lookup noted by Jamey Sharp.

Reviewed-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:47:42 -05:00
David Reveman
6dea617e0f fixes: Add panoramix support
Taken from:
583f4dde81

With minor style fixes and ported to dixLookupResourceByType.

Reviewed-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:47:41 -05:00
Linus Arver
78f94f19aa Xext: panoramiXprocs: fix typo
This fixes a typo introduced in commit
80b5d3a326. The pointer pDst was changed
unintentionally to pWin from a copy/paste error. This resulted in all
QT-based apps and some tcl/tk ones (like fontforge) to crash X 1.9 on
starting up, when Xinerama was enabled.

Bug report: https://bbs.archlinux.org/viewtopic.php?id=106125

Signed-off-by: Elie Bleton <drozofil@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Linus Arver <linusarver@gmail.com>
2010-11-15 08:44:39 +08:00
Peter Hutterer
675f4a8525 Abstract valuator masks through a set of APIs.
This commit introduces an abstraction API for handling masked valuators. The
intent is that drivers just allocate a mask, set the data and pass the mask
to the server. The actual storage type of the mask is hidden from the
drivers.

The new calls for drivers are:
    valuator_mask_new()     /* to allocate a valuator mask */
    valuator_mask_zero()    /* to reset a mask to zero */
    valuator_mask_set()     /* to set a valuator value */

The new interface to the server is
    xf86PostMotionEventM()
    xf86PostButtonEventM()
    xf86PostKeyboardEventM()
    xf86PostProximityEventM()

all taking a mask instead of the valuator array.

The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to
memory allocation restrictions in SIGIO handlers.

For easier review, a lot of the code still uses separate valuator arrays.
This will be fixed in a later patch.

This patch was initially written by Chase Douglas.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:48 +10:00
Tiago Vignatti
cbd4d5dbb7 xserver: delete pervasively use of DISPATCH_PROC
Some functions had to be moved around due some missing static definitions.
Another minor clean up like inexistent function declarations and etc were made
also.

Part of this patch was cooked using:
sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files`

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-28 16:45:05 +03:00
Tiago Vignatti
317e491e06 xext: remove unused header
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-10 21:49:29 +03:00
Chris Wilson
6dae7f3792 xace: Invalid reference to out-of-scope data.
The callback data passed by reference to the hook was allocated on stack
within the scope of the case statement. The compiler is free to reuse
any of that stack space whilst making the function call so we may end up
passing garbage into the callback.

References:

  Bug 18451 - Xorg server 1.5.2 SEGV during XFixesGetCursorImage()
  https://bugs.freedesktop.org/show_bug.cgi?id=18451

v2: Drop the unrelated hunk that snuck in when ammending the commit
message.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-08-10 16:04:16 -07:00
Ville Syrjälä
f7dae972aa xv: Don't send port notify when SetPortAttribute fails
Currently a port notify event is sent even if SetPortAttribute
fails. Furthermore the value field in the event will contain the
value that was specified in the failed request. So any client
interested in the actual value of the attribute will have to
double check the current value with GetPortAttribute after
receiving a port notify event.

Fix the problem by sending port notifications only when
SetPortAttribute succeeds.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-21 19:03:20 -07:00
Keith Packard
620ca54aaa Merge remote branch 'alanc/master' 2010-06-10 19:18:53 -07:00
Keith Packard
a8ec9eca85 Fix a couple more possible errors with input-only windows
Using type == DRAWABLE_WINDOW to differentiate between pixmaps and
windows isn't sufficient as input-only windows will end up in the
pixmap case. This patch changes a few more code paths to use
WindowDrawable instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-10 19:15:28 -07:00
Sam Lau
1c08a37e0e SecurityResource should not segfault when client owning resource has exited
Fixes OpenSolaris bug 6949754:
  Xorg crashes when the magnifier is enabled at gdm login greeter window.
  http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6949754

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-06-10 18:58:54 -07:00
Mikhail Gusarov
7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Keith Packard
8e97e5f942 If XTest is always required, then eliminate the XTest devPrivate
The internals of XTest are used by Xi and Xkb, and both Xi and Xkb are
always required, so it makes little sense to have XTest place data in
a devPrivate, especially a devPrivate which is only available when the
XTest extension is enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-07 19:56:47 -07:00
Keith Packard
bc26665661 Initialize private keys in test suite
Make sure all of the private keys used by the test code are
initialized before being used.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Robert Hooker <sarvatt@ubuntu.com>
2010-06-06 21:24:04 -07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Mikhail Gusarov
5a0fc0ad21 Replace deprecated bzero with memset
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Marcin Baczyński <marbacz@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 15:07:27 +07:00
Jamey Sharp
a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Keith Packard
965cade6ee Change region implementation from macros to inline functions.
This makes all of the previous macros into inline functions and also
turns all of the direct calls to pixman region code into inline
functions as well.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 19:03:22 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Jamey Sharp
f114f54986 Accumulate graphics exposures incrementally in PanoramiXCopyArea/Plane.
This fuses two loops in each function, eliminating an intermediate
MAXSCREENS-sized array from each.

Aside from being more efficient, I believe this is equivalent to the
previous implementation, since
- each per-screen GC has the graphicsExposures flag set the same way,
  and
- the REGION_* macros ignore their screen argument.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:04:20 -07:00
Jamey Sharp
a7c7ebe4b3 Delete XineramaScreenRegions cache.
Every screen region consists of a single rectangle, so initializing a
stack-allocated region for each screen on-demand does no heap allocation
and is fast.

This eliminates a MAXSCREENS-sized array.

The REGION_UNINIT calls are no-ops since no boxes are actually allocated
for a single-rectangle region, but it seemed wiser to include them.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
a0456da339 XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION.
This hides a MAXSCREENS-sized array as an implementation detail of
panoramiX.c rather than an exported global.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
a83cff9f4d Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
217ccaa5a3 Delete panoramiXdataPtr: it's redundant.
This eliminates a dynamically-allocated MAXSCREENS-sized array.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
80b5d3a326 Move each screen's screensaver data into ScreenRec.
Most references to the savedScreenInfo array already had the
corresponding screen pointer handy, which meant they usually looked like
"savedScreenInfo[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:22 -07:00
Tiago Vignatti
dcceb90b1d xext: delete wrong source reference from fontcache
This should go away in 0b45ba48.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-03 15:55:59 +03:00
Pierre-Loup A. Griffais
643cb6e87c Only deal with input code when changing the input shape.
Propagate the shape kind all the way to SetShape to avoid performing non-input
operations such as revalidating the tree and generating exposures when only
changing a window's input shape.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Acked-by: Aaron Plattner<aplattner@nvidia.com>
Reviewed-by: Daniel Stone<daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:11:31 -07:00
Jamey Sharp
0a98d9e6ce xf86bigfont: Silence compiler warning by initializing pDesc.
Access to pDesc was always guarded by (nCharInfos > 0), so the code
wasn't actually buggy, but this makes it clear that it's correct.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 11:10:27 -07:00
Jamey Sharp
c38552d115 Add typed resource-lookup errors for non-core resource types.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jamey Sharp
e291c56182 Return an appropriately-typed error from dixLookupResourceByType.
Rather than always returning BadValue, associate an error status like
BadWindow with a resource type like RT_WINDOW, and return the
appropriate one for the requested type.

This patch only touches the core protocol resource types. Others still
return BadValue and need to be mapped appropriately.

dixLookupResourceByType can now return BadImplementation, if the caller
asked for a resource type that has not been allocated in the server.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jamey Sharp
90e612dcbe Use WriteEventsToClient rather than TryClientEvents where possible.
If filter is NoEventMask (aka CantBeFiltered), grab is null, and the
first event is not in the set of "critical events", then TryClientEvents
simply calls WriteEventsToClient. In that case, it returns 0 for fake or
dead clients, and 1 otherwise. Inline for this special case.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
8033fb6c97 Set event sequence number in WriteEventsToClient instead of at callers.
TryClientEvents already did this; this commit just moves the assignment
one level down so that no event source has to worry about sequence
numbers.

...No event source, that is, except XKB, which inexplicably calls
WriteToClient directly for several events.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
4b9600a416 Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.
This matches the test in TryClientEvents, and is a superset of tests
done by the callers of these functions. The consequence of forgetting
these tests is a server crash, so they're always desirable. In my
opinion, it's better to not require the callers to remember to do these
checks.

For callers that don't do very much work before calling WriteToClient or
WriteEventsToClient, I've removed the redundant checks.

hw/xquartz/xpr/appledri.c has an interesting case: While its check for
"client == NULL" appears redundant with the test in WriteEventsToClient,
it dereferences client to get the sequence number.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
ee9cd2df4a xv: TryClientEvents already checks client and sets sequenceNumber.
So don't bother doing those steps again.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
673eb707ce SyncSendAlarmNotifyEvents: check the correct client's clientGone flag.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-18 15:39:25 -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
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
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
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
David James
758b861447 Fix wrong bracket values when startOver = FALSE.
Currently, SyncComputeBracketValues reuses old values of bracket_greater
and bracket_less when startOver = FALSE. This can result in incorrect bracket
values. To fix this issue, the startOver parameter is removed, and we do not
reuse old values of bracket_greater and bracket_less.

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

Signed-off-by: David James <davidjames@google.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-10 15:40:08 -07:00
Jamey Sharp
35761d5f81 Introduce dixLookupFontable for "FONT or GC" parameters.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 21:56:36 -07:00
Keith Packard
986d46144b Merge remote branch 'jamey/for-keith'
Conflicts:
	hw/xfree86/common/xf86xv.c
2010-04-30 12:40:53 -07:00
Keith Packard
a974c8e7cb Merge remote branch 'whot/for-keith' 2010-04-30 12:33:00 -07:00
Jamey Sharp
22c4300ee2 Simplify XineramifyXv.
The structure of the adaptor-matching algorithm was obscured by trying
to use "continue" and "break" as the only control-flow primitives. It's
a lot more clear if you add "return" to that set.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-04-27 10:07:09 -07:00
Peter Hutterer
af170a4ab7 Xext: only update the sprite on pointer events.
A call to miPointerUpdateSprite for the XTEST keyboard may result in a
NULL pointer dereference in miDCPutUpCursor() when the save buffer is NULL.

XTS test case: Xlib 11 KeymapNotify

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-27 15:50:26 +10:00
Jamey Sharp
7e573b5ccd Kill unused/useless macros in panoramiX.h: BREAK_IF, IF_RETURN, FORCE_ROOT
This header doesn't seem to be used outside the server tree, so I don't
think anything was depending on these except what I've fixed in this
patch.

FORCE_ROOT is not used anywhere, and never has been in all the history
that's in git. ajax removed its FORCE_WIN and FORCE_CMAP companions
three years ago, in 04b87d6dfa.

BREAK_IF and IF_RETURN expanded to exactly the keywords in their names,
which is silly. They were rarely used and served only to make callers
inconsistent with the idioms used elsewhere in the server.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-04-26 19:19:02 -07:00
Keith Packard
7ac6a6b7d0 Merge remote branch 'vignatti/for-keith'
Conflicts:
	exa/exa.c

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 16:07:38 -07:00
Tiago Vignatti
0ba82562ee Death to Multibuffer extension
The rationale behind is because no sane application will use this when we have
modern APIs such DRI2. Besides, as a fact, xfree86 server has already
deprecated this extension in 1998:

    http://www.xfree86.org/3.3.6/isc7.html

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-04-21 18:06:35 +03:00
Keith Packard
28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07:00
Julien Cristau
fc5d767408 XGE: don't register an extension event
The GenericEvent is a core event, we never send an extension event, so
don't reserve an id for one.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-13 09:27:32 -07:00
Michel Dänzer
3083c5d0c4 Xext: Fix cursor reference counting hazard.
Make sure the reference count of the new cursor is increased before the old
one is decreased, otherwise bad things will happen if they're one and the
same and the reference count is 1 initially. Not sure this can actually happen
here, but better safe than sorry.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-22 10:34:35 -07:00
Yaakov Selkowitz
abf4e0b7e3 New header for XF86Bigfont server functions
Xext/xf86bigfont.c contains three non-static functions which are called
elsewhere in the server.  This creates a new header containing these
declarations in order to fix several warnings:

xf86bigfont.c:285: warning: no previous prototype for `XF86BigfontFreeFontShm'
dixfonts.c:502: warning: implicit declaration of function `XF86BigfontFreeFontS$
dixfonts.c:502: warning: nested extern declaration of `XF86BigfontFreeFontShm'
log.c:436: warning: implicit declaration of function `XF86BigfontCleanup'
log.c:436: warning: nested extern declaration of `XF86BigfontCleanup'

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:48:04 -05:00
Yaakov Selkowitz
57a049ea89 Xext: fix old-style function definitions in xf86bigfont.c
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:47:55 -05:00
Eamon Walsh
178da6534f Xext: Link to external libraries when necessary.
Although the DDX should be linked to the necessary libraries, we may
also need to pull them in directly to the module to ensure the symbols
are resolved at runtime. Should fix this bug with XSELINUX:

/usr/bin/X: symbol lookup error:
/usr/lib64/xorg/modules/extensions/libextmod.so: undefined symbol:
is_selinux_enabled

-v2: use _LIBADD instead of _LIBS; remove SELINUX_LIBS from
     XSERVER_SYS_LIBS as it should only be needed in extmod.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-12 13:06:30 +10:00
Eamon Walsh
db4f676f25 xselinux: Bump extension minor version.
Changes introduced in this version:
	- 3 window-related requests now handle pixmaps also.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:05:01 -05:00
Eamon Walsh
a6cbcf6e78 xselinux: Rename window-related requests that now support pixmaps.
Renamed requests:
	SetWindowCreateContext -> SetDrawableCreateContext
	GetWindowCreateContext -> GetDrawableCreateContext
	GetWindowContext -> GetDrawableContext

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:04:46 -05:00
Eamon Walsh
ab68c707fd xselinux: Allow GetWindowContext to be used for pixmaps as well.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:04:39 -05:00
Eamon Walsh
eb9210097e xselinux: Remove reference counting calls for SID objects.
Starting with libselinux 2.0.86, SID objects are no longer
reference counted and the sidput() and sidget() calls are no-ops.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:04:33 -05:00
Eamon Walsh
2ecb9f7d86 libselinux now has a pkgconfig file. Use it.
Also remove HAVE_NETLINK_AVC_ACQUIRE_FD tests, because we now
require a version of libselinux that has it.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:03:50 -05:00
Eamon Walsh
9fc6b59d46 xselinux: Allow SetWindowCreateContext to be used for pixmaps as well.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:03:31 -05:00
Alan Coopersmith
895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Alan Coopersmith
a11c58fa0c Ensure all resource types created have names registered
Calls RegisterResourceName to record the type name for
use by X-Resource, XACE/SELinux/XTsol, and DTrace.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08:00
Alan Coopersmith
eb750f8b5e Check for failures from CreateNewResourceType
Make sure to check return value before setting bitmask flags.
For most calls, just fails to init the extension.   Since Xinput
already calls FatalError() on initialization failure, so does
failure to allocate Xinput's resource type.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08:00
Rami Ylimaki
eb967ca36c Xext: Fix a memory leak on GE client disconnect.
Add a call to dixRequestPrivate to inform dixFreePrivates that memory
allocated in GEClientCallback should be released when client
disconnects. Otherwise there is a leak of sizeof(GEClientInfoRec) for
every client connect/disconnect.

Also remove the explicit allocation and let GEGetClient /
dixLookupPrivate do it. This makes GEClientCallback similar to the
other extension callbacks.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-25 10:55:22 +10:00
Jamey Sharp
25979c46b4 Alloc/free drawables array for each ProcPanoramiXShmGetImage call.
Updates my previous patch, b422b532f3.
keithp recommended against allocating the drawables array globally, but my
updated patch with that fixed isn't the patch that landed.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 18:22:54 -07:00
Eamon Walsh
264ce9e836 xselinux: Use the now-exported IsPointerDevice() instead of a copy.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 20:33:53 -04:00
Eamon Walsh
6c2ae5fec5 xselinux: switch from x_device to separate x_pointer and x_keyboard classes.
This will allow separate controls over pointer and keyboard without having
to relabel the devices to separate types.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:19 -04:00
Eamon Walsh
0ff2831990 xselinux: Stop special-casing QueryPointer access checks.
XACE has been changed to not return BadAccess on device read failures.
Thus, no need for this workaround code.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:19 -04:00
Eamon Walsh
0493935691 xselinux: Factor out some dynamic array code into common helpers.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:18 -04:00
Eamon Walsh
ae8891ba0b xselinux: refactor extension code into smaller files.
New files:
xselinux_ext.c: Extension init and request handlers.
xselinux_hooks.c: XACE hook functions and other callbacks.
xselinux_label.c: Object security-labeling code.
xselinuxint.h: Shared internal functions.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:18 -04:00
Jamey Sharp
b0dd6be2c8 Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives
warnings about casts between int and pointer types. However, in the cases
covered by this patch, it's always a value that fits in int being stored
temporarily as a pointer and then converted back later, which is safe.
Casting through the pointer-sized integer type intptr_t convinces the
compiler that this is OK.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:38:44 +11:00
Jamey Sharp
b422b532f3 Remove static MAXSCREENS limit from Xext/shm.c
Dynamically allocate per-screen data in the SHM extension, instead of
having a single static-sized array.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:29:30 +11:00
Jamey Sharp
44efcdde50 Fix overlay detection when matching Xv adaptors across screens.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-07 12:46:38 -07:00
Michel Dänzer
11817a881c Fix ShmPutImage non-ZPixmap case.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23298 .
2009-09-29 08:56:59 +02:00
Peter Hutterer
693d4fdb1c Xext: switch mbuf.c to dixLookupResourceByType
Resolves a linker error caused by LookupIDByType.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:14:00 +10:00
Peter Hutterer
493d2f9c2f Xext: remove DisplayImageBuffers from mbuf.c
Not referenced by anything.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:05:07 +10:00
Peter Hutterer
fff40b3353 Xext: fix up multibuffer compiler errors.
Triggered by the xextproto 7.1 change, fixed by moving the matching
declarations from the header file to here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 10:54:47 +10:00
Peter Hutterer
55747d256d input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.

This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21 21:47:35 +10:00
Peter Hutterer
aa71e268f5 Xext: silence 'warning: no previous prototype' for sync, bigreq and xcmisc.
xcmisc and bigreq don't have their own header so just declare it here to
shut up the compiler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21 09:17:56 +10:00
Thomas Jaeger
971d4eac12 Xext: include security protocol header instead of client header
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 19:57:01 +10:00
Peter Hutterer
e62549b8d6 Xext: don't try to initialize XTEST device properties if they failed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-10 09:48:05 +10:00
Eamon Walsh
a470e8426e Correct outdated e-mail address in "Author" statements.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-09-02 17:56:52 -04:00
Jerome Glisse
0e46066efe Xext: fix a typo for bigreqsproto.h header file
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2009-09-01 13:59:47 +02:00
Jeremy Huddleston
c61d8ce150 Xext: Require newer versions of xcmiscproto, bigreqsproto, and xf86bigfontproto for new *proto.h header file names
bigreqsproto >= 1.1.0
xcmiscproto >= 1.2.0
xf86bigfontproto >= 1.2.0
2009-08-31 18:44:53 -07:00
Peter Hutterer
903c3db1d1 Xext: rename Xtst* to XTest*
This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer
8bfd23e144 input: move XTest device initialization into Xext/xtest.c
XTest devices are non-optional but nonetheless specific to the XTEST
extension.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:50 +10:00
Peter Hutterer
990d204ef8 Xext: remove un-used extern of DeviceMotionNotify.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:15:00 +10:00
Eamon Walsh
73975ef3a3 xselinux: Allow per-client device create contexts.
The previous behavior was to set the serverClient's value which was used globally.
This is in support of XI2, where clients can create device pairs directly.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:10 -04:00
Eamon Walsh
66e32d252c xselinux: Add more new device permissions for XI2.
Reflects the ability of clients to create/destroy device objects.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:10 -04:00
Richard Hughes
c1d901d723 Don't reset the lastDeviceEventTime when doing DPMS actions
When we change the DPMS mode, don't play games with the last event time as
this breaks applications using IDLETIME to turn the backlight off after a
preset time.

This patch fixes gnome-power-manager and xfce-power-manager

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 11:18:38 +10:00
Peter Hutterer
db568f9eab Xext: fix up wrong conditions for negative sync transitions.
If the counter had a value higher than the trigger value for a negative
transition, the trigger value did not get set.

The correct sequence of checks is:
if (positive transition)
   if (counter value < trigger value)
      set up trigger
if (negative transition)
   if (counter value > trigger value)
      set up trigger

Red Hat Bug 501601 <https://bugzilla.redhat.com/show_bug.cgi?id=501601>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-14 07:49:52 +10:00
Peter Hutterer
36e24a6d93 Xext: add missing return code check to ProcSyncDestroyAlarm
Introduced with 57aff88c7d.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:37 +10:00
Peter Hutterer
e46f02fa2d Xext: allocate a separate event list for XTest events (#23100)
XTest event processing may be interrupted by a SIGIO. If Xtest uses the same
event list as the rest of the server, this list may be overwritten
in-flight.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:35 +10:00
Peter Hutterer
4db8950b1d Xext: include securproto.h instead of securstr.h
Reported-by: Byeong-ryeol Kim
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-17 14:40:54 +10:00
Peter Hutterer
d3f6b43a24 Update to xextproto 7.0.99.1.
xextproto had Xlib client headers moved into libXext.
Protocol header files are named fooproto.h, header files with constants
foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-15 17:00:05 +10:00
Peter Hutterer
7b9e84e320 Xext: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:14:01 +10:00
Michael Lorenz
36dc66ae79 The way XaceHook() mixes struct initializers and va_arg() is not portable and
gives bogus data on sparc and probably others leading to a crash.

Fix:
Don't use initializers, instead set each member directly to enforce order.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-07-07 20:21:39 -04:00
Peter Hutterer
89cf81cd85 Xext: return BadValue for XTestFakeInput on unsupported capabilities.
Calling XTestFakeDevice*Event on a device that doesn't allow the matching
event returns BadValue.

Reported-by: Florian Echtler
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06 12:59:42 +10:00
Peter Hutterer
744bb55982 Xext: remove unused variable 'it'.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06 12:58:03 +10:00
Peter Hutterer
0814f511d5 input: store the master device's ID in the devPrivate for XTest devices.
Rather than storing a simple boolean in the devPrivate for XTest devices,
store the actual master device's id (since it is constant for the life of
the device anyway).

Callers should use GetXtstDevice now instead of digging around in the
devPrivates themselves.

This patch allows for a cleanup in the creation of new master devices since
GetMaster and GetXtstDevice spare the need for loops, IsPointer checks and
similar.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
2009-07-01 08:46:31 +10:00
Eamon Walsh
51105de9b0 xselinux: ignore property hook calls with the new Post access mode bit set.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-26 17:05:52 -04:00
Eamon Walsh
3efb23a6c4 xselinux: Add new device permissions for XI2.
Refects the ability of clients to add/remove devices and device properties.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-18 20:56:19 -04:00
Eamon Walsh
1e060c3d8b xselinux: Move the security class mapping to the header file.
Take the mapping of DixAccess bits to Flask permissions, move it
into the header file, break up the extremely long lines, and
annotate the permission names with the bit being referenced.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-18 20:56:18 -04:00
Peter Hutterer
d7aef3f663 Merge branch 'master' into xi2
Conflicts:
	Xext/geext.c
	Xi/chdevcur.c
	Xi/extgrbdev.c
	Xi/xiproperty.c
	configure.ac
	dix/ptrveloc.c
	hw/xfree86/common/xf86Config.c
	mi/mipointer.h
	test/input.c
	xkb/xkb.c
2009-05-28 17:20:58 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Eamon Walsh
0952d12717 xselinux: Relax ownership restriction on SetSelectionUseContext.
Instead, clients should keep track of the selection instances they use.
2009-05-11 15:27:46 -04:00
Alan Coopersmith
b680bda34d Fix a couple off-by-one array boundary checks.
Error: Write outside array bounds at Xext/geext.c:406
        in function 'GEWindowSetMask' [Symbolic analysis]
       In array dereference of cli->nextSib[extension] with index 'extension'
       Array size is 128 elements (of 4 bytes each), index <= 128

Error: Buffer overflow at dix/events.c:592
	in function 'SetMaskForEvent' [Symbolic analysis]
       In array dereference of filters[deviceid] with index 'deviceid'
       Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20

Error: Read buffer overflow at hw/xfree86/loader/loader.c:226
	in function 'LoaderOpen' [Symbolic analysis]
       In array dereference of refCount[new_handle] with index 'new_handle'
       Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256

These bugs were found using the Parfait source code analysis tool.
For more information see http://research.sun.com/projects/parfait

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 12:27:11 -07:00
Peter Hutterer
a38d33f6ac Xext: shut up compiler warnings in xtest.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
14d5471981 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators.
BadDevice is an XI error, but this cannot happen for core XTest fake input
anyway since the device will be the matching virtual XTest slave device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
f1bed0959e Xext: fix core Xtest button presses, don't call PickPointer.
We already did the device selection before, so dev should be the XTest virtual
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-05 14:12:04 +10:00
Peter Hutterer
63a3c727b3 Xext: shut up compiler warnings in xtest.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Peter Hutterer
226dd90597 Xext: return BadDevice from XTest if we don't have keys/buttons/valuators.
BadDevice is an XI error, but this cannot happen for core XTest fake input
anyway since the device will be the matching virtual XTest slave device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Peter Hutterer
0fdff0a47a Xext: fix core Xtest button presses, don't call PickPointer.
We already did the device selection before, so dev should be the XTest virtual
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:39 +10:00
Eamon Walsh
57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Peter Hutterer
057fc9a4f8 Merge branch 'master' into xi2
Conflicts:
	Xi/chdevhier.c
	include/input.h
2009-04-24 16:15:47 +10:00
Benjamin Close
fab563bf8f input: propagate XTst events through virtual slave devices.
A XTest virtual slave device pair (kbd/ptr) exists for every master
device pair. This is so XTest events are correctly propogated via slave
devices up to Master devices and the classes are correctly changed along
the way. We add the XTest slave device pair to the Virtual Core pointer
and provide a simple way of creating the devices.

A XTest Slave Device is identified by the XTstDevicePrivateKey property
being set in the devices devProperties

XI events are still propagated through the matching device, in the hope the
client knows what it is doing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-24 15:28:33 +10:00
Peter Hutterer
d5ad14c8ed Merge branch 'master' into xi2 2009-04-19 22:28:22 +10:00
Eamon Walsh
4559d2ace6 security: Grant untrusted windows remove access on all windows.
This allows untrusted clients to destroy their own windows when they
have been reparented by a trusted window manager.
2009-04-16 23:46:01 -04:00
Eamon Walsh
3481b32ab9 security: Fix a crash caused by wrong ordering of format arguments. 2009-04-16 23:46:01 -04:00
Eamon Walsh
6045506be0 security: Revert behavior of extension access for compatibility.
Previously, three extensions were defined as "trusted" by the extension:
BIG-REQUESTS, XC-MISC, and XPrint.  No other extensions were permitted
to be used by untrusted clients.

In commit 8b5d21cc1d this was changed for
some reason.  Return to the old, compatible behavior.
2009-04-16 23:46:00 -04:00
Eamon Walsh
682d7b5569 xselinux: Don't BadAlloc in List* requests if there are no items to list. 2009-04-09 02:48:04 -04:00
Eamon Walsh
e8b324102f xselinux: Don't require incoming context strings to be null-terminated. 2009-04-08 15:10:16 -04:00
Peter Hutterer
6c3b633299 Merge branch 'master' into xi2 2009-04-07 19:36:27 +10:00
Adam Jackson
e25d55ad54 Revert accidental Makefile change from previous commit 2009-04-03 22:38:00 -04:00
Adam Jackson
472811dc4b DPMS: Re-export the various DPMS variables.
The drivers might not need them but extmod does.  Should move it to
builtin though.
2009-04-03 22:27:51 -04:00
Adam Jackson
2d0a4fff79 DPMS: Remove unused DPMSGet() 2009-04-03 18:22:20 -04:00
Adam Jackson
4da347adb1 DPMS: Code motion. 2009-04-03 18:22:19 -04:00
Adam Jackson
283a081572 selinux: Only activate if policy says to be an object manager 2009-03-27 15:56:15 -04:00
Peter Hutterer
603db34337 Xext: set POINTER_SCREEN flag in XTestFakeInput if necessary. (RH #490984)
The POINTER_SCREEN flag must be set explicitly for XTest core events to avoid
out-of-range events when the lastSlave was an SD with an explicit axis range.
Device events sent through XTest don't need this flag, they are expected to be
in the valuator range of the device anyway.

Red Hat Bug 490984 <https://bugzilla.redhat.com/show_bug.cgi?id=490984>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-27 11:26:15 +10:00
Peter Hutterer
6b6b660c36 Xext: remove ev_fill from GEExtensions. 2009-03-20 15:17:54 +10:00
Peter Hutterer
445daa62e7 Xext: purge XGE event masks.
The masks were originally designed to generically handle event masks for
extensions. Since all that is in-server anyway, it's much better writing
custom event masks for those extensions that need it and not providing a
unified mechanism.
XI2 needs more than the current implementation, which is already too complex
for most other extensions. good riddance.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Adam Jackson
3992dd38ca selinux: Add support for avc_acquire_netlink_fd()
Requires libselinux 2.0.79 or newer.  Without this, libselinux will
check for policy updates on the netlink socket on basically every policy
lookup.  Statistically speaking, they never happen, and the check
translates to at least one more syscall on basically every operation.

Instead, take control of the fd from the library, and check it in
WakeupHandler if it polls readable.
2009-03-16 13:24:48 -04:00
Keith Packard
f8dd80d13b Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
2009-03-09 13:08:09 -07:00
Eamon Walsh
c7ebb4bef1 Fix 2 const warnings. 2009-03-03 14:02:36 -05:00
Eric Paris
c7cf926d25 This patch changes all places in the X code to use _raw functions. The
X server should never see, translate, or deal with a munged context.
Display managers which show contexts to the user should take care of
translating these to human readable form.
2009-03-03 13:15:39 -05:00
Adam Jackson
b030f858f2 selinux: Don't bother relabeling resources that are being destroyed
Makes window destroy about 40x faster in Xvfb.
2009-02-27 12:45:19 -05:00
Peter Hutterer
36583a4996 mi: split EQ popping and event processing into two functions.
mieqProcessInputEvents() - pop an event off the EQ and pass it to
mieqProcessDeviceEvent() - process the event according to the MD/SD hierarchy.

This way, we can use mieqPDE() from Xtest, xkb, and others to post an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Eric Anholt
b349a764e9 xinerama: Put the proto version in the code instead using proto headers.
Proto headers updating resulting in the server advertising new versions is
broken.  This should be applied to every extension.

This fixes the build against slightly-older xineramaproto.
2009-02-17 15:28:29 -08:00
Peter Ã…strand
ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Benjamin Close
a38ca0063c xext: Use proto header rather than the Xext include file, this prevents userspace being pulled in causing issues
Signed-off-by: Benjamin Close <Benjamin.Close@clearchain.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-02-13 17:24:37 +10:30
Peter Hutterer
43a1c91a3d Xext: fix typo in GEEventFill macro
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 11:17:02 +10:00
Peter Hutterer
faeb18eb7e Xext: rename shape's EventType to ShapeEventType to avoid name clashing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 08:51:11 +10:00
Peter Hutterer
cfd3443fe8 Xext: rename saver's EventType to SaverEventType.
Avoid namespace clashing with the internal events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 08:51:11 +10:00
Paulo Cesar Pereira de Andrade
4e7bc2d7a9 Work around inclusion of <X11/extensions/panoramiXext.h>
The X Server build only needs the macros PANORAMIX_MAJOR_VERSION
and PANORAMIX_MINOR_VERSION from that header.
  Addition of extra prototypes to <X11/extensions/panoramiXext.h>
caused a X Server build failure.
2009-01-30 03:56:39 -02:00
Adam Jackson
132b464d73 Remove a bunch of useless casts.
We've had void * for twenty years now people let's try to act like we
know how it works.
2009-01-22 02:11:16 -05:00
Daniel Stone
4fa3872dc2 Input: Remove core keysyms from KeyClassRec
Instead of always keeping two copies of the keymap, only generate the
core keymap from the XKB keymap when we really need to, and use the XKB
keymap as the canonical keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:59 +11:00
Adam Jackson
e45a8a498d Remove CreateUnclippedWinSize from window.h
This is utterly wrong, but then, so is sdksyms.sh
2009-01-20 22:07:07 -05:00
Adam Jackson
20d2117eb8 Move CreateUnclippedWinSize to mbuf
It's the only user, so.
2009-01-20 00:18:02 -05:00
Peter Hutterer
e30032d0bb Xext: clean up XGE macros.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-15 16:11:02 +10:00
Julien Cristau
6e20a4ae73 xsync: make SyncAlarmCounterDestroyed static 2009-01-11 08:54:10 +01:00
Julien Cristau
292311b421 Xext: ANSI cleanups 2009-01-11 08:54:10 +01:00
Thomas Jaeger
b2756a71a4 Xext: Send out correct events in ProcXTestFakeInput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-09 17:49:26 +10:00
Peter Hutterer
83eb863e3c Xext: don't accept DeviceValuator if the dev doesn't have valuators (in xtest)
Reported by Chris Ball.
2009-01-09 16:08:58 +10:00
Paulo Cesar Pereira de Andrade
200230535f Update sdk headers to export new symbols.
All symbols in installed sdk headers should be explicitly tagged
as exported symbols. Otherwise, to ensure it is not a mistake, one
could write it as something like:
extern /* NOEXPORT */ type name ...;
but the proper procedure really should be to use a non sdk header
(or a "noinst_" one).
  This patch also removes prototypes to some functions that existed
only temporarily.
2009-01-05 16:49:57 -02:00
Adam Jackson
f2d1de6c2a xv: remove useless XVCALL macro 2008-12-19 10:27:37 -05:00
Eamon Walsh
5d065a8890 xselinux: Use xace Xtrans wrappers instead of the now-inaccessible wrapees. 2008-12-18 14:01:10 -05:00
Eamon Walsh
f87e66486c xace: Export wrappers around two Xtrans functions used by modules.
Don't know a better way to do this, since Xtrans isn't a library that
can be linked into modules.
2008-12-18 13:58:35 -05:00
Eamon Walsh
777408914d Add xace headers to the SDK when enabled and export the XaceHooks symbol
to modules.
2008-12-18 12:39:08 -05:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Adam Jackson
beb749c87f Fix syncsrv.h guard define 2008-12-11 17:04:37 -05:00
Colin Harrison
9fba808b4f xsync: Prototype fix. 2008-12-11 13:22:53 -05:00
Adam Jackson
dce887ff53 xsync: build fix
argh protocol header disaster
2008-12-11 13:16:41 -05:00
Adam Jackson
1f4fb0225b xsync: Fix wakeup storm in idletime counter.
Wakeup scheduling only considered the threshold values, and not whether
the trigger was edge or level.

See also:
https://bugzilla.redhat.com/show_bug.cgi?id=474586
http://svn.gnome.org/viewvc/gnome-screensaver/trunk/src/test-idle-ext.c?view=markup
2008-12-11 10:31:48 -05:00
Adam Jackson
1a99110f0c xsync: ANSI cleanups 2008-12-11 10:31:45 -05:00
Adam Jackson
e0d8f6a808 xsync: Use a local header for server API definitions 2008-12-11 10:16:46 -05:00
Adam Jackson
1208a1dbca xsync: remove cast abuse. 2008-12-11 10:16:46 -05:00
Paulo Cesar Pereira de Andrade
b1dac41fb3 Use libtool convenience libraries and better "symbol" table.
All .a libraries were converted to .la, and instead of linking the
Xorg binary with a mix of .a and .la, and adding some libraries more
then once in the command line, etc, now it generates a single libxorg.la
from all the required convenience libraries, and links with a dummy
xorg.c (that should usually be the file with the main function...).
This removes the requirement of some things like libosandcommon and
libinit, that existed to circumvent problems when linking multiple
.a and .la in the final Xorg binary.

  The "symbol table" is now generated dynamically, by a shell script,
with an embedded gawk parser that parses cpp output. The new file
sdksyms.sh is generated by hand by analyzing all Makefile.am's and
making it create a sdksyms.c file, that includes all sdk headers that
will add symbols for the Xorg binary. Module headers aren't read, and
a in 2 files it was required to add a "<hash>ifndef XorgLoader" around
declarations shared between the Xorg binary and libextmod. A few
other changes were added to other sdk headers, like preventing
multiple inclusion, or including other headers to satisfy dependencies.

  This should be a lot more portable, and better (hopefully properly)
using libtool to generate convenience libraries.
2008-12-07 02:22:19 -02:00