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

Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
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 below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »

Price Scanner via MacPrices.net

Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more
You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more

Jobs Board

*Apple* Systems Administrator - JAMF - Syste...
Title: Apple Systems Administrator - JAMF ALTA is supporting a direct hire opportunity. This position is 100% Onsite for initial 3-6 months and then remote 1-2 Read more
Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.