103 Commits

Author SHA1 Message Date
pelya
95e445912d Compilation fixes for Xsdl 2012-04-24 15:12:24 +03:00
pelya
e6cef9e7aa Added back SDL backend, did not try to compile it yet 2012-04-24 15:12:24 +03:00
Michal Suchanek
240cd0675b Avoid crash on button events on device without valuators.
Backport of 2416ee4a01.

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-04-17 09:55:07 +10:00
Jeremy Huddleston
db9620c022 XQuartz: Fix the filename of our log file
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit fb55f8f790)
2012-03-13 00:08:08 -07:00
Jeremy Huddleston
42234f3cdb XQuartz: Short-circuit activateX:
This also avoids a deadlock when calling activateX: before the server
thread has initialized

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit cb6a32da27)
2012-02-24 11:33:24 -08:00
Jeremy Huddleston
53069ffd86 XQuartz: Actually install the new locales
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1562c4a1ca)
2012-02-24 11:33:14 -08:00
Jeremy Huddleston
4b75e41221 XQuartz: Build fix for possible conflict of BOOL type
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d53235af85)
2012-02-19 14:58:28 -08:00
Jeremy Huddleston
fb6c043833 XQuartz: Release all buttons and keys when deactivating
http://xquartz.macosforge.org/trac/ticket/486

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 85cecd9811)
2012-02-19 14:58:14 -08:00
Jeremy Huddleston
9138bbabcd XQuartz: Toggle off fullscreen mode when XQuartz is hidden
http://xquartz.macosforge.org/trac/ticket/478

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 47b457541b)
2012-02-19 14:58:07 -08:00
Jeremy Huddleston
fdca9c4d49 XQuartz: Localization Updates
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c2ba3f339f)
2012-02-19 14:57:59 -08:00
Alan Coopersmith
7773e74660 Assign ids to more tags in Xserver-Dtrace.xml
Keeps xsltproc from adding random-number id tags to html output so that
it's easier to see real changes vs. different random numbers.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Dew <marcoz@osource.org>
(cherry picked from commit 58d3d46d6c)
2012-02-10 15:51:35 -08:00
Jeremy Huddleston
e597f0119c configure.ac: 1.11.4
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-27 21:07:17 -08:00
Jeremy Huddleston
6c491463ee 1.11.3.902 (1.11.4 RC2)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-20 23:56:38 -08:00
Jeremy Huddleston
b747a91485 XQuartz: Bump bundle version to 2.7.1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-18 11:47:21 -08:00
Peter Hutterer
a1ed67fa05 render: don't bother with animated cursors on floating slaves (#39989)
X.Org Bug 39989 <http://bugs.freedesktop.org/show_bug.cgi?id=39989>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bbb6b8c834)
2012-01-18 10:55:12 -08:00
Peter Hutterer
f89c39e6c9 dix: Update pointer limits for floating devices too (#43635)
When the screen is restructured, the pointer limits need to be reset for
floating slave devices as well, not just for master pointers. Only skip
devices that don't have a cursor (attached slaves and keyboard)

Bug reproducer: float an absolute slave device, rotate the screen - the
device is now confined to a section of the screen only.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit 35bd77e9d0)
2012-01-18 10:54:13 -08:00
Zhigang Gong
dea9377a25 mi/mibitblt: Fix an overflow bug of bit shift.
When depth equal to 32 and planeMask equal to 0, the overflow will
occur and cause the pixmap can't be cleared. There are some test
cases in XTS hit this bug, and this fix can eliminate the corresponding
failures.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f4956faab9)
2012-01-18 10:53:31 -08:00
Alan Coopersmith
d2db5100b1 Convert DetermineClientCmd to use strdup instead of malloc+strncpy
*cmdname is initialized to NULL earlier in the function, so it's
okay to overwrite it with NULL if strdup fails, don't need that
extra check.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 780133f9ae)
2012-01-18 10:50:16 -08:00
Adam Jackson
5b28bcb340 dix: Tune dixLookupDrawable for success
The vast vast vast majority of resource lookups are successful.  Move some
work to the error paths so we don't punish success.

Before:
40000000 trep @   0.0009 msec (1109091.3/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square

After:
40000000 trep @   0.0009 msec (1148346.9/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 8f9bdfd293)
2012-01-18 10:40:03 -08:00
Adam Jackson
e1ea93fec9 dix: Tune dtrace hooks around Dispatch
Don't call LookupMajorName if the hooks aren't active, it's quite expensive.

Before:
40000000 trep @   0.0009 msec (1087458.5/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square

After:
40000000 trep @   0.0009 msec (1109091.3/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 83a98543b5)
2012-01-18 10:39:23 -08:00
Adam Jackson
9eaa0b5c89 xace: ricer tuning for XaceHook
gcc doesn't want to hoist the check for XaceHooks[hook] != NULL above the
varargs code for some reason, so do it ourselves.

Before:
40000000 trep @   0.0010 msec (1050420.2/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (1921147.6/sec): ShmPutImage 10x10 square

After:
40000000 trep @   0.0009 msec (1087458.5/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 11977fab54)
2012-01-18 10:39:13 -08:00
Peter Hutterer
a3b6ecc893 xfree86: split warning about missing identifier or input driver
Check for identifier first and bail if it's missing (also remove the current
identifier check after we've already bailed due to missing identifiers)

If a driver is missing, warn but also say that we may have added this device
already. I see too many bugreports with incorrectly shortened log files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
(cherry picked from commit 75953ccb9e)
2012-01-18 10:36:34 -08:00
Julien Cristau
4a339afc58 os: don't ignore failure from dladdr
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>
(cherry picked from commit 6269977c91)
2012-01-18 10:32:54 -08:00
Matthieu Herrb
9a4be7e99f Add OpenBSD support to DetermineClientCmd()
Uses kvm_getargv() from libkvm.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6d6d4cb604)
2012-01-18 10:32:53 -08:00
Alan Coopersmith
8046717d72 Add Solaris support to DetermineClientCmd
Uses /proc/pid/psinfo to read command & partial arguments.

Moves cmdsize & argsize variables into non-Solaris #else clause
to avoid unused variable warnings.

Fixes format mismatch errors when building with DEBUG defined on
a 64-bit platform (where Mask is defined as CARD32).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit cfc4c3d7fa)
2012-01-18 10:32:51 -08:00
Jeremy Huddleston
cea9f9f273 configure.ac: 1.11.3.901 (1.11.4 RC1)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-06 23:05:53 -08:00
Jeremy Huddleston
b15be8547d Xi: Fix mishandled git merge
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-06 23:05:42 -08:00
Jeremy Huddleston
82e0ae0423 Merge remote-tracking branch 'whot/server-1.11-branch' into server-1.11-branch 2012-01-02 20:58:22 -05:00
Carlos Garnacho
4e4bb319a4 Xi: assign correct grab_mode/other_device_mode in XI2 passive grabs
CreateGrab() expects the keyboard mode to be stored in grab_mode, and the
pointer mode in other_device_mode, so respect this in passive XI2 grabs,
and switch modes if needed.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit 5b169cb695)
2012-01-03 11:30:00 +10:00
Alan Coopersmith
8c73f6bcbd Change disable_clientpointer return type to void
It doesn't return anything, nor does it's caller expect it to.

Fixes Solaris Studio compiler error:
"xichangehierarchy.c", line 214: Function has no return statement : disable_clientpointer

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 372a6f10dc)
2012-01-03 11:29:43 +10:00
Peter Hutterer
ae4272a574 xfixes: don't dereference a NULL cursor
If the new cursor is the NULL cursor, don't dereference it and use zeros
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1ab50be938)
2012-01-03 11:24:51 +10:00
Peter Hutterer
20efd3c158 Xi: when removing a device, reset ClientPointers where needed
if a client had the to-be-removed device as ClientPointer, reset to NULL.

Fixes #43165

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d2ebbcdaf6)
2012-01-03 11:24:46 +10:00
Peter Hutterer
cf296f2eef Xext: don't swap CARD8 in SProcSELinuxQueryVersion
xselinux_ext.c: In function 'SELinuxSendItemsToClient':
xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable]
xselinux_ext.c: In function 'SProcSELinuxQueryVersion':
xselinux_ext.c:532:62: error: call to 'wrong_size' declared with attribute
error: wrong sized variable passed to swap
xselinux_ext.c:533:62: error: call to 'wrong_size' declared with attribute
error: wrong sized variable passed to swap

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit bb4aa1f263)

Conflicts:

	Xext/xselinux_ext.c
2012-01-03 11:23:18 +10:00
Peter Hutterer
4b38661024 dix: button state must show the logical buttons, not physical buttons
If the device is mapped 3 2 1, a click on physical button 1 sends a button 3
press, but the state was set for button 1. Fix this, the state must be set
for that button's logical mapping.

https://bugzilla.gnome.org/show_bug.cgi?id=655928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9567d21e85b99febe805263a4d93b15fd1f7ab42)

Conflicts:

	dix/inpututils.c
2012-01-03 10:47:53 +10:00
Peter Hutterer
f9b00c2aba Xi: when removing a device, reset ClientPointers where needed
if a client had the to-be-removed device as ClientPointer, reset to NULL.

Fixes #43165

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d2ebbcdaf6)
2012-01-02 15:39:21 -05:00
Peter Hutterer
e4984b3023 xfixes: don't dereference a NULL cursor
If the new cursor is the NULL cursor, don't dereference it and use zeros
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1ab50be938)
2012-01-02 15:38:52 -05:00
Peter Hutterer
625d108819 dmx: force -fno-strict-aliasing for xinput example
Compiler warning:
xinput.c:272: warning: dereferencing pointer 'e' does break strict-aliasing
rules

The code itself is the usual XInput client-side code:
        XEvent event;
        XDeviceMotionEvent *e = (XDeviceMotionEvent *)&event;
        XNextEvent(display, &event);
        printf("%d\n", e->type);

Since XDeviceMotionEvent is not guaranteed the same size as XEvent, clients
must use pointer aliasing as above when using the XNextEvent API. Disable
strict aliasing for this example.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3aca819940)
2011-12-21 12:21:58 -08:00
Keith Packard
53e347b22b Save major/minor opcodes in ClientRec for RecordAReply
The record extension needs the major and minor opcodes in the reply
hook, but the request buffer may have been freed by the time the hook
is invoked. Saving the request major and minor codes as the request is
executed avoids fetching from the defunct request buffer.

This patch also eliminates the public MinorOpcodeOfRequest function,
inlining it into Dispatch. Usages of that function have been replaced
with direct access to the new ClientRec field.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit fb22a408c6)

Conflicts:

	include/extension.h
2011-12-21 09:55:58 -08:00
Julien Cristau
b736f8c92b Fix ShmPutImage for XYBitmap
We can't call CopyArea in that case because the image has depth 1, which
might not match the target drawable, so we might overrun the shm
segment.  Commit 11817a881c apparently
fixed a similar bug for XYPixmap, but missed the bitmap case.

Fixes: http://bugs.debian.org/629611

Thanks to Alan Curry for diagnosing this and providing a test case.

Reported-and-tested-by: Alan Curry <pacman@kosh.dhis.org>
Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 08ec4da6a7)
2011-12-21 09:52:21 -08:00
Jeremy Huddleston
b2a4c09507 kdrive/linux: Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 1deede3c48)
2011-12-20 01:13:26 -08:00
Jeremy Huddleston
beaa7ad2ec configure.ac: Make Xephyr dependency error message more informative
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit d0170d54c7)
2011-12-20 01:13:21 -08:00
Jeremy Huddleston
41524dd610 configure.ac: 1.11.3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-16 17:47:46 -08:00
Gaetan Nadon
ee66474eb2 dmx: fix distcheck failure, missing compsize.h in Makefile.am
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>
(cherry picked from commit 2c1d0a539c)
2011-12-15 14:55:37 -08:00
Jeremy Huddleston
0ca8869e45 configure.ac: 1.11.2.902 (1.11.3 RC2)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-09 12:58:30 -08:00
Dave Airlie
e76c397eb9 kdrive: drop screen crossing code.
The only kdrive server we probably care about anymore is Xephyr,
and this screen enable/disable code totally breaks it in multi-screen mode.

When you are in one screen the other stops updating.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 98c4a888a4)
2011-12-09 12:35:59 -08:00
Dave Airlie
db418ff750 hal: free tmp_val in one missing case
Pointed out by coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 8d3731a811)
2011-12-09 12:35:44 -08:00
Dave Airlie
6b11b18ab6 xv: test correct number of requests. (v2)
Pointed out by coverity.

v2: fix swapped as well, as pointed out by Alan

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 41229392b7)
2011-12-09 12:35:37 -08:00
Dave Airlie
df16b789aa xaa: avoid possible freed pointer reuse in epilogue
If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps
avoid this by clearing the flags in to be destroyed pGCPriv.

Reported by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1049139499)
2011-12-09 12:35:27 -08:00
Dave Airlie
befa8a3b83 Xi: avoid overrun of callback array.
This code had an off-by-one and would allow writing one past the end of
the callbacks array.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 682c09a2ce)
2011-12-09 12:35:18 -08:00
Dave Airlie
b22783f483 xext: don't free uninitialised pointer when malloc fails. (v2)
Initialise the pAttr->values to values so if the values allocation
fails it just ends up as free(NULL).

Pointed out by coverity.

v2: use Alan's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit b62dc4fcbc)
2011-12-09 12:34:41 -08:00
Adam Jackson
083599c559 fbdevhw: iterate over all modes that match a mode. (v3)
So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it,
we run radeonfb and fbdev since ati won't work in userspace due to domain
issues in the older codebase.

On certain pseries blades the built-in KVM can't accept an 800x600-43 mode,
it requires the 800x600-60 mode, so we have to have the kernel radeonfb
driver reject the 800x600-43 mode when it sees it. However then fbdev
doesn't try any of the other 800x600 modes in the modelist, and we end up
getting a default 640x480 mode we don't want.

This patch changes the mode validation loop to continue on with the other modes
that match to find one that works.

v2: move code around to avoid extra loop, after comment from Jamey.
v3: move loop setup back into loop as per Jeremy's review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22605effd1)
2011-12-09 12:34:22 -08:00
Alan Coopersmith
05a890df0a LoaderOpen returns either a valid pointer or NULL, so don't check for < 0
Fixes Sun cc warning that was recently elevated to error by the
stricter default CFLAGS changes to xorg-macros:

"loadmod.c", line 914: improper pointer/integer combination: op "<"

Should have been changed when commit ab7f057ce9 changed the
LoaderOpen return type from int to void *.

Changes log message when file is found but dlopen() fails from:
 (EE) LoadModule: Module dbe does not have a dbeModuleData data object.
 (EE) Failed to load module "dbe" (invalid module, 0)
to:
 (EE) Failed to load module "dbe" (loader failed, 7)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit e4dcf580f0)
2011-12-09 12:33:42 -08:00
Alan Coopersmith
f494410842 Limit the number of screens Xvfb will attempt to allocate memory for
Commit f9e3a2955d removing the MAXSCREEN limit left the screen
number too unlimited, and allowed any positive int for a screen number:

Xvfb :1 -screen 2147483647 1024x1024x8

Fatal server error:
Not enough memory for screen 2147483647

Found by Parfait 0.3.7:
Error: Integer overflow (CWE 190)
   Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112
        at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'.

Since the X11 connection setup only has a CARD8 for number of SCREENS,
limit to 255 screens, which is also low enough to avoid overflow on the
sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit feebf67463)
2011-12-09 12:32:43 -08:00
Rui Matos
bed7d7f31e randr: Make the RRConstrainCursorHarder logic the same as miPointerSetPosition
The constraining logic in RRConstrainCursorHarder allows the cursor to reach
crtc positions of x = width and y = height while the constraining code in
miPointerSetPosition only allows it to reach x = width - 1 and y = height - 1
for the analogous screen case.

This patch makes the former's logic equivalent to the latter's which allows
applications to benefit from Fitts's law. E.g. a maximized application
adjacent to a crtc border wouldn't get pointer events if the user moved the
pointer all the way until it's contained.

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9cc44b955b)
2011-11-28 09:00:52 -08:00
Jeremy Huddleston
4689c84a07 configure.ac: 1.11.2.901 (1.11.3 RC1)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-28 00:07:29 -08:00
Derek Buitenhuis
e2661ddbc5 Fix vesa's VBE PanelID interpretation
xserver's VESA driver's VBE (Vesa BIOS Extensions) code
includes a PanelID probe, which can get a monitor's native
resolution. From this, using CVT formulas, it derives
horizontal sync rate and a vertical refresh rate ranges.

It however, only derives the upper bounds of the ranges, and
the lower bounds cannot de derived. By default, they are set
to hardcoded constants which represent the lowest supported
resolution: 640x480. The constants in vbe.c however, were
not actually derived from forulas, but carried over from
other code from the bad old days, and are not relevant
to flat panel displays. This caused, for example, EEEPC701's
panel, with a native resolution of 800x480, to end up with
a upper bound of the horizontal sync rate that was lower
than the hardcoded lower bound, which of course broke things.

These numbers have been rederived using both my own CVT tool
based on xf86CVTMode(), and using the provided 'cvt' tool
that comes with xserver.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f0d50cc665)
2011-11-24 12:15:00 -08:00
Jeremy Huddleston
2e3406fc67 dmx: Build fix for -Werror=implicit-function-declaration
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit f405dfffe7)
2011-11-24 12:05:59 -08:00
dtakahashi42
b440fc9c1b rootless: Fix a server crash when choosing a color with the gimp color wheel
https://trac.macports.org/ticket/30927

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 328074890e)
2011-11-21 18:44:34 -08:00
Ross Burton
40c1287f36 edid: Add quirk for Acer Aspire One 110
At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

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

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 58864146fb)
2011-11-21 18:44:24 -08:00
Chris Wilson
7972e2dade dri2: Register the DRI2DrawableType after server regeneration
The Resource database is reset upon regeneration and so the dri2 module
needs to re-register its RESTYPE for the drawable or else it will
clobber the next unsuspecting user of the database. Fortunately, DRI2 is
loaded late in the initialisation sequence and was last up until
xf86-video-intel started using the Resource database to track
outstanding swaps...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
(cherry picked from commit 34b0e4eee9)
2011-11-21 18:44:17 -08:00
Chris Wilson
73beaf9033 DRI2: Avoid a NULL pointer dereference
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=41211

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bfa1a0dd19)
2011-11-21 18:43:49 -08:00
Chris Wilson
6105fcaa35 VidMode: prevent crash with no modes
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit eeb21a133b)
2011-11-21 18:43:43 -08:00
Rami Ylimäki
d113b29115 record: Prevent out of bounds access when recording a reply.
Any pad bytes in replies are written to the client from a zeroed
array. However, record extension tries to incorrectly access the pad
bytes from the end of reply data.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
(cherry picked from commit c1bb8f43b9)
2011-11-21 18:43:32 -08:00
Jeremy Huddleston
4dc5b6ea9f xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
memType is a uint64_t on powerpc. Using memType only really makes
sense for *physical* addresses, which can be 64-bit for 32-bit
systems running on 64-bit hardware.

However, unmapVidMem() only deals with *virtual* addresses, which
are guaranteed to fit into an uintptr_t.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
(cherry picked from commit eb3377ffb8)
2011-11-21 18:42:42 -08:00
Peter Hutterer
a1925f0879 include: export GetProximityEvents and QueueProximityEvents
This is mainly needed for consistency with GetPointerEvents and friend.
No-one seems to actually need this function from outside the usual DDXs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit fc16917ad6)
2011-11-21 17:59:17 -08:00
Peter Hutterer
a6a21f84bb dix: Don't let a driver without a ProximityClassRec post events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 11840595a1)
2011-11-21 17:58:49 -08:00
Peter Hutterer
2f2d871ccd Xi: allow passive keygrabs on the XIAll(Master)Devices fake devices
They don't have a KeyClassRec, but we must still allow passive grabs on
them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 22715e465b)
2011-11-21 17:58:31 -08:00
Peter Hutterer
34bb83b9df dix: block signals when closing all devices
When closing down all devices, we manually unset master for all attached
devices, but the device's sprite info still points to the master's sprite
info. This leaves us a window where the master is freed already but the
device isn't yet. A signal during that window causes dereference of the
already freed spriteInfo in mieqEnqueue's EnqueueScreen macro.

Simply block signals when removing all devices. It's not like we're really
worrying about high-responsive input at this stage.

https://bugzilla.redhat.com/show_bug.cgi?id=737031

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit d7c44a7c97)
2011-11-07 18:00:33 -08:00
Christopher Yeleighton
97f2ae60fc Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2
https://bugs.freedesktop.org/show_bug.cgi?id=38420

Exit with fatal error message, not segfault.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7d50211ab5)
2011-11-06 16:53:06 -08:00
Dave Airlie
89626304ea xf86Crtc: handle no outputs with no modes harder.
If you started an X server with no connected outputs, we pick a default
1024x768 mode, however if you then ran an xvidmode using app against that
server it would segfault the server due to not finding any valid modes.

This was due to the no output mode set code, only adding the modes to the
scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
get called and remove all the modes and we'd end up with 0.

This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
least 1024x768, and pushes the initial configuration to just call it instead
of setting up the mode itself.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926

I've seen other bugs like this on other distros so it might also actually fix them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 17416e88dc)
2011-11-06 16:52:56 -08:00
Jeremy Huddleston
c68a84e73d configure.ac: Bump to 1.11.2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-04 10:24:08 -07:00
Jeremy Huddleston
2d6760f591 Revert "dix: don't XWarpPointer through the last slave anymore (#38313)"
This reverts commit bbe6a69da3.

This commit caused a regression.

See: http://xquartz.macosforge.org/trac/ticket/517#comment:10
2011-11-03 15:01:35 -07:00
Jeremy Huddleston
0bffe6b38c configure.ac: Bump to 1.11.1.902 (1.11.2 RC2)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-28 18:32:28 -07:00
Jeremy Huddleston
a1d638da0d XWin: windowswm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 286fa9bf9b)
2011-10-28 18:31:15 -07:00
Jeremy Huddleston
0715469f1c XQuartz: appledri: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit dc054fefc5)
2011-10-28 18:31:10 -07:00
Jeremy Huddleston
bc2600466e XQuartz: applewm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d5fee2b638)
2011-10-28 18:31:05 -07:00
Jeremy Huddleston
7be5492bcf XQuartz: appledri: Allow byte swapped requests
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1c8bda798b)
2011-10-24 18:25:10 -07:00
Jeremy Huddleston
0ad049706d XQuartz: appledri: Fix byte swapping in replies
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 14205ade0c)

Conflicts:

	hw/xquartz/xpr/appledri.c

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 18:25:10 -07:00
Jeremy Huddleston
3b931c9276 XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
http://xquartz.macosforge.org/trac/ticket/508

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 2ba0ac202a)
2011-10-24 18:16:57 -07:00
Jeremy Huddleston
f22a41416b Xnest: Match the host's keymap
This was a regression.

Introduced by: 08363c5830 and
               32db27a7f8
Masked by: 1e69fd4a60

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 83fef4235d)
2011-10-24 18:16:46 -07:00
Tomáš Trnka
82445286d5 Fix drain_console unregistration
Bug introduced by 9dca441670
xfree86: add a hook to replace the new console handler.

console_handler was not being set, making the server eat up CPU spinning
in WaitForSomething selecting consoleFd over and over again, every time
trying to unregister drain_console without success due to
console_handler being NULL.

Let's just fix the unregistration in xf86SetConsoleHandler() and use that.

But wait, there could be a catch: If some driver replaced the handler using
xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
that one. I don't understand Xorg well enough to know whether this poses a
problem (could mess up driver deinit somehow or something like that). As it is,
xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
handler is currently registered).

I had been using it for two days on my machine that previously hit 100% CPU
several times a day. That has now gone away without any new problems appearing.

Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 323869f329)
2011-10-24 16:36:06 -07:00
Jesse Barnes
c8c5ed998a crtc: match full preferred modes if possible when choosing an initial config
It's fairly common to have multiple, identical monitors plugged in.  In
that case, it's preferable to run the monitor's preferred mode on each
output, rather than just matching the width & height and end up with
different timings or refresh rates.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3e145d3d67)
2011-10-24 10:19:15 -07:00
Ville Syrjala
d780c6f630 composite: Update borderClip in compAllocPixmap()
Previously the parent constrained borderClip was copied over
when compRedirectWindow() is called. That is insufficient eg. in
case the window was already redirected, but not yet realized. So
copy the borderClip over in compAllocPixmap() instead.

Example:
Window 1 is below an automatically redirect window 2. Window 2 is
unmapped and moved outside the extents of window 1. Window 2 is
then mapped again, and MarkOverlappedWindows() uses the up to
date borderSize of window 2 to mark windows, which leaves
window 1 unmarked. Then exposures are calculated using the stale
borderClip of window 2, which causes the window below window 2,
to be exposed through an apparent hole in window 1.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a5266dcb3a)
2011-10-24 10:06:26 -07:00
Matthieu Herrb
12f65819ff Fix CVE-2011-4029: File permission change vulnerability.
Use fchmod() to change permissions of the lock file instead
of chmod(), thus avoid the race that can be exploited to set
a symbolic link to any file or directory in the system.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit b67581cf82)
2011-10-18 09:25:07 -07:00
Matthieu Herrb
f80d233578 Fix CVE-2011-4028: File disclosure vulnerability.
use O_NOFOLLOW to open the existing lock file, so symbolic links
aren't followed, thus avoid revealing if it point to an existing
file.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 6ba44b91e3)
2011-10-18 09:25:07 -07:00
Jeremy Huddleston
374be44d13 configure.ac: Bump to 1.11.1.901 (1.11.2 RC1)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-14 16:29:54 -07:00
Peter Hutterer
bbe6a69da3 dix: don't XWarpPointer through the last slave anymore (#38313)
This line was introduced pre-1.6 to fix Bug 19297. The effect of warping
through the VCP then was that if a device had custom valuator ranges, the
warp position would be wrong. The better device for this effect is the the
XTest device.

This fixes a server crash where the lastSlave is a pointer device without
valuators (Bug 38313#0).

And while we're at it, make sure the Xinerama code-path does the same.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 2bfb802839)
2011-10-14 15:35:33 +10:00
Nobuhiro Iwamatsu
2e28ff155f Disable check of double-aligned in test/input.c on Renesas SH
Renesas SH is not aligned at size of double.
When structure has double value, It is aligned in 4byte (long).

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b29ce0726d)
2011-10-14 15:35:31 +10:00
Peter Hutterer
79ac611d31 dix: don't use the pointer as modifier device in UngrabKey.
Modifier device is always the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 8c5a4d6fbe)
2011-10-14 15:35:23 +10:00
Peter Hutterer
843737b4f9 dix: ignore devices when adding passive core grabs to list (#39545)
Passive core grabs are mostly device-independent. In an MPX scenario, they
may change to reflect whichever master pair activated the grab last. For
adding new grabs to the list, ignore the device for core grabs to return
failures when trying to set the same grab combo twice on a window.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 09496996ac)
2011-10-14 15:35:06 +10:00
Peter Hutterer
cb9c1d6d6c dix: avoid using the VCP as modifier device
Core grabs may change device when they're activated to reflect the master
they apply to. If the device is a keyboard, modifierDevice is erroneously
set to the Virtual Core Pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 80c3704853)
2011-10-14 15:34:59 +10:00
Peter Hutterer
ef5c31430c config: fix a log message
PRODUCT was taken from the parent, hence ppath.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit e684e816ac)
2011-10-14 15:34:35 +10:00
Peter Harris
ec8ee3a9f7 xkb: add missing swaps for xkbGetDeviceInfoReply
Caught during review of e095369bf.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c90903b4f7)

Conflicts:

	xkb/xkb.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-14 15:33:56 +10:00
Jeremy Huddleston
603ad6608a XQuartz: pbproxy: Add missing AM_OBJCFLAGS
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit fae7ed62ad)
2011-10-09 01:36:11 -07:00
vdb@picaros.org
65469f5ea9 Fix a rare memory leak
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e4cddf509e)
2011-10-09 01:36:01 -07:00
Kirill Elagin
bec15eb73a Fix server crash due to invalid images
See https://bugs.freedesktop.org/show_bug.cgi?id=39383

Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5361121339)
2011-10-09 01:35:49 -07:00
Alan Hourihane
b45e226753 dixfonts: Don't overwrite local c variable until new_closure is safely initialized.
Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7a33c5b934)
2011-10-09 01:35:37 -07:00
Sam Spilsbury
e9ae333160 Remove the SendEvent bit (0x80) before doing range checks on event type.
Some extension libraries may set this bit before converting the event to
wire protocol and as such range checking the event will cause an invalid
BadValue error to result. As the documentation suggests the the bit
should be "forced on", remove it before doing range checks and continue
to force it on in the server.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2d2dce558d)
2011-10-04 20:08:33 -07:00
Carlos Garnacho
347f5610ca Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices
The corresponding DeviceIntPtr wasn't being gotten properly,
resulting in BadDevice from dixLookupDevice().

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f52d5cd374)
2011-10-04 20:08:24 -07:00
Jeremy Huddleston
7b74bb6752 XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 38e9e28ba2)
2011-10-04 20:02:29 -07:00
Jamey Sharp
bd6ea85209 Fix pixmap double-frees on error paths.
If AddResource fails, it will automatically free the object that was
passed to it by calling the appropriate deleteFunc; and of course
FreeResource also calls the deleteFunc. In both cases it's wrong to call
the destroy hook manually.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 0f380a5005)
2011-10-04 19:59:27 -07:00
Jeremy Huddleston
aabd25bd0b configure.ac: Version bumped to 1.11.1
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-24 00:06:32 -07:00
Aaron Plattner
8988105166 fb: Rename wfbTriangles and wfbTrapezoids
These symbols were not renamed when they were added to libfb:

 # nm -D libwfb.so | grep ' fb'
 0000000000028d00 T fbTrapezoids
 0000000000028d60 T fbTriangles

This causes corruption and/or crashes on wfb-ful drivers like nvidia:

 Program received signal SIGABRT, Aborted.
 0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
     in ../nptl/sysdeps/unix/sysv/linux/raise.c
 (gdb) bt
 #0  0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 #1  0x00007fd67f3a3680 in *__GI_abort () at abort.c:92
 #2  0x00007fd67f3995b1 in *__GI___assert_fail (assertion=0x7fd679ecb804 "key->initialized", file=<optimized out>, line=116, function=0x7fd679ecbbc0 "dixGetPrivateAddr")
     at assert.c:81
 #3  0x00007fd679ec55b6 in ?? () from /usr/lib/xorg/modules/libfb.so
 #4  0x00007fd679eca9ef in ?? () from /usr/lib/xorg/modules/libfb.so
 #5  0x00007fd679ecae20 in fbTriangles () from /usr/lib/xorg/modules/libfb.so
 #6  0x00007fd67a58fc55 in ?? () from /usr/lib/xorg/modules/drivers/nvidia_drv.so
 #7  0x00000000004f38d1 in ?? ()
 #8  0x0000000000437ae9 in ?? ()
 #9  0x0000000000426eaa in ?? ()
 #10 0x00007fd67f38cead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, fini=<optimized out>,
     rtld_fini=<optimized out>, stack_end=0x7fff99860d78) at libc-start.c:228
 #11 0x000000000042719d in _start ()

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 03d032991d)
2011-09-21 14:32:58 -07:00
145 changed files with 48263 additions and 18679 deletions

21
COPYING
View File

@@ -1233,6 +1233,27 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Copyright © 2004 PillowElephantBadgerBankPond
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of PillowElephantBadgerBankPond not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. PillowElephantBadgerBankPond makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
PillowElephantBadgerBankPond DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL PillowElephantBadgerBankPond BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
Permission to use, copy, modify, and distribute this software for any

View File

@@ -927,7 +927,7 @@ ScreenSaverSetAttributes (ClientPtr client)
goto bail;
}
/* over allocate for override redirect */
values = malloc((len + 1) * sizeof (unsigned long));
pAttr->values = values = malloc((len + 1) * sizeof (unsigned long));
if (!values)
{
ret = BadAlloc;
@@ -947,7 +947,6 @@ ScreenSaverSetAttributes (ClientPtr client)
pAttr->pCursor = NullCursor;
pAttr->pBackgroundPixmap = NullPixmap;
pAttr->pBorderPixmap = NullPixmap;
pAttr->values = values;
/*
* go through the mask, checking the values,
* looking up pixmaps and cursors and hold a reference

View File

@@ -148,9 +148,7 @@ SecurityLabelInitial(void)
static _X_INLINE const char *
SecurityLookupRequestName(ClientPtr client)
{
int major = ((xReq *)client->requestBuffer)->reqType;
int minor = MinorOpcodeOfRequest(client);
return LookupRequestName(major, minor);
return LookupRequestName(client->majorOp, client->minorOp);
}

View File

@@ -482,7 +482,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
{
PixmapPtr pPixmap;
if (format == ZPixmap || depth == 1) {
if (format == ZPixmap || (format == XYPixmap && depth == 1)) {
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
@@ -991,7 +991,6 @@ CreatePmap:
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pMap->drawable.id = newPix->info[j].id;
if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
(*pScreen->DestroyPixmap)(pMap);
result = BadAlloc;
break;
}
@@ -1002,10 +1001,8 @@ CreatePmap:
}
if(result == BadAlloc) {
while(j--) {
(*pScreen->DestroyPixmap)(pMap);
while(j--)
FreeResource(newPix->info[j].id, RT_NONE);
}
free(newPix);
} else
AddResource(stuff->pid, XRT_PIXMAP, newPix);
@@ -1110,7 +1107,6 @@ CreatePmap:
{
return Success;
}
pDraw->pScreen->DestroyPixmap(pMap);
}
return BadAlloc;
}

View File

@@ -101,6 +101,10 @@ int XaceHook(int hook, ...)
} u;
int *prv = NULL; /* points to return value from callback */
va_list ap; /* argument list */
if (!XaceHooks[hook])
return Success;
va_start(ap, hook);
/* Marshal arguments for passing to callback.

View File

@@ -528,12 +528,6 @@ ProcSELinuxDispatch(ClientPtr client)
static int
SProcSELinuxQueryVersion(ClientPtr client)
{
REQUEST(SELinuxQueryVersionReq);
int n;
REQUEST_SIZE_MATCH(SELinuxQueryVersionReq);
swaps(&stuff->client_major, n);
swaps(&stuff->client_minor, n);
return ProcSELinuxQueryVersion(client);
}

View File

@@ -263,8 +263,8 @@ SELinuxAudit(void *auditdata,
if (client) {
REQUEST(xReq);
if (stuff) {
major = stuff->reqType;
minor = MinorOpcodeOfRequest(client);
major = client->majorOp;
minor = client->minorOp;
}
}
if (audit->id)

View File

@@ -1265,7 +1265,7 @@ ProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data > xvNumRequests) {
if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}
@@ -1589,7 +1589,7 @@ SProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data > xvNumRequests) {
if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}

View File

@@ -927,7 +927,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
if (BitIsOn(mouse->button->down, i))
SetBit(event->buttons, i);
SetBit(event->buttons, mouse->button->map[i]);
if (kbd && kbd->key)
{
@@ -1441,7 +1441,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
rc = CheckGrabValues(client, param);
if (rc != Success)
return rc;
if (k == NULL)
if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
return BadMatch;
if (grabtype == GRABTYPE_XI)
{

View File

@@ -409,7 +409,7 @@ static int
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest;
return (*ProcIVector[stuff->data])(client);
@@ -428,7 +428,7 @@ static int
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest;
return (*SProcIVector[stuff->data])(client);

View File

@@ -202,6 +202,19 @@ unwind:
return rc;
}
static void
disable_clientpointer(DeviceIntPtr dev)
{
int i;
for (i = 0; i < currentMaxClients; i++)
{
ClientPtr client = clients[i];
if (client && client->clientPtr == dev)
client->clientPtr = NULL;
}
}
static int
remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
int flags[MAXDEVICES])
@@ -252,6 +265,8 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
if (rc != Success)
goto unwind;
disable_clientpointer(ptr);
/* Disabling sends the devices floating, reattach them if
* desired. */
if (r->return_mode == XIAttachToMaster)

View File

@@ -140,11 +140,17 @@ ProcXIPassiveGrabDevice(ClientPtr client)
memset(&param, 0, sizeof(param));
param.grabtype = GRABTYPE_XI2;
param.ownerEvents = stuff->owner_events;
param.this_device_mode = stuff->grab_mode;
param.other_devices_mode = stuff->paired_device_mode;
param.grabWindow = stuff->grab_window;
param.cursor = stuff->cursor;
if (IsKeyboardDevice(dev)) {
param.this_device_mode = stuff->grab_mode;
param.other_devices_mode = stuff->paired_device_mode;
} else {
param.this_device_mode = stuff->paired_device_mode;
param.other_devices_mode = stuff->grab_mode;
}
if (stuff->cursor != None)
{
status = dixLookupResourceByType(&tmp, stuff->cursor,
@@ -261,9 +267,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
if (rc != Success)
return rc;
if (stuff->deviceid == XIAllDevices)
dev = inputInfo.all_devices;
else if (stuff->deviceid == XIAllMasterDevices)
dev = inputInfo.all_master_devices;
else
{
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
if (rc != Success)
return rc;
}
if (stuff->grab_type != XIGrabtypeButton &&
stuff->grab_type != XIGrabtypeKeycode &&

View File

@@ -196,11 +196,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
anyMarked = compMarkWindows (pWin, &pLayerWin);
/* Make sure our borderClip is correct for ValidateTree */
RegionNull(&cw->borderClip);
RegionCopy(&cw->borderClip, &pWin->borderClip);
cw->borderClipX = pWin->drawable.x;
cw->borderClipY = pWin->drawable.y;
cw->update = CompositeRedirectAutomatic;
cw->clients = 0;
cw->oldx = COMP_ORIGIN_INVALID;
@@ -658,6 +654,13 @@ compAllocPixmap (WindowPtr pWin)
DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
}
/* Make sure our borderClip is up to date */
RegionUninit(&cw->borderClip);
RegionCopy(&cw->borderClip, &pWin->borderClip);
cw->borderClipX = pWin->drawable.x;
cw->borderClipY = pWin->drawable.y;
return TRUE;
}

View File

@@ -355,6 +355,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
if (!strcasecmp(tmp, ".options") && (!xkb_opts.options))
xkb_opts.options = strdup(tmp_val);
}
free(tmp_val);
}
}
}

View File

@@ -114,7 +114,7 @@ device_added(struct udev_device *udev_device)
== -1)
attrs.usb_id = NULL;
else
LOG_PROPERTY(path, "PRODUCT", product);
LOG_PROPERTY(ppath, "PRODUCT", product);
}
}
if (!name)

View File

@@ -26,8 +26,8 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
AC_INIT([xorg-server], 1.11.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2011-08-26"
AC_INIT([xorg-server], 1.11.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2012-01-27"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
@@ -652,6 +652,7 @@ AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server
dnl kdrive and its subsystems
AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
AC_ARG_ENABLE(xsdl, AS_HELP_STRING([--enable-xsdl], [Build the kdrive Xsdl server (default: auto)]), [XSDL=$enableval], [XSDL=auto])
AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
dnl kdrive options
@@ -999,6 +1000,13 @@ if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
else
CLIENTIDS=no
fi
if test "x$CLIENTIDS" = xyes; then
case $host_os in
openbsd*)
SYS_LIBS="$SYS_LIBS -lkvm"
;;
esac
fi
AC_MSG_RESULT([$CLIENTIDS])
AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
@@ -1973,6 +1981,9 @@ dnl kdrive DDX
XEPHYR_LIBS=
XEPHYR_INCS=
XSDL_LIBS=
XSDL_INCS=
XSDL_DIRS=
AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
@@ -2021,6 +2032,18 @@ if test "$KDRIVE" = yes; then
AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
fi
AC_CHECK_HEADERS([SDL/SDL.h])
if test x"$ac_cv_header_SDL_SDL_h" = xyes && test "x$XSDL" = xauto; then
XSDL=yes
fi
if test x"$XSDL" = xyes; then
# PKG_CHECK_MODULES(XSDL_EXTRA, Xfont xau $XDMCP_MODULES)
AC_DEFINE(XSDLSERVER,1,[Build Xsdl server])
XSDL_LIBS="`sdl-config --libs`"
XSDL_INCS="`sdl-config --cflags` $XSERVER_CFLAGS"
fi
XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xau xdmcp"
if test "x$XV" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
@@ -2029,12 +2052,10 @@ if test "$KDRIVE" = yes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
fi
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
if test "x$XEPHYR" = xauto; then
XEPHYR=$xephyr
fi
if test "x$XEPHYR" = xyes && test "x$xephyr" = xno; then
AC_MSG_ERROR([Xephyr dependencies missing])
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"])
elif test "x$XEPHYR" = xyes ; then
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS)
fi
# Xephyr needs nanosleep() which is in librt on Solaris
@@ -2085,6 +2106,8 @@ if test "$KDRIVE" = yes; then
AC_SUBST([XEPHYR_LIBS])
AC_SUBST([XEPHYR_INCS])
AC_SUBST([XSDL_LIBS])
AC_SUBST([XSDL_INCS])
fi
AC_SUBST([KDRIVE_INCS])
AC_SUBST([KDRIVE_PURE_INCS])
@@ -2098,6 +2121,7 @@ AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes])
AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes])
AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])
AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
AM_CONDITIONAL(XSDLSERVER, [test x"$XSDL" = xyes])
AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
@@ -2227,6 +2251,7 @@ hw/xquartz/xpr/Makefile
hw/kdrive/Makefile
hw/kdrive/ephyr/Makefile
hw/kdrive/ephyr/man/Makefile
hw/kdrive/sdl/Makefile
hw/kdrive/fake/Makefile
hw/kdrive/fbdev/Makefile
hw/kdrive/linux/Makefile

View File

@@ -982,6 +982,8 @@ CloseDownDevices(void)
{
DeviceIntPtr dev;
OsBlockSignals();
/* Float all SDs before closing them. Note that at this point resources
* (e.g. cursors) have been freed already, so we can't just call
* AttachDevice(NULL, dev, NULL). Instead, we have to forcibly set master
@@ -1004,6 +1006,8 @@ CloseDownDevices(void)
inputInfo.keyboard = NULL;
inputInfo.pointer = NULL;
XkbDeleteRulesDflts();
OsReleaseSignals();
}
/**

View File

@@ -337,8 +337,6 @@ DisableLimitedSchedulingLatency(void)
SmartScheduleLatencyLimited = 0;
}
#define MAJOROP ((xReq *)client->requestBuffer)->reqType
void
Dispatch(void)
{
@@ -419,22 +417,33 @@ Dispatch(void)
}
client->sequence++;
client->majorOp = ((xReq *)client->requestBuffer)->reqType;
client->minorOp = 0;
if (client->majorOp >= EXTENSION_BASE) {
ExtensionEntry *ext = GetExtensionEntry(client->majorOp);
if (ext)
client->minorOp = ext->MinorOpcode(client);
}
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
((xReq *)client->requestBuffer)->length,
client->index, client->requestBuffer);
if (XSERVER_REQUEST_START_ENABLED())
XSERVER_REQUEST_START(LookupMajorName(client->majorOp),
client->majorOp,
((xReq *)client->requestBuffer)->length,
client->index, client->requestBuffer);
#endif
if (result > (maxBigRequestSize << 2))
result = BadLength;
else {
result = XaceHookDispatch(client, MAJOROP);
result = XaceHookDispatch(client, client->majorOp);
if (result == Success)
result = (* client->requestVector[MAJOROP])(client);
result = (* client->requestVector[client->majorOp])(client);
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
client->sequence, client->index, result);
if (XSERVER_REQUEST_DONE_ENABLED())
XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp),
client->majorOp, client->sequence,
client->index, result);
#endif
if (client->noClientException != Success)
@@ -444,8 +453,8 @@ Dispatch(void)
}
else if (result != Success)
{
SendErrorToClient(client, MAJOROP,
MinorOpcodeOfRequest(client),
SendErrorToClient(client, client->majorOp,
client->minorOp,
client->errorValue, result);
break;
}
@@ -466,8 +475,6 @@ Dispatch(void)
SmartScheduleLatencyLimited = 0;
}
#undef MAJOROP
static int VendorRelease = VENDOR_RELEASE;
static char *VendorString = VENDOR_NAME;
@@ -1419,7 +1426,6 @@ CreatePmap:
}
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
return Success;
(*pDraw->pScreen->DestroyPixmap)(pMap);
}
return BadAlloc;
}

View File

@@ -1302,31 +1302,30 @@ doPolyText(ClientPtr client, PTclosurePtr c)
goto bail;
}
*new_closure = *c;
c = new_closure;
len = c->endReq - c->pElt;
c->data = malloc(len);
if (!c->data)
len = new_closure->endReq - new_closure->pElt;
new_closure->data = malloc(len);
if (!new_closure->data)
{
free(c);
free(new_closure);
err = BadAlloc;
goto bail;
}
memmove(c->data, c->pElt, len);
c->pElt = c->data;
c->endReq = c->pElt + len;
memmove(new_closure->data, new_closure->pElt, len);
new_closure->pElt = new_closure->data;
new_closure->endReq = new_closure->pElt + len;
/* Step 2 */
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen);
if (!pGC)
{
free(c->data);
free(c);
free(new_closure->data);
free(new_closure);
err = BadAlloc;
goto bail;
}
if ((err = CopyGC(c->pGC, pGC, GCFunction |
if ((err = CopyGC(new_closure->pGC, pGC, GCFunction |
GCPlaneMask | GCForeground |
GCBackground | GCFillStyle |
GCTile | GCStipple |
@@ -1337,15 +1336,16 @@ doPolyText(ClientPtr client, PTclosurePtr c)
Success)
{
FreeScratchGC(pGC);
free(c->data);
free(c);
free(new_closure->data);
free(new_closure);
err = BadAlloc;
goto bail;
}
c = new_closure;
origGC = c->pGC;
c->pGC = pGC;
ValidateGC(c->pDraw, c->pGC);
ClientSleep(client, (ClientSleepProcPtr)doPolyText, c);
/* Set up to perform steps 3 and 4 */

View File

@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
int rc;
*pDraw = NULL;
client->errorValue = id;
if (id == INVALID)
return BadDrawable;
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
if (rc != Success)
client->errorValue = id;
if (rc == BadValue)
return BadDrawable;
if (rc != Success)

View File

@@ -1356,7 +1356,7 @@ ScreenRestructured (ScreenPtr pScreen)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (!DevHasCursor(pDev))
if (!IsFloating(pDev) && !DevHasCursor(pDev))
continue;
/* GrabDevice doesn't have a confineTo field, so we don't need to
@@ -3678,7 +3678,7 @@ CheckPassiveGrabsOnWindow(
if (tempGrab.type < GenericEvent)
{
grab->device = device;
grab->modifierDevice = GetPairedDevice(device);
grab->modifierDevice = GetMaster(device, MASTER_KEYBOARD);
}
for (other = inputInfo.devices; other; other = other->next)
@@ -5224,6 +5224,8 @@ CloseDownEvents(void)
InputEventList = NULL;
}
#define SEND_EVENT_BIT 0x80
/**
* Server-side protocol handling for SendEvent request.
*
@@ -5241,6 +5243,16 @@ ProcSendEvent(ClientPtr client)
REQUEST_SIZE_MATCH(xSendEventReq);
/* libXext and other extension libraries may set the bit indicating
* that this event came from a SendEvent request so remove it
* since otherwise the event type may fail the range checks
* and cause an invalid BadValue error to be returned.
*
* This is safe to do since we later add the SendEvent bit (0x80)
* back in once we send the event to the client */
stuff->event.u.u.type &= ~(SEND_EVENT_BIT);
/* The client's event type must be a core event type or one defined by an
extension. */
@@ -5298,7 +5310,7 @@ ProcSendEvent(ClientPtr client)
client->errorValue = stuff->propagate;
return BadValue;
}
stuff->event.u.u.type |= 0x80;
stuff->event.u.u.type |= SEND_EVENT_BIT;
if (stuff->propagate)
{
for (;pWin; pWin = pWin->parent)
@@ -5360,7 +5372,7 @@ ProcUngrabKey(ClientPtr client)
tempGrab.window = pWin;
tempGrab.modifiersDetail.exact = stuff->modifiers;
tempGrab.modifiersDetail.pMask = NULL;
tempGrab.modifierDevice = GetPairedDevice(keybd);
tempGrab.modifierDevice = keybd;
tempGrab.type = KeyPress;
tempGrab.grabtype = GRABTYPE_CORE;
tempGrab.detail.exact = stuff->key;

View File

@@ -228,20 +228,6 @@ StandardMinorOpcode(ClientPtr client)
return ((xReq *)client->requestBuffer)->data;
}
unsigned short
MinorOpcodeOfRequest(ClientPtr client)
{
unsigned char major;
major = ((xReq *)client->requestBuffer)->reqType;
if (major < EXTENSION_BASE)
return 0;
major -= EXTENSION_BASE;
if (major >= NumExtensions)
return 0;
return (*extensions[major]->MinorOpcode)(client);
}
void
CloseDownExtensions(void)
{

View File

@@ -198,9 +198,11 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
{
int i;
if (!dev->valuator)
return;
/* Set the data to the previous value for unset absolute axes. The values
* may be used when sent as part of an XI 1.x valuator event. */
for (i = 0; i < valuator_mask_size(mask); i++)
for (i = 0; (i < valuator_mask_size(mask)) && (i < dev->valuator->numAxes); i++)
{
if (valuator_mask_isset(mask, i))
{
@@ -640,7 +642,7 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axis;
if (axisNum >= pDev->valuator->numAxes)
if (!pDev->valuator || axisNum >= pDev->valuator->numAxes)
return;
axis = pDev->valuator->axes + axisNum;
@@ -1185,7 +1187,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
if (flags & POINTER_ABSOLUTE)
{
if (flags & POINTER_SCREEN) /* valuators are in screen coords */
if ((flags & POINTER_SCREEN) && /* valuators are in screen coords */
pDev->valuator && (pDev->valuator->numAxes >= 2))
{
int scaled;
@@ -1309,7 +1312,7 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const Val
/* Sanity checks. */
if ((type != ProximityIn && type != ProximityOut) || !mask_in)
return 0;
if (!pDev->valuator)
if (!pDev->valuator || !pDev->proximity)
return 0;
valuator_mask_copy(&mask, mask_in);

View File

@@ -479,7 +479,7 @@ AddPassiveGrabToList(ClientPtr client, GrabPtr pGrab)
for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
{
if (GrabMatchesSecond(pGrab, grab, FALSE))
if (GrabMatchesSecond(pGrab, grab, (pGrab->grabtype == GRABTYPE_CORE)))
{
if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource))
{

View File

@@ -15,7 +15,7 @@
</affiliation>
</author>
<releaseinfo>X.Org Xserver version &xserver.version;</releaseinfo>
<legalnotice>
<legalnotice id="copyright">
<para>
Copyright (c) 2005, 2006, 2007, 2010, Oracle and/or its affiliates.
All rights reserved.
@@ -79,7 +79,7 @@ DEALINGS IN THE SOFTWARE.
<parameter>arg2</parameter>, etc. These tables should help you
determine what the real data is for each of the probe arguments.
<table>
<table id="Probes_and_their_arguments">
<title>Probes and their arguments</title>
<tgroup cols='7'>
<colspec colname="probe" colwidth="2*"/>
@@ -195,7 +195,7 @@ DEALINGS IN THE SOFTWARE.
To access data buffers referenced via <type>uintptr_t</type>'s, you will
need to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyin}}"><function>copyin()</function></ulink>.
<table>
<table id="Probe_Arguments">
<title>Probe Arguments</title>
<tgroup cols='3'>
<colspec colname="arg" colwidth="2*"/>
@@ -313,7 +313,7 @@ DEALINGS IN THE SOFTWARE.
<sect1 id="examples">
<title>Examples</title>
<example>
<example id="Counting_requests_by_request_name">
<title>Counting requests by request name</title>
<para>
@@ -370,7 +370,7 @@ Xserver*:::request-start
</para>
</example>
<example>
<example id="Get_average_CPU_time_per_request">
<title>Get average CPU time per request</title>
<para>This script records the CPU time used between the probes at
@@ -419,7 +419,7 @@ Xserver*:::request-done
</para>
</example>
<example>
<example id="Monitoring_clients_that_connect_and_disconnect">
<title>Monitoring clients that connect and disconnect</title>
<para>
@@ -476,7 +476,7 @@ CPU ID FUNCTION:NAME
</para>
</example>
<example>
<example id="Monitoring_clients_creating_Pixmaps">
<title>Monitoring clients creating Pixmaps</title>
<para>

View File

@@ -163,7 +163,9 @@ create_bits_picture (PicturePtr pict,
(pixman_format_code_t)pict->format,
pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
if (!image)
return NULL;
#ifdef FB_ACCESS_WRAPPER
#if FB_SHIFT==5

View File

@@ -160,6 +160,8 @@
#define fbStippleTable wfbStippleTable
#define fbTile wfbTile
#define fbTransparentSpan wfbTransparentSpan
#define fbTrapezoids wfbTrapezoids
#define fbTriangles wfbTriangles
#define fbUninstallColormap wfbUninstallColormap
#define fbUnmapWindow wfbUnmapWindow
#define fbUnrealizeFont wfbUnrealizeFont

View File

@@ -10,60 +10,60 @@ bin_PROGRAMS = \
noinst_PROGRAMS = xinput xtest evi res xled xbell $(EV_PROG)
dmxinfo_SOURCES = dmxinfo.c
dmxinfo_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxinfo_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxinfo_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxinfo_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxwininfo_SOURCES = dmxwininfo.c
dmxwininfo_LDADD = @DMXXMUEXAMPLES_DEP_LIBS@
dmxwininfo_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
dmxwininfo_LDADD = $(DMXXMUEXAMPLES_DEP_LIBS)
dmxwininfo_CFLAGS = $(DMXXMUEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxreconfig_SOURCES = dmxreconfig.c
dmxreconfig_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxreconfig_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxreconfig_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxreconfig_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxresize_SOURCES = dmxresize.c
dmxresize_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxresize_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxresize_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxresize_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxaddscreen_SOURCES = dmxaddscreen.c
dmxaddscreen_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxaddscreen_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxaddscreen_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxaddscreen_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxrmscreen_SOURCES = dmxrmscreen.c
dmxrmscreen_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxrmscreen_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxrmscreen_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxrmscreen_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxaddinput_SOURCES = dmxaddinput.c
dmxaddinput_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxaddinput_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxaddinput_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxaddinput_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxrminput_SOURCES = dmxrminput.c
dmxrminput_LDADD = @DMXEXAMPLES_DEP_LIBS@
dmxrminput_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
dmxrminput_LDADD = $(DMXEXAMPLES_DEP_LIBS)
dmxrminput_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xinput_SOURCES = xinput.c
xinput_LDADD = @DMXXIEXAMPLES_DEP_LIBS@
xinput_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
xinput_LDADD = $(DMXXIEXAMPLES_DEP_LIBS)
xinput_CFLAGS = $(DMXXIEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xtest_SOURCES = xtest.c
xtest_LDADD = @XTSTEXAMPLES_DEP_LIBS@
xtest_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
xtest_LDADD = $(XTSTEXAMPLES_DEP_LIBS)
xtest_CFLAGS = $(XTSTEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
evi_SOURCES = evi.c
evi_LDADD = @X11EXAMPLES_DEP_LIBS@
evi_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
evi_LDADD = $(X11EXAMPLES_DEP_LIBS)
evi_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
res_SOURCES = res.c
res_LDADD = @XRESEXAMPLES_DEP_LIBS@
res_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
res_LDADD = $(XRESEXAMPLES_DEP_LIBS)
res_CFLAGS = $(XRESEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xled_SOURCES = xled.c
xled_LDADD = @X11EXAMPLES_DEP_LIBS@
xled_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
xled_LDADD = $(X11EXAMPLES_DEP_LIBS)
xled_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xbell_SOURCES = xbell.c
xbell_LDADD = @X11EXAMPLES_DEP_LIBS@
xbell_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
xbell_LDADD = $(X11EXAMPLES_DEP_LIBS)
xbell_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
ev_SOURCES = ev.c
ev_LDADD =

View File

@@ -1,10 +1,12 @@
noinst_LIBRARIES = libglxproxy.a
libglxproxy_a_SOURCES = compsize.c \
compsize.h \
g_disptab.c \
g_disptab.h \
global.c \
glxcmds.c \
glxcmds.h \
glxcmdsswap.c \
glxcontext.h \
glxdrawable.h \

View File

@@ -29,6 +29,7 @@
*/
#include <GL/gl.h>
#include "compsize.h"
GLint __glFogiv_size(GLenum pname)
{

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2011 Apple Inc.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation on the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __compsize_h__
#define __compsize_h__
extern GLint __glColorTableParameterfv_size(GLenum pname);
extern GLint __glColorTableParameteriv_size(GLenum pname);
extern GLint __glConvolutionParameterfv_size(GLenum pname);
extern GLint __glConvolutionParameteriv_size(GLenum pname);
extern GLint __glFogfv_size(GLenum pname);
extern GLint __glFogiv_size(GLenum pname);
extern GLint __glLightModelfv_size(GLenum pname);
extern GLint __glLightModeliv_size(GLenum pname);
extern GLint __glLightfv_size(GLenum pname);
extern GLint __glLightiv_size(GLenum pname);
extern GLint __glMaterialfv_size(GLenum pname);
extern GLint __glMaterialiv_size(GLenum pname);
extern GLint __glTexEnvfv_size(GLenum e);
extern GLint __glTexEnviv_size(GLenum e);
extern GLint __glTexGendv_size(GLenum e);
extern GLint __glTexGenfv_size(GLenum e);
extern GLint __glTexGeniv_size(GLenum e);
extern GLint __glTexParameterfv_size(GLenum e);
extern GLint __glTexParameteriv_size(GLenum e);
#endif /* !__compsize_h__ */

View File

@@ -32,6 +32,7 @@
#include "glxext.h"
#include "g_disptab.h"
#include "unpack.h"
#include "compsize.h"
void __glXDispSwap_CallList(GLbyte *pc)
{

View File

@@ -52,6 +52,8 @@
#include "glxvisuals.h"
#include "glxswap.h"
#include "glxcmds.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#endif

37
hw/dmx/glxProxy/glxcmds.h Normal file
View File

@@ -0,0 +1,37 @@
/*
* Copyright 2011 Apple Inc.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation on the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __GLX_cmds_h__
#define __GLX_cmds_h__
extern int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
#endif /* !__GLX_cmds_h__ */

View File

@@ -35,11 +35,14 @@
#include <pixmapstr.h>
#include <windowstr.h>
#include "unpack.h"
#include "glxcmds.h"
#include "glxext.h"
#include "glxvendor.h"
extern int glxIsExtensionSupported( char *ext );
int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
/************************************************************************/
/*

View File

@@ -6,6 +6,10 @@ if XFAKESERVER
XFAKE_SUBDIRS = fake
endif
if XSDLSERVER
XSDL_SUBDIRS = sdl
endif
if XEPHYR
XEPHYR_SUBDIRS = ephyr
endif
@@ -15,6 +19,7 @@ LINUX_SUBDIRS = linux
endif
SERVER_SUBDIRS = \
$(XSDL_SUBDIRS) \
$(FBDEV_SUBDIRS) \
$(XEPHYR_SUBDIRS) \
$(XFAKE_SUBDIRS)
@@ -24,7 +29,7 @@ SUBDIRS = \
$(LINUX_SUBDIRS) \
$(SERVER_SUBDIRS)
DIST_SUBDIRS = fbdev ephyr src linux fake
DIST_SUBDIRS = fbdev sdl ephyr src linux fake
relink:
$(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done

View File

@@ -692,7 +692,7 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
return !Success;
fd = LinuxConsoleFd;
ki->driverPrivate = (void *) fd;
ki->driverPrivate = (void *) (intptr_t) fd;
ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
tcgetattr (fd, &LinuxTermios);
@@ -724,7 +724,7 @@ LinuxKeyboardDisable (KdKeyboardInfo *ki)
if (!ki)
return;
fd = (int) ki->driverPrivate;
fd = (int) (intptr_t) ki->driverPrivate;
KdUnregisterFd(ki, fd, FALSE);
ioctl(fd, KDSKBMODE, LinuxKbdTrans);
@@ -753,7 +753,7 @@ LinuxKeyboardLeds (KdKeyboardInfo *ki, int leds)
if (!ki)
return;
ioctl ((int)ki->driverPrivate, KDSETLED, leds & 7);
ioctl ((int)(intptr_t)ki->driverPrivate, KDSETLED, leds & 7);
}
KdKeyboardDriver LinuxKeyboardDriver = {

View File

@@ -152,7 +152,7 @@ MsEnable (KdPointerInfo *pi)
}
if (KdRegisterFd (port, MsRead, pi))
return TRUE;
pi->driverPrivate = (void *)port;
pi->driverPrivate = (void *)(intptr_t)port;
return Success;
@@ -164,7 +164,7 @@ MsEnable (KdPointerInfo *pi)
static void
MsDisable (KdPointerInfo *pi)
{
KdUnregisterFd (pi, (int)pi->driverPrivate, TRUE);
KdUnregisterFd (pi, (int)(intptr_t)pi->driverPrivate, TRUE);
}
static void

View File

@@ -159,7 +159,7 @@ Ps2Enable (KdPointerInfo *pi)
return BadAlloc;
}
pi->driverPrivate = (void *)fd;
pi->driverPrivate = (void *)(intptr_t)fd;
return Success;
}
@@ -168,7 +168,7 @@ Ps2Enable (KdPointerInfo *pi)
static void
Ps2Disable (KdPointerInfo *pi)
{
KdUnregisterFd (pi, (int)pi->driverPrivate, TRUE);
KdUnregisterFd (pi, (int)(intptr_t)pi->driverPrivate, TRUE);
}
static void

19
hw/kdrive/sdl/Makefile.am Normal file
View File

@@ -0,0 +1,19 @@
INCLUDES = \
@KDRIVE_PURE_INCS@ \
@KDRIVE_CFLAGS@ \
@XSDL_INCS@
bin_PROGRAMS = Xsdl
Xsdl_SOURCES = sdl.c
Xsdl_LDADD = \
@KDRIVE_LIBS@ \
@XSDL_LIBS@
Xsdl_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@
Xsdl_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
relink:
rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)

345
hw/kdrive/sdl/sdl.c Normal file
View File

@@ -0,0 +1,345 @@
/*
* Copyright © 2004 PillowElephantBadgerBankPond
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of PillowElephantBadgerBankPond not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. PillowElephantBadgerBankPond makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* PillowElephantBadgerBankPond DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL PillowElephantBadgerBankPond BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* It's really not my fault - see it was the elephants!!
* - jaymz
*
*/
#ifdef HAVE_CONFIG_H
#include "kdrive-config.h"
#endif
#include "kdrive.h"
#include <SDL/SDL.h>
#include <X11/keysym.h>
static void xsdlFini(void);
static Bool sdlScreenInit(KdScreenInfo *screen);
static Bool sdlFinishInitScreen(ScreenPtr pScreen);
static Bool sdlCreateRes(ScreenPtr pScreen);
static void sdlKeyboardFini(KdKeyboardInfo *ki);
static Bool sdlKeyboardInit(KdKeyboardInfo *ki);
static Bool sdlMouseInit(KdPointerInfo *pi);
static void sdlMouseFini(KdPointerInfo *pi);
void *sdlShadowWindow (ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure);
void sdlShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf);
void sdlTimer(void);
KdKeyboardInfo *sdlKeyboard = NULL;
KdPointerInfo *sdlPointer = NULL;
KdKeyboardDriver sdlKeyboardDriver = {
.name = "keyboard",
.Init = sdlKeyboardInit,
.Fini = sdlKeyboardFini,
};
KdPointerDriver sdlMouseDriver = {
.name = "mouse",
.Init = sdlMouseInit,
.Fini = sdlMouseFini,
};
KdCardFuncs sdlFuncs = {
.scrinit = sdlScreenInit, /* scrinit */
.finishInitScreen = sdlFinishInitScreen, /* finishInitScreen */
.createRes = sdlCreateRes, /* createRes */
};
int mouseState=0;
struct SdlDriver
{
SDL_Surface *screen;
};
static Bool sdlScreenInit(KdScreenInfo *screen)
{
struct SdlDriver *sdlDriver=calloc(1, sizeof(struct SdlDriver));
#ifdef DEBUG
printf("sdlScreenInit()\n");
#endif
if (!screen->width || !screen->height)
{
screen->width = 640;
screen->height = 480;
}
if (!screen->fb.depth)
screen->fb.depth = 4;
#ifdef DEBUG
printf("Attempting for %dx%d/%dbpp mode\n", screen->width, screen->height, screen->fb.depth);
#endif
sdlDriver->screen=SDL_SetVideoMode(screen->width, screen->height, screen->fb.depth, 0);
if(sdlDriver->screen==NULL)
return FALSE;
#ifdef DEBUG
printf("Set %dx%d/%dbpp mode\n", sdlDriver->screen->w, sdlDriver->screen->h, sdlDriver->screen->format->BitsPerPixel);
#endif
screen->width=sdlDriver->screen->w;
screen->height=sdlDriver->screen->h;
screen->fb.depth=sdlDriver->screen->format->BitsPerPixel;
screen->fb.visuals=(1<<TrueColor);
screen->fb.redMask=sdlDriver->screen->format->Rmask;
screen->fb.greenMask=sdlDriver->screen->format->Gmask;
screen->fb.blueMask=sdlDriver->screen->format->Bmask;
screen->fb.bitsPerPixel=sdlDriver->screen->format->BitsPerPixel;
screen->rate=60;
//screen->memory_base=(CARD8 *)sdlDriver->screen->pixels;
//screen->memory_size=0;
//screen->off_screen_base=0;
screen->driver=sdlDriver;
screen->fb.byteStride=(sdlDriver->screen->w*sdlDriver->screen->format->BitsPerPixel)/8;
screen->fb.pixelStride=sdlDriver->screen->w;
screen->fb.frameBuffer=(CARD8 *)sdlDriver->screen->pixels;
SDL_WM_SetCaption("Freedesktop.org X server (SDL)", NULL);
return TRUE;
}
void sdlShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
struct SdlDriver *sdlDriver=screen->driver;
#ifdef DEBUG
printf("Shadow update()\n");
#endif
if(SDL_MUSTLOCK(sdlDriver->screen))
{
if(SDL_LockSurface(sdlDriver->screen)<0)
{
#ifdef DEBUG
printf("Couldn't lock SDL surface - d'oh!\n");
#endif
return;
}
}
if(SDL_MUSTLOCK(sdlDriver->screen))
SDL_UnlockSurface(sdlDriver->screen);
SDL_UpdateRect(sdlDriver->screen, 0, 0, sdlDriver->screen->w, sdlDriver->screen->h);
}
void *sdlShadowWindow (ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
struct SdlDriver *sdlDriver=screen->driver;
*size=(sdlDriver->screen->w*sdlDriver->screen->format->BitsPerPixel)/8;
#ifdef DEBUG
printf("Shadow window()\n");
#endif
return (void *)((CARD8 *)sdlDriver->screen->pixels + row * (*size) + offset);
}
static Bool sdlCreateRes(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
KdShadowFbAlloc(screen, 0);
KdShadowSet(pScreen, RR_Rotate_0, sdlShadowUpdate, sdlShadowWindow);
return TRUE;
}
static Bool sdlFinishInitScreen(ScreenPtr pScreen)
{
if (!shadowSetup (pScreen))
return FALSE;
/*
#ifdef RANDR
if (!sdlRandRInit (pScreen))
return FALSE;
#endif
*/
return TRUE;
}
static void sdlKeyboardFini(KdKeyboardInfo *ki)
{
sdlKeyboard = NULL;
}
static Bool sdlKeyboardInit(KdKeyboardInfo *ki)
{
ki->minScanCode = 8;
ki->maxScanCode = 255;
sdlKeyboard = ki;
return TRUE;
}
static Bool sdlMouseInit (KdPointerInfo *pi)
{
sdlPointer = pi;
return TRUE;
}
static void sdlMouseFini(KdPointerInfo *pi)
{
sdlPointer = NULL;
}
void InitCard(char *name)
{
KdCardInfoAdd (&sdlFuncs, 0);
#ifdef DEBUG
printf("InitCard: %s\n", name);
#endif
}
void InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
{
KdInitOutput(pScreenInfo, argc, argv);
#ifdef DEBUG
printf("InitOutput()\n");
#endif
}
void InitInput(int argc, char **argv)
{
KdPointerInfo *pi;
KdKeyboardInfo *ki;
KdAddKeyboardDriver(&sdlKeyboardDriver);
KdAddPointerDriver(&sdlMouseDriver);
ki = KdParseKeyboard("keyboard");
KdAddKeyboard(ki);
pi = KdParsePointer("mouse");
KdAddPointer(pi);
KdInitInput();
}
#ifdef DDXBEFORERESET
void ddxBeforeReset(void)
{
}
#endif
void ddxUseMsg(void)
{
KdUseMsg();
}
int ddxProcessArgument(int argc, char **argv, int i)
{
return KdProcessArgument(argc, argv, i);
}
void sdlTimer(void)
{
static int buttonState=0;
SDL_Event event;
SDL_ShowCursor(FALSE);
/* get the mouse state */
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_MOUSEMOTION:
KdEnqueuePointerEvent(sdlPointer, mouseState, event.motion.x, event.motion.y, 0);
break;
case SDL_MOUSEBUTTONDOWN:
switch(event.button.button)
{
case 1:
buttonState=KD_BUTTON_1;
break;
case 2:
buttonState=KD_BUTTON_2;
break;
case 3:
buttonState=KD_BUTTON_3;
break;
}
mouseState|=buttonState;
KdEnqueuePointerEvent(sdlPointer, mouseState|KD_MOUSE_DELTA, 0, 0, 0);
break;
case SDL_MOUSEBUTTONUP:
switch(event.button.button)
{
case 1:
buttonState=KD_BUTTON_1;
break;
case 2:
buttonState=KD_BUTTON_2;
break;
case 3:
buttonState=KD_BUTTON_3;
break;
}
mouseState &= ~buttonState;
KdEnqueuePointerEvent(sdlPointer, mouseState|KD_MOUSE_DELTA, 0, 0, 0);
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
#ifdef DEBUG
printf("Keycode: %d\n", event.key.keysym.scancode);
#endif
KdEnqueueKeyboardEvent (sdlKeyboard, event.key.keysym.scancode, event.type==SDL_KEYUP);
break;
case SDL_QUIT:
/* this should never happen */
SDL_Quit();
}
}
}
static int xsdlInit(void)
{
#ifdef DEBUG
printf("Calling SDL_Init()\n");
#endif
return SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
}
static void xsdlFini(void)
{
SDL_Quit();
}
void
CloseInput (void)
{
KdCloseInput ();
}
KdOsFuncs sdlOsFuncs={
.Init = xsdlInit,
.Fini = xsdlFini,
.pollEvents = sdlTimer,
};
void OsVendorInit (void)
{
KdOsInit (&sdlOsFuncs);
}

View File

@@ -2135,12 +2135,6 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
static void
KdCrossScreen(ScreenPtr pScreen, Bool entering)
{
#ifndef XIPAQ
if (entering)
KdEnableScreen (pScreen);
else
KdDisableScreen (pScreen);
#endif
}
int KdCurScreen; /* current event screen */

View File

@@ -280,7 +280,9 @@ ddxProcessArgument(int argc, char *argv[], int i)
int screenNum;
CHECK_FOR_REQUIRED_ARGUMENTS(2);
screenNum = atoi(argv[i+1]);
if (screenNum < 0)
/* The protocol only has a CARD8 for number of screens in the
connection setup block, so don't allow more than that. */
if ((screenNum < 0) || (screenNum >= 255))
{
ErrorF("Invalid screen number %d\n", screenNum);
UseMsg();
@@ -864,6 +866,8 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
(1 << DirectColor)),
10, TrueColor, 0x3ff00000, 0x000ffc00, 0x000003ff);
break;
default:
return FALSE;
}
miSetPixmapDepths ();

View File

@@ -601,16 +601,15 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data)
InputHandlerProc
xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
{
static InputHandlerProc handler = NULL;
InputHandlerProc old_handler = handler;
static IHPtr handler = NULL;
IHPtr old_handler = handler;
if (old_handler)
xf86RemoveGeneralHandler(old_handler);
xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
handler = proc;
handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
return old_handler;
return (old_handler) ? old_handler->ihproc : NULL;
}
static void

View File

@@ -221,6 +221,9 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
return FALSE;
pScrn = xf86Screens[scrnIndex];
if (pScrn->modes == NULL)
return FALSE;
pVidMode = VMPTR(pScrn->pScreen);
pVidMode->First = pScrn->modes;
pVidMode->Next = pVidMode->First->next;

View File

@@ -939,15 +939,16 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
pInfo->attrs = DuplicateInputAttributes(attrs);
}
if (!pInfo->driver || !pInfo->name) {
xf86Msg(X_INFO, "No input driver/identifier specified (ignoring)\n");
if (!pInfo->name) {
xf86Msg(X_INFO, "No identifier specified, ignoring this device.\n");
rval = BadRequest;
goto unwind;
}
if (!pInfo->name) {
xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n");
rval = BadMatch;
if (!pInfo->driver) {
xf86Msg(X_INFO, "No input driver specified, ignoring this device.\n");
xf86Msg(X_INFO, "This device may have been added with another device file.\n");
rval = BadRequest;
goto unwind;
}

View File

@@ -780,7 +780,8 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
/* If we're currently waiting for a swap on this drawable, reset
* the request and suspend the client. We only support one
* blocked client per drawable. */
if ((pPriv->swapsPending) &&
if (pPriv &&
pPriv->swapsPending &&
pPriv->blockedClient == NULL) {
ResetCurrentRequest(client);
client->sequence--;
@@ -1193,14 +1194,24 @@ DRI2CloseScreen(ScreenPtr pScreen)
}
extern ExtensionModule dri2ExtensionModule;
extern Bool DRI2ModuleSetup(void);
/* Called by InitExtensions() */
Bool
DRI2ModuleSetup(void)
{
dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
if (!dri2DrawableRes)
return FALSE;
return TRUE;
}
static pointer
DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
if (!setupDone)
{
setupDone = TRUE;

View File

@@ -50,6 +50,7 @@
#include "xf86Module.h"
static ExtensionEntry *dri2Extension;
extern Bool DRI2ModuleSetup(void);
static Bool
validDrawable(ClientPtr client, XID drawable, Mask access_mode,
@@ -636,6 +637,8 @@ DRI2ExtensionInit(void)
StandardMinorOpcode);
DRI2EventBase = dri2Extension->eventBase;
DRI2ModuleSetup();
}
extern Bool noDRI2Extension;

View File

@@ -509,20 +509,22 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
pScrn->virtualY = pScrn->display->virtualY;
for (modename = pScrn->display->modes; *modename != NULL; modename++) {
for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next)
if (0 == strcmp(mode->name,*modename))
break;
for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) {
if (0 == strcmp(mode->name,*modename)) {
if (fbdevHWSetMode(pScrn, mode, TRUE))
break;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" test failed\n", *modename);
}
}
if (NULL == mode) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" not found\n", *modename);
continue;
}
if (!fbdevHWSetMode(pScrn, mode, TRUE)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" test failed\n", *modename);
continue;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" ok\n", *modename);

View File

@@ -918,7 +918,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
goto LoadModule_fail;
}
ret->handle = LoaderOpen(found, errmaj, errmin);
if (ret->handle < 0)
if (ret->handle == NULL)
goto LoadModule_fail;
ret->path = strdup(found);

View File

@@ -133,6 +133,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn,
crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
if (!crtcs)
{
free(crtc->gamma_red);
free(crtc);
return NULL;
}
@@ -1914,19 +1915,25 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
break;
}
if (scrn->modes != NULL) {
/* For some reason, scrn->modes is circular, unlike the other mode
* lists. How great is that?
*/
for (last = scrn->modes; last && last->next; last = last->next)
;
last->next = scrn->modes;
scrn->modes->prev = last;
if (mode) {
while (scrn->modes != mode)
scrn->modes = scrn->modes->next;
}
if (!scrn->modes) {
scrn->modes = xf86ModesAdd(scrn->modes,
xf86CVTMode(scrn->display->virtualX,
scrn->display->virtualY,
60, 0, 0));
}
/* For some reason, scrn->modes is circular, unlike the other mode
* lists. How great is that?
*/
for (last = scrn->modes; last && last->next; last = last->next)
;
last->next = scrn->modes;
scrn->modes->prev = last;
if (mode) {
while (scrn->modes != mode)
scrn->modes = scrn->modes->next;
}
scrn->currentMode = scrn->modes;
#ifdef XFreeXDGA
if (scrn->pScreen)
@@ -2059,13 +2066,28 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
if (o == p)
continue;
for (mode = output->probed_modes; mode; mode = mode->next) {
Rotation r = output->initial_rotation;
if (xf86ModeWidth(mode, r) == pref_width &&
xf86ModeHeight(mode, r) == pref_height) {
/*
* First see if the preferred mode matches on the next
* output as well. This catches the common case of identical
* monitors and makes sure they all have the same timings
* and refresh. If that fails, we fall back to trying to
* match just width & height.
*/
mode = xf86OutputHasPreferredMode(output, pref_width,
pref_height);
if (mode && xf86ModesEqual(mode, preferred[p])) {
preferred[o] = mode;
match = TRUE;
}
} else {
for (mode = output->probed_modes; mode;
mode = mode->next) {
Rotation r = output->initial_rotation;
if (xf86ModeWidth(mode, r) == pref_width &&
xf86ModeHeight(mode, r) == pref_height) {
preferred[o] = mode;
match = TRUE;
}
}
}
all_match &= match;
@@ -2513,16 +2535,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
width, height);
}
if (have_outputs) {
/* Mirror output modes to scrn mode list */
xf86SetScrnInfoModes (scrn);
} else {
/* Clear any existing modes from scrn->modes */
while (scrn->modes != NULL)
xf86DeleteMode(&scrn->modes, scrn->modes);
scrn->modes = xf86ModesAdd(scrn->modes,
xf86CVTMode(width, height, 60, 0, 0));
}
xf86SetScrnInfoModes (scrn);
success = TRUE;
bailout:

View File

@@ -165,6 +165,11 @@ static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC)
DDC->vendor.prod_id == 6400)
return TRUE;
/* Bug #41141: Acer Aspire One */
if (memcmp (DDC->vendor.name, "LGD", 4) == 0 &&
DDC->vendor.prod_id == 0x7f01)
return TRUE;
return FALSE;
}

View File

@@ -47,15 +47,12 @@ static char vtname[11];
static struct termios tty_attr; /* tty state to restore */
static int tty_mode; /* kbd mode to restore */
static void *console_handler;
static void
drain_console(int fd, void *closure)
{
errno = 0;
if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) {
xf86RemoveGeneralHandler(console_handler);
console_handler = NULL;
xf86SetConsoleHandler(NULL, NULL);
}
}
@@ -259,10 +256,11 @@ xf86CloseConsole(void)
return;
}
if (console_handler) {
xf86RemoveGeneralHandler(console_handler);
console_handler = NULL;
};
/*
* unregister the drain_console handler
* - what to do if someone else changed it in the meantime?
*/
xf86SetConsoleHandler(NULL, NULL);
/* Back to text mode ... */
SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));

View File

@@ -469,11 +469,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
static void
unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{
memType alignOff = (memType)Base
- ((memType)Base & ~(getpagesize() - 1));
uintptr_t alignOff = (uintptr_t)Base
- ((uintptr_t)Base & ~(getpagesize() - 1));
DebugF("alignment offset: %lx\n",alignOff);
munmap((caddr_t)((memType)Base - alignOff), (Size + alignOff));
DebugF("alignment offset: %lx\n", (unsigned long)alignOff);
munmap((void *)((uintptr_t)Base - alignOff), (Size + alignOff));
}

View File

@@ -1036,13 +1036,16 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data)
mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0);
pScrn->monitor->nHsync = 1;
pScrn->monitor->hsync[0].lo = 31.5;
pScrn->monitor->hsync[0].lo = 29.37;
pScrn->monitor->hsync[0].hi = (float)mode->Clock / (float)mode->HTotal;
pScrn->monitor->nVrefresh = 1;
pScrn->monitor->vrefresh[0].lo = 56.0;
pScrn->monitor->vrefresh[0].hi =
(float)mode->Clock*1000.0 / (float)mode->HTotal / (float)mode->VTotal;
if (pScrn->monitor->vrefresh[0].hi < 59.47)
pScrn->monitor->vrefresh[0].hi = 59.47;
free(mode);
}

View File

@@ -239,6 +239,7 @@ XAADestroyGC(GCPtr pGC)
free(pGCPriv->XAAOps);
free(pGCPriv->DashPattern);
pGCPriv->flags = 0;
(*pGC->funcs->DestroyGC)(pGC);
XAA_GC_FUNC_EPILOGUE (pGC);

View File

@@ -114,11 +114,13 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
int
xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
{
XModifierKeymap *modifier_keymap;
KeySym *keymap;
int mapWidth;
int min_keycode, max_keycode;
KeySymsRec keySyms;
int i;
CARD8 modmap[MAP_LENGTH];
int i, j;
XKeyboardState values;
XkbDescPtr xkb;
int op, event, error, major, minor;
@@ -130,7 +132,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
#ifdef _XSERVER64
{
KeySym64 *keymap64;
int i, len;
int len;
keymap64 = XGetKeyboardMapping(xnestDisplay,
min_keycode,
max_keycode - min_keycode + 1,
@@ -147,7 +149,17 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
max_keycode - min_keycode + 1,
&mapWidth);
#endif
memset(modmap, 0, sizeof(modmap));
modifier_keymap = XGetModifierMapping(xnestDisplay);
for (j = 0; j < 8; j++)
for(i = 0; i < modifier_keymap->max_keypermod; i++) {
CARD8 keycode;
if ((keycode = modifier_keymap->modifiermap[j * modifier_keymap->max_keypermod + i]))
modmap[keycode] |= 1<<j;
}
XFreeModifiermap(modifier_keymap);
keySyms.minKeyCode = min_keycode;
keySyms.maxKeyCode = max_keycode;
keySyms.mapWidth = mapWidth;
@@ -165,7 +177,12 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb);
InitKeyboardDeviceStruct(pDev, NULL,
xnestBell, xnestChangeKeyboardControl);
xnestBell, xnestChangeKeyboardControl);
XkbApplyMappingChange(pDev, &keySyms, keySyms.minKeyCode,
keySyms.maxKeyCode - keySyms.minKeyCode + 1,
modmap, serverClient);
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False);
free(keymap);

View File

@@ -23,17 +23,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define Cursor Mac_Cursor
#define BOOL Mac_BOOL
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
#include <ApplicationServices/ApplicationServices.h>
#undef Cursor
#undef BOOL
#include "capabilities.h"
#define Cursor X_Cursor
#include "os.h"
#undef Cursor
static void handleBufferModes(struct glCapabilitiesConfig *c, GLint bufferModes) {
if(bufferModes & kCGLStereoscopicBit) {

View File

@@ -68,9 +68,6 @@ extern int xpbproxy_run (void);
static dispatch_queue_t eventTranslationQueue;
#endif
/* Stuck modifier / button state... force release when we context switch */
static NSEventType keyState[NUM_KEYCODES];
extern Bool noTestExtensions;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
@@ -194,7 +191,9 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
}
- (void) activateX:(OSX_BOOL)state {
size_t i;
if (_x_active == state)
return;
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active);
if (state) {
if(bgMouseLocationUpdated) {
@@ -206,13 +205,13 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
if(darwin_all_modifier_flags)
DarwinUpdateModKeys(0);
for(i=0; i < NUM_KEYCODES; i++) {
if(keyState[i] == NSKeyDown) {
DarwinSendKeyboardEvents(KeyRelease, i);
keyState[i] = NSKeyUp;
}
}
DarwinInputReleaseButtonsAndKeys(darwinKeyboard);
DarwinInputReleaseButtonsAndKeys(darwinPointer);
DarwinInputReleaseButtonsAndKeys(darwinTabletCursor);
DarwinInputReleaseButtonsAndKeys(darwinTabletStylus);
DarwinInputReleaseButtonsAndKeys(darwinTabletEraser);
DarwinSendDDXEvent(kXquartzDeactivate, 0);
}
@@ -356,7 +355,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
*/
_appFlags._active = YES;
X11ApplicationSetFrontProcess();
[self set_front_process:nil];
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
@@ -1407,12 +1406,8 @@ static const char *untrusted_str(NSEvent *e) {
}
}
/* Avoid stuck keys on context switch */
if(keyState[[e keyCode]] == [e type])
return;
keyState[[e keyCode]] = [e type];
DarwinSendKeyboardEvents(([e type] == NSKeyDown) ? KeyPress : KeyRelease, [e keyCode]);
ev_type = ([e type] == NSKeyDown) ? KeyPress : KeyRelease;
DarwinSendKeyboardEvents(ev_type, [e keyCode]);
break;
default: break; /* for gcc */

View File

@@ -773,6 +773,13 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
- (void) applicationDidHide:(NSNotification *)notify
{
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMHideAll);
/* Toggle off fullscreen mode to leave our non-default video
* mode and hide our guard window.
*/
if (!XQuartzIsRootless && XQuartzFullscreenVisible) {
DarwinSendDDXEvent(kXquartzToggleFullscreen, 0);
}
}
- (void) applicationDidUnhide:(NSNotification *)notify

View File

@@ -727,10 +727,12 @@ AppleWMExtensionInit(
NULL,
StandardMinorOpcode)))
{
size_t i;
WMReqCode = (unsigned char)extEntry->base;
WMErrorBase = extEntry->errorBase;
WMEventBase = extEntry->eventBase;
EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
for (i=0; i < AppleWMNumberEvents; i++)
EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
appleWMProcs = procsPtr;
}
}

View File

@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.7.0</string>
<string>2.7.1</string>
<key>CFBundleVersion</key>
<string>2.7.0</string>
<string>2.7.1</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
@@ -37,9 +37,9 @@
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>
<string>© 2003-2011 Apple Inc.
<string>© 2003-2012 Apple Inc.
© 2003 XFree86 Project, Inc.
© 2003-2011 X.org Foundation, Inc.
© 2003-2012 X.org Foundation, Inc.
</string>
<key>NSMainNibFile</key>
<string>main</string>

View File

@@ -32,70 +32,152 @@ EXTRA_DIST = \
$(resource_DATA) \
Resources/ar.lproj/InfoPlist.strings \
Resources/ar.lproj/Localizable.strings \
Resources/ar.lproj/locversion.plist \
Resources/ar.lproj/main.nib/designable.nib \
Resources/ar.lproj/main.nib/keyedobjects.nib \
Resources/ca.lproj/InfoPlist.strings \
Resources/ca.lproj/Localizable.strings \
Resources/ca.lproj/locversion.plist \
Resources/ca.lproj/main.nib/designable.nib \
Resources/ca.lproj/main.nib/keyedobjects.nib \
Resources/cs.lproj/InfoPlist.strings \
Resources/cs.lproj/Localizable.strings \
Resources/cs.lproj/locversion.plist \
Resources/cs.lproj/main.nib/designable.nib \
Resources/cs.lproj/main.nib/keyedobjects.nib \
Resources/da.lproj/InfoPlist.strings \
Resources/da.lproj/Localizable.strings \
Resources/da.lproj/locversion.plist \
Resources/da.lproj/main.nib/designable.nib \
Resources/da.lproj/main.nib/keyedobjects.nib \
Resources/Dutch.lproj/InfoPlist.strings \
Resources/Dutch.lproj/Localizable.strings \
Resources/Dutch.lproj/locversion.plist \
Resources/Dutch.lproj/main.nib/designable.nib \
Resources/Dutch.lproj/main.nib/keyedobjects.nib \
Resources/el.lproj/InfoPlist.strings \
Resources/el.lproj/Localizable.strings \
Resources/el.lproj/locversion.plist \
Resources/el.lproj/main.nib/designable.nib \
Resources/el.lproj/main.nib/keyedobjects.nib \
Resources/English.lproj/InfoPlist.strings \
Resources/English.lproj/Localizable.strings \
Resources/English.lproj/locversion.plist \
Resources/English.lproj/main.nib/designable.nib \
Resources/English.lproj/main.nib/keyedobjects.nib \
Resources/fi.lproj/InfoPlist.strings \
Resources/fi.lproj/Localizable.strings \
Resources/fi.lproj/locversion.plist \
Resources/fi.lproj/main.nib/designable.nib \
Resources/fi.lproj/main.nib/keyedobjects.nib \
Resources/French.lproj/InfoPlist.strings \
Resources/French.lproj/Localizable.strings \
Resources/French.lproj/locversion.plist \
Resources/French.lproj/main.nib/designable.nib \
Resources/French.lproj/main.nib/keyedobjects.nib \
Resources/German.lproj/InfoPlist.strings \
Resources/German.lproj/Localizable.strings \
Resources/German.lproj/locversion.plist \
Resources/German.lproj/main.nib/designable.nib \
Resources/German.lproj/main.nib/keyedobjects.nib \
Resources/he.lproj/InfoPlist.strings \
Resources/he.lproj/Localizable.strings \
Resources/he.lproj/locversion.plist \
Resources/he.lproj/main.nib/designable.nib \
Resources/he.lproj/main.nib/keyedobjects.nib \
Resources/hr.lproj/InfoPlist.strings \
Resources/hr.lproj/Localizable.strings \
Resources/hr.lproj/locversion.plist \
Resources/hr.lproj/main.nib/designable.nib \
Resources/hr.lproj/main.nib/keyedobjects.nib \
Resources/hu.lproj/InfoPlist.strings \
Resources/hu.lproj/Localizable.strings \
Resources/hu.lproj/locversion.plist \
Resources/hu.lproj/main.nib/designable.nib \
Resources/hu.lproj/main.nib/keyedobjects.nib \
Resources/Italian.lproj/InfoPlist.strings \
Resources/Italian.lproj/Localizable.strings \
Resources/Italian.lproj/locversion.plist \
Resources/Italian.lproj/main.nib/designable.nib \
Resources/Italian.lproj/main.nib/keyedobjects.nib \
Resources/Japanese.lproj/InfoPlist.strings \
Resources/Japanese.lproj/Localizable.strings \
Resources/Japanese.lproj/locversion.plist \
Resources/Japanese.lproj/main.nib/designable.nib \
Resources/Japanese.lproj/main.nib/keyedobjects.nib \
Resources/ko.lproj/InfoPlist.strings \
Resources/ko.lproj/Localizable.strings \
Resources/ko.lproj/locversion.plist \
Resources/ko.lproj/main.nib/designable.nib \
Resources/ko.lproj/main.nib/keyedobjects.nib \
Resources/no.lproj/InfoPlist.strings \
Resources/no.lproj/Localizable.strings \
Resources/no.lproj/locversion.plist \
Resources/no.lproj/main.nib/designable.nib \
Resources/no.lproj/main.nib/keyedobjects.nib \
Resources/pl.lproj/InfoPlist.strings \
Resources/pl.lproj/Localizable.strings \
Resources/pl.lproj/locversion.plist \
Resources/pl.lproj/main.nib/designable.nib \
Resources/pl.lproj/main.nib/keyedobjects.nib \
Resources/pt.lproj/InfoPlist.strings \
Resources/pt.lproj/Localizable.strings \
Resources/pt.lproj/locversion.plist \
Resources/pt.lproj/main.nib/designable.nib \
Resources/pt.lproj/main.nib/keyedobjects.nib \
Resources/pt_PT.lproj/InfoPlist.strings \
Resources/pt_PT.lproj/Localizable.strings \
Resources/pt_PT.lproj/locversion.plist \
Resources/pt_PT.lproj/main.nib/designable.nib \
Resources/pt_PT.lproj/main.nib/keyedobjects.nib \
Resources/ro.lproj/InfoPlist.strings \
Resources/ro.lproj/Localizable.strings \
Resources/ro.lproj/locversion.plist \
Resources/ro.lproj/main.nib/designable.nib \
Resources/ro.lproj/main.nib/keyedobjects.nib \
Resources/ru.lproj/InfoPlist.strings \
Resources/ru.lproj/Localizable.strings \
Resources/ru.lproj/locversion.plist \
Resources/ru.lproj/main.nib/designable.nib \
Resources/ru.lproj/main.nib/keyedobjects.nib \
Resources/sk.lproj/InfoPlist.strings \
Resources/sk.lproj/Localizable.strings \
Resources/sk.lproj/locversion.plist \
Resources/sk.lproj/main.nib/designable.nib \
Resources/sk.lproj/main.nib/keyedobjects.nib \
Resources/Spanish.lproj/InfoPlist.strings \
Resources/Spanish.lproj/Localizable.strings \
Resources/Spanish.lproj/locversion.plist \
Resources/Spanish.lproj/main.nib/designable.nib \
Resources/Spanish.lproj/main.nib/keyedobjects.nib \
Resources/sv.lproj/InfoPlist.strings \
Resources/sv.lproj/Localizable.strings \
Resources/sv.lproj/locversion.plist \
Resources/sv.lproj/main.nib/designable.nib \
Resources/sv.lproj/main.nib/keyedobjects.nib \
Resources/th.lproj/InfoPlist.strings \
Resources/th.lproj/Localizable.strings \
Resources/th.lproj/locversion.plist \
Resources/th.lproj/main.nib/designable.nib \
Resources/th.lproj/main.nib/keyedobjects.nib \
Resources/tr.lproj/InfoPlist.strings \
Resources/tr.lproj/Localizable.strings \
Resources/tr.lproj/locversion.plist \
Resources/tr.lproj/main.nib/designable.nib \
Resources/tr.lproj/main.nib/keyedobjects.nib \
Resources/uk.lproj/InfoPlist.strings \
Resources/uk.lproj/Localizable.strings \
Resources/uk.lproj/locversion.plist \
Resources/uk.lproj/main.nib/designable.nib \
Resources/uk.lproj/main.nib/keyedobjects.nib \
Resources/X11.icns \
Resources/zh_CN.lproj/InfoPlist.strings \
Resources/zh_CN.lproj/Localizable.strings \
Resources/zh_CN.lproj/locversion.plist \
Resources/zh_CN.lproj/main.nib/designable.nib \
Resources/zh_CN.lproj/main.nib/keyedobjects.nib \
Resources/zh_TW.lproj/InfoPlist.strings \
Resources/zh_TW.lproj/Localizable.strings \
Resources/zh_TW.lproj/locversion.plist \
Resources/zh_TW.lproj/main.nib/designable.nib \
Resources/zh_TW.lproj/main.nib/keyedobjects.nib

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>106.5</string>
<key>LprojLocale</key>
<string>ca</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>106.5</string>
<key>LprojLocale</key>
<string>cs</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -3,12 +3,12 @@
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>105</string>
<string>106.5</string>
<key>LprojLocale</key>
<string>el</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>105</string>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1040</int>
<string key="IBDocument.SystemVersion">11A289</string>
<string key="IBDocument.InterfaceBuilderVersion">900</string>
<string key="IBDocument.AppKitVersion">1094.2</string>
<string key="IBDocument.HIToolboxVersion">521.00</string>
<string key="IBDocument.SystemVersion">11A444d</string>
<string key="IBDocument.InterfaceBuilderVersion">905</string>
<string key="IBDocument.AppKitVersion">1119.1</string>
<string key="IBDocument.HIToolboxVersion">555.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">900</string>
<string key="NS.object.0">905</string>
</object>
<array class="NSMutableArray" key="IBDocument.EditedObjectIDs"/>
<array key="IBDocument.PluginDependencies">
@@ -404,7 +404,7 @@
<object class="NSFont" key="NSSupport" id="463863101">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
<int key="NSfFlags">1040</int>
</object>
<reference key="NSControlView" ref="119157981"/>
<int key="NSButtonFlags">1211912703</int>
@@ -436,7 +436,7 @@
<object class="NSFont" key="NSSupport" id="26">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
<int key="NSfFlags">3088</int>
</object>
<string key="NSPlaceholderString"/>
<reference key="NSControlView" ref="443008216"/>
@@ -553,7 +553,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA</string>
<object class="NSTextFieldCell" key="NSCell" id="617441821">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">4194304</int>
<string key="NSContents">Kun käytössä, Optio-näppäimet lähettävät Alt_L- ja Alt_R X11 -näppäinsymbolit Mode_switchin sijaan.</string>
<string key="NSContents">Kun käytössä, Optio-näppäimet lähettävät X11:n Alt_L- ja Alt_R-näppäinsymbolit Mode_switchin sijaan.</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="278155937"/>
<reference key="NSBackgroundColor" ref="57160303"/>
@@ -1285,6 +1285,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA</string>
<string key="NSMinSize">{320, 262}</string>
<string key="NSMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
<string key="NSFrameAutosaveName">x11_prefs</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSWindowTemplate" id="604417141">
<int key="NSWindowStyleMask">11</int>
@@ -1594,6 +1595,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA</string>
<string key="NSMinSize">{450, 262}</string>
<string key="NSMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
<string key="NSFrameAutosaveName">x11_apps</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSMenu" id="294137138">
<string key="NSTitle">Valikko</string>

View File

@@ -3,12 +3,12 @@
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>105</string>
<string>106.5</string>
<key>LprojLocale</key>
<string>he</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>105</string>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>106.5</string>
<key>LprojLocale</key>
<string>hr</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>106.5</string>
<key>LprojLocale</key>
<string>hu</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>106.5</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -3,12 +3,12 @@
<plist version="1.0">
<dict>
<key>LprojCompatibleVersion</key>
<string>106</string>
<string>106.3</string>
<key>LprojLocale</key>
<string>no</string>
<key>LprojRevisionLevel</key>
<string>1</string>
<key>LprojVersion</key>
<string>106</string>
<string>106.3</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More