Wednesday, April 17, 2013

X Window System


Back in 1970 when Unix was released,it comes with CLI (command line interface) which is to some extent, pretty user-hostile .Nowadays every operating system have a GUI subsystem.They are several reason to use a GUI over CLI,it gives more control over how things are displayed on-screen and it's multitasking nature gives a lot of programs running at any given time.Historically, UNIX has developed a lot by academic project. One such project, Athena project at the Massachusetts Institute of Technology (MIT) developed X Window System.



Later an entity called the "X Consortium" took over X .This is how XFree86 came. Now X project are lead by X.Org Foundation. This consortium developed X windows system current protocol (X11version) and it's been used by all major Linux distributors.
  
http://en.wikipedia.org/wiki/XFree86#Release_history

X Window overview


X is designed as a client/server architecture. The clients communicate to the X server using the X11 network protocol. Clients can run locally to the Xserver or remotely on other machines



The applications (window manager,xterm) themselves are the clients; they communicate with the server and issue requests such as "create a rectangular box", or "render this string of text, using this font, at this position on-screen".



X server is in charge of actual graphics display,includes reading the mouse and keyboard. Client only concern is to create a rectangular box in some X by Y pixel in size,it's the server decide where to create the box.

1.The screen is your whole ``desktop''
2.The root window is the background of your screen.
3.The window manager is the main interface between the X Window system and the user.




 
The X server basic services are : input handling, window services, graphics, text and fonts.



Input handling services taking keyboard and mouse inputs to clients as events via the window manager, which X regards as just another client. Window services are requests by clients to the X server to provide information about windows or to create or destroy them .Graphics services are the drawing of lines and shapes.

Window manager

Now X server creates the rectangular box,however X server doesn't handles manipulation such aschanging size, maximize or minimize windows. The program that decides where to place windows, control the windows' appearance, position and size, window titles, and buttons is called Window Manager. windows manager is a X client application





Window manager which is essentially the component which controls the appearance of windows and provides the means by which the user can interact with them.



Windows manager : Sawmill, Metacity, Mutter





Toolkit

Windows manages gives the appearance,but where did the decorations of the windows come from. This job is done by Widget toolkits. Widget toolkits are library function an API which include decorative menus, buttons, radio buttons, scroll bars, and canvases. In simple terms windows managers arrange the windows and toolkits provides the decoration. Toolkit is another X client application





The widely known toolkit which is used is GTK+,it was originally designed and used in the GNU Image Manipulation Program (GIMP) project. Another famous toolkit is QT.



Toolkit widgets : GTK+, QT





Upto this point we are talking about X server/client architecture. In this server/client architecture we see several window managers and lot of widget toolkit libraries. Let say that a User opened 3 different application each using a different window manager and toolkit. This means each application varies from one window manager to other. This create a mess. This is resolved by Desktop Environment



Desktop Environment



A Desktop Environment provides a range of integrated utilities and applications such as panels(or starting applications and displaying status ) a desktop (where data and applications can be placed), windows manages and toolkit.



The most popular Linux desktop environments are GNOME and KDE.



GNOME uses MUTTER as windows manager and GTK+ as widget toolkit library. On the other hand KDE uses KWin as their window manager and QT as widget toolkit





So these all create a desktop in your Linux Box.Seem overwhelming? It's definitely a different experience than Windows where you just install the OS and go.


No comments:

Post a Comment