X Windows - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

X Windows

Description:

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. ... X architecture ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 22
Provided by: andrew345
Category:
Tags: windows

less

Transcript and Presenter's Notes

Title: X Windows


1
X Windows
COMP 121-401 UNIX Programming
  • Andrew Nashel
  • nashel_at_cs.unc.edu
  • Department of Computer Science
  • February 4, 2004

2
Course topics
  • X Windows
  • X Protocol
  • Window managers
  • Classic X apps
  • Starting X apps

3
X Windows
  • The 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.

4
X Windows contd
  • X was developed in the mid 80s 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.

5
X Protocol
  • The 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.

6
X Protocol contd
  • The X Protocol is also divided into device
    dependent and device independent layers.

7
X architecture
  • The client-server nature of the X Protocol allows
    a single X server to support many clients
    (applications) on several hosts.

8
Client-server design
  • X 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

9
X Protocol messages
  • Requests 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

10
An aside XFree86
  • What 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).

11
Using X Windows
  • First, 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.

12
xterm
  • The most important X application is, rather
    ironically, the terminal program xterm.

Old school xterm
13
Xterm contd
OS X xterm
Fancy xterm
14
An aside Copying text
  • In 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.

15
Some classic X apps
  • xman manual pages app

Not this
16
Some classic X apps
  • xbiff mail notification
  • Back when we didnt 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.

17
Some classic X apps
  • xeyes ok, this is really the most important

18
Some classic X apps
  • xclock pretty self-explanatory

19
Window managers
  • The 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

20
Starting X applications
  • To 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 remotehost
  • 2) The target display for the remote
    application.
  • setenv DISPLAYserverdisplay

21
Homework for Fri., Feb 2
  • Try and work out any problems you had with
    profiling and/or porting code to a Unix system.
  • Ill be able to help on a case by case basis,
    tomorrow and Friday.
Write a Comment
User Comments (0)
About PowerShow.com