Commit Graph

65 Commits

Author SHA1 Message Date
Alan Coopersmith
7ac2802874 Convert mi & miext to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Peter Hutterer
732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Keith Packard
60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Jeremy Huddleston Sequoia
c5f8eb968e rootless: Use miCopyRegion instead of fbCopyRegion
Fixes regression introduced by e657635dbe

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-10-06 09:18:15 -07:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Cyril Brulebois
99275ad2fa Remove superfluous if(p!=NULL) checks around free(p); p=NULL;
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
-  if (E != NULL) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
-  }
+ free(E);
+ E = NULL;

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:22:59 +10:00
Jamey Sharp
58d1ec0fe8 rootless: ROOTLESS_GLOBAL_COORDS is always set, so unifdef it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-13 15:58:08 -07:00
Jamey Sharp
35ce892a70 rootless: ROOTLESS_TRACK_DAMAGE is never set, so unifdef it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-13 15:58:08 -07:00
Jeremy Huddleston
4fc4cab98d XQuartz: Make application switching work better for the no-spaces case
We still have the issue with not raising the frontmost window for the case
when spaces is enabled, and the AppleSpacesSwitchOnActivate preference is
disabled.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-08-12 20:26:36 -10:00
Jan Hauffa
95756f410c rootless: Adjust the frame size of the native root window in RootlessResizeWindow
If the native root window isn't resized as well, we will likely crash the
next time we draw to the root.  On OS X, this can be seen by:

1) Put the display preferences in the menu bar and set X11's preferences so you
   can access the menu bar in fullscreen mode
2) Set the resolution of your screen lower than normal.
3) Start X11 in fullscreen mode.  The root window will cover the screen as
   expected.
4) Use the menu bar to increase the resolution of the display.  The root
   window will now cover the old area and not the full screen, but
   'xwininfo -root' will report the full width.
5) Run 'xsetroot -solid red', and we have the crash you mention above.

Leaving/entering fullscreen after #4 will fix the problem.  This is because the
WINREC is erased when we leave fullscreen mode and it is recreated upon
re-entry:

RootlessUpdateRooted(FALSE)
    RootlessDisableRoot(screenInfo.screens[0])
        RootlessDestroyFrame (pRoot, winRec);
RootlessUpdateRooted(TRUE)
    RootlessEnableRoot(screenInfo.screens[0])
        RootlessEnsureFrame(screenInfo.screens[0]->pRoot)
            creates a new WINREC...

Signed-off-by: Jan Hauffa <hauffa@in.tum.de>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-By: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-07-19 19:11:26 -07:00
Jamey Sharp
a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Jeremy Huddleston
1768e51976 rootless: Fix SetShape regression
This fixes a regression in miext/rootless from 643cb6e87c

Found-by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 17:13:34 -07:00
Jamey Sharp
a83cff9f4d Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Jeremy Huddleston
4d3789c9b3 rootless: Remove an unneeded comment
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Rami Ylimaki
5b9a52be7e os: Prevent core dump from being truncated.
The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
  echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.

While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.

I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.

Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17 23:20:52 -08:00
Jeremy Huddleston
5b91dfac6f 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>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-13 13:59:57 -07:00
Jeremy Huddleston
b3415187e9 Rootless: Correct border rendering on parent-relative windows
Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow
(cherry picked from commit cf2e3312cf)
2009-09-27 23:31:50 -07:00
Jeremy Huddleston
fc24a97a8d Rootless: Use serverClient instead of NullClient
This seems to stop the crash when moving windows.
(cherry picked from commit fcd857c8e2)
2009-06-06 22:23:56 -07:00
Jeremy Huddleston
dfb0d7aefb XQuartz: Update window levels when changing rootless state
(cherry picked from commit 1359ded5bf)
2009-04-10 00:47:40 -07:00
Jeremy Huddleston
15146b8637 XQuartz: Properly set the window level for the root window
(cherry picked from commit bdf9286d1c)
2009-04-10 00:47:16 -07:00
Jeremy Huddleston
83edcc08de XQuartz: Get rid of white rectangle bug
(cherry picked from commit 3269959033)
2008-12-21 21:34:38 -08:00
Jeremy Huddleston
20239a4dee Rootless: LP64 related casting fixes from Bob Murphy
(cherry picked from commit 40441c4e31)
2008-10-31 19:03:32 -07:00
Jeremy Huddleston
4e762b8aa3 Rootless: Force initialization of static variable before use.
(cherry picked from commit cece293172)
2008-10-31 15:49:59 -07:00
George Peter Staplin
b397cc7277 miext/rootless: Fix the usage of DeleteProperty so that this builds again.
(cherry picked from commit 3de250e28a)
2008-10-23 16:31:44 -07:00
Jeremy Huddleston
d13c3cbd43 XQuartz: Some motion made towards supporting fullscreen.
(cherry picked from commit 99be3d68b6)
2008-10-08 18:45:17 -07:00
Jeremy Huddleston
6548a55ebd XQuartz: 256 color support
(cherry picked from commit 8dd6d5c825)
2008-09-12 15:26:13 -07:00
Jeremy Huddleston
c661c6ae7a XQuartz: Remove decls of crashtracer strings that we don't use anymore in here
(cherry picked from commit 4a653c6bfd)
2008-09-12 15:22:11 -07:00
Jeremy Huddleston
54162aca40 XQuartz: Fixed a crash in RootlessNativeWindowMoved
(cherry picked from commit a16048cec0)
2008-09-12 15:22:06 -07:00
Jeremy Huddleston
8abcc12fdd XQuartz: Added debugging output to the crash log to help track down two crashes, since people don't often report their system.log spew.
(cherry picked from commit aaf0f71db1)
2008-08-29 20:55:25 -07:00
Adam Jackson
d6228cb22a Shape extension is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Jeremy Huddleston
6acc2acd0d Rootless: mi doesn't let us resize root, so we need to do it ourselves...
(cherry picked from commit c1ec36e28c)
2008-05-05 15:34:10 -07:00
Jeremy Huddleston
ba87c25321 Make rootless use dixLookupClient rather than deprecated LookupClient.
(cherry picked from commit 582b5b01f9)
2008-04-21 20:09:30 -07:00
Ben Byer
5ffb6a2fe8 Nuke a call to deprecated LookupClient, and hopefully prevent a
null-pointer dereference, too!
(cherry picked from commit 3d28e9f953)
2008-04-21 19:58:03 -07:00
Ben Byer
edd3fb784b random flailing
(cherry picked from commit 7fb9b2dc61)
2008-04-18 20:07:41 -07:00
Jeremy Huddleston
3f51f493b6 XQuartz: Fix issue where clicking on an X11 window might send that event to an X11 window in another space.
(cherry picked from commit df21312c8b)
(cherry picked from commit 2d4194a8d1)
2008-04-08 17:03:18 -07:00
Eamon Walsh
ef60632e20 dix: Modify callers of property and selection API to use new interfaces. 2008-02-29 18:01:37 -05:00
Jeremy Huddleston
4fc2d3cef8 Rootless: RootlessEnsureFrame: Added check for !IsRoot
This was causing an issue with Apple-DRI and was reported here:
http://trac.macosforge.org/projects/xquartz/ticket/51
(cherry picked from commit 116800279d)
2008-01-28 12:25:29 -08:00
Eamon Walsh
c8feb73f58 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/EVI.c
	Xext/bigreq.c
	Xext/cup.c
	Xext/dpms.c
	Xext/fontcache.c
	Xext/mitmisc.c
	Xext/xcmisc.c
	Xext/xf86bigfont.c
	Xext/xtest.c
	configure.ac
	dbe/dbe.c
	hw/darwin/darwin.h
	hw/darwin/darwinEvents.c
	hw/darwin/iokit/xfIOKit.h
	hw/darwin/iokit/xfIOKitCursor.c
	hw/darwin/quartz/fullscreen/fullscreen.c
	hw/darwin/quartz/fullscreen/quartzCursor.c
	hw/darwin/quartz/quartz.c
	hw/darwin/quartz/quartzCommon.h
	hw/darwin/quartz/quartzCursor.c
	hw/darwin/quartz/xpr/dri.c
	hw/darwin/quartz/xpr/dristruct.h
	hw/darwin/quartz/xpr/xprCursor.c
	hw/darwin/quartz/xpr/xprFrame.c
	hw/xfree86/modes/xf86RandR12.c
	include/cursor.h
	miext/rootless/rootlessCommon.h
	miext/rootless/rootlessScreen.c
	miext/rootless/rootlessWindow.c
	render/picturestr.h

Trying to pick up the pieces from the darwin churn here...
2007-12-13 18:38:25 -05:00
Jeremy Huddleston
2082e7aa87 Rootless: Remove the PaintWindow optimization which snuck back in. 2007-11-22 17:18:48 -08:00
Ben Byer
74214a9f42 Darwin: Patch to avert (some) damage / rootless crashes, courtesy of Ken Thomases
(cherry picked from commit 148a87ff20)
2007-11-21 23:18:34 -08:00
Ben Byer
f5f833b806 Darwin: These changes are necessary, yet not sufficient, to get 8-bit indexed
color mode working in Xquartz.
(cherry picked from commit a415f62f52)
2007-11-21 23:18:13 -08:00
Eamon Walsh
1603130236 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/xace.c
	Xext/xace.h
2007-11-14 13:35:50 -05:00
Ben Byer
f2a3728868 Patch to rootless code that should fix many crashes. Credit to Ken Thomases
at CodeWeavers for the patch.  From his description:

Fix a display bug with the X server.  The Generic Rootless extension
installs overrides for certain GC (graphics context) operations.  Within
these overrides, they temporarily uninstall themselves, perform their work,
and then reinstall themselves.  Except sometimes they would return early
and wouldn't reinstall themselves when they should.  Now they do in all cases.

Fix a bug in RootlessCopyWindow where early returns could leave the screen's
dispatch table entry for CopyWindow unwrapped.  We think that this is
another case (hopefully the last) of the rootless drawing bug.
2007-11-08 20:42:01 -08:00
Ben Byer
50dac9b2cb Fixed Spaces issue, correctly -- dragging an X window from one
Space to another in Expose mode now works.
2007-11-08 20:11:34 -08:00
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Ben Byer
b1764ddf13 pulling more patches over from xorg-xserver-1.2-apple branch 2007-11-05 05:45:21 -08:00
Eamon Walsh
97c150b61b Merge branch 'master' into XACE-SELINUX
Conflicts:

	afb/afbpntwin.c
	afb/afbscrinit.c
	afb/afbwindow.c
	cfb/cfb.h
	cfb/cfballpriv.c
	cfb/cfbscrinit.c
	cfb/cfbwindow.c
	configure.ac
	fb/wfbrename.h
	hw/xfree86/xf4bpp/ppcIO.c
	hw/xfree86/xf4bpp/ppcPntWin.c
	hw/xfree86/xf4bpp/ppcWindow.c
	hw/xfree86/xf8_32bpp/cfbscrinit.c
	mfb/mfb.h
	mfb/mfbpntwin.c
	mfb/mfbscrinit.c
	mfb/mfbwindow.c
	mi/miexpose.c

Note: conflicts caused by devPrivates rework vs. paintwindow changes.
2007-09-19 07:25:55 -04:00