summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-31os: don't ignore failure from dladdrHEADmasterJulien Cristau1-1/+5
If dladdr returns 0, don't go and use the returned Dl_info, it may contain garbage. X.Org bug#44315 <https://bugs.freedesktop.org/show_bug.cgi?id=44315> Reported-and-tested-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-12-31linux/ia64: Fix regression after domain I/O support code removal.Cyril Brulebois1-19/+0
Side effect of aa0bfb0f133481c57762012e8e30c05ffa151423: | CCLD Xorg | sdksyms.o:(.data.rel+0x27d8): undefined reference to `outl' | collect2: ld returned 1 exit status Since the linux/ia64 domain I/O support code got removed in that commit, there's no reason to keep on declaring those functions (inb, inl, inw, outb, outl, outw). Bugzilla: https://bugs.freedesktop.org/43985 Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-12-17Version 1.11.99.2 (1.12 snapshot 2)Keith Packard1-2/+2
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-16xserver: check for elevated privileges not uid=0Antoine Martin5-24/+91
This allows us to run the server as a normal user whilst still being able to use the -modulepath, -logfile and -config switches We define a xf86PrivsElevated which will do the checks and cache the result in case it is called more than once. Also renamed the paths #defines to match their new meaning. Original discussion which led to this patch can be found here: http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html Signed-off-by: Antoine Martin <antoine@nagafix.co.uk> Tested-by: Michal Suchanek <hramrach at centrum.cz> Reviewed-by: Jamey Sharp <jamey at minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-15dmx: fix distcheck failure, missing compsize.h in Makefile.amGaetan Nadon1-0/+2
which was added in commit: dmx: Build fix for -Werror=implicit-function-declaration Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-14configure: split the required modules upPeter Hutterer1-2/+16
We do the same thing for libraries and optional modules already, and it's much easier to read when one of them changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-14Merge remote-tracking branch 'whot/for-keith'Keith Packard29-592/+801
2011-12-13Merge branch 'for-whot' of git://people.freedesktop.org/~alanc/xserver into ↵Peter Hutterer4-12/+29
for-keith
2011-12-13dix: add a MAXEVENTS define for the number of core + extension eventsPeter Hutterer5-7/+8
Not including GenericEvents Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Walter Harms <wharms@bfs.de> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: move event filter retrieval helpers to inpututils.cPeter Hutterer4-21/+31
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: switch EventIsDeliverable to take the event type onlyPeter Hutterer2-8/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: move storing last.valuators into a helper functionPeter Hutterer1-12/+26
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: always allocate and set the grab's sync.eventPeter Hutterer2-7/+2
Allocate the memory at device creation time and always store the event, even if we're not frozen. This way we know which event triggered the grab. Since the event was never freed anyway except on device shutdown, this doesn't really change things much. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13input: replace GRABTYPE_* with the InputLevel enumsPeter Hutterer18-158/+152
They achieve the same thing, re-use the more generic InputLevel so we can convert to/fro easier. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Add GrabIsPointerGrab and GrabIsKeyboardGrab helpersPeter Hutterer3-6/+21
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: move delivery stop condition out of event maskPeter Hutterer1-6/+7
Previously, this was only called if there was a mask match, so even if we had a no-propagate flag set or a stopAt window specified, if no mask triggered on the window we would recurse up to the root window and eventually deliver. Move this, so that the stopAt and do-not-propagate mask is honoured. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: split out core state and event state setting into helper functionsPeter Hutterer3-28/+44
no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: move grab matching code into a helper functionPeter Hutterer1-21/+60
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: split core grab interference check into helper functionPeter Hutterer1-18/+25
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: compare the grab type, not the tempGrab typePeter Hutterer1-1/+1
No functional change. To get here, GrabMatchesSecond() needs to be TRUE and for that the two grab types must be identical. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: remove event type checkPeter Hutterer1-7/+0
Can't remember why this is there but we'll need to pass in XI2 events soon, so this check is obsolete. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: Split ActivatePassiveGrab() from CheckPassiveGrab()Chase Douglas2-89/+112
The changed logic means we don't require the explicit grab = NULL setting and early exit anymore. Not 100% of it, but if we see that message pop up in a log we know it's broken. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-13dix: Move grab check and activation logic to CheckPassiveGrab()Chase Douglas1-180/+204
This is needed for future pointer emulation work. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-13dix: move EventDeliveryState into a header file, we'll need it elsewherePeter Hutterer2-7/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Xi: split updating button count and state into helper functionsPeter Hutterer1-12/+29
Functional change: for a button mapped to 0, the motionHintWindow is not updated to the NullWindow anymore. Before it got updated unconditionally to the button mapping. I have no idea what the practical effect of this is, but I guess it's closer to the correct behaviour: pressing a button that's logically disabled now does not disrupt the motion hint delivery. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Xi: deduplicate button motion mask settingPeter Hutterer1-12/+25
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: deduplicate callers of DeliverDeviceEvents in DeliverGrabbedEventsPeter Hutterer1-8/+10
No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: split grab event conversion and delivery into a helper functionPeter Hutterer2-72/+77
Effective functional change: XI2 events are checked with XACE now. DeliverOneGrabbedEvent is exported for future use by touch events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: replace conversion errors with BUG_WARN_MSGPeter Hutterer1-8/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: deduplicate event delivery codePeter Hutterer1-49/+62
Move all the event delivery code into DeliverOneEvent, based on the InputLevel we're sending to. Functional change: we now check XI2 events with XACE too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13include: Add an InputLevel enumChase Douglas1-0/+6
Currently unused, but will be in the future. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12verify_internal_event: preserve constness of data pointerAlan Coopersmith1-1/+1
All we're using it for is ErrorF calls, so make it a const char * to stop gcc from warning: inpututils.c: In function 'verify_internal_event': inpututils.c:629:9: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Use const cast in BitIsOn macro to avoid angering gccAlan Coopersmith1-1/+1
Fixes gcc warnings such as: inpututils.c: In function 'valuator_mask_isset': inpututils.c:498:5: warning: cast discards qualifiers from pointer target type inpututils.c: In function 'CountBits': inpututils.c:613:9: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Fix deconstifying cast warning in xi2_get_typeAlan Coopersmith1-1/+1
Since we're just comparing values in the struct, cast it to a const xGenericEvent * to clear gcc warning of: events.c: In function 'xi2_get_type': events.c:193:5: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Include client name if available in PrintDeviceGrabInfoAlan Coopersmith1-9/+26
Also adds missing newline to first line of output. Before patch: [3581472.414] (II) Printing all currently active device grabs: [3581472.414] Active grab 0x1800000 (core) on device 'Virtual core pointer' (2): client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x0 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] Active grab 0x1800000 (core) on device 'Virtual core keyboard' (3) : client pid 26174 uid 0 gid 10 [3581472.415] at 3581469139 (from active grab) (device thawed, state 1) [3581472.415] core event mask 0x3 [3581472.415] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581472.415] (II) End list of active device grabs After patch: [3581736.601] (II) Printing all currently active device grabs: [3581736.601] Active grab 0x1600000 (core) on device 'Virtual core pointer' (2): [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x0 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] Active grab 0x1600000 (core) on device 'Virtual core keyboard' (3) : [3581736.601] client pid 26741 /usr/bin/xscreensaver -nosplash [3581736.601] at 3581735000 (from active grab) (device thawed, state 1) [3581736.601] core event mask 0x3 [3581736.601] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0 [3581736.601] (II) End list of active device grabs Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
2011-12-12xf86 parser: convert Error to a varargs macro to clear gcc format warningsAlan Coopersmith15-100/+100
Previously it always passed a format string with exactly one argument, using NULL when the format string needed none. Now pass the right number of arguments to clear gcc warnings of 'too many arguments for format'. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Add some printf format attributes suggested by gccAlan Coopersmith5-6/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12xf86Priv.h: Add some noreturn attributes suggested by gccAlan Coopersmith1-4/+2
Both functions call exit() at the end and have no other return path. Also correct comment/heading to reflect commit 6450f6ca7ee0 moving DoShowOptions into xf86Configure.c. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Remove duplicate declarations of KdAdd*Driver in kdrive.hAlan Coopersmith1-6/+0
Clears gcc warnings in every file that includes kdrive.h: kdrive.h:507:1: warning: redundant redeclaration of 'KdAddPointerDriver' kdrive.h:225:6: note: previous declaration of 'KdAddPointerDriver' was here kdrive.h:510:1: warning: redundant redeclaration of 'KdAddKeyboardDriver' kdrive.h:284:6: note: previous declaration of 'KdAddKeyboardDriver' was here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Remove duplicate declaration of xf86ValidateModesFlags in xf86Modes.hAlan Coopersmith1-4/+0
Clears gcc warning in every file that includes xf86Modes.h: xf86Modes.h:102:1: warning: redundant redeclaration of 'xf86ValidateModesFlags' xf86Modes.h:72:1: note: previous declaration of 'xf86ValidateModesFlags' was here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12_XkbFilterDeviceBtn: move variable declarations to match usage scopeAlan Coopersmith1-4/+5
The main body of this function is an if { } else if { } pair of blocks. Previously there was int button at the top level scope which is used only in the first block, and a redeclaration of int button inside the second block. Since there's no overlap in the code paths for the two uses of button, move the one from the outer block into the first block to help the programmer more quickly determine they are unrelated usages, and to silence the gcc warning of: xkbActions.c: In function '_XkbFilterDeviceBtn': xkbActions.c:999:6: warning: declaration of 'button' shadows a previous local xkbActions.c:955:6: warning: shadowed declaration is here For consistency, move DeviceIntPtr dev declarations as well that are used in the same way. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12XkbFindSrvLedInfo: remove extraneous name-clashing sli variableAlan Coopersmith1-4/+2
Variable is already defined outside the outer if statement, and there's no need to redefine inside the if statement. No point in setting sli before if (dev->kbdfeed->xkb_sli==NULL) check - if check is true, we immediately set it, if check is false, we immediately return without further reference or use of it. The one thing we do with it inside the inner if statement is store an allocation in it for a brief moment before writing to the final destination, which is immediately returned to the caller. In short, there's no benefit to the variable at all in this block, it just gives the optimizer more code to figure out how to omit. Fixes gcc warning: xkbLEDs.c: In function 'XkbFindSrvLedInfo': xkbLEDs.c:683:19: warning: declaration of 'sli' shadows a previous local xkbLEDs.c:679:18: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12KdParseFindNext: Constify delim argumentAlan Coopersmith2-2/+2
It's only used as input to strchr to find the delimiters, never written to. Clears a bunch of gcc warnings of the form: kdrive.c:323:2: warning: passing argument 2 of 'KdParseFindNext' discards qualifiers from pointer target type kdrive.c:261:1: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Convert KdDoSwitchCmd to use asprintf instead of malloc/strcat/etc.Alan Coopersmith1-9/+4
Also fix the reason argument to be const char * to clear several gcc warnings of: kdrive.c:151:2: warning: passing argument 1 of 'KdDoSwitchCmd' discards qualifiers from pointer target type kdrive.c:116:1: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12DoShowOptions: preserve constness of options list as we walk itAlan Coopersmith1-2/+3
Since all we do with the option list is walk down the list printing the names, there's no need to cast away its constness. Clears gcc warning: xf86Configure.c: In function 'DoShowOptions': xf86Configure.c:781:4: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12x86emu: constify debug stringsAlan Coopersmith4-14/+14
Strings are all pointers to literal constants, just used as input to printf calls when debugging is enabled. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12CompareISOLatin1Lowered: constify argumentsAlan Coopersmith3-5/+6
Allows callers to avoid deconstifying arguments when calling, fixing gcc warning: filter.c: In function 'PictureGetFilterId': filter.c:59:2: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12xdmcp.c: fix three small const warningsAlan Coopersmith1-3/+3
xdmcp.c:63:36: warning: initialization discards qualifiers from pointer target type xdmcp.c: In function 'XdmcpRegisterConnection': xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c: In function 'get_mcast_options': xdmcp.c:1596:21: warning: initialization discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12LockServer: store path to LOCKDIR literal string in a const char *Alan Coopersmith1-3/+1
And instead of initializing to NULL, then resetting to LOCKDIR almost immediately (before ever using the NULL value), skip directly to setting it to LOCKDIR. tmppath variable is only used as input for generating the path name via calls to strlen, sprintf, etc. Fixes gcc warning of: utils.c: In function 'LockServer': utils.c:259:11: warning: assignment discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12WriteToClient: preserve constness of buf while extracting length valueAlan Coopersmith1-1/+1
Fixes gcc warning: io.c: In function 'WriteToClient': io.c:826:6: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>