Rootless X Free on MacOSX

phule

Registered
A person on /. at http://slashdot.org/ reports "The XonX project over
at Source Forge is finally seeing some cool results. This time we
finally have X windows running along side Aqua windows. See for
yourself here http://www.mit.edu/~rueckert/XFreeAqua.jpg> and here
http://www.mit.edu/~rueckert/XFreeAqua2.jpg The author states that
this release is not in a very usable form just yet. A post explaining
how it was was done and how you too can run XonX can be found here
http://sourceforge.net/forum/forum.php?thread_id=72936&forum_id=57136
Finally!"
 
phule,

I've got the lastest version of XonX and i've got that to work with afterstep pretty reliably but I can't get the aqua version you're linking to to work. twm just puts up blank black windows and afterstep bugs out saying something like
AfterStep: internal error
Request 72, Error 16
EventType: 0

over and over again. Have you got it working (or anyone)?

peter
 
Originally posted by monty
phule,

I've got the lastest version of XonX and i've got that to work with afterstep pretty reliably but I can't get the aqua version you're linking to to work. twm just puts up blank black windows and afterstep bugs out saying something like
AfterStep: internal error
Request 72, Error 16
EventType: 0

over and over again. Have you got it working (or anyone)?

peter

I have to admit not owning MacOS X (yet), so I'm afraid I can't help you.
 
That is a really good advance, but the true revolution and optimisation is :
a XWindow wrapper to Quartz calls (buffering, hardware optimization, OpenGL, etc...)
When a XWindow Window has to be opened, it should be a real Quartz window, not a WindowManager under XWindow...

All graphics calls are doublons : aqua and X : double space, double memory usage, double processor usage...
It should has a way to wrap X-Calls to Quartz.

I am a programmer, but I'm not enough good to start or participate in such a project :-(
I don't know how Xlibs works, and I'm not an hardcore Quartz engeneer...
 
I agree. If apple were to take over the project, I doubt it would take them long to create xlibs that use aqua and make it more like classic ie. a supporting application, maybe a backgroud application like TruBluEnvironment and having xwindows windows alongside aqua windows. Dock support would be easy for them to do (they already did it with classic apps).

peter
 
I have written a proposal to implement rootless XFree86 and I think I can clarify how best to go about it.

The fundamental difference between X11 and Quartz is X11 draws directly to screen and uses regions to avoid drawing in areas now owned by a specific process, while Quartz is a more advanced display server where every process draws it's own 'surface' which acts like a layer.

Quartz is more flexible in that you can apply alpha channels and mapping matrixes to surfaces. The disadvantage is 2D acceleration is more difficult because unlike X11 or QuickDraw, each pixel does not belong to a specific process but rather is a composition of several 'surfaces'.

Currently there is no 2D Acceleration in the same sense of the term we use in QuickDraw. This is to say PDF is rendered by the CPU and not the GPU. There is acceleration in moving and perhaps blending surfaces once they are rendered by the CPU. Also hardware can be used to draw surfaces like for OpenGL and QuickTime Video. Perhaps the GeForce3 is able to render anti-aliased bezier curves to accelerate PDF rendering, but that's speculation.

To accelerate moving (and perhaps blending) of surfaces, OS X has a video memory sharing method implemented in kernel space (usually in a kernel module or kmod). This allows surfaces to be swapped in and out of video memory very quickly (using a shared context). Then you have drivers like GL Drivers which instruct the GPU to render surfaces. Other drivers can render surfaces outside the GPU like DV Firewire drivers.

The best way to implement rootless X11 is to have every X11 drawing window be a CoreGraphics surface which can move and refresh themselves (a surface has to be refreshed or partially refreshed in order for changes to be displayed in Quartz). Thus you will use an X11 window manager to move and resize X11 windows. Obviously regions wouldn't be used at all (except the global region).

The primary difficulty is X11 would have to be patched extensively. Every drawing call would need to be patched so we know which portion of the surface needs to be refreshed. Mouse movements, clipboard, etc. Also the global region used in multiple monitors needs to be patched so X11 doesn't move surfaces beyond the visible viewing area. However once done it would be as seamless as possible.

This is a lot different than Tenon's solution which uses regions and has problems as a result. Basically Tenon is copying portions of the X11 frame buffer to Cocoa Views which is slower and ugly.

Using my approach would also make it feasible to implement better 2D acceleration, although not likely since it depends on whomever is writing drivers for a specific card. You would need to write the X11 equivalent of a GL Driver to interface with the video card's kmod.

Using an X11 window manager also has the advantage of being able to easily differentiate between X11 windows and non-X11 windows. Difference being X11 has no UI, only G.

I'm not interested in X11 proliferation, in fact I doubt enough people (read: programmers) are interested to implement rootless X11 on OS X. X11 is primitive and it would be far better to port X11 apps to Cocoa then back to GNUStep so everybody (X11 and OS X users) benefits from OpenStep's UI and graphical abstraction.
 
wow,

you really know your stuff. I'm with you i don't really want x windows in all its ugliness but how many program do you think will actually be ported to GNU step? For the time being I would like a quick job done by apple so that we can use more apps. Think about it, classic is far from perfect but it gets the job done. Something like that would do.

peter
 
I think Apple has a bazillion more important things to worry about |-p

X11 apps are nothing to fawn over. All the good ones are commercial anyway. The rest is garbage.

Porting apps to Cocoa then back to GNUStep makes more sense than porting to GNUStep. Cocoa is far more mature and uncompromised. Also people will be more inclined to use the graphics abstraction in OpenStep (like NSBezierPath) instead of X11 calls which many GNUStep apps currently use. I only mention GNUStep because GStep apps have better and more generalized human interfaces than typical X11 or gtk+ apps. If more developmental effort were put into GNUStep instead of rootless X11 I think the result would be better for everybody involved.
 
Ya, I'm with you !

I agree it should be far better if all good UNIX, LINUX apps are ported to cocoa !

However, Linux uses X11, and a rootless X11 is a way to have all Linux stuff to work on Mac OS X (with a Linux emulation (wrapper Linux/BSD))

If this works, all that is Linux can works with MacOS X...

A lot of Linux people would be able to use Mac OS X and switch from Linux...

And for those totally free Open Community people, they could use Darwin with X11 and the Linux emulation.

After, developers will prefer develop for Darwin, so basta the Linux emulation, and then they will develop for Quartz, and then basta X11...
 
X11 and Cocoa are not analogous technologies. GNUStep is Cocoa implemented on Linux/X11.

Linux people can switch to OS X now if they want, there is nothing they would give up except perhaps WINE (which is no big loss).

There is no need for Linux emulation to port Linux apps (if there are any worth porting).

If the Linux weenies want to ditch X11 (which 0.00001% of them will admit) the first step would be adopting a higher level application framework with graphics abstraction. This is essentially what GNUStep offers. By using NSBezierPaths and other imaging classes you can write complex graphical applications which aren't tied to X11.

They could do that today with or without OS X, but they aren't and they won't. Too busy fawning over crapware like GIMP and fooling themselves it's the best thing ever.

GNUStep is basically their only hope, and they have basically rejected it. The project is OLDER than KDE or gnome! Ah, screw em.
 
yeah, you're right. Like I said I don't want permanent X Windows in OS X and I don't want it built in. But a download on apples site for people who want more apps on OS X.

Although now I see your point. if X windows is ported to mac osx and apps compile OK then they will never be ported to OSX natively. Maybe if apple would get involved in the GNU step project and bring it up to par with their's?
That would be the best thing. GNU step on Linux, BSD, etc and Cocoa on OS X would be good for all, except microsoft.

peter
 
Originally posted by strobe
I think the less we involve Apple the better.

yeah i realised that just after I posted. Apple isn't going to want to give up any of their secrets but it would be good if they would give GNUStep a bit more help. The last thing we want is for them not to be almost totally compatible. Think about it: apps finally getting ported to GNUStep and then not compiling on OS X.

If you had another reason in mind feel free to correct me!

peter
 
Originally posted by monty
phule,

Have you got it working (or anyone)?

peter

I'm having exactly the same problem you are having. Maybe it was developed on one of the later builds, and never tested in the public beta?
 
I think that you guys could be missing the point about X windows on OSX. Most people will not spend the effort porting X windows apps to Aqua. I am a Solaris programmer and I love the mac but i will be buggered if I am going to learn objective C and Aqua to port my code to OSX. But if X is there and it works then I shall make sure my apps run on OSX. Call me lazy and undedicated to the cause if you like but thats the harsh realities of my life and i am sure thoasands of programmers like me.


I am too busy and i have too much brain space invested in Solaris and X and C to learn these new things to get my apps to run on the mac.

We want to be in the Open source community and be able to take advantage of all it offers. Including X applications. Being able to recompile a *nix program and have it just run is a HUGE boon for the platform.
X does suck. But *nix will never drop it. So we are stuck with it.

If you can say to programmers like me "come to our platform its soooo easy to get your code working and you can do things here exactly the same as on your other *nix platform" Then people will come. Once alot of people have come then people will start to write things NATIVE.

Butttttttt then again i could be wrong.
 
If you are too lazy to do a proper port which is actually usable what makes you think I have the time to implement rootless X Server?

I'm porting GRASS to OS X (actually I'm making a better version of GRASS which will kick the X11's sorry narrow ass).

There are virtually zero open source X11 applications worth using. I know because I'm porting one and the only reason I am is because when I'm finished it'll be a million times better than the X11 version will ever be.

We are not stuck with X11, you are.

Finally if you want to move beyond X11 then you would port to Cocoa then port back to GNUStep, then perhaps fewer X11 apps will stink. That's what I plan to do with my port.
 
Originally posted by mrjohns
I think that you guys could be missing the point about X windows on OSX. Most people will not spend the effort porting X windows apps to Aqua. I am a Solaris programmer and I love the mac but i will be buggered if I am going to learn objective C and Aqua to port my code to OSX. But if X is there and it works then I shall make sure my apps run on OSX. Call me lazy and undedicated to the cause if you like but thats the harsh realities of my life and i am sure thoasands of programmers like me.



I can throw in another scenario--remote *NIX applications. For example, when I teach UNIX I like to run the class (like all my classes) off of my PowerBook. I can telnet into the *NIX server and other workstations but to access the X applications I need to use XTen. Rootless X on Mac OS X would be a trememdous boost. You can also extend this to people who administer UNIX systems who can do so remotely quite easily with OS X.

Before you mention that no self-respecting UNIX geek would be caught dead with a candy-colored OS, I can mention several of my colleagues who are looking to buy their first Mac specifically because of OS X and its BSD underpinnings.

 
OPENSTEP also supported remote display. The feature was present in OS X but I suspect disabled because it's not working 100% yet.

Anyway it's a poor reason to promote X11. Remote display PDF has far greater potential.
 
Originally posted by strobe
OPENSTEP also supported remote display. The feature was present in OS X but I suspect disabled because it's not working 100% yet.

Anyway it's a poor reason to promote X11. Remote display PDF has far greater potential.

Actually, NXHost'ing went away with DPS. Since there is no longer a DPS server to NXHost to, it can't be done under Quartz.

Actually, I think that porting something like GTK+ to use Quartz would be the best of both worlds. Basically, what I'd rather have is an X-11 equivalent of Carbon -- meaning that you could recompile X-11 apps with this toolkit and have Aqua apps although they wouldn't be as well integrated as native Cocoa apps.

/carmi
 
Back
Top