TweetFollow Us on Twitter

X11: A C of Window Systems

Volume Number: 19 (2003)
Issue Number: 3
Column Tag: Section 7

X11: A C of Window Systems

or possibly a Fortran?

by Rich Morin

Taken on its own terms, X11 is a stunning success. As www.x.org/X11.htm proclaims:

    The X Window System, more simply 'X' or 'X11', is judged worldwide to be one of the most successful open source, collaborative technologies developed to date. It is the de facto standard graphical engine for the UNIX and Linux operating systems and provides the only common windowing environment bridging the heterogeneous platforms in today's enterprise computing. The inherent independence of the X Window System from operating system and hardware, its network-transparency, and its support for a wide range of popular desktops are responsible for its continuing and growing popularity.

    All major hardware vendors support the X Window System. Many third parties provide technologies for integrating X Window System applications into network or personal computer environments under DOS, Windows, Windows 9x, and Windows NT, while thousands of independent software developers provide X Window System applications. The worldwide community of users of the X Window System currently exceeds 30 million.

X11 is such a dominant technology in Unix circles that shipping a Unix system without an integral copy of X11 would be like omitting a C compiler or, erm, hiding the command line. Nonetheless, Apple's initial position was fairly plausible: "X11 support is an opportunity for third-party developers".

Several developers, indeed, accepted the challenge. Tenon Intersystems (www.tenon.com) has produced a well-regarded proprietary X11 implementation for OSX. OroborOSX (oroborosx.sf.net), XDarwin (www.xdarwin.org), and XonX (www.mrcla.com/XonX) provide free distributions of X11 for OSX.

Nonetheless, Apple's release of an "official" implementation of X11 is certain to interest many users, including some who have been wary of trying X11. And, indeed, Apple is in a position to make X11 interoperate with Aqua in ways that a third-party vendor might not have been able to duplicate. I would expect, however, to see the third-party developers adopt any enabling technologies that Apple makes available.

The Apple implementation includes "standard X11 display server software, client libraries, and developer toolkits". The intention, as confirmed by an Apple spokesman, is to place X11 at about the same level of OS support as, say, Carbon. That is, better integrated than Classic, but possibly missing some Cocoa functionality.

So, we can expect to see X11 apps appearing commonly on OSX. Despite the best efforts of all concerned, however, it is not clear that the fit will be all that good: the goals, designs, and philosophy of the two systems are wildly different. Let's look at each of these, using OSX as our point of reference.

X VS. X

The goals of X11, as noted above, are "network transparency" and "bridging heterogeneous platforms". An X11 user can access an X11-based application on either the local machine or on any machine which is reachable over the network.

Apple Remote Desktop, SSH, Timbuktu, and VNC all allow remote access, but none of these provides the level of integration and performance that X11 does. In short, if you want network-transparent, cross-platform support for GUI-based apps, X11 is your answer.

X11's design differences reflect its differing goals. An X11 "client" application sets up callback functions and issues UI requests, just as a Cocoa or Carbon app would. In X11, however, everything is translated into a serial stream of data, suitable for sending over the network.

In place of Apple's Cocoa and Carbon APIs, X11 has "widget sets" (e.g., GTK+, Motif, Qt, Xaw). In place of the Finder, X11 has "window managers" (e.g., fvwm, kvm, mwm, sawfish, twm) and "desktop environments" (e.g., CDE, Gnome, KDE).

Making all of this play nicely with Aqua (e.g., supporting drag and drop) isn't going to be an easy job. In fact, some things will simply fail to translate. If X11 has a widget that Aqua doesn't (or vice versa), there isn't much that a "glue layer" can do about it.

X11's basic philosophy is likely to cause the worst dislocations, however. Apple has worked for years to develop, document, and promote the Macintosh "Human Interface Guidelines". As a result, Mac users feel comfortable starting up a new app, knowing that the command keys and menus will all be familiar. No such guidelines are present in X11:

With no central authority specifying policy, no consistent user interface developed. Each of X11's widget sets, window managers, desktop environments, and applications was free to go off in its own direction. The resulting inconsistency will grate on seasoned Mac users.

Porting X11 apps

Now that Apple is providing an X11 development system, porting an X11 app shouldn't be much harder than porting any other Unix-based app. Nonetheless, I'd like to see Apple provide an X11 and Unix analog to the "Carbon Dater" (an analysis tool for Carbonizing Classic apps); this could ease the task of identifying the OSX equivalents to unavailable include files, library calls, system calls, etc.

While I'm fantasizing, I'd also like a way for Aqua apps to be accessible via the X11 protocol and an X11 toolkit that implements the Aqua look and feel. Both technical and legal issues surround these pipe dreams, however, so I'd best get back to reality.

If an app is written for certain X11 toolkits (e.g., GTK+, Qt, Tk), it may be possible to link it to Carbon or Cocoa. This could provide access to useful Cocoa features and/or improvement in appearance and/or performance. Look around for interface libraries, ala:

If the app only needs to run on a single machine, a port to native Cocoa may be appropriate. If the app has a clean separation between its Model and View code, the rework shouldn't be all that hard. Unfortunately, the real problems may not be obvious at the beginning of the effort.

X11, Layer by Layer

I have made some hand-waving claims about the differences between the OSX model and the X11 model. For those that may be interested, here is a (somewhat) detailed discussion of X11's structure.

At the bottom layer, X11 is a communication protocol. The units of discourse are user events (e.g., mouse and keyboard actions) and displayable items (e.g., characters and pixel rectangles, also known as "pixrects"). An X11 "server" runs on the user's desktop, making the screen and input devices available to the "client" application.

The low level of the X protocol limits the amount of processing power that the server can usefully provide. Once items display instantly, extra computing power is irrelevant. Compare this to Aqua, Display PostScript, Java, Javascript, or Sun's ill-fated NeWS, all of which can offload rendering and other processing to a separate processor.

In addition, X11 is not well suited to displaying shapes other than rectangles. Although any shape can be rendered as a set of rectangles, a PDF-based description of an arbitrary shape is likely to be a lot shorter than the pixrect equivalent.

At the next level, programming interfaces, X11 provides only the bare essentials. You can draw characters and pixrects, as implied above, but doing anything else requires "widgets". The good news is that there are a lot of widgets to choose from; the bad news is that there are a lot of widget sets to choose from. The sets all do roughly the same things, but the look, feel, and APIs vary.

Similarly, window management can be performed by any of a few dozen "window managers" (really, special-purpose X11 clients). These are similar to "skins" and "themes", but their influence extends into the feel, as well as the look, of the apps they are presenting.

Moving up to the application level, we see even more diversity. Historically, X11 app designers picked their own "hot keys", menu layouts, and other UI options. As a result, there was little consistency at this level.

Recently, some X11-based "desktop environments" have begun to promote more consistency in widgets, window management, and applications. The good news is that these environments are becoming popular; the bad news is that there are several desktop environments to choose from. Gnome and KDE are the most popular in Open Source circles. CDE is found on many proprietary Unix systems, but Sun intends to transition Solaris and its users to Gnome.

In Summary

The X mantra of "mechanism, not policy" has resulted in a prolific, but anarchic collection of APIs, window managers, and look and feel decisions. Like the many variations of the C programming language (e.g., C, C++, Objective-C), X11 has evolved into a "sea" of window systems, each with its own vagaries.

Apple's frameworks may be appallingly complex, but they are internally consistent, logical, and produce consistent results on the desktop. Where Microsoft Windows is simple (nay, simplistic), consistent, and ugly, X11 is powerful, inconsistent, and ugly.

This inconsistency, appearing at all levels of X11, means that users cannot build reliable habits. Apple's developer community has spent a great deal of time and effort on making sure that OSX apps act in a consistent manner; the X11 developer community has not, and it shows.

Co-existence?

Many OSX users and programmers will be inclined to ignore X11 entirely, but there are reasons why you might wish to consider a co-existence strategy. If you need a particular X11 app or some of the capabilities that X11 provides, you'll have to allow X11 into your world. Another reason might be the plethora of free (both libre and gratis) X11 apps.

Some institutions will find X11 unavoidable, because critically necessary apps are only available under it. The engineering and scientific communities have been using Unix and X11 for decades; OSX and Aqua are still (largely unproven) newcomers. Until the apps you need get ported to Cocoa, there really isn't any alternative to using X11.

There is also the possibility that you will need to create an OS-independent and/or network-capable application. As noted above, Apple has no real solution in this area; Apple Remote Desktop is fine for sharing a remote screen, but it isn't capable of supporting generic, distributed applications.

Even if your work doesn't require a specialized app, however, you may be interested in trying out some X11 packages. You can pick these up off the Internet (e.g., via Fink or the GNU-Darwin project), but you'll probably have less trouble with a pre-packaged collection.

BSDMall (www.bsdmall.com) has produced a set of X11-based "Office Applications for Mac OS X". The set includes word processors, spreadsheets, graphics tools, games, and more. You may recognize tools such as AbiWord, Calc, Chimera, Draw, Gaim, Gimp, Impress, Math, and OpenOffice. If you're interested in trying X11, this might be a good starting point.

More generally, for a good list of X11 resources, try Kenton Lee's "Technical X Window System and Motif WWW Sites" page, http://www.rahul.net/kenton/xsites.html. He has done a really fine job of collecting and organizing X11-related links!


Rich Morin has been using computers since 1970, Unix since 1983, and Mac-based Unix since 1986 (when he helped Apple create A/UX 1.0). When he isn't writing this column, Rich runs Prime Time Freeware (www.ptf.com), a publisher of books and CD-ROMs for the Free and Open Source software community. Feel free to write to Rich at rdm@ptf.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.