Upload
santoshbjs
View
223
Download
1
Embed Size (px)
Citation preview
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Windows
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Course topics• X Windows♦ X Protocol♦ Window managers♦ Classic X apps♦ Starting X apps
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X WindowsThe X Windows System, also referred to as ‘X’ or “X11”, is the standard graphical engine for Unix and Linux.
It is largely OS and hardware independent, it is network-transparent, and it supports many different desktops.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Windows cont’dX was developed in the mid 80’s to provide a standard GUI for Unix systems, similar to Microsoft Windows.
Windows only runs locally on the machine, but X Windows uses the X Protocol to separate the processing and display for an application.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X ProtocolThe X Protocol provides a client-server architecture at the application level:
The X client is the processing part of the application and often runs on a remote machine.
The X server is the display and interaction system.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Protocol cont’dThe X Protocol is also divided into device dependent and device independent layers.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X architectureThe client-server nature of the X Protocol allows a single X server to support many clients (applications) on several hosts.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
roles of a windowing system
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Windows architecture
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Windows architecture (ctd)• pixel imaging model with some pointing
mechanism
• X protocol defines server-client communication
• separate window manager client enforces policies for input/output:♦ how to change input focus♦ tiled vs. overlapping windows♦ inter-client data transfer
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Client-server designX server• Runs locally and accepts multiple X clients• Displays drawing requests and errors• Handles keyboard, video, and mouse• Creates and destroys windows
X client• An application written using X libraries (e.g. Xlib)• Sends request and receives events and errors
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
X Protocol messagesRequests – client sends requests to the server (e.g. create window)
Replies – server response to client requests
Events – server forwards events (such as mouse clicks or keyboard entry) to the client
Errors – server reports errors to the client
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
An aside: XFree86What is XFree86?
“In short, XFree86 is an open source X11-based desktop infrastructure.” – xfree86.org
It runs primarily on Unix and Unix-like OSes such as Linux (and also under Cygwin).
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Using X WindowsFirst, an X server must be running:On a local PC or workstation, you can usually start the X server with the “startx” command or it may start automatically, presenting a graphical login display.
Historical note: An X terminal is a dumb terminal that only runs the X server locally, and always connects to X clients on a remote host.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
xtermThe most important X application is, rather ironically, the terminal program xterm.
Old school xterm:
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Xterm cont’d
Fancy xterm: OS X xterm:
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
An aside: Copying textIn X Windows, the copying interaction is very different from the Ctrl-C/Ctrl-V of Windows.
In an xterm or other X application, highlight the text with the left button, and then paste by middle clicking in any window accepting input.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Some classic X appsxman – manual pages app
Not this
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Some classic X appsxbiff – mail notification
Back when we didn’t have mail servers (and we liked it!), mail was stored in local spool files and a process notified the user of new mail. xbiff is named after biff, which is named after Biff the dog, who barked at the postman. Seriously.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Some classic X appsxeyes – ok, this is really the most important
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Some classic X appsxclock – pretty self-explanatory
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Window managersThe window manager is a special X client that controls the placement and movement of applications, provides title bars and control buttons, menus and taskbars. Some support virtual desktops and very fancy graphics.
Classic window managers include: twm, mwm, olwm, fvwm
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Starting X applicationsTo launch an X client from a remote host for display on the local X server, you need to set two things:1) Permission for the remote host to display X clients on the local machine.
xhost +remotehost2) The target display for the remote application.
setenv DISPLAY=server:display