summaryrefslogtreecommitdiff
path: root/xfixes
AgeCommit message (Collapse)AuthorFilesLines
2011-05-31fixes: Add support for pointer barriersAdam Jackson4-10/+446
Implements pointer barriers as specified by version 5 of the XFIXES protocol. Barriers are axis-aligned, zero-width lines that block pointer movement for relative input devices. Barriers may block motion in either the positive or negative direction, or both. v3: - Fix off-by-one in version_requests array - Port to non-glib test harness - Fix review notes from Søren Sandmann Pedersen, add tests to match Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-13include: add version_compare helper functionPeter Hutterer1-6/+6
Compare two version numbers in the major.minor form. Switch the few users of manual version switching over to the new function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-04xorg: remove unused pointer values all over the serverTiago Vignatti1-2/+0
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-14xfixes: calloc, not malloc the cursorScreenRecPeter Hutterer1-1/+1
Debugging NULL pointers is significantly easier than random memory. Plus, if new fields (such as pointer barriers) are added they may just be properly initialised. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-07Sun's copyrights now belong to OracleAlan Coopersmith3-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-11-30fixes: Add panoramix supportDavid Reveman3-0/+121
Taken from: 583f4dde81d8d5e9101b0289946e1914ea1ee124 With minor style fixes and ported to dixLookupResourceByType. Reviewed-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov4-7/+7
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-05Clean up after removal of screen parameters from region macros.Jamey Sharp1-3/+1
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard2-5/+8
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-05Rename region macros to eliminate screen argumentKeith Packard1-30/+30
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-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp1-1/+1
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-02Only deal with input code when changing the input shape.Pierre-Loup A. Griffais1-1/+1
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-05-24xfixes: Remove the invisible cursor sprite, using NullCursor instead.Jamey Sharp1-38/+1
Oliver McFadden reports that the invisible cursor sprite caused damage events and thus unnecessary redrawing, so removing it improves performance when using software cursor sprites, especially on those devices where you do not want a visible cursor: touchscreen tablets, embedded devices, etc. For the xfree86 DDX, if hardware cursors are used, the driver is required to provide a HideCursor function, which will be called instead of trying to set a null cursor. I think software cursors are already safe. The other DDXes also look safe. As far as I can tell, there's no reason to realize a null cursor. I think everything that handles null cursors doesn't rely on any setup in RealizeCursor, and treats them as empty cursors. Xnest assumes that if a cursor is created, it will be realized before it is freed, which didn't happen if the invisible cursor was never used in a server generation. So this fixes a segfault in Xnest as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Tested-by: Oliver McFadden <oliver.mcfadden@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp2-4/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19Return an appropriately-typed error from dixLookupResourceByType.Jamey Sharp2-9/+6
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-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp2-2/+0
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-19Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.Jamey Sharp2-4/+2
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-13Eliminate boilerplate around client->noClientException.Jamey Sharp4-43/+30
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-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp1-1/+1
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.Jamey Sharp1-4/+4
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-12Kill DoChangeGC in favor of dixChangeGC.Jamey Sharp1-1/+1
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-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov3-21/+21
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-07VERIFY_PICTURE always returns BadPicture. Don't bother specifying.Jamey Sharp1-4/+2
Same goes for VERIFY_ALPHA, VERIFY_XIN_PICTURE, and VERIFY_XIN_ALPHA. 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-03Make sure XFixes invisible cursor gets freed on server resetKeith Packard1-11/+12
This uses the same hack that dix uses for the rootCursor -- allocate a resource ID for the invisible cursor so that it gets freed at reset time. This also allows us to unconditionally create it during extension initialization; necessary as the privates layout may well be different on subsequent generations. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19unifdef -B -DRENDER to always include RENDER codeKeith Packard1-10/+0
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>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith3-23/+11
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-18Ensure all resource types created have names registeredAlan Coopersmith3-0/+17
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-18Check for failures from CreateNewResourceTypeAlan Coopersmith2-2/+3
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-16Update Sun license notices to current X.Org standard formAlan Coopersmith3-63/+45
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21input: define server-supported protocol versions in one single file.Peter Hutterer1-8/+6
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-20fixes: Make sure invisible cursor is inialized with zero src/maskThomas Jaeger1-4/+2
This fixes a regression introduced in 9040dab76182d1a019ca7fef7b29733d2c199e61. Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-28xfixes: minor clean ups on createInvisibleCursor()Tiago Vignatti1-7/+4
- unused return value - no reason to declare static variable given the function is just called once - no reason to declare different type and cast it after. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-03xfixes: backup the DisplayCursor/CloseScreen proc before restoring it (#23034)Peter Hutterer1-5/+9
The screen's DisplayCursor func is wrapped as AnimCurDisplayCursor -> CursorDisplayCursor -> miPointerDisplayCursor. Calling CursorDisplayCursor while an animated cursor was currently displayed would remove AnimCurDisplayCursor from the wrap stack. Thus, the next call to ChangeToCursor wouldn't update the animated cursor state. The block handler for animated cursors would then continuously overwrite the actual cursor, leaving an animated cursor everywhere on the screen. X.Org Bug 23034 <http://bugs.freedesktop.org/show_bug.cgi?id=23034>
2009-08-03xfixes: allocate CurrentCursor for all devices.Peter Hutterer1-7/+7
XFixes requires cursor notifies to clients when the cursor changes. This should work on the ClientPointer and then on all master pointers. Hence change CurrentCursor to a MAXDEVICES array. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-03xfixes: FixesHideCursor should work on all master pointers.Peter Hutterer1-2/+12
Presumably, a client calling HideCursor doesn't want any cursor displayed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14xfixes: switch to byte counting functionsPeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-15Correct some Sun license notices to Sun's standard X11 license formatAlan Coopersmith3-51/+72
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-29Fix most remaining deprecated resource lookups.Eamon Walsh2-2/+11
Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage.
2009-04-28Make the cursor completely optionalSimon Farnsworth1-2/+4
For embedded use, it's convenient to be able to disable the cursor completely, without having to audit and fix up all your third-party code (e.g. Mozilla Firefox). Add -nocursor and -cursor server options to enable and disable the cursor. The default is still -cursor, but embedded users can run the server with -nocursor to hide the cursor regardless of what application developers do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-14xfixes: Fix a couple of resource lookupsKristian Høgsberg2-15/+26
2009-03-16xfixes: useless (void) typecast removalPeter Hutterer1-5/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-09Replace dixLookupResource by dixLookupResourceBy{Type,Class}Keith Packard2-5/+5
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-02-16xserver: Avoid sending uninitialized padding data over the networkPeter Åstrand2-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03Constify atom name stringsAlan Coopersmith1-2/+2
Changes MakeAtom to take a const char * and NameForAtom to return them, since many callers pass pointers to constant strings stored in read-only ELF sections. Updates in-tree callers as necessary to clear const mismatch warnings introduced by this change. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-1/+0
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-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade4-5/+9
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-12-02Add visibility flags to XSERVER_CFLAGS.Paulo Cesar Pereira de Andrade2-2/+2
This is done to actually change DIX_CFLAGS, as not all "modules" use XORG_CFLAGS. Also export the symbols that are required by other modules after the change.
2008-10-02Unifdef ISCAdam Jackson6-0/+0
2008-09-26xfixes: realize the invisible cursor before displaying it.Peter Hutterer1-1/+2
AllocARGBCursor realizes the cursor but can only do so if we have devices there already. If we don't - then the cursor needs to be realized elsewhere. This is usually done in InitializeSprite, but since xfixes just hard-swaps the (realized) cursor to the InvisibleCursor, we need to manually realize it before trying to display it.
2008-09-24Fix un-suppressing the initial cursor.Adam Jackson1-25/+7
The intended behaviour was "show as soon as someone calls XDefineCursor". What you actually got was, uh, slightly less well defined, since the screen's ChangeWindowAttributes hook would run after DIX handled the cursor change. Oops. The trivial way to turn the cursor on is: % xsetroot -cursor_name gumby Refer to /usr/include/X11/cursorfont.h for cursor names. Thanks to anholt for catching this.