Commit Graph

11680 Commits

Author SHA1 Message Date
Michal Suchanek
d2f71b1394 Xi: Remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:30 +01:00
Michal Suchanek
a4f87f885a kdrive: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:26 +01:00
Michal Suchanek
369edd7876 dix: don't duplicate DoFocusEvents declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:21 +01:00
Michal Suchanek
36377fb0e8 dix: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:17 +01:00
Michal Suchanek
ea9ed83f8f xfree86: don't include xvmodproc.h when not needed
The functions are already declared in xf86xv.h

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:12 +01:00
Michal Suchanek
1927e5ab25 xserver: Remove duplicate declaration in resource.h
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:08 +01:00
Michal Suchanek
1339681e4f miext: Remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:04 +01:00
Michal Suchanek
6699f54fe0 mi: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:01 +01:00
Michal Suchanek
b4bf90f9fb exa: Remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:16:57 +01:00
Michal Suchanek
5595e7ce07 randr: Remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:16:54 +01:00
Michal Suchanek
c59c9dac84 xkb: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:16:50 +01:00
Michal Suchanek
d0a8346045 xfixes: remove redundant declaration.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:16:46 +01:00
Keith Packard
3a94b338aa Merge remote-tracking branch 'whot/for-keith' 2012-05-09 21:17:16 -07:00
James Cloos
afc153a5b4
Fix RANDR’s gamma_to_ramp().
In order to generate a 256-entry ramp in [0,65535] which covers the full
range, one must mupliply eight-bit values not by 256 but rather by 257.

Many years back – well before the RANDR extension was written, and
before xorg@fdo – a similar bug fix was made to the DIX for converting
client-supplied eight-bit color values into sixteen-bit values.

Noticed by: Elle Stone and Graeme Gill.

Signed-off-by: James Cloos <cloos@jhcloos.com>
2012-05-08 17:55:10 -04:00
Yaakov Selkowitz
e501c34d49 hw/xwin/glx: Use silent rules
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-05-04 13:13:57 -05:00
Yaakov Selkowitz
026d402fef xfree86: use silent rules with sdksyms generation
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-05-04 13:13:55 -05:00
Yaakov Selkowitz
3d98dac46c xfree86: respect EXEEXT in relink target
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-05-04 13:13:52 -05:00
Yaakov Selkowitz
e6461db6dc os: Add CryptoAPI as a choice of SHA1 implementation
Both Cygwin and MinGW can use Windows' native CryptoAPI for SHA1,
saving a dependency on libgcrypt or OpenSSL.  The necessary functions
are in ADVAPI32.DLL, which is among the default lib flags and is
already used in hw/xwin for accessing the registry.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2012-05-04 13:13:50 -05:00
Daniel Kurtz
c91d00e0f3 os/log: refactor logging
It is not safe to ever use an arbitrary (possibly user supplied) string as
part of the format for a *sprintf() call.

For example:
  1. Name a Bluetooth keyboard "%n%n%n%n%n%n%n%n"
  2. Pair it with a computer running X and try to use it
  3. X is not happy when trying to do the following in xf86-input-evdev:
     xf86IDrvMsg(pInfo, X_CONFIG, "Device: \"%s\"\n", device);
     because LogVHdrMessageVerb() has put the %n from the device name
     into a format string of the form:
        "evdev: %n%n%n%n%n%n%n%n: Device: \"%s\"\n"

Instead, build up a log message in place by appending successive formatted
strings by sncprintf'ing to the end of the previous.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-03 14:59:23 +10:00
Daniel Kurtz
6ce0eac4f8 os/log: only write timestamp if a message is actually written to logfile
The current code will write a timestamps into the logFile whenever
the last message ended with a '\n' - even if the verb for that timestamp
is at too high a level.  This timestamp will sit there with no matching
message until the next call to LogVWrite with a valid verb.

In other words, in some cases, timestamps in the X.org.log are for some
completely unrelated message that was previously ignored due to
insufficient verbosity, and not for the message that appears next to it
in the log file.

We keep the current policy which appears to be to only apply timestamps if
a message is actually written to a log file.  That is, no timestamps on
stderr, or in the mem buffer.  Therefore, the timestamp stringification
is moved to the conditional where it is used.

Since logging uses a fixed length buffer, this patch also forces a '\n'
whenever a buffer is terminated due to a too-long write request.  This
allows the newline detection to work even on overflow, and also cleans up
the log a bit in the overflow case.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-03 14:59:23 +10:00
Daniel Kurtz
5c2e2a164d os/xprintf: add Xvscnprintf and Xscnprintf
Normal snprintf() usually returns the number of bytes that would have been
written into a buffer had the buffer been long enough.

The scnprintf() variants return the actual number of bytes written,
excluding the trailing '\0'.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-03 14:59:23 +10:00
Daniel Kurtz
c30862879d os/log: trivial cleanups
* space->tab
 * remove comment that doesn't make any sense

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-03 14:59:23 +10:00
Keith Packard
97041364a6 Merge remote-tracking branch 'whot/for-keith'
No conflicts here
2012-05-02 20:47:25 -07:00
Chase Douglas
ee542b8559 Report touch emulated buttons in XIQueryPointer for XI 2.1 and earlier
XInput 2.1 and earlier clients do not know about touches. We must report
touch emulated button presses for these clients. For later clients, we
only report true pointer button presses.

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>
2012-05-03 11:20:43 +10:00
Ryan Pavlik
19082726cb configure.ac: on MinGW, link with ws2_32 instead of winsock2
ws2_32 is the correct name for the libary (even on 64 bit Windows :-))

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-05-02 12:40:33 +01:00
Ryan Pavlik
ad9605a3e2 configure.ac: MinGW doesn't have setuid binaries either.
If the target platform isn't in a list of platforms we know don't use a
setuid binary, we try to test if we can chown something to root.

This test possibly won't give the right answer if we are cross-compiling,
which is common for the MinGW target.  This patch adds MinGW to the list
of platforms we know don't use a setuid binary.

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-05-02 12:40:32 +01:00
Ryan Pavlik
2225208c2e configure.ac: auto-disable MITSHM if we lack IPC
The MITSHM extension uses SYSV IPC, but even if configure's test
for IPC failed, MITSHM was still enabled by default, breaking
MinGW builds by default.

Unfortunately, fixing this exposes the fact that the HAVE_SYSV_IPC
test wasn't being used for anything before and so we hadn't noticed it
was failing on Cygwin.

Change from using SHM_W|SHM_R flags (which aren't required by POSIX) to
S_IRUSR|S_IWUSR flags (which are)

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-05-02 12:39:22 +01:00
Chase Douglas
1e7b500a8e Report logical button state in ProcXIQueryPointer
Physical button state is usually meaningless to an X client.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-02 09:37:51 +10:00
Jon TURNEY
0426e6d65b configure.ac: Make default configuration for MinGW disable unsupported extensions and DDXs
Same as the default configuration for Cygwin, --disable-xorg and --disable-dmx DDX by default,
and force --disable-xv and other unsupported extensions

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-05-01 17:01:36 +01:00
Peter Hutterer
f3410b97cf dix: when disabling a device, release all buttons and keys
A suspend-induced device disable may happen before the device gets to see
the button release event. On resume, the server's internal state still has
some buttons pressed, causing inconsistent behaviour.

Force the release and the matching events to be sent to the client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-01 11:36:36 +10:00
Peter Hutterer
af88b43f9e dix: don't emulate scroll events for non-existing axes (#47281)
Test case:
- create a device with REL_HWHEEL and ABS_X and ABS_Y. evdev 2.7.0 will set
  that up as device with 1 relative axis
- move pointer to VGA1
- xrandr --output VGA1 --off

Warps the pointer to the new spot and calls GPE with the x/y mask bits set.
When running through the loop to check for scroll event, this overruns the
axes and may try to emulate scroll events based on random garbage in the
memory. If that memory contained non-zero for the scroll type but near-zero
for the increment field, the server would hang in an infinite loop.

This was the trigger for this suggested, never-merged, patch here:
http://patchwork.freedesktop.org/patch/9543/

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-01 11:36:35 +10:00
Peter Hutterer
08962951de os: make timers signal-safe
If TimerSet() is called from a signal handler (synaptics tap handling code)
may result in list corruption if we're currently inside TimerSet().

See backtrace in
https://bugzilla.redhat.com/show_bug.cgi?id=814869

Block signals for all list manipulations in the timers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-01 11:36:35 +10:00
Michal Suchanek
d662fa2450 dmx: Annotate dmxlog.c with _X_ATTRIBUTE_PRINTF and _X_NORETURN
and fix resulting printf warning in dmxLogVisual

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-01 11:36:35 +10:00
Chase Douglas
5c361d59c5 TouchListenerAcceptReject: Warn and return early on bad listener index
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-01 11:36:35 +10:00
Chase Douglas
88bacc49f0 os: Add -displayfd option
This option specifies a file descriptor in the launching process.  X
will scan for an available display number and write that number back to
the launching process, at the same time as SIGUSR1 generation.  This
means display managers don't need to guess at available display numbers.
As a consequence, if X fails to start when using -displayfd, it's not
because the display was in use, so there's no point in retrying the X
launch on a higher display number.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-01 11:36:30 +10:00
Michal Suchanek
1d82ec9594 xserver: Fix out-of-tree build
Fixes regression caused by ccb3e78124

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-01 11:36:30 +10:00
Peter Hutterer
ea51e9b287 Xi: return BadValue on XIQueryVersion if the version is less than first call
Clients that use plugin systems may require multiple calls to
XIQueryVersion from different plugins. The current error handling requires
client-side synchronisation of version numbers.

The first call to XIQueryVersion defines the server behaviour. Once cached,
always return that version number to any clients. Unless a client requests a
version lower than the first defined one, then a BadValue must be returned
to be protocol-compatible.

Introduced in 2c23ef83b0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-01 11:36:30 +10:00
Jeremy Huddleston
93d6ba5b71 XQuartz: Make sure we tell startx the correct server binary to use in our fallback path
With multiple servers installed, we can't be certain if X is Xorg or Xquartz

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-26 21:25:38 -07:00
Michal Suchanek
fa6dddc6ce xfree86: workaround crash on close
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Knut Petersen <Knut_Petersen@t-online.de>
2012-04-23 20:20:42 -07:00
Jonas Maebe
adcb48a29d glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than
sizeof(struct _glapi_struct) bytes.

Signed-off-by: Jonas Maebe <jonas.maebe@elis.ugent.be>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:42 -07:00
Jeremy Huddleston
e34519e525 XQuartz: darwinPointer now sends both absolute and relative motion
This should hopefully help out wine clients that were continuing to
have issues after the earlier changes.

http://xquartz.macosforge.org/trac/ticket/548

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:42 -07:00
Jeremy Huddleston
662d41acdd XQuartz: Add a hack to better handle clicky wheel scroll mice
We loose information from AppKit being in our way.  Before adopting
smooth scrolling, we always rounded-up the number of scroll button
clicks per NSEvent.  Now, the scroll value is accumulated in the
dix, and clicky scroll wheels with legacy X11 clients are seeing
an accumulation of error due to so many translations (button press
to smooth scrolling value in AppKit, passed to the dix, and then
synthesized into a button press).  This attempts to make the
situation better.

http://xquartz.macosforge.org/trac/ticket/562

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
eda85290ae XQuartz: Use screenInfo.{width,height} instead of grabbing it from the first screen
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
b99586c908 XQuartz: Separate out tablet and mouse event delivery into separate functions
This should have no immediate impact aside from fake mouse buttons no longer
working with tablets (where they aren't needed or desired anyways).  This
prepares us for future changes.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
30623d6ff7 XQuartz: Correct calculation of the size of our file descriptor array in console_redirect
Reported-by: Joe Rohde <joer@valvesoftware.com>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
b4c4c65a35 XQuartz: Fix a deadlock in pre-dispatch code
The fact that this has been in place so long makes me really wonder if
anybody cares about this running in Tiger or Leopard.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
d1ef0d4964 test: Fix make dist
It seems like make dist should be doing te right thing without this commit,
but it's not in some cases.  Don't ask me to explain why.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 20:20:41 -07:00
Jeremy Huddleston
d97868d934 os: Annotate OsVendorFatalError as _X_ATTRIBUTE_PRINTF
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-By: Michal Suchanek <hramrach@gmail.com>
2012-04-23 20:20:38 -07:00
Jeremy Huddleston
0ba1794fe2 xres: Fix build without composite
Regression from: b8d0d19a6d
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Tested-By: Michal Suchanek <hramrach@gmail.com>
2012-04-23 20:16:53 -07:00
Keith Packard
d77eb7ee49 Merge remote-tracking branch 'yselkowitz/master'
Pull in Cygwin for XFree86
2012-04-19 15:48:34 -05:00