The purpose of this assignment is to give you some hands-on experience playing with the details of the X Window system. In particular, by the end of the assignment, you should have a good understanding of how to use X and how X manages complexity using modularity (through client and servers) and hierarchy (in managing windows). This assignment should take one to two hours at most. Please turn in answers to the questions asked only! Do not submit pages of output from the various commands. Also include how long this assignment took you to complete so we can gauge the complexity of future assignments.
I. Warmup
Section 2 of the paper presents nine design requirements for the X window system. See if you can think of examples of how these requirements are used in X today. For example, the requirement of display independence is realized by the fact that the machines in Berry patch cluster are different models and from different vendors, but all run X. In a few sentences, describe an example of something which uses the fifth requirement.
II. Basic X usage
The design of X has led it to be highly configurable and customizable. You may notice this in how different people can make their logins. To begin understanding some of this, skim the generic man page for the X:
berry-patch-machine% man XCreate an xterm with a different background and foreground color from the default, that starts out in the bottom right corner. Give the command you used.
III. Understanding the window hierarchy
Now, let's get our hands dirty playing with some of the more technical parts of X. There are a number of useful commands that are provided with the X Window System that helps you explore the different properties of the system. The first one we will look at is called
xwininfo. Run it, and then click on the window you ran it from.berry-patch-machine% xwininfoxwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x3000014 "XTerminal" Absolute upper-left X: 296 Absolute upper-left Y: 244 Relative upper-left X: 0 Relative upper-left Y: 0 Width: 499 Height: 316 Depth: 16 Visual Class: TrueColor Border width: 0 Class: InputOutput Colormap: 0x23 (installed) Bit Gravity State: NorthWestGravity Window Gravity State: NorthWestGravity Backing Store State: NotUseful Save Under State: no Map State: IsViewable Override Redirect State: no Corners: +296+244 -5+244 -5-40 +296-40 -geometry 80x24-0-35As you can see, this reveals a lot of the properties of the window. Your reading from part II should help you make sense of most of these properties. xwininfo also has two options which help you explore the window hierarchy. First try:
and select the xterm you ran that from. As you can see, the window has a parent and a child. In conjunction with the -id option toberry-patch-machine% xwininfo -childrenxwininfo, explore up and down the tree for your Xterm. Use the the different options toxwininfoto find out more about these windows. What is the function of each of the parents? What about the children? How are they realized on your screen? You may find the -tree option useful as well.IV. Architecture
Consider figure 1 from the paper (p.85). Now consider the workstation you are logged in to. On your display you have many windows. According to the figure, these windows are generated by applications that run over the network and talk to a server. In your case, what machine is running the server? What machine is running the clients? Does the network play a role?
V. Wrap-up
Hopefully this has given you a taste of how X works. There are other useful tools that will let you explore the details of X. Here is a list of some of them. If you are interested, you can run them and see what they tell you. You may find the man pages useful in understanding what they do.
- xev
- xdpyinfo
- xlsclients
- xprop
- xrdb