X Window System Architecture Overview HOWTO

Total Page:16

File Type:pdf, Size:1020Kb

X Window System Architecture Overview HOWTO X Window System Architecture Overview HOWTO Daniel Manrique [email protected] Revision History Revision 1.0.1 2001−05−22 Revised by: dm Some grammatical corrections, pointed out by Bill Staehle Revision 1.0 2001−05−20 Revised by: dm Initial LDP release. This document provides an overview of the X Window System's architecture, give a better understanding of its design, which components integrate with X and fit together to provide a working graphical environment and what choices are there regarding such components as window managers, toolkits and widget libraries, and desktop environments. X Window System Architecture Overview HOWTO Table of Contents 1. Preface..............................................................................................................................................................1 2. Introduction.....................................................................................................................................................2 3. The X Window System Architecture: overview...........................................................................................3 4. Window Managers..........................................................................................................................................4 5. Client Applications..........................................................................................................................................5 6. Widget Libraries or toolkits...........................................................................................................................6 7. What we have so far........................................................................................................................................7 8. Desktop environments to the rescue..............................................................................................................8 9. Specific Desktop Environments.....................................................................................................................9 10. How it all fits together................................................................................................................................10 11. A day in the life of an X system.................................................................................................................11 12. Copyright and License................................................................................................................................12 i 1. Preface This document aims to provide an overview of the X Window System's architecture, hoping to give people a better understanding of why it's designed the way it's designed, which components integrate with X and fit together to provide a working graphical environment and what choices are there regarding those components. We explore several concepts that get mentioned a lot but might be a bit unclear for those without a technical background, such as widgets and toolkits, window managers and desktop environments. Some examples of how these components interact during day−to−day use of applications are provided. This document is, deliberately, not too technically oriented. It's based on the author's (empirical) knowledge of the subject, and while it's primarily meant as a non−technical introduction, it can certainly benefit from any kind of comments, further examples and explanations, and technical corrections. The author welcomes all questions and comments regarding this document and can be reached at [email protected]. 1. Preface 1 2. Introduction Back when UNIX was a new thing, around 1970, graphical user interfaces were only a weird thing being played with in a laboratory (Xerox's PARC to be precise). Nowadays, however, any operating system in hopes of being competitive needs to have a GUI subsystem. GUIs are supposed to be easier to use. This is not much of a concern under UNIX, which has traditionally been, to some extent, pretty user−hostile, preferring versatility over ease of use. However, there are several reasons why a GUI is desirable even on a UNIX system. For instance, given UNIX's multitasking nature, it's natural to have a lot of programs running at any given time. A GUI gives more control over how things are displayed on−screen, thus providing with better facilities for having a lot of programs on−screen at the same time. Also, some kinds of information are better displayed in graphical form (some, even, can only be displayed in graphical form; like pr0n and other inherently graphical data). Historically, UNIX has had a lot of improvements done by academic types. A good example is the BSD networking code added to it in the late 1970's, which was, of course, the product of work at the University of California at Berkeley. As it turns out, the X Window System (also called X, but never X Windows), which is the foundation for most GUI subsystems found in modern UNIX (unices?), Linux and the BSD's included, was also the result of an academic project, namely the Athena project at the Massachusetts Institute of Technology (MIT). Unix has been a multiuser, multitasking, timesharing operating system since its beginnings. Also, since the incorporation of networking technologies, it's had the ability to allow a user to connect remotely and perform work on the system. Previously this was accomplished either via dumb serial terminals, or network connections (the legendary telnet). When the time came to develop a GUI system that could run primarily under Unix, these concepts were kept in mind and incorporated into the design. Actually, X has a pretty complex design, which has often been mentioned as a disadvantage. However, because of its design, it's also a really versatile system, and this will become quite clear as we explain how all the parts comprising a GUI under Unix fit together. Before taking a look at X's architecture, a really brief tour of its history, and how it ended up on your Linux system, is in order. X was developed by the Athena project, and released in 1984. In 1988 an entity called the "X Consortium" took over X, and to this day handles its development and distribution. The X specification is freely available, this was a smart move as it has made X almost ubiquitous. This is how XFree86 came to be. XFree86 is the implementation of X we use on our Linux computers. XFree86 also works on other operating systems, like the *BSD lineage, OS/2 and maybe others. Also, despite its name, XFree86 is also available for other CPU architectures. 2. Introduction 2 3. The X Window System Architecture: overview X was designed with a client−server architecture. The applications themselves are the clients; they communicate with the server and issue requests, also receiving information from the server. The X server maintains exclusive control of the display and services requests from the clients. At this point, the advantages of using this model are pretty clear. Applications (clients) only need to know how to communicate with the server, and need not be concerned with the details of talking to the actual graphics display device. At the most basic level, a client tells the server stuff like "draw a line from here to here", or "render this string of text, using this font, at this position on−screen". This would be no different from just using a graphics library to write our application. However the X model goes a step further. It doesn't constrain the client being in the same computer as the server. The protocol used to communicate between clients and server can work over a network, or actually, any "inter−process communication mechanism that provides a reliable octet stream". Of course, the preferred way to do this is by using the TCP/IP protocols. As we can see, the X model is really powerful; the classical example of this is running a processor−intensive application on a Cray computer, a database monitor on a Solaris server, an e−mail application on a small BSD mail server, and a visualization program on an SGI server, and then displaying all those on my Linux workstation's screen. So far we've seen that the X server is the one handling the actual graphics display. Also, since it's the X server which runs on the physical, actual computer the user is working on, it's the X server's responsibility to perform all actual interactions with the user. This includes reading the mouse and keyboard. All this information is relayed to the client, which of course will have to react to it. X provides a library, aptly called Xlib, which handles all low−level client−server communication tasks. It sounds obvious that, then, the client has to invoke functions contained within Xlib to get work done. At this point everything seems to be working fine. We have a server in charge of visual output and data input, client applications, and a way for them to communicate between each other. In picturing a hypothetical interaction between a client and a server, the client could ask the server to assign a rectangular area on the screen. Being the client, I'm not concerned with where i'm being displayed on the screen. I just tell the server "give me an area X by Y pixels in size", and then call functions to perform actions like "draw a line from here to there", "tell me whether the user is moving the mouse in my screen area" and so on. 3. The X Window System Architecture: overview 3 4. Window Managers However, we never mentioned how the X server handles manipulation of the clients' on−screen display areas (called windows). It's obvious, to anyone
Recommended publications
  • Linux on a Stick Everyone Knows You Can Boot Linux from a Live CD, but Have You Thought About Putting Linux on a Compact and Highly Portable USB
    KNOW HOW Memory Stick Linux Booting Linux from a USB Memory Stick Linux on a Stick Everyone knows you can boot Linux from a live CD, but have you thought about putting Linux on a compact and highly portable USB memory stick? BY FABRIZIO CIACCHI bootable “live” CD like Knoppix much more common. Part of our pur- ent from DSL, but it includes more [1] or Kanotix [2] gives the user a pose is to create an inexpensive system, software (about 14 MB plus), and it Afully portable operating environ- so I will base this discussion on the stan- has already been refined and tested for ment. You can carry your system with dard and very common 128 MB size. USB devices. you and boot it from anywhere. However, the procedure I describe in this • Flonix [8]: Flonix is also based on Your tools, your files, and your work- article can also be used to put a larger DSL, but it uses some different pro- space will follow you wherever you go – Knoppix-based distribution on a larger grams (for instance, IceWM instead even to another PC with a different USB memory stick. of Fluxbox). The Flonix project also operating system. Live CDs are also used Assuming you want room to work and introduced a useful web install by system administrators for trouble- store documents, it is a good idea to only process. Ultimately, Flonix was so shooting computers that won’t boot use half of the available space (64 MB) successful that it become a commer- normally. for the Linux system and related tools.
    [Show full text]
  • Web Vmstat Any Distros, Especially Here’S Where Web Vmstat Comes Those Targeted at In
    FOSSPICKS Sparkling gems and new releases from the world of FOSSpicks Free and Open Source Software Mike Saunders has spent a decade mining the internet for free software treasures. Here’s the result of his latest haul… Shiny statistics in a browser Web VMStat any distros, especially Here’s where Web VMStat comes those targeted at in. It’s a system monitor that runs Madvanced users, ship an HTTP server, so you can connect with shiny system monitoring tools to it via a web browser and see on the desktop. Conky is one such fancy CSS-driven charts. Before you tool, while GKrellM was all the rage install it, you’ll need to get the in the last decade, and they are websocketd utility, which you can genuinely useful for keeping tabs find at https://github.com/ on your boxes, especially when joewalnes/websocketd. Helpfully, you’re an admin in charge of the developer has made pre- various servers. compiled executables available, so Now, pretty much all major you can just grab the 32-bit or distros include a useful command 64-bit tarball, extract it and there line tool for monitoring system you have it: websocketd. (Of course, Here’s the standard output for vmstat – not very interesting, right? resource usage: vmstat. Enter if you’re especially security vmstat 1 in a terminal window and conscious, you can compile it from copy the aforementioned you’ll see a regularly updating (once its source code.) websocketd into the same place. per second) bunch of statistics, Next, clone the Web VMStat Git Then just enter: showing CPU usage, free RAM, repository (or grab the Zip file and ./run swap usage and so forth.
    [Show full text]
  • Working with System Frameworks in Python and Objective-C
    Working with System Frameworks in Python and Objective-C by James Barclay Feedback :) j.mp/psumac2015-62 2 Dude, Where’s My Source Code? CODE https://github.com/futureimperfect/psu-pyobjc-demo https://github.com/futureimperfect/PSUDemo SLIDES https://github.com/futureimperfect/slides 3 Dude, Where’s My Source Code? CODE https://github.com/futureimperfect/psu-pyobjc-demo https://github.com/futureimperfect/PSUDemo SLIDES https://github.com/futureimperfect/slides 3 Dude, Where’s My Source Code? CODE https://github.com/futureimperfect/psu-pyobjc-demo https://github.com/futureimperfect/PSUDemo SLIDES https://github.com/futureimperfect/slides 3 Agenda 1. What are system frameworks, and why should you care? 2. Brief overview of the frameworks, classes, and APIs that will be demonstrated. 3. Demo 1: PyObjC 4. Demo 2: Objective-C 5. Wrap up and questions. 4 What’s a System Framework? …and why should you care? (OS X) system frameworks provide interfaces you need to write software for the Mac. Many of these are useful for Mac admins creating: • scripts • GUI applications • command-line tools Learning about system frameworks will teach you more about OS X, which will probably make you a better admin. 5 Frameworks, Classes, and APIs oh my! Cocoa CoreFoundation • Foundation • CFPreferences - NSFileManager CoreGraphics - NSTask • Quartz - NSURLSession - NSUserDefaults • AppKit - NSApplication 6 CoreFoundation CoreFoundation is a C framework that knows about Objective-C objects. Some parts of CoreFoundation are written in Objective-C. • Other parts are written in C. CoreFoundation uses the CF class prefix, and it provides CFString, CFDictionary, CFPreferences, and the like. Some Objective-C objects are really CF types behind the scenes.
    [Show full text]
  • Ubuntu Kung Fu
    Prepared exclusively for Alison Tyler Download at Boykma.Com What readers are saying about Ubuntu Kung Fu Ubuntu Kung Fu is excellent. The tips are fun and the hope of discov- ering hidden gems makes it a worthwhile task. John Southern Former editor of Linux Magazine I enjoyed Ubuntu Kung Fu and learned some new things. I would rec- ommend this book—nice tips and a lot of fun to be had. Carthik Sharma Creator of the Ubuntu Blog (http://ubuntu.wordpress.com) Wow! There are some great tips here! I have used Ubuntu since April 2005, starting with version 5.04. I found much in this book to inspire me and to teach me, and it answered lingering questions I didn’t know I had. The book is a good resource that I will gladly recommend to both newcomers and veteran users. Matthew Helmke Administrator, Ubuntu Forums Ubuntu Kung Fu is a fantastic compendium of useful, uncommon Ubuntu knowledge. Eric Hewitt Consultant, LiveLogic, LLC Prepared exclusively for Alison Tyler Download at Boykma.Com Ubuntu Kung Fu Tips, Tricks, Hints, and Hacks Keir Thomas The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas Prepared exclusively for Alison Tyler Download at Boykma.Com Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
    [Show full text]
  • UKUI: a Lightweight Desktop Environment Based on Pluggable
    2016 International Conference on Artificial Intelligence and Computer Science (AICS 2016) ISBN: 978-1-60595-411-0 UKUI: A Lightweight Desktop Environment Based on Pluggable Framework for Linux Distribution Jie YU1, Lu SI1,*, Jun MA1, Lei LUO1, Xiao-dong LIU1, Ya-ting KUANG2, Huan PENG2, Rui LI1, Jin-zhu KONG2 and Qing-bo WU1 1College of Computer, National University of Defense Technology, Changsha, China 2Tianjin KYLIN Information Technology Co., Ltd, Tianjin, China *[email protected] *Corresponding author Keywords: Desktop environment, Ubuntu, User interface. Abstract. Ubuntu is an operating system with Linux kernel based on Debian and distributed as free and open-source software. It uses Unity as its default desktop environment, which results in more difficulties of usage for Microsoft Windows users. In this paper, we present a lightweight desktop environment named UKUI based on UbuntuKylin, the official Chinese version of Ubuntu, for Linux distribution. It is designed as a pluggable framework and provides better user experience during human-computer interaction. In order to evaluate the performance of UKUI, a set of testing bench suits were performed on a personal computer. Overall, the results showed that UKUI has better performance compared with Unity. Introduction Linux is a freely available operating system (OS) originated by Linux Torvalds and further developed by thousands of others. Typically, Linux is packaged in a form known as a Linux distribution for both desktop and server use. Some of the most popular mainstream Linux distributions are Red Hat [1], Ubuntu [2], Arch [3], openSUSY [4], Gentoo [5], etc. There are several desktop environments available for nowadays modern Linux distributions, such as XFCE [6], GNOME [7], KDE [8] and LXDE [9].
    [Show full text]
  • Porting a Window Manager from Xlib to XCB
    Porting a Window Manager from Xlib to XCB Arnaud Fontaine (08090091) 16 May 2008 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version pub- lished by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Contents List of figures i List of listings ii Introduction 1 1 Backgrounds and Motivations 2 2 X Window System (X11) 6 2.1 Introduction . .6 2.2 History . .6 2.3 X Window Protocol . .7 2.3.1 Introduction . .7 2.3.2 Protocol overview . .8 2.3.3 Identifiers of resources . 10 2.3.4 Atoms . 10 2.3.5 Windows . 12 2.3.6 Pixmaps . 14 2.3.7 Events . 14 2.3.8 Keyboard and pointer . 15 2.3.9 Extensions . 17 2.4 X protocol client libraries . 18 2.4.1 Xlib . 18 2.4.1.1 Introduction . 18 2.4.1.2 Data types and functions . 18 2.4.1.3 Pros . 19 2.4.1.4 Cons . 19 2.4.1.5 Example . 20 2.4.2 XCB . 20 2.4.2.1 Introduction . 20 2.4.2.2 Data types and functions . 21 2.4.2.3 xcb-util library . 22 2.4.2.4 Pros . 22 2.4.2.5 Cons . 23 2.4.2.6 Example . 23 2.4.3 Xlib/XCB round-trip performance comparison .
    [Show full text]
  • Part II, Window Managers and Desktop Environments
    Part II Window Managers and Desktop Environments The window manager is responsible for managing application windows and application- independent behavior, such as pop-up menus appearing in the background. The window manager manages the placement, borders, and decorations of all windows, and is responsible for the look and feel of your particular X session. Desktop environments typically include an integrated window manager, some sort of control panel, applications, and a consistent look and feel across applications. The chapters in Part II, Window Managers and Desktop Environments, are: Overview This chapter provides a conceptual introduction to window managers and desktop environments and briefly surveys some of the many window managers and desktop environments available for Linux. FVWM FVWM is a traditional window manager for Linux systems. It is now into its second major version, FVWM2. Window Maker Window Maker is an elegant X11 window manager designed to give integration support to GNUstep-based applications. It emulates the look and feel of OpenStep, the NeXTSTEP GUI. Enlightenment Enlightenment, often shortened to just E, may be the most elaborate and bizarre window manager available. Enlightenment’s motto, “time to rethink everything,” provides a good indication of the uniqueness and flashiness behind Enlightenment. Using GNOME GNOME, which stands for GNU Network Object Model Environment, is a freely available desktop environment that can be used with any of several window managers, including Enlightenment and Sawfish. Using KDE KDE, the K Desktop Environment, is another freely available desktop environment. KDE includes an assortment of games and utilities, as well as an integrated suite of office productivity applications..
    [Show full text]
  • Easy Slackware
    1 Создание легкой системы на базе Slackware I - Введение Slackware пользуется заслуженной популярностью как классический linux дистрибутив, и поговорка "кто знает Red Hat тот знает только Red Hat, кто знает Slackware тот знает linux" несмотря на явный снобизм поклонников "бога Патре­ га" все же имеет под собой основания. Одним из преимуществ Slackware является возможность простого создания на ее основе практически любой системы, в том числе быстрой и легкой десктопной, о чем далее и пойдет речь. Есть дис­ трибутивы, клоны Slackware, созданные именно с этой целью, типа Аbsolute, но все же лучше создавать систему под себя, с максимальным учетом именно своих потребностей, и Slackware пожалуй как никакой другой дистрибутив подходит именно для этой цели. Легкость и быстрота системы определяется выбором WM (DM) , набором программ и оптимизацией программ и системы в целом. Первое исключает KDE, Gnome, даже новые версии XFCЕ, остается разве что LXDE, но набор программ в нем совершенно не устраивает. Оптимизация наиболее часто используемых про­ грамм и нескольких базовых системных пакетов осуществляется их сборкой из сорцов компилятором, оптимизированным именно под Ваш комп, причем каж­ дая программа конфигурируется исходя из Ваших потребностей к ее возможно­ стям. Оптимизация системы в целом осуществляется ее настройкой согласно спе­ цифическим требованиям к десктопу. Такой подход был выбран по банальной причине, возиться с gentoo нет ни­ какого желания, комп все таки создан для того чтобы им пользоваться, а не для компиляции программ, в тоже время у каждого есть минимальный набор из не­ большого количества наиболее часто используемых программ, на которые стоит потратить некоторое, не такое уж большое, время, чтобы довести их до ума. Кро­ ме того, такой подход позволяет иметь самые свежие версии наиболее часто ис­ пользуемых программ.
    [Show full text]
  • Introduction to the Enlightenment Foundation Libraries
    Introduction to the Enlightenment foundation libraries. An overview of EFL Kostis Kapelonis Introduction to the Enlightenment foundation libraries.: An overview of EFL Kostis Kapelonis Abstract The target audience of this document are UNIX programmers who are interested in the Enlightenment Foundation Libraries (EFL). You must already know C programming. You will not however learn how to program using the EFL. Instead, you will learn why you should program with the EFL. If you ever wanted to evaluate the EFL but did not see any advantages over previous graphic libraries then this document is for you! Table of Contents 1. Introduction ............................................................................................................................1 A little History ...................................................................................................................1 Related documentation ......................................................................................................... 2 Obtaining the EFL libraries ................................................................................................... 2 2. The EFL structure .................................................................................................................... 4 Organization of the Libraries ................................................................................................. 4 Brief description of each EFL library ...................................................................................... 5 3.
    [Show full text]
  • Lightweight Distros on Test
    GROUP TEST LIGHTWEIGHT DISTROS LIGHTWEIGHT DISTROS GROUP TEST Mayank Sharma is on the lookout for distros tailor made to infuse life into his ageing computers. On Test Lightweight distros here has always been a some text editing, and watch some Linux Lite demand for lightweight videos. These users don’t need URL www.linuxliteos.com Talternatives both for the latest multi-core machines VERSION 2.0 individual apps and for complete loaded with several gigabytes of DESKTOP Xfce distributions. But the recent advent RAM or even a dedicated graphics Does the second version of the distro of feature-rich resource-hungry card. However, chances are their does enough to justify its title? software has reinvigorated efforts hardware isn’t supported by the to put those old, otherwise obsolete latest kernel, which keeps dropping WattOS machines to good use. support for older hardware that is URL www.planetwatt.com For a long time the primary no longer in vogue, such as dial-up VERSION R8 migrators to Linux were people modems. Back in 2012, support DESKTOP LXDE, Mate, Openbox who had fallen prey to the easily for the i386 chip was dropped from Has switching the base distro from exploitable nature of proprietary the kernel and some distros, like Ubuntu to Debian made any difference? operating systems. Of late though CentOS, have gone one step ahead we’re getting a whole new set of and dropped support for the 32-bit SparkyLinux users who come along with their architecture entirely. healthy and functional computers URL www.sparkylinux.org that just can’t power the newer VERSION 3.5 New life DESKTOP LXDE, Mate, Xfce and others release of Windows.
    [Show full text]
  • The GNOME Desktop Environment
    The GNOME desktop environment Miguel de Icaza ([email protected]) Instituto de Ciencias Nucleares, UNAM Elliot Lee ([email protected]) Federico Mena ([email protected]) Instituto de Ciencias Nucleares, UNAM Tom Tromey ([email protected]) April 27, 1998 Abstract We present an overview of the free GNU Network Object Model Environment (GNOME). GNOME is a suite of X11 GUI applications that provides joy to users and hackers alike. It has been designed for extensibility and automation by using CORBA and scripting languages throughout the code. GNOME is licensed under the terms of the GNU GPL and the GNU LGPL and has been developed on the Internet by a loosely-coupled team of programmers. 1 Motivation Free operating systems1 are excellent at providing server-class services, and so are often the ideal choice for a server machine. However, the lack of a consistent user interface and of consumer-targeted applications has prevented free operating systems from reaching the vast majority of users — the desktop users. As such, the benefits of free software have only been enjoyed by the technically savvy computer user community. Most users are still locked into proprietary solutions for their desktop environments. By using GNOME, free operating systems will have a complete, user-friendly desktop which will provide users with powerful and easy-to-use graphical applications. Many people have suggested that the cause for the lack of free user-oriented appli- cations is that these do not provide enough excitement to hackers, as opposed to system- level programming. Since most of the GNOME code had to be written by hackers, we kept them happy: the magic recipe here is to design GNOME around an adrenaline response by trying to use exciting models and ideas in the applications.
    [Show full text]
  • Linux Einführungskurs
    Linux Einführungskurs Burkhard Obergöker Oktober 2011 Linux-Einführungskurs Inhalt 1 BEVOR ES LOSGEHT .....................................................................................4 2 HISTORIE..........................................................................................................5 3 AUFBAU DES UNIX-( UND LINUX-) SYSTEMS..............................................6 4 BENUTZERVERWALTUNG.............................................................................8 4.1 Benutzer..................................................................................................................................................8 4.2 Der Superuser (root)..............................................................................................................................8 4.3 Gruppen..................................................................................................................................................8 5 DATEISYSTEME.............................................................................................10 5.1 Die Struktur des Dateisystems...........................................................................................................10 5.2 Dateitypen.............................................................................................................................................11 5.3 Technischer Aufbau eines Dateisystems............................................................................................11 5.4 Rechtevergabe......................................................................................................................................13
    [Show full text]