Compare commits

...

79 Commits

Author SHA1 Message Date
Jeremy Huddleston
7e178ffbed Rootless: src drawable window can now be NULL
Fix a possible crash when pSrc->pDrawable is NULL.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-10-13 12:54:56 -07:00
Jeremy Huddleston
6980f77892 Rootless: Abstract some of the Xplugin specific stuff which has crept into rootlessWindow.c
The rootless extension now directly calls some Xplugin functions, and relies
on types defined in Xplugin.h, which isn't very abstracted :-)

This patch is a start at abstracting some of the Xplugin specific stuff which
has crept into rootlessWindow.c.  This has been done in a pretty mindless fashion,
without much thought as to if the additions to the generic rootless interface are
the correct ones

There is some confusion as to if RootlesscolormapCallback() returns a Bool or
xp_error_enum value (not so abstact), but I have no way of checking, of finding
out if Xplugin actually checks the result :-)

Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-10-13 12:54:11 -07:00
Jeremy Huddleston
7e06166001 Merge commit 'origin/server-1.7-branch' into xorg-server-1.7-apple 2009-10-13 12:53:38 -07:00
Peter Hutterer
5411e78bd5 xserver 1.7.0.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-12 14:12:45 +10:00
Michel Dänzer
b6e723eaeb EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always
PICT_a8r8g8b8.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1088073b11)
2009-10-10 12:19:57 +02:00
Ben Skeggs
2e37bda8d6 EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture
Easily reproducible by running "rendercheck -t fill".

It should be safe to just test against rbits for all colour components
as we should always have values for r/g/bbits for PICT_FORMAT_COLOR
formats.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Michel Dänzer <daenzer@vmware
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 55305cf8db)
2009-10-10 12:19:57 +02:00
Michel Dänzer
6d99a7de3f composite: Revert changes from adding support for BGRA picture formats.
They were aimed towards a since abandoned approach for making radeon KMS work
on big endian machines, and Aaron Plattner pointed out that they break the
Composite extension when the X server runs in 16bpp.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b375be9285)
2009-10-10 12:19:55 +02:00
Alan Coopersmith
398b5e01a7 Fix make warning: overriding commands for target `dix.O'
Not only does automake generate unnecessary rules for dix.O on platforms
for which SPECIAL_DTRACE_OBJECTS is false, it generates duplicate sets
when "if SPECIAL_DTRACE_OBJECTS" is nested inside "if XSERVER_DTRACE"

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit c0a1bb511a)
2009-10-09 09:16:44 +10:00
Jeremy Huddleston
b916ac74e2 XQuartz: Send mouse location with scroll events.
This fixes the problem where (0, 0) was sent as the mouse location with scroll
button events causing the event to not reach the client.
(cherry picked from commit c4886fbabc)
2009-10-07 18:13:03 -07:00
Alan Coopersmith
a4ce2aa634 Add platform tests for Dtrace linker magic
Replaces special handling for Xquartz DDX and scales better to handling
the multiple platforms that now have some level of Dtrace support available.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-07 17:24:03 -07:00
Alan Coopersmith
22fd21a71d Fix build of unit tests when dtrace probes are enabled
ar loses the dtrace probe magic when building static libraries, so we
have to link with the .O files in order to resolve the dtrace probe symbols.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-07 17:23:44 -07:00
Alan Coopersmith
8e3299eee8 Set XQUARTZ to no on non-Darwin OS'es
Fixes build with dtrace probes on Solaris after efacd7bfd0

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-07 17:23:06 -07:00
Kim Woelders
f496e0042b render: Fix clip region translation in miClipPictureSrc().
Signed-off-by: Kim Woelders <kim@woelders.dk>
Reviewed-by:  Soren Sandmann Pedersen <sandmann@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cbc886a351)
2009-10-06 18:58:48 +10:00
Peter Hutterer
5bc90ffdee xfree86: remove log-spamming DebugF
All input drivers use xf86PostKeyEventP indirectly now and have been since
it exists. I guess that qualifies it as tested - no need to spam the logs.

Reported-by: Felix Wenk
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit bd7430a32e)
2009-10-06 18:58:47 +10:00
Peter Hutterer
5c35d07c3b Require libXtst >= 1.0.99.2 and libdmx >= 1.0.99.1
libXtst requirement is already implicit since we require xextproto 7.1 and
that doesn't go well with pre 1.0.99.2 versions of libXtst. Nonetheless,
list it explicitly.

Since d044027510 we require dmxproto 2.2.99.1.
Complementing that is libdmx 1.0.99.1 with the dmxext.h header file.

Reported-by: Mark Rosenstand
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c629e0fc50)
2009-10-06 18:58:43 +10:00
Jeremy Huddleston
9e7603fae9 XQuartz: Fix a possible minor memory leak
(cherry picked from commit 24e640e1fa)
2009-10-02 19:22:43 -07:00
Jeremy Huddleston
3fc87c3b10 XQuartz: Send mouse location with scroll events.
This fixes the problem where (0, 0) was sent as the mouse location with scroll
button events causing the event to not reach the client.
(cherry picked from commit c4886fbabc)
2009-10-02 19:01:48 -07:00
Jeremy Huddleston
293c318c85 Merge commit 'origin/server-1.7-branch' into xorg-server-1.7-apple 2009-10-01 23:36:26 -07:00
Jeremy Huddleston
b6016134b5 XQuartz: Set the proper bitmap for key repeats...
XkbSetRepeatKeys lies and doesn't do what it says it will...

(cherry picked from commits b9dfed9e88 and
                            873467adad)
2009-10-01 23:34:23 -07:00
Jeremy Huddleston
3808ecc99a XQuartz: Query the BundleIdentifier from the bundle in X11.bin rather than using the configure option.
This lets X11.bin drop into any .app ... the Info.plist and Xquartz binary need to have it hardcoded still.
(cherry picked from commit 9ad16b8e50)
2009-10-01 23:33:18 -07:00
Nirbheek Chauhan
80735dbf56 xkb: check permissions on XKM_OUTPUT_DIR
Checking just for root is insufficient since that does not guarantee write/read
permissions in XKM_OUTPUT_DIR (for example with sandbox).

Check if we can write a file, as well as read it later. Otherwise, invoke the
fallback to /tmp

Signed-off-by: Nirbheek Chauhan <nirbheek@gentoo.org>
Signed-off-by: RĂ©mi Cardona <remi@gentoo.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9bc7cbf9c0)
2009-10-02 16:20:29 +10:00
Jeremy Huddleston
616c7a009d XQuartz: Update version strings to be X11R7.5 and the bundle 2.5.0
Is fink really _still_ relying on this X11R7.x version string?
(cherry picked from commit 3d7cf468df)
2009-10-02 16:20:22 +10:00
Kim Woelders
19592ee774 dix: Fix potential memory corruption in doListFontsWithInfo.
Signed-off-by: Kim Woelders <kim@woelders.dk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4970666827)
2009-10-02 16:19:41 +10:00
Peter Hutterer
4257023c1e xserver 1.7.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-02 15:31:23 +10:00
Peter Hutterer
15b4faff28 dix: force a minimum of 0 for screen coordinates.
Currently the root coordinates may fall into ]-1..0] if the subpixel
remainder is less than 0. Screen coordinates mustn't go below 0, so use
miPointerSetPosition to cap off the remainder if the coordinates are below
0.

This is cheating a bit, a more comprehensive solution to deal with subpixels
correctly when crossing screens is needed. For now, this'll do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
(cherry picked from commit 45f447dafd)
2009-10-02 13:28:01 +10:00
Peter Hutterer
3788113618 configure: if xnest was requested but modules weren't found, fail.
Tested-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 64fe5784b4)
2009-10-02 13:27:57 +10:00
Dave Airlie
c3034dc3af rotate: drop unwrapping inside block handler.
Keith has shown half the block handlers wrappers are wrong, also
dynamic wrapping/unwrapping from what I can see will happen after
the drivers, so its really accidental ABI, that we can't change
now without modifing drivers. So be safe for 1.7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Declared-as-sane-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3ebb82d61c)
2009-10-02 13:27:56 +10:00
Jeremy Huddleston
dfcfd04a73 XQuartz: Update version strings to be X11R7.5 and the bundle 2.5.0
Is fink really _still_ relying on this X11R7.x version string?
(cherry picked from commit 3d7cf468df)
2009-10-01 12:49:34 -07:00
Jeremy Huddleston
02d7f94676 XQuartz: Set the proper bitmap for key repeats...
XkbSetRepeatKeys lies and doesn't do what it says it will...
(cherry picked from commit 873467adad)
2009-10-01 12:49:05 -07:00
Peter Hutterer
47c0b80915 render: Fix crash in RenderAddGlyphs (#23645)
This patch fixes two bugs:
size is calculated as glyph height * padded_width. If the client submits
garbage, this may get above INT_MAX, resulting in a negative size if size is
unsigned. The sanity checks don't trigger for negative sizes and the server
goes and writes into random memory locations.

If the client submits glyphs with a width or height 0, the destination
pixmap is NULL, causing a null-pointer dereference. Since there's nothing to
composite if the width/height is 0, we might as well skip the whole thing
anyway.

Tested with Xvfb, Xephyr and Xorg.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 622fc98fd0)
2009-10-01 16:27:36 +10:00
Peter Hutterer
30ebee3bfc render: set the glyph picture to NULL by default.
In a follow-up patch we may have glyphs with a NULL picture. To cope with
that, always set the pictures for glyphs to NULL at creation time and cope
with cleaning up such glyphs. Also, since compositing a NULL source doesn't
do a lot anyway, skip trying to do so.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 758ab55d2d)
2009-10-01 16:27:36 +10:00
Michel Dänzer
8026c5a085 exa: avoid infinite loops if UTS sw fallbacks.
The upload in finish access can cause an infinite loop if
UTS returns FALSE in here.

Fixes fd.o bug #24246.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b5fcc5553e)
2009-10-01 16:27:36 +10:00
Keith Packard
e182c1b436 Re-fix DGA removal.
Removing DGA ended up breaking any drivers calling into the old
xf86DiDGAInit function as it tried to see if DGA was already enabled
and ended up crashing if the VT wasn't completely initialized. Oops.

Also, if the driver initializes DGA itself, have the DiDGA
initialization overwrite that information as the DiDGA code will call
ReInit on mode detect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit db98b26ee1)
2009-10-01 16:27:36 +10:00
Dave Airlie
369b5d526b dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ffda5aae7)
2009-09-30 10:05:05 +10:00
Michel Dänzer
d3ba814884 Fix ShmPutImage non-ZPixmap case.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23298 .
(cherry picked from commit 11817a881c)
2009-09-30 10:04:55 +10:00
Peter Hutterer
8fc0d54cba ephyr: if -parent is given, check for a trailing -screen. (#24144)
If -parent is given, don't open up a new window if -screen is given as well.
The commandline option -screen allows to set the depth of the embedded
Xephry instance, even though width and height are autoscaled on -parent.

This patch checks for a -screen parameter after -parent and - if one is
found - delays initializing the screen. The parent window id is stored
temporarily but re-set after a -screen argument.
The following command is thus valid:

Xephyr -parent 1234 -screen 640x480@8 -screen 1024x768

It embeds the first 8-bit screen into window 1234 and opens up a new window
for the second screen. Multiple parent arguments are possible, the screens
are embedded in-order.

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

Tested-by: Vic Lee
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 19be992d9d)
2009-09-30 10:04:50 +10:00
Peter Hutterer
857ec3e6ff xfree86: use the DDC size if either width or height of DisplaySize is bogus.
If either width or height of DisplaySize is invalid, assume that the
configuration is invalid and use the DDC-reported values instead.

See Comment 9, Bug 9758.
http://bugs.freedesktop.org/show_bug.cgi?id=9758#c9

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 83023ffd09)
2009-09-30 10:04:45 +10:00
Peter Hutterer
2d4bab18c0 render: Plug a memory leak in AddGlyph. (#23286)
AddGlyph was missing the FreePicture() call that DeleteGlyph used, resulting
in a memory leak when more than one Glyph was added in a RenderAddGlyphs
request.

Since the code in AddGlyph and DeleteGlyph is identical, move into a static
function to avoid such mistakes in the future.

X.Org Bug 23286 <http://bugs.freedesktop.org/show_bug.cgi?id=23286>
(cherry picked from commit f772014c43)
2009-09-30 10:04:28 +10:00
Jeremy Huddleston
b9dfed9e88 XQuartz: Cleaned up keymap setting for easier maintenance 2009-09-28 23:08:36 -07:00
Jeremy Huddleston
d2263645d8 XQuartz: Remove the redundant xquartz_resetenv_display
unsetenv(DISPLAY) takes care of this for us anyway
2009-09-28 23:08:35 -07:00
Jeremy Huddleston
9ad16b8e50 XQuartz: Query the BundleIdentifier from the bundle in X11.bin rather than using the configure option.
This lets X11.bin drop into any .app ... the Info.plist and Xquartz binary need to have it hardcoded still.
2009-09-28 23:08:35 -07:00
Peter Hutterer
290a9639db xserver 1.6.99.903 (xserver 1.7 RC3)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-28 21:05:11 +10:00
Peter Hutterer
8c83457c60 Merge remote branch 'origin/xorg-server-1.7-apple' into server-1.7-branch 2009-09-28 16:48:46 +10:00
Tilman Sauerbeck
6af44db315 configure: make XNEST default to auto.
When we're checking whether to build Xnest, we're comparing the
variable to auto but before it never was assigned that.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>

[Xnest was enabled to yes to increase build exposure and catch compiler
errors early. The requirements to Xnest are quite low and I expect most
developers have them, so Xnext will be enabled on most boxes. Anyone
missing those requires probably doesn't want to build Xnest anyway.]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3db28f92b0)
2009-09-28 16:47:00 +10:00
Ben Byer
b49dba33f9 Add (ok, fix) support for DTrace under OS X
(cherry picked from commit 8428a57184)
2009-09-27 23:34:28 -07:00
Jeremy Huddleston
cf2e3312cf Rootless: Correct border rendering on parent-relative windows
Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow
2009-09-27 23:09:51 -07:00
Jeremy Huddleston
dadab5a227 XQuartz: Fix QuartzSetCursor to match the expected prototype. 2009-09-27 23:00:59 -07:00
Jeremy Huddleston
54000bdcbc XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 22:57:25 -07:00
Jeremy Huddleston
29cb904e4d XQuartz: Nuke TSM
It's deprecated in SnowLeopard.  Ben and I both have no idea what it is for.  It says something about unicode input, but urxvt seems fine taking in unicode, so /shrug... bye.
2009-09-27 22:29:49 -07:00
Jeremy Huddleston
de6cee11e1 XQuartz: Fix inverse map from mode_switch to alt 2009-09-27 22:26:22 -07:00
Peter Hutterer
7e6640b555 Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus"
The vesa driver still uses slowbcopy_frombus and slowbcopy_tobus.

This reverts commit 5ef53a94ce.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-28 12:27:35 +10:00
Jeremy Huddleston
ceaa5c779c XQuartz: Force a keymap resync on the first keypress to workaround XKB mucking with our keymap.
We need to find a better way to work with XKB on this.
2009-09-27 18:25:57 -07:00
Jeremy Huddleston
a3dbde2de8 XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 17:08:12 -07:00
Peter Hutterer
4aeac52c49 Merge remote branch 'origin/xorg-server-1.7-apple' into server-1.7-branch 2009-09-28 09:54:53 +10:00
Samuel Thibault
498135f26e xfree86: Hurd fix
I hadn't paid attention that the parameters order had changed, here is a
trivial patch, please apply.

Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 78ad6ca9a9)
2009-09-28 09:49:21 +10:00
Jeremy Huddleston
77099b933a XQuartz: Stop checking version numbers of the bundle because CFBundleGetVersionNumber is gimpish
(cherry picked from commit 9f5bdd8960)
2009-09-27 13:53:02 -07:00
Jeremy Huddleston
7958f6b75b XQuartz: Add pressure/tilt property labels 2009-09-27 13:53:02 -07:00
Jeremy Huddleston
29b2d9cdf5 XQuartz: Fix a brain-o array indexing problem
/bop Peter
2009-09-27 13:53:01 -07:00
Jeremy Huddleston
fd1adc21a9 XQuartz: Nuke duplicate locks that make painful headaches 2009-09-27 13:53:01 -07:00
Jeremy Huddleston
6e4fc5d066 Xi: CopyKeyClass is not static for XQuartz 2009-09-27 13:53:01 -07:00
Jeremy Huddleston
e0e2eaf1f3 XQuartz: Use internal xshm header for new xextproto
(cherry picked from commit 1755239330)
(cherry picked from commit 697be460d0)
2009-09-27 13:53:01 -07:00
Jeremy Huddleston
1a0dfde2d1 XQuartz: GLX capabilities: Allow 16bit accumulation buffers
http://xquartz.macosforge.org/trac/ticket/308
(cherry picked from commit e9e63a2118)
2009-09-27 13:53:01 -07:00
Michel Dänzer
0c6423b3d5 EXA: Fix mixed pixmaps crash with missing / failing UploadToScreen hook.
For the recent mixed pixmaps changes, I failed to realize (or hit in my
testing) a problem which can occur if the driver doesn't provide an
UploadToScreen hook or provides one which can fail: There can be a crash
in exaMemcpyBox() because exaCopyDirtyToFb() passes pExaPixmap->fb_ptr to
exaCopyDirty(), but that's normally NULL with driver allocated pixmaps.

The solution is to make exaCopyDirty*() no longer rely on pExaPixmap->fb_ptr
but use pPixmap->devPrivate.ptr after PrepareAccess instead.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24167 .
(cherry picked from commit 73ae547d5e)
2009-09-27 20:18:08 +10:00
Kevin E Martin
bb7c26e38c dmx: undefine MITSHM, move undefs to miinitext.c.
This patch undefines MITSHM for dmx - we don't support the required
screen->ModifyPixmapHeaders. All undefines are moved from dmx-config to
miinitext.c, where they belong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c9ec2bab2f)
2009-09-27 20:18:07 +10:00
Kevin E Martin
72f0194be1 dmx: reshuffle linker order to avoid errors when MITSHM is undefined.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fc9d733bab)
2009-09-27 20:18:06 +10:00
Peter Hutterer
e4edb4f2e6 dmx: core events are always in screen coordinates when passed to GPE.
This fixes input in dmx, the pointer appears at the right positions to the
clients now.

Also mark the spot where we pass in the button state as valuator to GPE
with a FIXME. (??)

Tested-by: Kevin Martin
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit e7c2598f56)
2009-09-27 20:18:01 +10:00
Peter Hutterer
7c9e0b0778 Xi: update axisVals with the right subpixel data.
Subpixel data in data_frac is stored as FP32.32, hence we need to get that
down again before adding it to the current value.

Reported-by: Thomas Jaeger
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9bd08c690f)
2009-09-27 20:17:58 +10:00
Peter Hutterer
1745808c29 configure: Unify all library defines that require a specific version.
This patch moves all libraries that require a specific version into a single
location instead or duplicating them across the configure.ac file.
Libraries that do not require specific versions are left where they are.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 43a2eb794f)
2009-09-27 20:17:57 +10:00
Michel Dänzer
e5371c7fc8 EXA: Extend mixed pixmaps scheme to allow driver PrepareAccess hook to fail.
If the PrepareAccess hook fails, use the DownloadFromScreen hook to retrieve
driver pixmap contents to a system RAM copy, perform software rendering on that
and copy the results back using the UploadToScreen hook. Use the classic
migration logic to minimize transfers (which as a bonus allows slightly
cleaning up some of the existing mixed pixmap code).

This enables things that weren't possible before with driver-allocated pixmap
storage: If some (or all) GPU pixmap storage can't be mapped directly by the
CPU, this can be handled between the PrepareAccess and
DownloadFrom/UploadToScreen hooks, e.g.:

* Radeon KMS on big endian machines can fail PrepareAccess if the pixmap
  requires byte-swapping and swap bytes in DownloadFrom/UploadToScreen.
* Environments where GPU and CPU don't have a shared address space at all.
  Here the driver PrepareAccess hook will always fail and leave all transfers
  between GPU / CPU storage to the Download/From/UploadToScreen hooks.

Drivers which can handle all pixmaps in the PrepareAccess hook should notice
little if any difference.
(cherry picked from commit 1818cbd70f)
2009-09-26 12:38:22 +10:00
Peter Hutterer
cecd484fbb Require libXext >= 1.0.99.4
Reported-by: Tilman Sauerbeck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9fa73be9fa)
2009-09-26 12:37:51 +10:00
Peter Hutterer
f188fabfe2 kdrive: plug two memory leaks when freeing the KdKeyboard/Pointer.
xkbRules, xkbModel and xkbLayout are strdup'd in KdNewKeyboard, need to be
freed.

The ephyr driver strdups the name on top of the already allocated
kdrive-assigned name. Memory must be freed beforehand.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a9c274df5c)
2009-09-26 12:37:49 +10:00
Peter Hutterer
48ab48a6ce dix: plug memory leak in DeviceEnterLeaveEvents.
'event' must be freed before exiting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fd91313673)
2009-09-26 12:37:43 +10:00
Peter Hutterer
9e39491166 Xi: fix length calculation for ValuatorState in QueryDeviceState reply.
The length field needs to include the bytes required for the valuators
(INT32) as well.

The reply length has the right value and since the valuator state is always
last, clients didn't notice the wrong offset.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ee796e9bb)
2009-09-26 12:37:37 +10:00
Peter Hutterer
a9e2f7ac15 configure: fix up tslib check once again.
This patch addresses two issues:
The check for HAVE_TSLIB = xauto can never be true, the check has been
corrected to TSLIB = xauto.

Pre-pkgconfig versions of tslib fail to be found, this patch restores the
additional AC_CHECK_LIB. However, the pgk-config check must happen before
AC_CHECK_LIB, as AC_CHECK_LIB does not seem to honour the LD_LIBRARY_PATH.
Thus, if tslib is installed outside of the default paths, AC_CHECK_LIB
fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked--by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 3b5bbb149d)
2009-09-25 09:14:58 +10:00
Thomas Jaeger
1f74cfdeac dix: report XI1 axis values correctly if first_valuator != 0
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5402f18d9c)
2009-09-25 09:14:55 +10:00
Michel Dänzer
8867c60782 render: Don't add b8g8r8x8 format for depth 24.
The components are required to be packed in the bottom of the pixel, so this
format can't fit in depth 24.

Also fix up a comment for the addition of BGRA formats.
(cherry picked from commit ce1fe8ddb4)
2009-09-25 09:14:44 +10:00
Michel Dänzer
ac1490b651 EXA: Fix some issues pointed out by clang.
Remove dead variables, fix use of uninitialized values, that kind of thing.
(cherry picked from commit 096f21bb7a)
2009-09-25 09:14:40 +10:00
Simon Thum
6b656c3498 dix: move bounds check before access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 824a09d856)
2009-09-25 09:09:54 +10:00
Peter Hutterer
9c1a18377a xserver 1.6.99.902 (xserver 1.7 RC2)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 12:58:34 +10:00
94 changed files with 1268 additions and 1276 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ xorg-server.pc
xorg-server-*.tar.bz2
xorg-server-*.tar.gz
stamp-h?
dix/Xserver-dtrace.h
do-not-use-config.h
do-not-use-config.h.in
dix/dix.c

View File

@ -497,15 +497,40 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
char *data)
{
PixmapPtr pPixmap;
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
data);
if (!pPixmap)
return;
pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
if (format == ZPixmap || depth == 1) {
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
data);
if (!pPixmap)
return;
pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
} else {
GCPtr putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC)
return;
pPixmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) {
FreeScratchGC(putGC);
return;
}
ValidateGC(&pPixmap->drawable, putGC);
(*putGC->ops->PutImage)(&pPixmap->drawable, putGC, depth, -sx, -sy, w, h, 0,
(format == XYPixmap) ? XYPixmap : ZPixmap, data);
FreeScratchGC(putGC);
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh,
dx, dy, 1L);
else
(void)(*pGC->ops->CopyArea)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh,
dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
}
}
#ifdef PANORAMIX

View File

@ -192,7 +192,7 @@ XIGetDevice(xEvent* xE)
* This code is basically the old SwitchCoreKeyboard.
*/
static void
void
CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
{
KeyClassPtr mk = master->key;
@ -805,7 +805,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
{
/* XXX: Relative/Absolute mode */
v->axisVal[i] = event->valuators.data[i];
v->axisVal[i] += event->valuators.data_frac[i];
v->axisVal[i] += (event->valuators.data_frac[i] * 1.0f / (1 << 16) / (1 << 16));
}
}

View File

@ -147,7 +147,7 @@ ProcXQueryDeviceState(ClientPtr client)
if (v != NULL) {
tv = (xValuatorState *) buf;
tv->class = ValuatorClass;
tv->length = sizeof(xValuatorState);
tv->length = sizeof(xValuatorState) + v->numAxes * 4;
tv->num_valuators = v->numAxes;
tv->mode = v->mode;
buf += sizeof(xValuatorState);

View File

@ -238,7 +238,6 @@ static CompAlternateVisual altVisuals[] = {
{ 24, PICT_r8g8b8 },
#endif
{ 32, PICT_a8r8g8b8 },
{ 32, PICT_b8g8r8a8 },
};
static const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) /
@ -248,15 +247,9 @@ static Bool
compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
CompAlternateVisual *alt)
{
VisualPtr visual, visuals;
int i;
int numVisuals;
XID *installedCmaps;
ColormapPtr installedCmap;
int numInstalledCmaps;
VisualPtr visual;
DepthPtr depth;
PictFormatPtr pPictFormat;
VisualID *vid;
unsigned long alphaMask;
/*
@ -273,58 +266,16 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
return TRUE;
pPictFormat = PictureMatchFormat (pScreen, alt->depth, alt->format);
if (!pPictFormat ||
pPictFormat->direct.red != pScreen->visuals[0].offsetRed)
if (!pPictFormat)
return FALSE;
vid = xalloc(sizeof(VisualID));
if (!vid)
return FALSE;
/* Find the installed colormaps */
installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
if (!installedCmaps) {
xfree(vid);
return FALSE;
}
numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen,
installedCmaps);
/* realloc the visual array to fit the new one in place */
numVisuals = pScreen->numVisuals;
visuals = xrealloc(pScreen->visuals, (numVisuals + 1) * sizeof(VisualRec));
if (!visuals) {
xfree(vid);
xfree(installedCmaps);
return FALSE;
if (ResizeVisualArray(pScreen, 1, depth) == FALSE) {
return FALSE;
}
/*
* Fix up any existing installed colormaps -- we'll assume that
* the only ones created so far have been installed. If this
* isn't true, we'll have to walk the resource database looking
* for all colormaps.
*/
for (i = 0; i < numInstalledCmaps; i++) {
int j, rc;
rc = dixLookupResourceByType((pointer *)&installedCmap,
installedCmaps[i], RT_COLORMAP,
serverClient, DixReadAccess);
if (rc != Success)
continue;
j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j];
}
xfree(installedCmaps);
pScreen->visuals = visuals;
visual = visuals + pScreen->numVisuals; /* the new one */
pScreen->numVisuals++;
visual = pScreen->visuals + (pScreen->numVisuals - 1); /* the new one */
/* Initialize the visual */
visual->vid = FakeClientID (0);
visual->bitsPerRGBValue = 8;
if (PICT_FORMAT_TYPE(alt->format) == PICT_TYPE_COLOR) {
visual->class = PseudoColor;
@ -357,10 +308,6 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
/* remember the visual ID to detect auto-update windows */
compRegisterAlternateVisuals(cs, &visual->vid, 1);
/* Fix up the depth */
*vid = visual->vid;
depth->numVids = 1;
depth->vids = vid;
return TRUE;
}

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.6.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="(unreleased)"
AC_INIT([xorg-server], 1.7.0.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2009-10-12"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
@ -85,12 +85,6 @@ dnl ISDN trace program named dtrace
AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
[Enable dtrace probes (default: enabled if dtrace found)]),
[WDTRACE=$withval], [WDTRACE=auto])
dnl Darwin 9 has dtrace, but it doesn't support compilation into ELF...
if test "x$WDTRACE" = xauto; then
case $host_os in
darwin*) WDTRACE="no" ;;
esac
fi
if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
if test "x$DTRACE" = "xnot_found" ; then
@ -108,8 +102,20 @@ fi
if test "x$WDTRACE" != "xno" ; then
AC_DEFINE(XSERVER_DTRACE, 1,
[Define to 1 if the DTrace Xserver provider probes should be built in.])
# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
# object files, and require linking with those as relocatable objects, not .a
# archives. MacOS X handles all this in the normal compiler toolchain, and on
# some releases (like Tiger), will error out on dtrace -G. For now, other
# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
# ports appear to, based on my web searches, but have not yet been tested).
case $host_os in
darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
*) SPECIAL_DTRACE_OBJECTS=yes ;;
esac
fi
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
AC_HEADER_DIRENT
AC_HEADER_STDC
@ -604,7 +610,7 @@ dnl DDXes.
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: yes)]), [XNEST=$enableval], [XNEST=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
@ -707,6 +713,7 @@ case $host_os in
XF86VIDMODE=no
fi
;;
*) XQUARTZ=no ;;
esac
dnl ---------------------------------------------------------------------------
@ -738,6 +745,18 @@ dnl Core modules for most extensions, et al.
REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >= 7.0.99.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >= 1.9.99.902] [kbproto >= 1.0.3]"
REQUIRED_LIBS="xfont xau [pixman-1 >= 0.15.20]"
dnl List of libraries that require a specific version
LIBAPPLEWM="applewm >= 1.4"
LIBDMX="dmx >= 1.0.99.1"
LIBDRI="dri >= 7.1.0"
LIBDRM="libdrm >= 2.3.0"
LIBGL="gl >= 7.1.0"
LIBXEXT="xext >= 1.0.99.4"
LIBXI="xi >= 1.2.99.1"
LIBXTST="xtst >= 1.0.99.2"
LIBPCIACCESS="pciaccess >= 0.8.0"
LIBGLIB="glib-2.0 >= 2.16"
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
dnl API.
@ -901,7 +920,7 @@ fi
if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], $GLPROTO [gl >= 7.1.0])
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la'
@ -928,7 +947,7 @@ AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
PKG_CHECK_MODULES([DRI], $GLPROTO [dri >= 7.1.0])
PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
AC_SUBST(DRIPROTO_CFLAGS)
fi
@ -946,7 +965,7 @@ esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0])
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
AC_SUBST(LIBDRM_CFLAGS)
AC_SUBST(LIBDRM_LIBS)
fi
@ -1193,7 +1212,7 @@ AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
# If unittests aren't explicitly disabled, check for required support
if test "x$UNITTESTS" != xno ; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
PKG_CHECK_MODULES([GLIB], $LIBGLIB,
[HAVE_GLIB=yes], [HAVE_GLIB=no])
# Check if linker supports -wrap, passed via compiler flags
@ -1240,13 +1259,15 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
if test "x$WDTRACE" != "xno" ; then
if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
DIX_LIB='$(top_builddir)/dix/dix.O'
OS_LIB='$(top_builddir)/os/os.O'
else
DIX_LIB='$(top_builddir)/dix/libdix.la'
OS_LIB='$(top_builddir)/os/libos.la'
fi
AC_SUBST([DIX_LIB])
AC_SUBST([OS_LIB])
MAIN_LIB='$(top_builddir)/dix/libmain.la'
AC_SUBST([MAIN_LIB])
@ -1360,7 +1381,7 @@ fi
dnl Xnest DDX
PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
PKG_CHECK_MODULES(XNESTMODULES, [xfont $LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
AC_MSG_CHECKING([whether to build Xnest DDX])
if test "x$XNEST" = xauto; then
XNEST="$have_xnest"
@ -1369,6 +1390,9 @@ AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
if test "x$XNEST" = xyes; then
if test "x$have_xnest" = xno; then
AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
fi
XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $CONFIG_LIB"
XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XNEST_LIBS])
@ -1440,7 +1464,7 @@ if test "x$XORG" = xyes; then
AC_SUBST([symbol_visibility])
dnl ===================================================================
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
SAVE_LIBS=$LIBS
SAVE_CFLAGS=$CFLAGS
CFLAGS=$PCIACCESS_CFLAGS
@ -1746,7 +1770,7 @@ if test "x$XQUARTZ" = xyes; then
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO [applewm >= 1.4] xfixes x11)
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
if test "x$XQUARTZ_SPARKLE" = xyes ; then
AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
@ -1775,7 +1799,7 @@ AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
dnl DMX DDX
PKG_CHECK_MODULES([DMXMODULES],
[xmuu xext x11 xrender xfixes xfont xi >= 1.2.99.1 $DMXPROTO xau $XDMCP_MODULES],
[xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
[have_dmx=yes], [have_dmx=no])
AC_MSG_CHECKING([whether to build Xdmx DDX])
if test "x$DMX" = xauto; then
@ -1795,7 +1819,7 @@ if test "x$DMX" = xyes; then
fi
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $FIXES_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB"
XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS])
@ -1810,17 +1834,17 @@ dnl Linux sources in DMX require <linux/keyboard.h>
PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11])
AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
AC_SUBST(XDMXCONFIG_DEP_LIBS)
PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [dmx xext x11])
PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
AC_SUBST(DMXEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [dmx xmu xext x11])
PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [dmx xi xext x11])
PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [xtst xext x11])
PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres xext x11])
PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
AC_SUBST(XRESEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([X11EXAMPLES_DEP], [xext x11])
PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
AC_SUBST(X11EXAMPLES_DEP_LIBS)
fi
AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
@ -1861,7 +1885,11 @@ if test "$KDRIVE" = yes; then
PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
if test "x$HAVE_TSLIB" = xauto; then
if test "x$HAVE_TSLIB" = xno; then
AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"])
fi
if test "xTSLIB" = xauto; then
TSLIB="$HAVE_TSLIB"
fi
@ -1885,12 +1913,12 @@ if test "$KDRIVE" = yes; then
XSDL_INCS="`sdl-config --cflags` $XSERVER_CFLAGS"
fi
XEPHYR_REQUIRED_LIBS="x11 xext xfont xau xdmcp"
XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xfont xau xdmcp"
if test "x$XV" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
fi
if test "x$DRI" = xyes && test "x$GLX" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS gl libdrm"
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
fi
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])

View File

@ -54,14 +54,17 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \
|| cp Xserver-dtrace.h.in $@
endif
if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libdix
dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
noinst_PROGRAMS = dix.O
dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
ld -r -o $@ .libs/*.o
ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
endif
dix.c:

View File

@ -29,8 +29,13 @@
/*
* Xserver dtrace provider definition
*/
#ifdef __APPLE__
#define string char *
#define pid_t uint32_t
#define zoneid_t uint32_t
#else
#include <sys/types.h>
#endif
provider Xserver {
/* reqType, data, length, client id, request buffer */

View File

@ -2690,3 +2690,67 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
xfree(pmaps);
return (found);
}
struct colormap_lookup_data {
ScreenPtr pScreen;
VisualPtr visuals;
};
static void _colormap_find_resource(pointer value, XID id,
pointer cdata)
{
struct colormap_lookup_data *cmap_data = cdata;
VisualPtr visuals = cmap_data->visuals;
ScreenPtr pScreen = cmap_data->pScreen;
ColormapPtr cmap = value;
int j;
j = cmap->pVisual - pScreen->visuals;
cmap->pVisual = &visuals[j];
}
/* something has realloced the visuals, instead of breaking
ABI fix it up here - glx and compsite did this wrong */
Bool
ResizeVisualArray(ScreenPtr pScreen, int new_visual_count,
DepthPtr depth)
{
struct colormap_lookup_data cdata;
int numVisuals;
VisualPtr visuals;
XID *vids, vid;
int first_new_vid, first_new_visual, i;
first_new_vid = depth->numVids;
first_new_visual = pScreen->numVisuals;
vids = xrealloc(depth->vids, (depth->numVids + new_visual_count) * sizeof(XID));
if (!vids)
return FALSE;
/* its realloced now no going back if we fail the next one */
depth->vids = vids;
numVisuals = pScreen->numVisuals + new_visual_count;
visuals = xrealloc(pScreen->visuals, numVisuals * sizeof(VisualRec));
if (!visuals) {
return FALSE;
}
cdata.visuals = visuals;
cdata.pScreen = pScreen;
FindClientResourcesByType(serverClient, RT_COLORMAP, _colormap_find_resource, &cdata);
pScreen->visuals = visuals;
for (i = 0; i < new_visual_count; i++) {
vid = FakeClientID(0);
pScreen->visuals[first_new_visual + i].vid = vid;
vids[first_new_vid + i] = vid;
}
depth->numVids += new_visual_count;
pScreen->numVisuals += new_visual_count;
return TRUE;
}

View File

@ -1046,7 +1046,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
err = AllocError;
break;
}
memset(reply + c->length, 0, length - c->length);
memset((char*)reply + c->length, 0, length - c->length);
c->reply = reply;
c->length = length;
}

View File

@ -352,17 +352,17 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
xv->device_state = state;
switch (xv->num_valuators) {
case 6:
xv->valuator5 = ev->valuators.data[i + 5];
xv->valuator5 = ev->valuators.data[xv->first_valuator + 5];
case 5:
xv->valuator4 = ev->valuators.data[i + 4];
xv->valuator4 = ev->valuators.data[xv->first_valuator + 4];
case 4:
xv->valuator3 = ev->valuators.data[i + 3];
xv->valuator3 = ev->valuators.data[xv->first_valuator + 3];
case 3:
xv->valuator2 = ev->valuators.data[i + 2];
xv->valuator2 = ev->valuators.data[xv->first_valuator + 2];
case 2:
xv->valuator1 = ev->valuators.data[i + 1];
xv->valuator1 = ev->valuators.data[xv->first_valuator + 1];
case 1:
xv->valuator0 = ev->valuators.data[i + 0];
xv->valuator0 = ev->valuators.data[xv->first_valuator + 0];
}
if (i + 6 < num_valuators)

View File

@ -4414,10 +4414,12 @@ DeviceEnterLeaveEvent(
filter, grab);
} else {
if (!GetWindowXI2Mask(mouse, pWin, (xEvent*)event))
return;
goto out;
DeliverEventsToWindow(mouse, pWin, (xEvent*)event, 1, filter,
NullGrab);
}
out:
xfree(event);
}

View File

@ -578,12 +578,13 @@ GetMaximumEventsNum(void) {
static void
clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axis = pDev->valuator->axes + axisNum;
/* InitValuatoraAxisStruct ensures that (min < max). */
AxisInfoPtr axis;
if (axisNum >= pDev->valuator->numAxes)
return;
axis = pDev->valuator->axes + axisNum;
/* If a value range is defined, clip. If not, do nothing */
if (axis->max_value <= axis->min_value)
return;
@ -780,6 +781,19 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
*screeny_frac = dev->last.remainder[1];
}
/* Hit the left screen edge? */
if (*screenx <= 0 && *screenx_frac < 0.0f)
{
*screenx_frac = 0.0f;
x_frac = 0.0f;
}
if (*screeny <= 0 && *screeny_frac < 0.0f)
{
*screeny_frac = 0.0f;
y_frac = 0.0f;
}
old_screenx = *screenx;
old_screeny = *screeny;
/* This takes care of crossing screens for us, as well as clipping

View File

@ -286,11 +286,10 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
* Returns TRUE if pixmap can be accessed offscreen.
*/
Bool
ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
{
ScreenPtr pScreen = pDrawable->pScreen;
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv (pScreen);
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
ExaPixmapPriv(pPixmap);
Bool offscreen;
int i;
@ -324,7 +323,7 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
offscreen = exaPixmapIsOffscreen(pPixmap);
if (offscreen)
if (offscreen && pExaPixmap->fb_ptr)
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
else
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
@ -333,20 +332,10 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
if (!offscreen) {
/* Do we need to allocate our system buffer? */
if ((pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && (pExaScr->info->flags & EXA_MIXED_PIXMAPS)) {
if (!pExaPixmap->sys_ptr && !exaPixmapIsPinned(pPixmap)) {
pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch * pDrawable->height);
if (!pExaPixmap->sys_ptr)
FatalError("EXA: malloc failed for size %d bytes\n", pExaPixmap->sys_pitch * pDrawable->height);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
}
}
if (!offscreen)
return FALSE;
}
exaWaitSync (pDrawable->pScreen);
exaWaitSync (pScreen);
if (pExaScr->info->PrepareAccess == NULL)
return TRUE;
@ -360,7 +349,8 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
}
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED &&
!(pExaScr->info->flags & EXA_MIXED_PIXMAPS))
FatalError("Driver failed PrepareAccess on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
@ -370,31 +360,6 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
return TRUE;
}
void
exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
{
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
ExaScreenPriv(pPixmap->drawable.pScreen);
if (pExaScr->do_migration) {
ExaMigrationRec pixmaps[1];
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
exaDoMigration(pixmaps, 1, FALSE);
}
ExaDoPrepareAccess(pDrawable, index);
}
/**
* exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler.
*
@ -404,7 +369,13 @@ exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
void
exaPrepareAccess(DrawablePtr pDrawable, int index)
{
exaPrepareAccessReg(pDrawable, index, NULL);
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaScreenPriv(pDrawable->pScreen);
if (pExaScr->prepare_access_reg)
pExaScr->prepare_access_reg(pPixmap, index, NULL);
else
(void)ExaDoPrepareAccess(pPixmap, index);
}
/**
@ -432,7 +403,6 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
if (pExaScr->access[i].pixmap == pPixmap) {
if (--pExaScr->access[i].count > 0)
return;
index = i;
break;
}
}
@ -442,25 +412,25 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
EXA_FatalErrorDebug(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
pPixmap));
pExaScr->access[index].pixmap = NULL;
pExaScr->access[i].pixmap = NULL;
/* We always hide the devPrivate.ptr. */
pPixmap->devPrivate.ptr = NULL;
if (pExaScr->info->FinishAccess == NULL)
if (pExaScr->finish_access)
pExaScr->finish_access(pPixmap, index);
if (!pExaScr->info->FinishAccess || !exaPixmapIsOffscreen(pPixmap))
return;
if (!exaPixmapIsOffscreen (pPixmap))
return;
if (index >= EXA_PREPARE_AUX_DEST &&
if (i >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
"unsupported index EXA_PREPARE_AUX*\n");
return;
}
(*pExaScr->info->FinishAccess) (pPixmap, index);
(*pExaScr->info->FinishAccess) (pPixmap, i);
}
/**
@ -537,7 +507,7 @@ exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
* For EXA_HANDLES_PIXMAPS the driver will handle whatever is needed.
* We want to signal that the pixmaps will be used as destination.
*/
ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
ExaDoPrepareAccess(pPixmap, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
@ -1071,6 +1041,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_mixed;
pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
pExaScr->do_move_out_pixmap = NULL;
pExaScr->prepare_access_reg = exaPrepareAccessReg_mixed;
pExaScr->finish_access = exaFinishAccess_mixed;
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
@ -1079,6 +1051,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_driver;
pExaScr->do_move_in_pixmap = NULL;
pExaScr->do_move_out_pixmap = NULL;
pExaScr->prepare_access_reg = NULL;
pExaScr->finish_access = NULL;
}
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic);
@ -1088,6 +1062,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_classic;
pExaScr->do_move_in_pixmap = exaMoveInPixmap_classic;
pExaScr->do_move_out_pixmap = exaMoveOutPixmap_classic;
pExaScr->prepare_access_reg = exaPrepareAccessReg_classic;
pExaScr->finish_access = NULL;
}
if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n",

View File

@ -701,7 +701,6 @@ exaGlyphs (CARD8 op,
GlyphListPtr list,
GlyphPtr *glyphs)
{
PicturePtr pPicture;
PixmapPtr pMaskPixmap = 0;
PicturePtr pMask = NULL;
ScreenPtr pScreen = pDst->pDrawable->pScreen;
@ -803,7 +802,6 @@ exaGlyphs (CARD8 op,
while (n--)
{
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
if (glyph->info.width > 0 && glyph->info.height > 0)
{

View File

@ -104,9 +104,8 @@ exaPixmapShouldBeInFB (PixmapPtr pPix)
static void
exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h,
char *sys, int sys_pitch), CARD8 *fallback_src,
CARD8 *fallback_dst, int fallback_srcpitch, int fallback_dstpitch,
int fallback_index, void (*sync) (ScreenPtr pScreen))
char *sys, int sys_pitch), int fallback_index,
void (*sync) (ScreenPtr pScreen))
{
PixmapPtr pPixmap = migrate->pPix;
ExaPixmapPriv (pPixmap);
@ -120,7 +119,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool need_sync = FALSE;
/* Damaged bits are valid in current copy but invalid in other one */
if (exaPixmapIsOffscreen(pPixmap)) {
if (pExaPixmap->offscreen) {
REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
damage);
REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
@ -225,23 +224,24 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pExaPixmap->sys_pitch))
{
if (!access_prepared) {
ExaDoPrepareAccess(&pPixmap->drawable, fallback_index);
ExaDoPrepareAccess(pPixmap, fallback_index);
access_prepared = TRUE;
}
exaMemcpyBox (pPixmap, pBox,
fallback_src, fallback_srcpitch,
fallback_dst, fallback_dstpitch);
if (fallback_index == EXA_PREPARE_DEST) {
exaMemcpyBox (pPixmap, pBox,
pExaPixmap->sys_ptr, pExaPixmap->sys_pitch,
pPixmap->devPrivate.ptr, pPixmap->devKind);
} else {
exaMemcpyBox (pPixmap, pBox,
pPixmap->devPrivate.ptr, pPixmap->devKind,
pExaPixmap->sys_ptr, pExaPixmap->sys_pitch);
}
} else
need_sync = TRUE;
pBox++;
}
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else if (need_sync && sync)
sync (pPixmap->drawable.pScreen);
pExaPixmap->offscreen = save_offscreen;
pPixmap->devKind = save_pitch;
@ -256,6 +256,11 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);
REGION_UNINIT(pScreen, &CopyReg);
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else if (need_sync && sync)
sync (pPixmap->drawable.pScreen);
}
/**
@ -263,7 +268,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
* the framebuffer memory copy to the system memory copy. Both areas must be
* allocated.
*/
static void
void
exaCopyDirtyToSys (ExaMigrationPtr migrate)
{
PixmapPtr pPixmap = migrate->pPix;
@ -271,9 +276,8 @@ exaCopyDirtyToSys (ExaMigrationPtr migrate)
ExaPixmapPriv (pPixmap);
exaCopyDirty(migrate, &pExaPixmap->validSys, &pExaPixmap->validFB,
pExaScr->info->DownloadFromScreen, pExaPixmap->fb_ptr,
pExaPixmap->sys_ptr, pExaPixmap->fb_pitch,
pExaPixmap->sys_pitch, EXA_PREPARE_SRC, exaWaitSync);
pExaScr->info->DownloadFromScreen, EXA_PREPARE_SRC,
exaWaitSync);
}
/**
@ -281,7 +285,7 @@ exaCopyDirtyToSys (ExaMigrationPtr migrate)
* the system memory copy to the framebuffer memory copy. Both areas must be
* allocated.
*/
static void
void
exaCopyDirtyToFb (ExaMigrationPtr migrate)
{
PixmapPtr pPixmap = migrate->pPix;
@ -289,9 +293,7 @@ exaCopyDirtyToFb (ExaMigrationPtr migrate)
ExaPixmapPriv (pPixmap);
exaCopyDirty(migrate, &pExaPixmap->validFB, &pExaPixmap->validSys,
pExaScr->info->UploadToScreen, pExaPixmap->sys_ptr,
pExaPixmap->fb_ptr, pExaPixmap->sys_pitch,
pExaPixmap->fb_pitch, EXA_PREPARE_DEST, NULL);
pExaScr->info->UploadToScreen, EXA_PREPARE_DEST, NULL);
}
/**
@ -545,7 +547,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
pExaPixmap->offscreen = TRUE;
pPixmap->devKind = pExaPixmap->fb_pitch;
if (!ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC))
if (!ExaDoPrepareAccess(pPixmap, EXA_PREPARE_SRC))
goto skip;
while (nbox--) {
@ -718,3 +720,23 @@ exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
}
}
}
void
exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
ExaMigrationRec pixmaps[1];
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
exaDoMigration(pixmaps, 1, FALSE);
(void)ExaDoPrepareAccess(pPixmap, index);
}

View File

@ -31,55 +31,16 @@
#include "exa_priv.h"
#include "exa.h"
static void
exaUploadFallback(PixmapPtr pPixmap, CARD8 *src, int src_pitch)
{
ExaPixmapPriv(pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
GCPtr pGC = GetScratchGC (pPixmap->drawable.depth,
pPixmap->drawable.pScreen);
int nbox, cpp = pPixmap->drawable.bitsPerPixel / 8;
DamagePtr backup = pExaPixmap->pDamage;
BoxPtr pbox;
CARD8 *src2;
/* We don't want damage optimisations. */
pExaPixmap->pDamage = NULL;
ValidateGC (&pPixmap->drawable, pGC);
pbox = REGION_RECTS(damage);
nbox = REGION_NUM_RECTS(damage);
while (nbox--) {
src2 = src + pbox->y1 * src_pitch + pbox->x1 * cpp;
ExaCheckPutImage(&pPixmap->drawable, pGC,
pPixmap->drawable.depth, pbox->x1, pbox->y1,
pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, 0,
ZPixmap, (char*) src2);
pbox++;
}
FreeScratchGC (pGC);
pExaPixmap->pDamage = backup;
}
void
exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
ExaPixmapPriv(pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
void *sys_buffer = pExaPixmap->sys_ptr;
int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
int usage_hint = pPixmap->usage_hint;
int sys_pitch = pExaPixmap->sys_pitch;
int paddedWidth = sys_pitch;
int nbox;
BoxPtr pbox;
int paddedWidth = pExaPixmap->sys_pitch;
/* Already done. */
if (pExaPixmap->driverPriv)
@ -105,50 +66,8 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
if (!pExaPixmap->driverPriv)
return;
pExaPixmap->offscreen = TRUE;
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_pitch = pPixmap->devKind = 0;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
/* scratch pixmaps */
if (!w || !h)
goto finish;
/* we do not malloc memory by default. */
if (!sys_buffer)
goto finish;
if (!pExaScr->info->UploadToScreen)
goto fallback;
pbox = REGION_RECTS(damage);
nbox = REGION_NUM_RECTS(damage);
while (nbox--) {
if (!pExaScr->info->UploadToScreen(pPixmap, pbox->x1, pbox->y1, pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1, (char *) (sys_buffer) + pbox->y1 * sys_pitch + pbox->x1 * (bpp / 8), sys_pitch))
goto fallback;
pbox++;
}
goto finish;
fallback:
exaUploadFallback(pPixmap, sys_buffer, sys_pitch);
finish:
free(sys_buffer);
/* We no longer need this. */
if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL;
}
}
void
@ -175,8 +94,16 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
for (i = 0; i < npixmaps; i++) {
PixmapPtr pPixmap = pixmaps[i].pPix;
ExaPixmapPriv(pPixmap);
if (!pExaPixmap->driverPriv)
exaCreateDriverPixmap_mixed(pPixmap);
if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToFb(pixmaps + i);
}
pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap);
}
}
@ -192,3 +119,91 @@ exaMoveInPixmap_mixed(PixmapPtr pPixmap)
exaDoMigration(pixmaps, 1, TRUE);
}
/* With mixed pixmaps, if we fail to get direct access to the driver pixmap, we
* use the DownloadFromScreen hook to retrieve contents to a copy in system
* memory, perform software rendering on that and move back the results with the
* UploadToScreen hook (see exaFinishAccess_mixed).
*/
void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
if (!ExaDoPrepareAccess(pPixmap, index)) {
ExaPixmapPriv(pPixmap);
Bool is_offscreen = exaPixmapIsOffscreen(pPixmap);
ExaMigrationRec pixmaps[1];
/* Do we need to allocate our system buffer? */
if (!pExaPixmap->sys_ptr) {
pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch *
pPixmap->drawable.height);
if (!pExaPixmap->sys_ptr)
FatalError("EXA: malloc failed for size %d bytes\n",
pExaPixmap->sys_pitch * pPixmap->drawable.height);
}
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
if (!pExaPixmap->pDamage && (is_offscreen || !exaPixmapIsPinned(pPixmap))) {
Bool as_dst = pixmaps[0].as_dst;
/* Set up damage tracking */
pExaPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone,
TRUE, pPixmap->drawable.pScreen,
pPixmap);
DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage);
/* This ensures that pending damage reflects the current operation. */
/* This is used by exa to optimize migration. */
DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE);
if (is_offscreen) {
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
/* We don't know which region of the destination will be damaged,
* have to assume all of it
*/
if (as_dst) {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
pixmaps[0].pReg = NULL;
}
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
if (as_dst)
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
} else if (is_offscreen) {
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
pExaPixmap->offscreen = FALSE;
}
}
/* Move back results of software rendering on system memory copy of mixed driver
* pixmap (see exaPrepareAccessReg_mixed).
*/
void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
{
ExaPixmapPriv(pPixmap);
if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
DamageRegionProcessPending(&pPixmap->drawable);
exaMoveInPixmap_mixed(pPixmap);
}
}

View File

@ -32,8 +32,6 @@
#include "exa.h"
/* This file holds the driver allocated pixmaps + better initial placement code.
* A pinned pixmap implies one that is either driver based already or otherwise altered.
* Proper care is taken to free the initially allocated buffer.
*/
static _X_INLINE void*
@ -46,9 +44,6 @@ ExaGetPixmapAddress(PixmapPtr p)
/**
* exaCreatePixmap() creates a new pixmap.
*
* Pixmaps are always marked as pinned, unless the pixmap can still be transfered to a
* driver pixmaps.
*/
PixmapPtr
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
@ -57,7 +52,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
PixmapPtr pPixmap;
ExaPixmapPrivPtr pExaPixmap;
int bpp;
size_t paddedWidth, datasize;
size_t paddedWidth;
ExaScreenPriv(pScreen);
if (w > 32767 || h > 32767)
@ -79,15 +74,12 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
if (paddedWidth / 4 > 32767 || h > 32767)
return NullPixmap;
datasize = h * paddedWidth;
/* We will allocate the system pixmap later if needed. */
pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_ptr = NULL;
pExaPixmap->sys_pitch = paddedWidth;
pExaPixmap->area = NULL;
pExaPixmap->offscreen = FALSE;
pExaPixmap->fb_ptr = NULL;
pExaPixmap->pDamage = NULL;
@ -95,36 +87,15 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
/* Avoid freeing sys_ptr. */
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
/* We want to be able to transfer the pixmap to driver memory later on. */
pExaPixmap->score = EXA_PIXMAP_SCORE_INIT;
/* A scratch pixmap will become a driver pixmap right away. */
if (!w || !h) {
exaCreateDriverPixmap_mixed(pPixmap);
} else {
/* Set up damage tracking */
pExaPixmap->pDamage = DamageCreate (NULL, NULL,
DamageReportNone, TRUE,
pScreen, pPixmap);
if (pExaPixmap->pDamage == NULL) {
swap(pExaScr, pScreen, DestroyPixmap);
pScreen->DestroyPixmap (pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return NULL;
}
DamageRegister (&pPixmap->drawable, pExaPixmap->pDamage);
/* This ensures that pending damage reflects the current operation. */
/* This is used by exa to optimize migration. */
DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE);
}
pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap);
} else
pExaPixmap->offscreen = FALSE;
return pPixmap;
}
@ -136,7 +107,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
Bool ret;
Bool ret, is_offscreen;
if (!pPixmap)
return FALSE;
@ -144,26 +115,23 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaScr = ExaGetScreenPriv(pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
if (pExaPixmap) {
if (!exaPixmapIsPinned(pPixmap)) {
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_pitch = pPixmap->devKind = 0;
/* We no longer need this. */
if (pPixData) {
if (pExaPixmap->driverPriv) {
if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL;
}
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
}
if (pPixData)
pExaPixmap->sys_ptr = pPixData;
if (devKind > 0)
pExaPixmap->sys_pitch = devKind;
pExaPixmap->offscreen = FALSE;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
}
if (pExaPixmap->driverPriv) {
if (width > 0 && height > 0 && bitsPerPixel > 0) {
exaSetFbPitch(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
@ -171,9 +139,15 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
}
}
/* Anything can happen, don't try to predict it all. */
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
is_offscreen = exaPixmapIsOffscreen(pPixmap);
if (is_offscreen) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
} else {
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
/* Only pass driver pixmaps to the driver. */
@ -184,10 +158,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
* If pPixmap->devPrivate.ptr is non-NULL, then we've got a non-offscreen pixmap.
* We need to store the pointer, because PrepareAccess won't be called.
*/
if (!pPixData && pPixmap->devPrivate.ptr && pPixmap->devKind) {
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->sys_pitch = pPixmap->devKind;
}
if (ret == TRUE)
goto out;
}
@ -198,6 +168,13 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
swap(pExaScr, pScreen, ModifyPixmapHeader);
out:
if (is_offscreen) {
pExaPixmap->fb_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->fb_pitch = pPixmap->devKind;
} else {
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->sys_pitch = pPixmap->devKind;
}
/* Always NULL this, we don't want lingering pointers. */
pPixmap->devPrivate.ptr = NULL;
@ -217,10 +194,14 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
else if (pExaPixmap->sys_ptr && !exaPixmapIsPinned(pPixmap))
free(pExaPixmap->sys_ptr);
pExaPixmap->driverPriv = NULL;
pExaPixmap->sys_ptr = NULL;
if (pExaPixmap->pDamage) {
if (pExaPixmap->sys_ptr)
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
}
swap(pExaScr, pScreen, DestroyPixmap);

View File

@ -176,6 +176,8 @@ typedef struct {
Bool (*pixmap_is_offscreen) (PixmapPtr pPixmap);
void (*do_move_in_pixmap) (PixmapPtr pPixmap);
void (*do_move_out_pixmap) (PixmapPtr pPixmap);
void (*prepare_access_reg)(PixmapPtr pPixmap, int index, RegionPtr pReg);
void (*finish_access)(PixmapPtr pPixmap, int index);
Bool swappedOut;
enum ExaMigrationHeuristic migration;
@ -511,10 +513,7 @@ ExaOffscreenFini (ScreenPtr pScreen);
/* exa.c */
Bool
ExaDoPrepareAccess(DrawablePtr pDrawable, int index);
void
exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg);
ExaDoPrepareAccess(PixmapPtr pPixmap, int index);
void
exaPrepareAccess(DrawablePtr pDrawable, int index);
@ -609,6 +608,12 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
void
exaMoveInPixmap_mixed(PixmapPtr pPixmap);
void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
void
exaFinishAccess_mixed(PixmapPtr pPixmap, int index);
/* exa_render.c */
Bool
exaOpReadsDestination (CARD8 op);
@ -664,6 +669,12 @@ exaGlyphs (CARD8 op,
GlyphPtr *glyphs);
/* exa_migration_classic.c */
void
exaCopyDirtyToSys (ExaMigrationPtr migrate);
void
exaCopyDirtyToFb (ExaMigrationPtr migrate);
void
exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
@ -676,4 +687,7 @@ exaMoveOutPixmap_classic (PixmapPtr pPixmap);
void
exaMoveInPixmap_classic (PixmapPtr pPixmap);
void
exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg);
#endif /* EXAPRIV_H */

View File

@ -185,41 +185,56 @@ exaGetRGBAFromPixel(CARD32 pixel,
CARD16 *green,
CARD16 *blue,
CARD16 *alpha,
PictFormatPtr pFormat)
PictFormatPtr pFormat,
PictFormatShort format)
{
int rbits, bbits, gbits, abits;
int rshift, bshift, gshift, ashift;
if (!PICT_FORMAT_COLOR(pFormat->format) &&
PICT_FORMAT_TYPE(pFormat->format) != PICT_TYPE_A)
if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A)
return FALSE;
rbits = PICT_FORMAT_R(pFormat->format);
gbits = PICT_FORMAT_G(pFormat->format);
bbits = PICT_FORMAT_B(pFormat->format);
abits = PICT_FORMAT_A(pFormat->format);
rbits = PICT_FORMAT_R(format);
gbits = PICT_FORMAT_G(format);
bbits = PICT_FORMAT_B(format);
abits = PICT_FORMAT_A(format);
rshift = pFormat->direct.red;
gshift = pFormat->direct.green;
bshift = pFormat->direct.blue;
ashift = pFormat->direct.alpha;
if (pFormat) {
rshift = pFormat->direct.red;
gshift = pFormat->direct.green;
bshift = pFormat->direct.blue;
ashift = pFormat->direct.alpha;
} else if (format == PICT_a8r8g8b8) {
rshift = 16;
gshift = 8;
bshift = 0;
ashift = 24;
} else
FatalError("EXA bug: exaGetRGBAFromPixel() doesn't match "
"createSourcePicture()\n");
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
while (rbits < 16) {
*red |= *red >> rbits;
rbits <<= 1;
}
if (rbits) {
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
while (rbits < 16) {
*red |= *red >> rbits;
rbits <<= 1;
}
*green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
while (gbits < 16) {
*green |= *green >> gbits;
gbits <<= 1;
}
*green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
while (gbits < 16) {
*green |= *green >> gbits;
gbits <<= 1;
}
*blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
while (bbits < 16) {
*blue |= *blue >> bbits;
bbits <<= 1;
*blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
while (bbits < 16) {
*blue |= *blue >> bbits;
bbits <<= 1;
}
} else {
*red = 0x0000;
*green = 0x0000;
*blue = 0x0000;
}
if (abits) {
@ -266,6 +281,10 @@ exaTryDriverSolidFill(PicturePtr pSrc,
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
if (pSrc->pDrawable) {
xSrc += pSrc->pDrawable->x;
ySrc += pSrc->pDrawable->y;
}
if (!miComputeCompositeRegion (&region, pSrc, NULL, pDst,
xSrc, ySrc, 0, 0, xDst, yDst,
@ -277,16 +296,13 @@ exaTryDriverSolidFill(PicturePtr pSrc,
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
if (pSrc->pDrawable) {
xSrc += pSrc->pDrawable->x;
ySrc += pSrc->pDrawable->y;
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
pixel = exaGetPixmapFirstPixel (pSrcPix);
} else
pixel = pSrc->pSourcePict->solidFill.color;
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
pSrc->pFormat) ||
pSrc->pFormat, pSrc->format) ||
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
pDst->pFormat))
{
@ -340,7 +356,8 @@ exaTryDriverCompositeRects(CARD8 op,
ExaCompositeRectPtr rects)
{
ExaScreenPriv (pDst->pDrawable->pScreen);
int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
int src_off_x = 0, src_off_y = 0, mask_off_x = 0, mask_off_y = 0;
int dst_off_x, dst_off_y;
PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix;
ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix;
@ -656,7 +673,7 @@ exaTryDriverComposite(CARD8 op,
*/
if (pDstExaPix->accel_blocked ||
(pSrcExaPix && pSrcExaPix->accel_blocked) ||
(pMask && (pMaskExaPix->accel_blocked)))
(pMaskExaPix && (pMaskExaPix->accel_blocked)))
{
return -1;
}

View File

@ -101,16 +101,19 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *bits)
{
ExaPixmapPriv(exaGetDrawablePixmap(pDrawable));
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaPixmapPriv(pPixmap);
ExaScreenPriv(pDrawable->pScreen);
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage ||
exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu, pGC->clientClipType))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pExaPixmap->pDamage ?
DamagePendingRegion(pExaPixmap->pDamage) : NULL);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST,
DamagePendingRegion(pExaPixmap->pDamage));
pGC->ops->PutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
@ -323,9 +326,6 @@ void
ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d)
{
BoxRec Box;
RegionRec Reg;
int xoff, yoff;
ScreenPtr pScreen = pDrawable->pScreen;
PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
ExaScreenPriv(pScreen);
@ -333,16 +333,24 @@ ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
EXA_FALLBACK(("from %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable)));
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
if (pExaScr->prepare_access_reg) {
int xoff, yoff;
BoxRec Box;
RegionRec Reg;
Box.x1 = pDrawable->y + x + xoff;
Box.y1 = pDrawable->y + y + yoff;
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
REGION_INIT(pScreen, &Reg, &Box, 1);
Box.x1 = pDrawable->y + x + xoff;
Box.y1 = pDrawable->y + y + yoff;
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
REGION_INIT(pScreen, &Reg, &Box, 1);
pExaScr->prepare_access_reg(pPix, EXA_PREPARE_SRC, &Reg);
} else
exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
swap(pExaScr, pScreen, GetImage);
pScreen->GetImage (pDrawable, x, y, w, h, format, planeMask, d);
swap(pExaScr, pScreen, GetImage);
@ -401,23 +409,23 @@ ExaCheckComposite (CARD8 op,
if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
if (!exaOpReadsDestination(op)) {
if (!exaOpReadsDestination(op) && pExaScr->prepare_access_reg) {
PixmapPtr pDstPix;
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
goto skip;
exaGetDrawableDeltas (pDst->pDrawable,
exaGetDrawablePixmap(pDst->pDrawable),
&xoff, &yoff);
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff);
REGION_TRANSLATE(pScreen, &region, xoff, yoff);
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST,
&region);
pExaScr->prepare_access_reg(exaGetDrawablePixmap(pDst->alphaMap->pDrawable),
EXA_PREPARE_AUX_DEST, &region);
exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, &region);
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, &region);
} else {
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);

View File

@ -250,12 +250,8 @@ GLint glxConvertToXVisualType(int visualType)
static VisualPtr
AddScreenVisuals(ScreenPtr pScreen, int count, int d)
{
XID *installedCmaps, *vids, vid;
int numInstalledCmaps, numVisuals, i, j;
VisualPtr visuals;
ColormapPtr installedCmap;
int i;
DepthPtr depth;
int rc;
depth = NULL;
for (i = 0; i < pScreen->numDepths; i++) {
@ -267,56 +263,8 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
if (depth == NULL)
return NULL;
/* Find the installed colormaps */
installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
if (!installedCmaps)
return NULL;
numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen, installedCmaps);
/* realloc the visual array to fit the new one in place */
numVisuals = pScreen->numVisuals;
visuals = xrealloc(pScreen->visuals, (numVisuals + count) * sizeof(VisualRec));
if (!visuals) {
xfree(installedCmaps);
return NULL;
}
vids = xrealloc(depth->vids, (depth->numVids + count) * sizeof(XID));
if (vids == NULL) {
xfree(installedCmaps);
xfree(visuals);
return NULL;
}
/*
* Fix up any existing installed colormaps -- we'll assume that
* the only ones created so far have been installed. If this
* isn't true, we'll have to walk the resource database looking
* for all colormaps.
*/
for (i = 0; i < numInstalledCmaps; i++) {
rc = dixLookupResourceByType((pointer *)&installedCmap,
installedCmaps[i], RT_COLORMAP,
serverClient, DixReadAccess);
if (rc != Success)
continue;
j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j];
}
xfree(installedCmaps);
for (i = 0; i < count; i++) {
vid = FakeClientID(0);
visuals[pScreen->numVisuals + i].vid = vid;
vids[depth->numVids + i] = vid;
}
pScreen->visuals = visuals;
pScreen->numVisuals += count;
depth->vids = vids;
depth->numVids += count;
if (ResizeVisualArray(pScreen, count, depth) == FALSE)
return NULL;
/* Return a pointer to the first of the added visuals. */
return pScreen->visuals + pScreen->numVisuals - count;

View File

@ -84,10 +84,7 @@ XDMX_LIBS = \
@XDMX_LIBS@ \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
$(MAIN_LIB) \
$(XSERVER_LIBS) \
$(top_builddir)/xfixes/libxfixes.la
config/libdmxconfig.a
Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
Xdmx_DEPENDENCIES= $(XDMX_LIBS)

View File

@ -72,17 +72,4 @@
/* Enable the DMX extension */
#define DMXEXT
/* Disable the extensions that are not currently supported */
#undef MULTIBUFFER
#undef XV
#undef DBE
#undef XF86VIDMODE
#undef XFreeXDGA
#undef XF86DRI
#undef SCREENSAVER
#undef RANDR
#undef XFIXES
#undef DAMAGE
#undef COMPOSITE
#endif /* DMX_CONFIG_H */

View File

@ -183,7 +183,7 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
GetEventList(&events);
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, (InternalEvent*)(events + i)->event);
return;
@ -688,7 +688,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
detail = dmxGetButtonMapping(dmxLocal, detail);
GetEventList(&events);
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE,
POINTER_ABSOLUTE | POINTER_SCREEN,
0, /* first_valuator = 0 */
0, /* num_valuators = 0 */
valuators);
@ -700,9 +700,9 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
GetEventList(&events);
valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y;
valuators[2] = e->xmotion.state;
valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE, 0, 3, valuators);
POINTER_ABSOLUTE | POINTER_SCREEN, 0, 3, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, (InternalEvent*)(events + i)->event);
return;

View File

@ -46,6 +46,11 @@ sets the screen size.
.BI -parent " id"
uses exiting window
.I id .
If a
.BI -screen
argument follows a
.BI -parent
argument, this screen is embedded into the given window.
.TP 8
.B -host-cursor
set 'cursor acceleration':

View File

@ -1074,6 +1074,8 @@ MouseInit (KdPointerInfo *pi)
((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
pi->nAxes = 3;
pi->nButtons = 32;
if (pi->name)
xfree(pi->name);
pi->name = strdup("Xephyr virtual mouse");
ephyrMouse = pi;
return Success;
@ -1123,6 +1125,8 @@ EphyrKeyboardInit (KdKeyboardInfo *ki)
}
ki->minScanCode = ephyrKeySyms.minKeyCode;
ki->maxScanCode = ephyrKeySyms.maxKeyCode;
if (ki->name)
xfree(ki->name);
ki->name = strdup("Xephyr virtual keyboard");
ephyrKbd = ki;
return Success;

View File

@ -148,6 +148,7 @@ processScreenArg (char *screen_size, char *parent_id)
int
ddxProcessArgument (int argc, char **argv, int i)
{
static char* parent = NULL;
EPHYR_DBG("mark argv[%d]='%s'", i, argv[i] );
if (i == 1)
@ -159,6 +160,18 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if(i+1 < argc)
{
int j;
/* If parent is specified and a screen argument follows, don't do
* anything, let the -screen handling init the rest */
for (j = i; j < argc; j++)
{
if (!strcmp(argv[j], "-screen"))
{
parent = argv[i + 1];
return 2;
}
}
processScreenArg ("100x100", argv[i+1]);
return 2;
}
@ -170,7 +183,8 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if ((i+1) < argc)
{
processScreenArg (argv[i+1], NULL);
processScreenArg (argv[i+1], parent);
parent = NULL;
return 2;
}

View File

@ -166,6 +166,12 @@ KdFreeKeyboard(KdKeyboardInfo *ki)
xfree(ki->name);
if (ki->path)
xfree(ki->path);
if (ki->xkbRules)
xfree(ki->xkbRules);
if (ki->xkbModel)
xfree(ki->xkbModel);
if (ki->xkbLayout)
xfree(ki->xkbLayout);
ki->next = NULL;
xfree(ki);
}

View File

@ -80,7 +80,7 @@ BUILT_SOURCES = xorg.conf.example
DISTCLEANFILES += xorg.conf.example xorg.conf.example.pre
EXTRA_DIST = xorgconf.cpp
if XSERVER_DTRACE
if SPECIAL_DTRACE_OBJECTS
# Re-add dtrace object code that gets lost when building static libraries
Xorg_LDADD += $(XSERVER_LIBS)
endif

View File

@ -1211,6 +1211,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Some macros to hide the system dependencies for MMIO accesses */
/* Changed to kill noise generated by gcc's -Wcast-align */
@ -1342,4 +1344,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
# define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
# endif /* __alpha__ */
/*
* With Intel, the version in os-support/misc/SlowBcopy.s is used.
* This avoids port I/O during the copy (which causes problems with
* some hardware).
*/
# ifdef __alpha__
# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
# else /* __alpha__ */
# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
# endif /* __alpha__ */
#endif /* _COMPILER_H */

View File

@ -120,8 +120,22 @@ DGAInit(
DGAScreenKey = &DGAScreenKeyIndex;
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
return FALSE;
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
if (!pScreenPriv)
{
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
return FALSE;
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
pScreen->DestroyColormap = DGADestroyColormap;
pScreenPriv->InstallColormap = pScreen->InstallColormap;
pScreen->InstallColormap = DGAInstallColormap;
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
}
pScreenPriv->pScrn = pScrn;
pScreenPriv->numModes = num;
@ -146,17 +160,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
pScreen->DestroyColormap = DGADestroyColormap;
pScreenPriv->InstallColormap = pScreen->InstallColormap;
pScreen->InstallColormap = DGAInstallColormap;
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
return TRUE;
}

View File

@ -896,11 +896,6 @@ xf86PostKeyEvent(DeviceIntPtr device,
int i = 0;
static int valuators[MAX_VALUATORS];
/* instil confidence in the user */
DebugF("this function has never been tested properly. if things go quite "
"badly south after this message, then xf86PostKeyEvent is "
"broken.\n");
XI_VERIFY_VALUATORS(num_valuators);
va_start(var, num_valuators);
@ -924,11 +919,6 @@ xf86PostKeyEventP(DeviceIntPtr device,
{
int i = 0, nevents = 0;
/* instil confidence in the user */
DebugF("this function has never been tested properly. if things go quite "
"badly south after this message, then xf86PostKeyEvent is "
"broken.\n");
XI_VERIFY_VALUATORS(num_valuators);
if (is_absolute) {

View File

@ -806,7 +806,7 @@ xf86CrtcScreenInit (ScreenPtr screen)
screen->CloseScreen = xf86CrtcCloseScreen;
#ifdef XFreeXDGA
xf86DiDGAInit(screen, 0);
_xf86_di_dga_init_internal(screen);
#endif
#ifdef RANDR_13_INTERFACE
return RANDR_INTERFACE_VERSION;
@ -1928,7 +1928,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
scrn->currentMode = scrn->modes;
#ifdef XFreeXDGA
if (scrn->pScreen)
xf86DiDGAReInit(scrn->pScreen);
_xf86_di_dga_reinit_internal(scrn->pScreen);
#endif
}

View File

@ -833,6 +833,10 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus);
extern _X_EXPORT Bool
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address);
/* this is the real function, used only internally */
_X_INTERNAL Bool
_xf86_di_dga_init_internal (ScreenPtr pScreen);
/**
* Re-initialize dga for this screen (as when the set of modes changes)
*/
@ -841,6 +845,10 @@ extern _X_EXPORT Bool
xf86DiDGAReInit (ScreenPtr pScreen);
#endif
/* This is the real function, used only internally */
_X_INTERNAL Bool
_xf86_di_dga_reinit_internal (ScreenPtr pScreen);
/*
* Set the subpixel order reported for the screen using
* the information from the outputs

View File

@ -174,6 +174,12 @@ static DGAFunctionRec xf86_dga_funcs = {
Bool
xf86DiDGAReInit (ScreenPtr pScreen)
{
return TRUE;
}
Bool
_xf86_di_dga_reinit_internal (ScreenPtr pScreen)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@ -189,13 +195,16 @@ xf86DiDGAReInit (ScreenPtr pScreen)
Bool
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
{
return TRUE;
}
Bool
_xf86_di_dga_init_internal (ScreenPtr pScreen)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
if (DGAAvailable(pScreen->myNum))
return TRUE;
xf86_config->dga_flags = 0;
xf86_config->dga_address = 0;
xf86_config->dga_width = 0;

View File

@ -957,7 +957,7 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
quirks = xf86DDCDetectQuirks(scrnIndex, DDC, FALSE);
if (Monitor->widthmm <= 0 && Monitor->heightmm <= 0) {
if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) {
Monitor->widthmm = 10 * DDC->features.hsize;
Monitor->heightmm = 10 * DDC->features.vsize;
}

View File

@ -268,13 +268,9 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
rotation_active = xf86RotateRedisplay(pScreen);
pScreen->BlockHandler = xf86_config->BlockHandler;
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
if (rotation_active) {
/* Re-wrap if rotation is still happening */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
} else {
xf86_config->BlockHandler = NULL;
}
/* cannot avoid re-wrapping until all wrapping is audited */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
}
void

View File

@ -42,7 +42,7 @@
* Video Memory Mapping section
***************************************************************************/
static pointer
mapVidMem(int ScreenNum,int Flags, unsigned long Base, unsigned long Size)
mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
{
mach_port_t device,iopl_dev;
memory_object_t iopl_mem;

View File

@ -1,8 +1,15 @@
/*******************************************************************************
for Alpha Linux
*******************************************************************************/
/*
* Create a dependency that should be immune from the effect of register
* renaming as is commonly seen in superscalar processors. This should
* insert a minimum of 100-ns delays between reads/writes at clock rates
* up to 100 MHz---GGL
*
* Slowbcopy(char *src, char *dst, int count)
*
*/
#ifdef HAVE_XORG_CONFIG_H
@ -47,3 +54,48 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
while(len--)
*dst++ = *src++;
}
#ifdef __alpha__
#ifdef linux
#define SPARSE (7)
#else
#define SPARSE 0
#endif
void
xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
{
unsigned long addr;
long result;
addr = (unsigned long) src;
while( count ){
result = *(volatile int *) addr;
result >>= ((addr>>SPARSE) & 3) * 8;
*dst++ = (unsigned char) (0xffUL & result);
addr += 1<<SPARSE;
count--;
outb(0x80, 0x00);
}
}
void
xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
{
unsigned long addr;
addr = (unsigned long) dst;
while(count) {
*(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
src++;
addr += 1<<SPARSE;
count--;
outb(0x80, 0x00);
}
}
#endif

View File

@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);

View File

@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo1) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
}
#endif
@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo2) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
}
#endif
@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->TextInfo) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
hwp->Base, TEXT_AMOUNT);
}
#endif
@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
}
#endif /* SAVE_FONT1 */
#if SAVE_FONT2
if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
}
#endif /* SAVE_FONT2 */
#if SAVE_TEXT
if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
xf86SlowBcopy(hwp->Base,
slowbcopy_frombus(hwp->Base,
(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
}
#endif /* SAVE_TEXT */

View File

@ -103,7 +103,7 @@ static void handleStencilModes(struct glCapabilitiesConfig *c, GLint smodes) {
}
static int handleColorAndAccumulation(struct glColorBufCapabilities *c,
GLint cmodes) {
GLint cmodes, int forAccum) {
int offset = 0;
/*1*/
@ -204,8 +204,9 @@ static int handleColorAndAccumulation(struct glColorBufCapabilities *c,
++offset;
}
#if 0
/*
if(forAccum) {
//#if 0
/* FIXME
* Disable this path, because some part of libGL, X, or Xplugin
* doesn't work with sizes greater than 8.
* When this is enabled and visuals are chosen using depths
@ -274,7 +275,8 @@ static int handleColorAndAccumulation(struct glColorBufCapabilities *c,
c[offset].a = 16;
++offset;
}
#endif
}
//#endif
/* FIXME should we handle the floating point color modes, and if so, how? */
@ -284,14 +286,14 @@ static int handleColorAndAccumulation(struct glColorBufCapabilities *c,
static void handleColorModes(struct glCapabilitiesConfig *c, GLint cmodes) {
c->total_color_buffers = handleColorAndAccumulation(c->color_buffers,
cmodes);
cmodes, 0);
assert(c->total_color_buffers < GLCAPS_COLOR_BUFFERS);
}
static void handleAccumulationModes(struct glCapabilitiesConfig *c, GLint cmodes) {
c->total_accum_buffers = handleColorAndAccumulation(c->accum_buffers,
cmodes);
cmodes, 1);
assert(c->total_accum_buffers < GLCAPS_COLOR_BUFFERS);
}

View File

@ -277,7 +277,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
(c-1)->next = NULL;
if (c - visualConfigs != numConfigs) {
FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, c - visualConfigs);
FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, (int)(c - visualConfigs));
}
freeGlCapabilities(&caps);

View File

@ -33,7 +33,6 @@ libXquartz_la_SOURCES = \
quartzAudio.c \
quartzCocoa.m \
quartzKeyboard.c \
quartzPasteboard.c \
quartzStartup.c \
threadSafety.c
@ -50,7 +49,6 @@ EXTRA_DIST = \
quartzAudio.h \
quartzCommon.h \
quartzKeyboard.h \
quartzPasteboard.h \
sanitizedCarbon.h \
sanitizedCocoa.h \
threadSafety.h

View File

@ -184,9 +184,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
}
- (void) activateX:(OSX_BOOL)state {
/* Create a TSM document that supports full Unicode input, and
have it activated while X is active */
static TSMDocumentID x11_document;
size_t i;
DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
if (state) {
@ -195,16 +192,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
bgMouseLocationUpdated = FALSE;
}
DarwinSendDDXEvent(kXquartzActivate, 0);
if (!_x_active) {
if (x11_document == 0) {
OSType types[1];
types[0] = kUnicodeDocument;
NewTSMDocument (1, types, &x11_document, 0);
}
if (x11_document != 0) ActivateTSMDocument (x11_document);
}
} else {
if(darwin_all_modifier_flags)
@ -217,9 +204,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
}
DarwinSendDDXEvent(kXquartzDeactivate, 0);
if (_x_active && x11_document != 0)
DeactivateTSMDocument (x11_document);
}
_x_active = state;
@ -259,23 +243,26 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
if(!for_appkit) {
NSPoint NSlocation = [e locationInWindow];
NSWindow *window = [e window];
NSRect NSframe, NSvisibleFrame;
CGRect CGframe, CGvisibleFrame;
CGPoint CGlocation;
if (window != nil) {
NSRect frame = [window frame];
NSlocation.x += frame.origin.x;
NSlocation.y += frame.origin.y;
}
NSRect NSframe = [[NSScreen mainScreen] frame];
NSRect NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
NSframe = [[NSScreen mainScreen] frame];
NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
CGRect CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
NSframe.size.width, NSframe.size.height);
CGRect CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
NSvisibleFrame.origin.y,
NSvisibleFrame.size.width,
NSvisibleFrame.size.height);
CGPoint CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
if(CGRectContainsPoint(CGframe, CGlocation) &&
!CGRectContainsPoint(CGvisibleFrame, CGlocation))
@ -350,6 +337,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
case NSApplicationActivatedEventType:
for_x = NO;
if ([self modalWindow] == nil) {
BOOL switch_on_activate, ok;
for_appkit = NO;
/* FIXME: hack to avoid having to pass the event to appkit,
@ -360,7 +348,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
BOOL switch_on_activate, ok;
switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
switch_on_activate = YES;
@ -999,7 +986,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
isMouseOrTabletEvent = [e type] == NSLeftMouseDown || [e type] == NSOtherMouseDown || [e type] == NSRightMouseDown ||
[e type] == NSLeftMouseUp || [e type] == NSOtherMouseUp || [e type] == NSRightMouseUp ||
[e type] == NSLeftMouseDragged || [e type] == NSOtherMouseDragged || [e type] == NSRightMouseDragged ||
[e type] == NSMouseMoved || [e type] == NSTabletPoint;
[e type] == NSMouseMoved || [e type] == NSTabletPoint || [e type] == NSScrollWheel;
isTabletEvent = ([e type] == NSTabletPoint) ||
(isMouseOrTabletEvent && ([e subtype] == NSTabletPointEventSubtype || [e subtype] == NSTabletProximityEventSubtype));
@ -1180,6 +1167,17 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
break;
case NSKeyDown: case NSKeyUp:
{
/* XKB clobbers our keymap at startup, so we need to force it on the first keypress.
* TODO: Make this less of a kludge.
*/
static int force_resync_keymap = YES;
if(force_resync_keymap) {
DarwinSendDDXEvent(kXquartzReloadKeymap, 0);
force_resync_keymap = NO;
}
}
if(darwinSyncKeymap) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource();

View File

@ -52,8 +52,6 @@
#include <sys/types.h>
#include <sys/wait.h>
BOOL xquartz_resetenv_display = NO;
@implementation X11Controller
- (void) awakeFromNib
@ -353,7 +351,7 @@ BOOL xquartz_resetenv_display = NO;
newargv[3] = NULL;
s = getenv("DISPLAY");
if (xquartz_resetenv_display || s == NULL || s[0] == 0) {
if (s == NULL || s[0] == 0) {
snprintf(buf, sizeof(buf), ":%s", display);
setenv("DISPLAY", buf, TRUE);
}
@ -632,6 +630,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
- (IBAction)prefs_changed:sender
{
BOOL pbproxy_active;
darwinFakeButtons = [fake_buttons intValue];
quartzUseSysBeep = [use_sysbeep intValue];
X11EnableKeyEquivalents = [enable_keyequivs intValue];
@ -653,7 +653,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
[NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]];
[NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]];
BOOL pbproxy_active = [sync_pasteboard intValue];
pbproxy_active = [sync_pasteboard intValue];
[NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active];
[NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[sync_pasteboard_to_clipboard intValue]];

View File

@ -210,10 +210,7 @@ updateEventMask (WMEventPtr *pHead)
/*ARGSUSED*/
static int
WMFreeClient (data, id)
pointer data;
XID id;
{
WMFreeClient (pointer data, XID id) {
WMEventPtr pEvent;
WMEventPtr *pHead, pCur, pPrev;
@ -237,10 +234,7 @@ WMFreeClient (data, id)
/*ARGSUSED*/
static int
WMFreeEvents (data, id)
pointer data;
XID id;
{
WMFreeEvents (pointer data, XID id) {
WMEventPtr *pHead, pCur, pNext;
pHead = (WMEventPtr *) data;
@ -344,10 +338,7 @@ ProcAppleWMSelectInput (register ClientPtr client)
*/
void
AppleWMSendEvent (type, mask, which, arg)
int type, which, arg;
unsigned int mask;
{
AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
WMEventPtr *pHead, pEvent;
ClientPtr client;
xAppleWMNotifyEvent se;
@ -712,9 +703,7 @@ ProcAppleWMDispatch (
}
static void
SNotifyEvent(from, to)
xAppleWMNotifyEvent *from, *to;
{
SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to) {
to->type = from->type;
to->kind = from->kind;
cpswaps (from->sequenceNumber, to->sequenceNumber);

View File

@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.4.0</string>
<string>2.5.0</string>
<key>CFBundleVersion</key>
<string>2.4.0</string>
<string>2.5.0</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>

View File

@ -67,8 +67,7 @@
#include <IOKit/hidsystem/IOHIDLib.h>
#ifdef MITSHM
#define _XSHM_SERVER_
#include <X11/extensions/XShm.h>
#include "shmint.h"
#endif
#include "darwin.h"
@ -291,8 +290,8 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
#define NAXES 2
// 7 buttons: left, right, middle, then four scroll wheel "buttons"
CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3, 4, 5, 6, 7};
Atom btn_labels[NAXES] = {0};
Atom axes_labels[NBUTTONS] = {0};
Atom btn_labels[NBUTTONS] = {0};
Atom axes_labels[NAXES] = {0};
switch (what) {
case DEVICE_INIT:
@ -341,8 +340,8 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
#define NBUTTONS 3
#define NAXES 5
CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3};
Atom axes_labels[NAXES] = {0};
Atom btn_labels[NBUTTONS] = {0};
Atom axes_labels[NAXES] = {0};
switch (what) {
case DEVICE_INIT:
@ -354,6 +353,9 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X);
axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y);
// Set button map.
InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,

View File

@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
#include "windowstr.h"
#include "pixmapstr.h"
#include "inputstr.h"
#include "eventstr.h"
#include "mi.h"
#include "scrnintstr.h"
#include "mipointer.h"
@ -71,7 +72,7 @@ in this Software without prior written authorization from The Open Group.
#include "applewmExt.h"
/* FIXME: Abstract this better */
void QuartzModeEQInit(void);
extern Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev);
int darwin_all_modifier_flags = 0; // last known modifier state
int darwin_all_modifier_mask = 0;
@ -84,7 +85,7 @@ static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER;
static pthread_t fd_add_tid = NULL;
static EventList *darwinEvents = NULL;
static EventListPtr darwinEvents = NULL;
static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER;
@ -190,89 +191,98 @@ static void DarwinUpdateModifiers(
be moved into their own individual functions and set as handlers using
mieqSetHandler. */
static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) {
int i;
static void DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr dev) {
XQuartzEvent *e = &(ie->xquartz_event);
TA_SERVER();
// DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents);
for (i=0; i<nevents; i++) {
switch(xe[i].u.u.type) {
case kXquartzControllerNotify:
DEBUG_LOG("kXquartzControllerNotify\n");
AppleWMSendEvent(AppleWMControllerNotify,
AppleWMControllerNotifyMask,
xe[i].u.clientMessage.u.l.longs0,
xe[i].u.clientMessage.u.l.longs1);
break;
case kXquartzPasteboardNotify:
DEBUG_LOG("kXquartzPasteboardNotify\n");
AppleWMSendEvent(AppleWMPasteboardNotify,
AppleWMPasteboardNotifyMask,
xe[i].u.clientMessage.u.l.longs0,
xe[i].u.clientMessage.u.l.longs1);
break;
case kXquartzActivate:
DEBUG_LOG("kXquartzActivate\n");
QuartzShow(xe[i].u.keyButtonPointer.rootX,
xe[i].u.keyButtonPointer.rootY);
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsActive, 0);
break;
case kXquartzDeactivate:
DEBUG_LOG("kXquartzDeactivate\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsInactive, 0);
switch(e->subtype) {
case kXquartzControllerNotify:
DEBUG_LOG("kXquartzControllerNotify\n");
AppleWMSendEvent(AppleWMControllerNotify,
AppleWMControllerNotifyMask,
e->data[0],
e->data[1]);
break;
case kXquartzPasteboardNotify:
DEBUG_LOG("kXquartzPasteboardNotify\n");
AppleWMSendEvent(AppleWMPasteboardNotify,
AppleWMPasteboardNotifyMask,
e->data[0],
e->data[1]);
break;
case kXquartzActivate:
DEBUG_LOG("kXquartzActivate\n");
QuartzShow();
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsActive, 0);
break;
case kXquartzDeactivate:
DEBUG_LOG("kXquartzDeactivate\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsInactive, 0);
QuartzHide();
break;
case kXquartzReloadPreferences:
DEBUG_LOG("kXquartzReloadPreferences\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMReloadPreferences, 0);
break;
case kXquartzToggleFullscreen:
DEBUG_LOG("kXquartzToggleFullscreen\n");
if (quartzEnableRootless)
QuartzSetFullscreen(!quartzHasRoot);
else if (quartzHasRoot)
QuartzHide();
break;
else
QuartzShow();
break;
case kXquartzSetRootless:
DEBUG_LOG("kXquartzSetRootless\n");
QuartzSetRootless(e->data[0]);
if (!quartzEnableRootless && !quartzHasRoot)
QuartzHide();
break;
case kXquartzSetRootClip:
QuartzSetRootClip((Bool)e->data[0]);
break;
case kXquartzQuit:
GiveUp(0);
break;
case kXquartzSpaceChanged:
DEBUG_LOG("kXquartzSpaceChanged\n");
QuartzSpaceChanged(e->data[0]);
break;
case kXquartzReloadPreferences:
DEBUG_LOG("kXquartzReloadPreferences\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMReloadPreferences, 0);
break;
case kXquartzToggleFullscreen:
DEBUG_LOG("kXquartzToggleFullscreen\n");
if (quartzEnableRootless)
QuartzSetFullscreen(!quartzHasRoot);
else if (quartzHasRoot)
QuartzHide();
else
QuartzShow(xe[i].u.keyButtonPointer.rootX,
xe[i].u.keyButtonPointer.rootY);
break;
case kXquartzSetRootless:
DEBUG_LOG("kXquartzSetRootless\n");
QuartzSetRootless(xe[i].u.clientMessage.u.l.longs0);
if (!quartzEnableRootless && !quartzHasRoot)
QuartzHide();
break;
case kXquartzSetRootClip:
QuartzSetRootClip((Bool)xe[i].u.clientMessage.u.l.longs0);
break;
case kXquartzQuit:
GiveUp(0);
break;
case kXquartzSpaceChanged:
DEBUG_LOG("kXquartzSpaceChanged\n");
QuartzSpaceChanged(xe[i].u.clientMessage.u.l.longs0);
break;
default:
ErrorF("Unknown application defined event type %d.\n", xe[i].u.u.type);
}
}
case kXquartzListenOnOpenFD:
ErrorF("Calling ListenOnOpenFD() for new fd: %d\n", (int)e->data[0]);
ListenOnOpenFD((int)e->data[0], 1);
break;
case kXquartzReloadKeymap:
DarwinKeyboardReloadHandler();
break;
case kXquartzDisplayChanged:
QuartzUpdateScreens();
break;
default:
if(!QuartzModeEventHandler(screenNum, e, dev))
ErrorF("Unknown application defined event type %d.\n", e->subtype);
}
}
void DarwinListenOnOpenFD(int fd) {
@ -298,16 +308,6 @@ static void DarwinProcessFDAdditionQueue_thread(void *args) {
}
}
static void kXquartzListenOnOpenFDHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) {
size_t i;
TA_SERVER();
for (i=0; i<nevents; i++) {
ErrorF("Calling ListenOnOpenFD() for new fd: %d\n", (int)xe[i].u.clientMessage.u.l.longs0);
ListenOnOpenFD((int)xe[i].u.clientMessage.u.l.longs0, 1);
}
}
Bool DarwinEQInit(void) {
int *p;
@ -320,23 +320,7 @@ Bool DarwinEQInit(void) {
}
mieqInit();
mieqSetHandler(kXquartzReloadKeymap, DarwinKeyboardReloadHandler);
mieqSetHandler(kXquartzActivate, DarwinEventHandler);
mieqSetHandler(kXquartzDeactivate, DarwinEventHandler);
mieqSetHandler(kXquartzReloadPreferences, DarwinEventHandler);
mieqSetHandler(kXquartzSetRootClip, DarwinEventHandler);
mieqSetHandler(kXquartzQuit, DarwinEventHandler);
mieqSetHandler(kXquartzReadPasteboard, QuartzReadPasteboard);
mieqSetHandler(kXquartzWritePasteboard, QuartzWritePasteboard);
mieqSetHandler(kXquartzToggleFullscreen, DarwinEventHandler);
mieqSetHandler(kXquartzSetRootless, DarwinEventHandler);
mieqSetHandler(kXquartzSpaceChanged, DarwinEventHandler);
mieqSetHandler(kXquartzControllerNotify, DarwinEventHandler);
mieqSetHandler(kXquartzPasteboardNotify, DarwinEventHandler);
mieqSetHandler(kXquartzDisplayChanged, QuartzDisplayChangedHandler);
mieqSetHandler(kXquartzListenOnOpenFD, kXquartzListenOnOpenFDHandler);
QuartzModeEQInit();
mieqSetHandler(ET_XQuartz, DarwinEventHandler);
/* Note that this *could* cause a potential async issue, since we're checking
* darwinEvents without holding the lock, but darwinEvents is only ever set
@ -364,16 +348,16 @@ Bool DarwinEQInit(void) {
* Read and process events from the event queue until it is empty.
*/
void ProcessInputEvents(void) {
xEvent xe;
int x = sizeof(xe);
char nullbyte;
int x = sizeof(nullbyte);
TA_SERVER();
mieqProcessInputEvents();
// Empty the signaling pipe
while (x == sizeof(xe)) {
x = read(darwinEventReadFD, &xe, sizeof(xe));
while (x == sizeof(nullbyte)) {
x = read(darwinEventReadFD, &nullbyte, sizeof(nullbyte));
}
}
@ -382,7 +366,7 @@ void ProcessInputEvents(void) {
static void DarwinPokeEQ(void) {
char nullbyte=0;
// <daniels> oh, i ... er ... christ.
write(darwinEventWriteFD, &nullbyte, 1);
write(darwinEventWriteFD, &nullbyte, sizeof(nullbyte));
}
/* Convert from Appkit pointer input values to X input values:
@ -476,7 +460,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
darwinEvents_lock(); {
num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button,
POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, darwinEvents[i].event);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
}
@ -491,7 +475,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
darwinEvents_lock(); {
num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,darwinEvents[i].event);
for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
}
@ -519,7 +503,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
darwinEvents_lock(); {
num_events = GetProximityEvents(darwinEvents, pDev, ev_type,
0, 5, valuators);
for(i=0; i<num_events; i++) mieqEnqueue (pDev,darwinEvents[i].event);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
}
@ -529,13 +513,14 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
void DarwinSendScrollEvents(float count_x, float count_y,
float pointer_x, float pointer_y,
float pressure, float tilt_x, float tilt_y) {
int sign_x, sign_y;
if(!darwinEvents) {
DEBUG_LOG("DarwinSendScrollEvents called before darwinEvents was initialized\n");
return;
}
int sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
int sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
count_x = fabs(count_x);
count_y = fabs(count_y);
@ -566,27 +551,26 @@ void DarwinUpdateModKeys(int flags) {
* Send the X server thread a message by placing it on the event queue.
*/
void DarwinSendDDXEvent(int type, int argc, ...) {
xEvent xe;
INT32 *argv;
int i, max_args;
XQuartzEvent e;
int i;
va_list args;
memset(&xe, 0, sizeof(xe));
xe.u.u.type = type;
xe.u.clientMessage.u.l.type = type;
memset(&e, 0, sizeof(e));
e.header = ET_Internal;
e.type = ET_XQuartz;
e.length = sizeof(e);
e.time = GetTimeInMillis();
e.subtype = type;
argv = &xe.u.clientMessage.u.l.longs0;
max_args = 4;
if (argc > 0 && argc <= max_args) {
if (argc > 0 && argc < XQUARTZ_EVENT_MAXARGS) {
va_start (args, argc);
for (i = 0; i < argc; i++)
argv[i] = (int) va_arg (args, int);
e.data[i] = (uint32_t) va_arg (args, uint32_t);
va_end (args);
}
darwinEvents_lock(); {
mieqEnqueue(NULL, &xe);
mieqEnqueue(NULL, (InternalEvent*)&e);
DarwinPokeEQ();
} darwinEvents_unlock();
}

View File

@ -45,17 +45,14 @@ void DarwinUpdateModKeys(int flags);
void DarwinListenOnOpenFD(int fd);
/*
* Special ddx events understood by the X server
* Subtypes for the ET_XQuartz event type
*/
enum {
kXquartzReloadKeymap // Reload system keymap
= LASTEvent+1, // (from X.h list of event names)
kXquartzReloadKeymap, // Reload system keymap
kXquartzActivate, // restore X drawing and cursor
kXquartzDeactivate, // clip X drawing and switch to Aqua cursor
kXquartzSetRootClip, // enable or disable drawing to the X screen
kXquartzQuit, // kill the X server and release the display
kXquartzReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
kXquartzWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
kXquartzBringAllToFront, // bring all X windows to front
kXquartzToggleFullscreen, // Enable/Disable fullscreen mode
kXquartzSetRootless, // Set rootless mode

View File

@ -62,8 +62,6 @@ void DarwinListenOnOpenFD(int fd);
extern int noPanoramiXExtension;
extern int xquartz_resetenv_display;
#define DEFAULT_CLIENT X11BINDIR "/xterm"
#define DEFAULT_STARTX X11BINDIR "/startx"
#define DEFAULT_SHELL "/bin/sh"
@ -80,7 +78,8 @@ const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Bui
char __crashreporter_info__buf[4096];
char *__crashreporter_info__ = __crashreporter_info__buf;
static char *server_bootstrap_name = LAUNCHD_ID_PREFIX".X11";
static char *launchd_id_prefix = NULL;
static char *server_bootstrap_name = NULL;
#define DEBUG 1
@ -149,15 +148,17 @@ static int accept_fd_handoff(int connected_fd) {
char databuf[] = "display";
struct iovec iov[1];
iov[0].iov_base = databuf;
iov[0].iov_len = sizeof(databuf);
union {
struct cmsghdr hdr;
char bytes[CMSG_SPACE(sizeof(int))];
} buf;
struct msghdr msg;
struct cmsghdr *cmsg;
iov[0].iov_base = databuf;
iov[0].iov_len = sizeof(databuf);
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_control = buf.bytes;
@ -166,7 +167,7 @@ static int accept_fd_handoff(int connected_fd) {
msg.msg_namelen = 0;
msg.msg_flags = 0;
struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
cmsg = CMSG_FIRSTHDR (&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@ -197,6 +198,7 @@ static void socket_handoff_thread(void *arg) {
socket_handoff_t *handoff_data = (socket_handoff_t *)arg;
int launchd_fd = -1;
int connected_fd;
unsigned remain;
/* Now actually get the passed file descriptor from this connection
* If we encounter an error, keep listening.
@ -229,7 +231,7 @@ static void socket_handoff_thread(void *arg) {
* into it.
*/
unsigned remain = 3000000;
remain = 3000000;
fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
while((remain = usleep(remain)) > 0);
@ -298,6 +300,7 @@ kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename)
handoff_data->fd = create_socket(handoff_data->filename);
if(!handoff_data->fd) {
free(handoff_data);
return KERN_FAILURE;
}
@ -425,9 +428,6 @@ static int startup_trigger(int argc, char **argv, char **envp) {
if((s = getenv("DISPLAY"))) {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
unsetenv("DISPLAY");
/* This tells X11Controller to not use the environment's DISPLAY and reset it based on the server's display */
xquartz_resetenv_display = 1;
} else {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
}
@ -453,6 +453,7 @@ static void setup_env(void) {
char *temp;
const char *pds = NULL;
const char *disp = getenv("DISPLAY");
size_t len;
/* Pass on our prefs domain to startx and its inheritors (mainly for
* quartz-wm and the Xquartz stub's MachIPC)
@ -462,45 +463,56 @@ static void setup_env(void) {
CFStringRef pd = CFBundleGetIdentifier(bundle);
if(pd) {
pds = CFStringGetCStringPtr(pd, 0);
if(pds) {
server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
strcpy(server_bootstrap_name, pds);
setenv("X11_PREFS_DOMAIN", pds, 1);
}
}
}
/* fallback to hardcoded value if we can't discover it */
if(!pds) {
pds = LAUNCHD_ID_PREFIX".X11";
}
server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
if(!server_bootstrap_name) {
fprintf(stderr, "Memory allocation error.\n");
exit(1);
}
strcpy(server_bootstrap_name, pds);
setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1);
len = strlen(server_bootstrap_name);
launchd_id_prefix = malloc(sizeof(char) * (len - 3));
if(!launchd_id_prefix) {
fprintf(stderr, "Memory allocation error.\n");
exit(1);
}
strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
/* We need to unset DISPLAY if it is not our socket */
if(disp) {
if(!pds) {
/* If we can't detet our id, we are beyond hope and need to just
* revert to the non-launchd startup */
unsetenv("DISPLAY");
} else {
/* s = basename(disp) */
const char *d, *s;
/* s = basename(disp) */
const char *d, *s;
for(s = NULL, d = disp; *d; d++) {
if(*d == '/')
s = d + 1;
if(*d == '/')
s = d + 1;
}
if(s && *s) {
temp = (char *)malloc(sizeof(char) * len);
if(!temp) {
fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
exit(1);
}
if(s && *s) {
size_t pds_len = strlen(pds);
temp = (char *)malloc(sizeof(char) * pds_len);
if(!temp) {
fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
}
strlcpy(temp, pds, pds_len - 3);
strlcat(temp, ":0", pds_len);
if(strcmp(temp, s) != 0) {
/* If we don't have a match, unset it. */
unsetenv("DISPLAY");
}
free(temp);
} else {
/* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */
strlcpy(temp, launchd_id_prefix, len);
strlcat(temp, ":0", len);
if(strcmp(temp, s) != 0) {
/* If we don't have a match, unset it. */
unsetenv("DISPLAY");
}
free(temp);
} else {
/* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */
unsetenv("DISPLAY");
}
}
@ -626,11 +638,11 @@ static char *command_from_prefs(const char *key, const char *default_value) {
if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
int len = strlen(default_value) + 1;
CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
int len = strlen(default_value) + 1;
command = (char *)malloc(len * sizeof(char));
if(!command)
return NULL;

View File

@ -36,7 +36,7 @@
#include "launchd_fd.h"
int launchd_display_fd() {
int launchd_display_fd(void) {
launch_data_t sockets_dict, checkin_request, checkin_response;
launch_data_t listening_fd_array, listening_fd;

View File

@ -69,13 +69,12 @@ static char x11_path[PATH_MAX + 1];
static pid_t x11app_pid = 0;
static void set_x11_path() {
static void set_x11_path(void) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
CFURLRef appURL = NULL;
CFBundleRef bundle = NULL;
OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
UInt32 ver;
switch (osstatus) {
case noErr:
@ -96,20 +95,6 @@ static void set_x11_path() {
exit(3);
}
ver = CFBundleGetVersionNumber(bundle);
if( !(ver >= 0x02308000 || (ver >= 0x02168000 && ver < 0x02208000))) {
CFStringRef versionStr = CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey);
const char * versionCStr = "Unknown";
if(versionStr)
versionCStr = CFStringGetCStringPtr(versionStr, kCFStringEncodingMacRoman);
fprintf(stderr, "Xquartz: Could not find a new enough X11.app LSFindApplicationForInfo() returned\n");
fprintf(stderr, " X11.app = %s\n", x11_path);
fprintf(stderr, " Version = %s (%x), Expected Version > 2.3.0 or 2.1.6\n", versionCStr, (unsigned)ver);
exit(9);
}
strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path));
#ifdef DEBUG
fprintf(stderr, "Xquartz: X11.app = %s\n", x11_path);
@ -162,15 +147,17 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
char databuf[] = "display";
struct iovec iov[1];
iov[0].iov_base = databuf;
iov[0].iov_len = sizeof(databuf);
union {
struct cmsghdr hdr;
char bytes[CMSG_SPACE(sizeof(int))];
} buf;
struct msghdr msg;
struct cmsghdr *cmsg;
iov[0].iov_base = databuf;
iov[0].iov_len = sizeof(databuf);
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_control = buf.bytes;
@ -179,7 +166,7 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
msg.msg_namelen = 0;
msg.msg_flags = 0;
struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
cmsg = CMSG_FIRSTHDR (&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@ -218,7 +205,7 @@ int main(int argc, char **argv, char **envp) {
sig_t handler;
if(argc == 2 && !strcmp(argv[1], "-version")) {
fprintf(stderr, "X.org Release 7.4\n");
fprintf(stderr, "X.org Release 7.5\n");
fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
return EXIT_SUCCESS;
@ -245,10 +232,11 @@ int main(int argc, char **argv, char **envp) {
kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr != KERN_SUCCESS) {
pid_t child;
set_x11_path();
/* This forking is ugly and will be cleaned up later */
pid_t child = fork();
child = fork();
if(child == -1) {
fprintf(stderr, "Xquartz: Could not fork: %s\n", strerror(errno));
return EXIT_FAILURE;

View File

@ -231,7 +231,7 @@ RREditConnectionInfo (ScreenPtr pScreen)
}
#endif
static void QuartzUpdateScreens(void) {
void QuartzUpdateScreens(void) {
ScreenPtr pScreen;
WindowPtr pRoot;
int x, y, width, height, sx, sy;
@ -299,14 +299,6 @@ static void QuartzUpdateScreens(void) {
#endif
}
/*
* QuartzDisplayChangeHandler
* Adjust for screen arrangement changes.
*/
void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) {
QuartzUpdateScreens();
}
void QuartzSetFullscreen(Bool state) {
DEBUG_LOG("QuartzSetFullscreen: state=%d\n", state);
@ -374,10 +366,7 @@ void QuartzSetRootless(Bool state) {
* Calls mode specific screen resume to restore the X clip regions
* (if needed) and the X server cursor state.
*/
void QuartzShow(
int x, // cursor location
int y )
{
void QuartzShow(void) {
int i;
if (quartzServerVisible)
@ -386,7 +375,7 @@ void QuartzShow(
quartzServerVisible = TRUE;
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
quartzProcs->ResumeScreen(screenInfo.screens[i]);
}
}

View File

@ -33,8 +33,6 @@
#ifndef _QUARTZ_H
#define _QUARTZ_H
#include "quartzPasteboard.h"
#include "screenint.h"
#include "window.h"
@ -59,7 +57,7 @@ typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
* Suspend and resume X11 activity
*/
typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
typedef void (*ResumeScreenProc)(ScreenPtr pScreen);
/*
* Screen state change support
@ -123,13 +121,15 @@ void QuartzInitInput(int argc, char **argv);
void QuartzInitServer(int argc, char **argv, char **envp);
void QuartzGiveUp(void);
void QuartzProcessEvent(xEvent *xe);
void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents);
void QuartzUpdateScreens(void);
void QuartzShow(int x, int y); // (x, y) = cursor loc
void QuartzShow(void);
void QuartzHide(void);
void QuartzSetRootClip(BOOL enable);
void QuartzSpaceChanged(uint32_t space_id);
void QuartzSetFullscreen(Bool state);
void QuartzSetRootless(Bool state);
int server_main(int argc, char **argv, char **envp);
#endif

View File

@ -311,8 +311,10 @@ void QuartzAudioInit(void)
// Prepare for playback
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
{
AudioDeviceIOProcID sInputIOProcID = NULL;
status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID );
}
#else
status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
#endif

View File

@ -40,66 +40,9 @@
#include "quartzCommon.h"
#include "inputstr.h"
#include "quartzPasteboard.h"
#include "darwin.h"
/*
* QuartzWriteCocoaPasteboard
* Write text to the Mac OS X pasteboard.
*/
void QuartzWriteCocoaPasteboard(
char *text)
{
NSPasteboard *pasteboard;
NSArray *pasteboardTypes;
NSString *string;
if (! text) return;
pasteboard = [NSPasteboard generalPasteboard];
if (! pasteboard) return;
string = [NSString stringWithCString:text];
if (! string) return;
pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
// nil owner because we don't provide type translations
[pasteboard declareTypes:pasteboardTypes owner:nil];
[pasteboard setString:string forType:NSStringPboardType];
}
/*
* QuartzReadCocoaPasteboard
* Read text from the Mac OS X pasteboard and return it as a heap string.
* The caller must free the string.
*/
char *QuartzReadCocoaPasteboard(void)
{
NSPasteboard *pasteboard;
NSArray *pasteboardTypes;
NSString *existingType;
char *text = NULL;
pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
pasteboard = [NSPasteboard generalPasteboard];
if (! pasteboard) return NULL;
existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
if (existingType) {
NSString *string = [pasteboard stringForType:existingType];
char *buffer;
if (! string) return NULL;
buffer = (char *) [string UTF8String];
text = (char *) malloc(strlen(buffer)+1);
if (text)
strcpy(text, buffer);
}
return text;
}
/*
* QuartzFSUseQDCursor
* Return whether the screen should use a QuickDraw cursor.

View File

@ -251,6 +251,10 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
break;
case XK_Mode_switch:
info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
#ifdef NX_MODIFIERKEY_RALTERNATE
info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
#endif
info->modMap[MIN_KEYCODE + i] = Mod1Mask;
break;
@ -275,36 +279,6 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
}
}
/*
* DarwinLoadKeyboardMapping
* Load the keyboard map from a file or system and convert
* it to an equivalent X keyboard map and modifier map.
*/
static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) {
DarwinBuildModifierMaps(&keyInfo);
keySyms->map = keyInfo.keyMap;
keySyms->mapWidth = GLYPHS_PER_KEY;
keySyms->minKeyCode = MIN_KEYCODE;
keySyms->maxKeyCode = MAX_KEYCODE;
}
/*
* DarwinKeyboardSetDeviceKeyMap
* Load a keymap into the keyboard device
*/
static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) {
DeviceIntPtr pDev;
pthread_mutex_lock(&keyInfo_mutex);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
XkbApplyMappingChange(pDev, keySyms, keySyms->minKeyCode,
keySyms->maxKeyCode - keySyms->minKeyCode + 1,
modmap, serverClient);
pthread_mutex_unlock(&keyInfo_mutex);
}
/*
* DarwinKeyboardInit
* Get the Darwin keyboard map and compute an equivalent
@ -312,64 +286,117 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) {
* device structure.
*/
void DarwinKeyboardInit(DeviceIntPtr pDev) {
KeySymsRec keySyms;
XkbComponentNamesRec names;
CFIndex value;
BOOL ok;
// Open a shared connection to the HID System.
// Note that the Event Status Driver is really just a wrapper
// for a kIOHIDParamConnectType connection.
assert(darwinParamConnect = NXOpenEventStatus());
bzero(&names, sizeof(names));
/* We need to really have rules... or something... */
//XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
pthread_mutex_lock(&keyInfo_mutex);
DarwinLoadKeyboardMapping(&keySyms);
DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap);
pthread_mutex_unlock(&keyInfo_mutex);
/* Get our key repeat settings from GlobalPreferences */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
value = CFPreferencesGetAppIntegerValue(CFSTR("InitialKeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
value = 35;
if(value == 300000) { // off
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
} else {
pDev->key->xkbInfo->desc->ctrls->repeat_delay = value * 15;
value = CFPreferencesGetAppIntegerValue(CFSTR("KeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
value = 6;
pDev->key->xkbInfo->desc->ctrls->repeat_interval = value * 15;
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
}
DarwinKeyboardReloadHandler();
CopyKeyClass(pDev, inputInfo.keyboard);
}
void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr pDev, int nevents) {
/* Set the repeat rates based on global preferences and keycodes for modifiers.
* Precondition: Has the keyInfo_mutex lock.
*/
static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, int initialKeyRepeatValue, int keyRepeatValue) {
if(initialKeyRepeatValue == 300000) { // off
/* Turn off repeats globally */
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
} else {
int i;
XkbControlsPtr ctrl;
XkbControlsRec old;
/* Turn on repeats globally */
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
/* Setup the bit mask for individual key repeats */
ctrl = pDev->key->xkbInfo->desc->ctrls;
old= *ctrl;
ctrl->repeat_delay = initialKeyRepeatValue * 15;
ctrl->repeat_interval = keyRepeatValue * 15;
/* Turn off key-repeat for modifier keys, on for others */
/* First set them all on */
for(i=0; i < XkbPerKeyBitArraySize; i++)
ctrl->per_key_repeat[i] = -1;
/* Now turn off the modifiers */
for(i=0; i < 32; i++) {
unsigned char keycode;
keycode = keyInfo.modifierKeycodes[i][0];
if(keycode)
ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
keycode = keyInfo.modifierKeycodes[i][1];
if(keycode)
ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
}
/* Hurray for data duplication */
if (pDev->kbdfeed)
memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize);
//fprintf(stderr, "per_key_repeat =\n");
//for(i=0; i < XkbPerKeyBitArraySize; i++)
// fprintf(stderr, "%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n");
/* And now we notify the puppies about the changes */
XkbDDXChangeControls(pDev, &old, ctrl);
}
}
void DarwinKeyboardReloadHandler(void) {
KeySymsRec keySyms;
CFIndex initialKeyRepeatValue, keyRepeatValue;
BOOL ok;
DeviceIntPtr pDev = darwinKeyboard;
DEBUG_LOG("DarwinKeyboardReloadHandler\n");
// if (pDev->key) {
// if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map);
// xfree(pDev->key);
// }
/* Get our key repeat settings from GlobalPreferences */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
pthread_mutex_lock(&keyInfo_mutex);
DarwinLoadKeyboardMapping(&keySyms);
DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap);
pthread_mutex_unlock(&keyInfo_mutex);
initialKeyRepeatValue = CFPreferencesGetAppIntegerValue(CFSTR("InitialKeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
initialKeyRepeatValue = 35;
keyRepeatValue = CFPreferencesGetAppIntegerValue(CFSTR("KeyRepeat"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
keyRepeatValue = 6;
pthread_mutex_lock(&keyInfo_mutex); {
/* Initialize our keySyms */
DarwinBuildModifierMaps(&keyInfo);
keySyms.map = keyInfo.keyMap;
keySyms.mapWidth = GLYPHS_PER_KEY;
keySyms.minKeyCode = MIN_KEYCODE;
keySyms.maxKeyCode = MAX_KEYCODE;
/* Apply the mappings to darwinKeyboard */
XkbApplyMappingChange(darwinKeyboard, &keySyms, keySyms.minKeyCode,
keySyms.maxKeyCode - keySyms.minKeyCode + 1,
keyInfo.modMap, serverClient);
DarwinKeyboardSetRepeat(darwinKeyboard, initialKeyRepeatValue, keyRepeatValue);
/* Apply the mappings to the core keyboard */
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
XkbApplyMappingChange(pDev, &keySyms, keySyms.minKeyCode,
keySyms.maxKeyCode - keySyms.minKeyCode + 1,
keyInfo.modMap, serverClient);
DarwinKeyboardSetRepeat(pDev, initialKeyRepeatValue, keyRepeatValue);
}
}
} pthread_mutex_unlock(&keyInfo_mutex);
}
//-----------------------------------------------------------------------------

View File

@ -53,7 +53,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info);
/* Provided for darwinEvents.c */
extern darwinKeyboardInfo keyInfo;
extern pthread_mutex_t keyInfo_mutex;
void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents);
void DarwinKeyboardReloadHandler(void);
int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
int DarwinModifierNXKeyToNXKeycode(int key, int side);
int DarwinModifierNXKeyToNXMask(int key);

View File

@ -1,147 +0,0 @@
/**************************************************************
* quartzPasteboard.c
*
* Aqua pasteboard <-> X cut buffer
* Greg Parker gparker@cs.stanford.edu March 8, 2001
**************************************************************/
/*
* Copyright (c) 2001 Greg Parker. 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
* 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "misc.h"
#include "inputstr.h"
#include "quartzPasteboard.h"
#include <X11/Xatom.h>
#include "windowstr.h"
#include "propertyst.h"
#include "scrnintstr.h"
#include "selection.h"
#include "globals.h"
// Helper function to read the X11 cut buffer
// FIXME: What about multiple screens? Currently, this reads the first
// CUT_BUFFER0 from the first screen where the buffer content is a string.
// Returns a string on the heap that the caller must free.
// Returns NULL if there is no cut text or there is not enough memory.
static char * QuartzReadCutBuffer(void)
{
int rc, i;
char *text = NULL;
for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i];
PropertyPtr pProp;
rc = dixLookupProperty(&pProp, WindowTable[pScreen->myNum],
XA_CUT_BUFFER0, serverClient, DixReadAccess);
if (rc != Success) continue;
if (pProp->type != XA_STRING) continue;
if (pProp->format != 8) continue;
text = xalloc(1 + pProp->size);
if (! text) continue;
memcpy(text, pProp->data, pProp->size);
text[pProp->size] = '\0';
return text;
}
// didn't find any text
return NULL;
}
// Write X cut buffer to Mac OS X pasteboard
// Called by mieqProcessInputEvents() in response to request from X server thread.
void QuartzWritePasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
{
char *text;
text = QuartzReadCutBuffer();
if (text) {
QuartzWriteCocoaPasteboard(text);
free(text);
}
}
#define strequal(a, b) (0 == strcmp((a), (b)))
// Read Mac OS X pasteboard into X cut buffer
// Called by mieqProcessInputEvents() in response to request from X server thread.
void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
{
char *oldText = QuartzReadCutBuffer();
char *text = QuartzReadCocoaPasteboard();
// Compare text with current cut buffer contents.
// Change the buffer if both exist and are different
// OR if there is new text but no old text.
// Otherwise, don't clear the selection unnecessarily.
if ((text && oldText && !strequal(text, oldText)) ||
(text && !oldText)) {
int scrn, rc;
Selection *pSel;
for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
ScreenPtr pScreen = screenInfo.screens[scrn];
// Set the cut buffers on each screen
// fixme really on each screen?
dixChangeWindowProperty(serverClient, WindowTable[pScreen->myNum],
XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
strlen(text), (pointer)text, TRUE);
}
// Undo any current X selection (similar to code in dispatch.c)
// FIXME: what about secondary selection?
// FIXME: only touch first XA_PRIMARY selection?
rc = dixLookupSelection(&pSel, XA_PRIMARY, serverClient,
DixSetAttrAccess);
if (rc == Success) {
// Notify client if necessary
if (pSel->client) {
xEvent event;
event.u.u.type = SelectionClear;
event.u.selectionClear.time = GetTimeInMillis();
event.u.selectionClear.window = pSel->window;
event.u.selectionClear.atom = pSel->selection;
TryClientEvents(pSel->client, dev, &event, 1, NoEventMask,
NoEventMask /*CantBeFiltered*/, NullGrab);
}
// Erase it
pSel->pWin = NullWindow;
pSel->window = None;
pSel->client = NullClient;
}
}
if (text) free(text);
if (oldText) free(oldText);
}

View File

@ -1,44 +0,0 @@
/*
QuartzPasteboard.h
Mac OS X pasteboard <-> X cut buffer
Greg Parker gparker@cs.stanford.edu March 8, 2001
*/
/*
* Copyright (c) 2001 Greg Parker. 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
* 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifndef _QUARTZPASTEBOARD_H
#define _QUARTZPASTEBOARD_H
// Aqua->X
void QuartzReadPasteboard(int, xEventPtr, DeviceIntPtr, int);
char * QuartzReadCocoaPasteboard(void); // caller must free string
// X->Aqua
void QuartzWritePasteboard(int, xEventPtr, DeviceIntPtr, int);
void QuartzWriteCocoaPasteboard(char *text);
#endif /* _QUARTZPASTEBOARD_H */

View File

@ -255,10 +255,10 @@ ProcAppleDRIDestroySurface(
register ClientPtr client
)
{
int rc;
REQUEST(xAppleDRIDestroySurfaceReq);
DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
int rc;
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
DixReadAccess);

View File

@ -72,7 +72,7 @@ X_PFX (cvt_vptr_to_uint) (void * val) __attribute__((always_inline));
static __inline__ void *
X_PFX (cvt_uint_to_vptr) (unsigned int val)
{
return (void*)((size_t)(val));
return (void*)((unsigned long)(val));
}
static __inline__ unsigned int

View File

@ -45,7 +45,7 @@ void xprHideWindows(Bool hide);
Bool QuartzInitCursor(ScreenPtr pScreen);
void QuartzSuspendXCursor(ScreenPtr pScreen);
void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
void QuartzResumeXCursor(ScreenPtr pScreen);
/* If we are rooted, we need the root window and desktop levels to be below
* the menubar (24) but above native windows. Normal window level is 0.

View File

@ -392,7 +392,7 @@ QuartzSuspendXCursor(ScreenPtr pScreen)
* X server is showing. Restore the X cursor.
*/
void
QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
QuartzResumeXCursor(ScreenPtr pScreen)
{
WindowPtr pWin;
CursorPtr pCursor;
@ -407,5 +407,5 @@ QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
if (pCursor == NULL)
return;
QuartzSetCursor(darwinPointer, pScreen, pCursor, x, y);
QuartzSetCursor(darwinPointer, pScreen, pCursor, /* x */ 0, /* y */ 0);
}

View File

@ -39,6 +39,7 @@
#include "windowstr.h"
#include "pixmapstr.h"
#include "inputstr.h"
#include "eventstr.h"
#include "mi.h"
#include "scrnintstr.h"
#include "mipointer.h"
@ -55,36 +56,26 @@
#include "rootlessWindow.h"
#include "xprEvent.h"
static void xprEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) {
int i;
Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) {
TA_SERVER();
DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents);
for (i=0; i<nevents; i++) {
switch(xe[i].u.u.type) {
case kXquartzWindowState:
DEBUG_LOG("kXquartzWindowState\n");
RootlessNativeWindowStateChanged(xprGetXWindow(xe[i].u.clientMessage.u.l.longs0),
xe[i].u.clientMessage.u.l.longs1);
break;
case kXquartzWindowMoved:
DEBUG_LOG("kXquartzWindowMoved\n");
RootlessNativeWindowMoved(xprGetXWindow(xe[i].u.clientMessage.u.l.longs0));
break;
case kXquartzBringAllToFront:
DEBUG_LOG("kXquartzBringAllToFront\n");
RootlessOrderAllWindows();
break;
}
switch(e->subtype) {
case kXquartzWindowState:
DEBUG_LOG("kXquartzWindowState\n");
RootlessNativeWindowStateChanged(xprGetXWindow(e->data[0]),
e->data[1]);
return TRUE;
case kXquartzWindowMoved:
DEBUG_LOG("kXquartzWindowMoved\n");
RootlessNativeWindowMoved(xprGetXWindow(e->data[0]));
return TRUE;
case kXquartzBringAllToFront:
DEBUG_LOG("kXquartzBringAllToFront\n");
RootlessOrderAllWindows();
return TRUE;
default:
return FALSE;
}
}
void QuartzModeEQInit(void) {
mieqSetHandler(kXquartzWindowState, xprEventHandler);
mieqSetHandler(kXquartzWindowMoved, xprEventHandler);
mieqSetHandler(kXquartzBringAllToFront, xprEventHandler);
}

View File

@ -29,6 +29,6 @@
#ifndef __XPR_EVENT_H__
#define __XPR_EVENT_H__
void QuartzModeEQInit(void);
Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev);
#endif

View File

@ -83,6 +83,8 @@ static void xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
int shift_x, int shift_y);
static void xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin);
static Bool xprDoReorderWindow(RootlessWindowPtr pFrame);
static void xprHideWindow(RootlessFrameID wid);
static void xprUpdateColormap(RootlessFrameID wid, ScreenPtr pScreen);
static void xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
int dx, int dy);
@ -117,6 +119,11 @@ xprSetNativeProperty(RootlessWindowPtr pFrame)
}
}
static xp_error
xprColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors)
{
return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch);
}
/*
* Create and display a new frame.
@ -142,7 +149,7 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
if (pWin->drawable.depth == 8)
{
wc.depth = XP_DEPTH_INDEX8;
wc.colormap = RootlessColormapCallback;
wc.colormap = xprColormapCallback;
wc.colormap_data = pScreen;
mask |= XP_COLORMAP;
}
@ -215,10 +222,10 @@ xprDestroyFrame(RootlessFrameID wid)
static void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{
TA_SERVER();
xp_window_changes wc;
TA_SERVER();
wc.x = newX;
wc.y = newY;
// ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
@ -272,7 +279,7 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
}
if(window_hash) {
RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr((xp_window_id)wid), NULL);
RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, wid, NULL);
if(winRec) {
if(quartzEnableRootless)
@ -447,6 +454,8 @@ static RootlessFrameProcsRec xprRootlessProcs = {
xprDamageRects,
xprSwitchWindow,
xprDoReorderWindow,
xprHideWindow,
xprUpdateColormap,
xp_copy_bytes,
xp_fill_bytes,
xp_composite_pixels,
@ -566,8 +575,8 @@ xprHideWindows(Bool hide)
TA_SERVER();
for (screen = 0; screen < screenInfo.numScreens; screen++) {
pRoot = WindowTable[screenInfo.screens[screen]->myNum];
RootlessFrameID prevWid = NULL;
pRoot = WindowTable[screenInfo.screens[screen]->myNum];
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
RootlessWindowRec *winRec = WINREC(pWin);
@ -593,3 +602,39 @@ xprHideWindows(Bool hide)
}
}
}
// XXX: identical to x_cvt_vptr_to_uint ?
#define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x)))
Bool no_configure_window;
static inline int
configure_window (xp_window_id id, unsigned int mask,
const xp_window_changes *values)
{
if (!no_configure_window)
return xp_configure_window (id, mask, values);
else
return XP_Success;
}
static
void xprUpdateColormap(RootlessFrameID wid, ScreenPtr pScreen)
{
/* This is how we tell xp that the colormap may have changed. */
xp_window_changes wc;
wc.colormap = xprColormapCallback;
wc.colormap_data = pScreen;
configure_window(MAKE_WINDOW_ID(wid), XP_COLORMAP, &wc);
}
static
void xprHideWindow(RootlessFrameID wid)
{
xp_window_changes wc;
wc.stack_mode = XP_UNMAPPED;
wc.sibling = 0;
configure_window(MAKE_WINDOW_ID(wid), XP_STACKING, &wc);
}

View File

@ -317,11 +317,11 @@ xprAddScreen(int index, ScreenPtr pScreen)
if (noPseudoramiXExtension)
{
ErrorF("Warning: noPseudoramiXExtension!\n");
CGDirectDisplayID dpy;
CGRect frame;
ErrorF("Warning: noPseudoramiXExtension!\n");
dpy = displayAtIndex(index);
frame = displayScreenBounds(dpy);

View File

@ -58,8 +58,10 @@ winMWExtWMProcs = {
winMWExtWMDamageRects,
#endif
winMWExtWMRootlessSwitchWindow,
NULL,//winWMExtWMDoReorderWindow,
NULL,//winMWExtWMDoReorderWindow,
NULL,//winMWExtWMHideWindow,
NULL,//winMWExtWMUpdateColorMap,
NULL,//winMWExtWMCopyBytes,
NULL,//winMWExtWMFillBytes,
NULL,//winMWExtWMCompositePixels,

View File

@ -179,4 +179,9 @@ extern _X_EXPORT int IsMapInstalled(
Colormap /*map*/,
WindowPtr /*pWin*/);
extern _X_EXPORT Bool ResizeVisualArray(
ScreenPtr /* pScreen */,
int /* new_vis_count */,
DepthPtr /* depth */);
#endif /* CMAP_H */

View File

@ -592,6 +592,7 @@ extern Bool IsKeyboardDevice(DeviceIntPtr dev);
extern Bool IsPointerEvent(InternalEvent *event);
extern Bool IsMaster(DeviceIntPtr dev);
extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what);

View File

@ -30,6 +30,9 @@ typedef struct _DeviceChangedEvent DeviceChangedEvent;
typedef struct _DGAEvent DGAEvent;
#endif
typedef struct _RawDeviceEvent RawDeviceEvent;
#ifdef XQUARTZ
typedef struct _XQuartzEvent XQuartzEvent;
#endif
typedef union _InternalEvent InternalEvent;
#endif

View File

@ -66,6 +66,9 @@ enum EventType {
ET_RawButtonPress,
ET_RawButtonRelease,
ET_RawMotion,
#ifdef XQUARTZ
ET_XQuartz,
#endif
ET_Internal = 0xFF /* First byte */
};
@ -210,6 +213,18 @@ struct _RawDeviceEvent
} valuators;
};
#ifdef XQUARTZ
#define XQUARTZ_EVENT_MAXARGS 5
struct _XQuartzEvent {
unsigned char header; /**< Always ET_Internal */
enum EventType type; /**< Always ET_XQuartz */
int length; /**< Length in bytes */
Time time; /**< Time in ms. */
int subtype; /**< Subtype defined by XQuartz DDX */
uint32_t data[XQUARTZ_EVENT_MAXARGS]; /**< Up to 5 32bit values passed to handler */
};
#endif
/**
* Event type used inside the X server for input event
* processing.
@ -227,6 +242,9 @@ union _InternalEvent {
DGAEvent dga_event;
#endif
RawDeviceEvent raw_event;
#ifdef XQUARTZ
XQuartzEvent xquartz_event;
#endif
};
#endif

View File

@ -323,7 +323,8 @@ CopyGetMasterEvent(DeviceIntPtr sdev,
CHECKEVENT(original);
if (!sdev->u.master)
/* ET_XQuartz has sdev == NULL */
if (!sdev || !sdev->u.master)
return NULL;
switch(original->any.type)

View File

@ -518,6 +518,14 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
REGION_DESTROY( pWin->drawable.pScreen, exposures);
}
#ifdef ROOTLESS
/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */
void RootlessSetPixmapOfAncestors(WindowPtr pWin);
void RootlessStartDrawing(WindowPtr pWin);
void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
Bool IsFramedWindow(WindowPtr pWin);
#endif
void
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
{
@ -543,6 +551,19 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
Bool solid = TRUE;
DrawablePtr drawable = &pWin->drawable;
#ifdef ROOTLESS
if(IsFramedWindow(pWin)) {
RootlessStartDrawing(pWin);
RootlessDamageRegion(pWin, prgn);
if(pWin->backgroundState == ParentRelative) {
if((what == PW_BACKGROUND) ||
(what == PW_BORDER && !pWin->borderIsPixel))
RootlessSetPixmapOfAncestors(pWin);
}
}
#endif
if (what == PW_BACKGROUND)
{
while (pWin->backgroundState == ParentRelative)

View File

@ -55,6 +55,18 @@ SOFTWARE.
#ifdef HAVE_DMX_CONFIG_H
#include <dmx-config.h>
#undef MULTIBUFFER
#undef XV
#undef DBE
#undef XF86VIDMODE
#undef XFreeXDGA
#undef XF86DRI
#undef SCREENSAVER
#undef RANDR
#undef XFIXES
#undef DAMAGE
#undef COMPOSITE
#undef MITSHM
#endif
#ifdef HAVE_XNEST_CONFIG_H

View File

@ -1,3 +1,4 @@
/***********************************************************
Copyright 1987, 1998 The Open Group

View File

@ -351,6 +351,13 @@ typedef void (*RootlessCopyWindowProc)
(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
int dx, int dy);
typedef void (*RootlessHideWindowProc)
(RootlessFrameID wid);
typedef void (*RootlessUpdateColormapProc)
(RootlessFrameID wid, ScreenPtr pScreen);
/*
* Rootless implementation function list
*/
@ -374,6 +381,8 @@ typedef struct _RootlessFrameProcs {
/* Optional frame functions */
RootlessSwitchWindowProc SwitchWindow;
RootlessDoReorderWindowProc DoReorderWindow;
RootlessHideWindowProc HideWindow;
RootlessUpdateColormapProc UpdateColormap;
/* Optional acceleration functions */
RootlessCopyBytesProc CopyBytes;

View File

@ -146,6 +146,7 @@ void RootlessStartDrawing(WindowPtr pWindow)
ScreenPtr pScreen = pWindow->drawable.pScreen;
WindowPtr top = TopLevelParent(pWindow);
RootlessWindowRec *winRec;
PixmapPtr curPixmap;
if (top == NULL)
return;
@ -172,7 +173,7 @@ void RootlessStartDrawing(WindowPtr pWindow)
winRec->is_drawing = TRUE;
}
PixmapPtr curPixmap = pScreen->GetWindowPixmap(pWindow);
curPixmap = pScreen->GetWindowPixmap(pWindow);
if (curPixmap == winRec->pixmap)
{
RL_DEBUG_MSG("Window %p already has winRec->pixmap %p; not pushing\n", pWindow, winRec->pixmap);

View File

@ -268,9 +268,6 @@ Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color,
void RootlessFlushWindowColormap (WindowPtr pWin);
void RootlessFlushScreenColormaps (ScreenPtr pScreen);
// xp_error
int RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors);
// Move a window to its proper location on the screen.
void RootlessRepositionWindow(WindowPtr pWin);
@ -285,5 +282,6 @@ void RootlessUpdateRooted (Bool state);
void RootlessEnableRoot (ScreenPtr pScreen);
void RootlessDisableRoot (ScreenPtr pScreen);
void RootlessSetPixmapOfAncestors(WindowPtr pWin);
#endif /* _ROOTLESSCOMMON_H */

View File

@ -257,7 +257,7 @@ RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pMask->pDrawable : NULL;
}
srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pSrc->pDrawable : NULL;
dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pDst->pDrawable : NULL;
@ -297,7 +297,7 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
GlyphPtr glyph;
WindowPtr srcWin, dstWin;
srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pSrc->pDrawable : NULL;
dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pDst->pDrawable : NULL;

View File

@ -36,15 +36,15 @@
#include <stddef.h> /* For NULL */
#include <limits.h> /* For CHAR_BIT */
#include <assert.h>
#ifdef __APPLE__
//#include <X11/Xlib.h>
#include <X11/Xatom.h>
#ifdef __APPLE__
#include <Xplugin.h>
#include "mi.h"
#include "pixmapstr.h"
#include "windowstr.h"
#include <Xplugin.h>
//#include <X11/extensions/applewm.h>
extern int darwinMainScreenX, darwinMainScreenY;
extern Bool no_configure_window;
#endif
#include "fb.h"
@ -61,8 +61,6 @@ extern int darwinMainScreenX, darwinMainScreenY;
#define SCREEN_TO_GLOBAL_Y 0
#endif
#define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x)))
#define DEFINE_ATOM_HELPER(func,atom_name) \
static Atom func (void) { \
static unsigned int generation = 0; \
@ -74,34 +72,15 @@ extern int darwinMainScreenX, darwinMainScreenY;
return atom; \
}
DEFINE_ATOM_HELPER (xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
DEFINE_ATOM_HELPER (xa_native_window_id, "_NATIVE_WINDOW_ID")
DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
static Bool no_configure_window;
static Bool windows_hidden;
// TODO - abstract xp functions
static inline int
configure_window (xp_window_id id, unsigned int mask,
const xp_window_changes *values)
{
if (!no_configure_window)
return xp_configure_window (id, mask, values);
else
return XP_Success;
}
#ifdef __APPLE__
/*static inline unsigned long
current_time_in_seconds (void)
{
unsigned long t = 0;
t += currentTime.milliseconds / 1000;
t += currentTime.months * 4294967;
return t;
} */
// XXX: identical to x_cvt_vptr_to_uint ?
#define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x)))
void
RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
@ -153,25 +132,7 @@ void RootlessNativeWindowMoved (WindowPtr pWin) {
no_configure_window = FALSE;
}
/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
static void
set_screen_origin (WindowPtr pWin)
{
long data[2];
if (!IsRoot (pWin))
return;
/* FIXME: move this to an extension? */
data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
+ darwinMainScreenX);
data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
+ darwinMainScreenY);
dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
}
#endif /* __APPLE__ */
/*
* RootlessCreateWindow
@ -437,13 +398,6 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
#endif
}
Bool
RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors)
{
return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch);
}
/*
* RootlessEnsureFrame
* Make sure the given window is framed. If the window doesn't have a
@ -1482,19 +1436,15 @@ void
RootlessFlushWindowColormap (WindowPtr pWin)
{
RootlessWindowRec *winRec = WINREC (pWin);
xp_window_changes wc;
ScreenPtr pScreen = pWin->drawable.pScreen;
if (winRec == NULL)
return;
RootlessStopDrawing (pWin, FALSE);
/* This is how we tell xp that the colormap may have changed. */
wc.colormap = RootlessColormapCallback;
wc.colormap_data = pWin->drawable.pScreen;
configure_window (MAKE_WINDOW_ID(winRec->wid), XP_COLORMAP, &wc);
if (SCREENREC(pScreen)->imp->UpdateColormap)
SCREENREC(pScreen)->imp->UpdateColormap(winRec->wid, pScreen);
}
/*
@ -1617,7 +1567,6 @@ RootlessHideAllWindows (void)
ScreenPtr pScreen;
WindowPtr pWin;
RootlessWindowRec *winRec;
xp_window_changes wc;
if (windows_hidden)
return;
@ -1641,9 +1590,8 @@ RootlessHideAllWindows (void)
winRec = WINREC (pWin);
if (winRec != NULL)
{
wc.stack_mode = XP_UNMAPPED;
wc.sibling = 0;
configure_window (MAKE_WINDOW_ID(winRec->wid), XP_STACKING, &wc);
if (SCREENREC(pScreen)->imp->HideWindow)
SCREENREC(pScreen)->imp->HideWindow(winRec->wid);
}
}
}
@ -1684,3 +1632,29 @@ RootlessShowAllWindows (void)
RootlessScreenExpose (pScreen);
}
}
/*
* SetPixmapOfAncestors
* Set the Pixmaps on all ParentRelative windows up the ancestor chain.
*/
void
RootlessSetPixmapOfAncestors(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr topWin = TopLevelParent(pWin);
RootlessWindowRec *topWinRec = WINREC(topWin);
while (pWin->backgroundState == ParentRelative) {
if (pWin == topWin) {
// disallow ParentRelative background state on top level
XID pixel = 0;
ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
break;
}
pWin = pWin->parent;
pScreen->SetWindowPixmap(pWin, topWinRec->pixmap);
}
}

View File

@ -52,7 +52,9 @@ void RootlessResizeWindow(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, WindowPtr pSib);
void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
#ifdef __APPLE__
void RootlessNativeWindowMoved (WindowPtr pWin);
void RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state);
#endif
#endif

View File

@ -41,7 +41,7 @@ endif
EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
$(XDMCP_SRCS) $(STRLCAT_SRCS)
if XSERVER_DTRACE
if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libos & libdix
dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS)
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o

View File

@ -272,13 +272,32 @@ CheckDuplicates (GlyphHashPtr hash, char *where)
#define DuplicateRef(a,b)
#endif
static void
FreeGlyphPicture(GlyphPtr glyph)
{
PictureScreenPtr ps;
int i;
for (i = 0; i < screenInfo.numScreens; i++)
{
ScreenPtr pScreen = screenInfo.screens[i];
if (GlyphPicture(glyph)[i])
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
ps = GetPictureScreenIfSet (pScreen);
if (ps)
(*ps->UnrealizeGlyph) (pScreen, glyph);
}
}
void
FreeGlyph (GlyphPtr glyph, int format)
{
CheckDuplicates (&globalGlyphs[format], "FreeGlyph");
if (--glyph->refcnt == 0)
{
PictureScreenPtr ps;
GlyphRefPtr gr;
int i;
int first;
@ -305,17 +324,7 @@ FreeGlyph (GlyphPtr glyph, int format)
globalGlyphs[format].tableEntries--;
}
for (i = 0; i < screenInfo.numScreens; i++)
{
ScreenPtr pScreen = screenInfo.screens[i];
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
ps = GetPictureScreenIfSet (pScreen);
if (ps)
(*ps->UnrealizeGlyph) (pScreen, glyph);
}
FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
xfree (glyph);
}
@ -334,15 +343,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
TRUE, glyph->sha1);
if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph)
{
PictureScreenPtr ps;
int i;
for (i = 0; i < screenInfo.numScreens; i++)
{
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
if (ps)
(*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph);
}
FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
xfree (glyph);
glyph = gr->glyph;
@ -414,6 +415,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
for (i = 0; i < screenInfo.numScreens; i++)
{
GlyphPicture(glyph)[i] = NULL;
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
if (ps)
@ -721,32 +723,35 @@ miGlyphs (CARD8 op,
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
if (maskFormat)
if (pPicture)
{
CompositePicture (PictOpAdd,
pPicture,
None,
pMask,
0, 0,
0, 0,
x - glyph->info.x,
y - glyph->info.y,
glyph->info.width,
glyph->info.height);
}
else
{
CompositePicture (op,
pSrc,
pPicture,
pDst,
xSrc + (x - glyph->info.x) - xDst,
ySrc + (y - glyph->info.y) - yDst,
0, 0,
x - glyph->info.x,
y - glyph->info.y,
glyph->info.width,
glyph->info.height);
if (maskFormat)
{
CompositePicture (PictOpAdd,
pPicture,
None,
pMask,
0, 0,
0, 0,
x - glyph->info.x,
y - glyph->info.y,
glyph->info.width,
glyph->info.height);
}
else
{
CompositePicture (op,
pSrc,
pPicture,
pDst,
xSrc + (x - glyph->info.x) - xDst,
ySrc + (y - glyph->info.y) - yDst,
0, 0,
x - glyph->info.x,
y - glyph->info.y,
glyph->info.width,
glyph->info.height);
}
}
x += glyph->info.xOff;

View File

@ -318,14 +318,14 @@ miClipPictureSrc (RegionPtr pRegion,
Bool result;
pixman_region_translate ( pPicture->clientClip,
pPicture->clipOrigin.x - dx,
pPicture->clipOrigin.y - dy);
pPicture->clipOrigin.x + dx,
pPicture->clipOrigin.y + dy);
result = REGION_INTERSECT (pScreen, pRegion, pRegion, pPicture->clientClip);
pixman_region_translate ( pPicture->clientClip,
- (pPicture->clipOrigin.x - dx),
- (pPicture->clipOrigin.y - dy));
- (pPicture->clipOrigin.x + dx),
- (pPicture->clipOrigin.y + dy));
if (!result)
return FALSE;

View File

@ -223,9 +223,8 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
b = Ones (pVisual->blueMask);
type = PICT_TYPE_OTHER;
/*
* Current rendering code supports only two direct formats,
* Current rendering code supports only three direct formats,
* fields must be packed together at the bottom of the pixel
* and must be either RGB or BGR
*/
if (pVisual->offsetBlue == 0 &&
pVisual->offsetGreen == b &&
@ -322,8 +321,6 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
PICT_x8r8g8b8, pDepth->depth);
nformats = addFormat (formats, nformats,
PICT_x8b8g8r8, pDepth->depth);
nformats = addFormat (formats, nformats,
PICT_b8g8r8x8, pDepth->depth);
}
if (pDepth->depth >= 30)
{

View File

@ -1043,7 +1043,7 @@ ProcRenderAddGlyphs (ClientPtr client)
CARD32 *gids;
xGlyphInfo *gi;
CARD8 *bits;
int size;
unsigned int size;
int err;
int i, screen;
PicturePtr pSrc = NULL, pDst = NULL;
@ -1131,6 +1131,10 @@ ProcRenderAddGlyphs (ClientPtr client)
ScreenPtr pScreen;
int error;
/* Skip work if it's invisibly small anyway */
if (!width || !height)
break;
pScreen = screenInfo.screens[screen];
pSrcPix = GetScratchPixmapHeader (pScreen,
width, height,

View File

@ -9,6 +9,10 @@ AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
INCLUDES = @XORG_INCS@
TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
if SPECIAL_DTRACE_OBJECTS
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
endif
xkb_LDADD=$(TEST_LDADD)
input_LDADD=$(TEST_LDADD)
xtest_LDADD=$(TEST_LDADD)

View File

@ -17,6 +17,10 @@ INCLUDES = @XORG_INCS@
TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
COMMON_SOURCES=protocol-common.h protocol-common.c
if SPECIAL_DTRACE_OBJECTS
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
endif
protocol_xiqueryversion_LDADD=$(TEST_LDADD)
protocol_xiquerydevice_LDADD=$(TEST_LDADD)
protocol_xiselectevents_LDADD=$(TEST_LDADD)

View File

@ -158,10 +158,9 @@ OutputDirectory(
size_t size)
{
#ifndef WIN32
if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size))
/* Can we write an xkm and then open it too? */
if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size))
{
/* if server running as root it *may* be able to write */
/* FIXME: check whether directory is writable at all */
(void) strcpy (outdir, XKM_OUTPUT_DIR);
} else
#else