Working principle of a Desktop environment

Hi guys

You guys have been always a great help to me.

Today I am posting or you can say asking something very unusual.

till now you guys have met people asking that questions about Linux and it's development either in normal way or in embedded field.

But I am not going to ask this as there are lots of stuff out there on google and others.

What I want to ask is that the working principle of the Desktop environment, i.e. how it works and how it is laid over the Linux I mean the way we run our applications over linux kernel just by installing the kernel and providing a rootfs to it we are able to talk to the kernel with the terminal or command line.

But this time I want to know that how the GUI layer is laid over the Linux kernel.

I do a couple of hours search but found nothing very much informative except this link.

formatting link

It's very informative, but I want more information as deep as it would be so that I would be able to get each and every bit of understanding of it.

All you guys are expert , So I though rather than wasting my time in googling and searching in wrong direction I opt for you people support to guide me in write direction.

Just give me hint that how to search for this matter on google, any special links if you have regarding that please do share with me and also any kind of article or book is there please provide me link.

I hope that you guys would not mind I just want a kick start that's it and nothing else. So please give me support in this regard and I am hoping support from all specialists visiting this post.

Thanks and Regards.

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey
Loading thread data ...

You should start by learning about the X11 server and what a window manager is. It's a fairly good start.

--
Weland Treebark, 
Wandering Philosopher and Engineer
Reply to
Weland

The bird's eye view is as follow.

An X server (X11) runs on top of the Linux kernel. It grabs the whole display and listens to unix domain socket and/or TCP/IP for the connections. (There are alternatives, I'll tell you later).

The software uses some kind of GUI toolkit library (GTK+, Qt, E17 etc.) to draw its widgets. The toolkit library is a wrapper on top of low-level graphics API, X11 protocol. The X11 protocol library connects to X server via the socket. If the connection is done locally, the socket connection is usually immediately upgraded to faster shared memory connection.

Each toolkit library has its own high level rendering engine. Qt has everything built-in. GTK+ uses Cairo for vector graphics and Pango for font rendering, and Pango uses Freetype.

Most toolkits are able to use OpenGL and/or OpenVG if available. The OpenGL is forwarded to the X server (so-called GLX).

Window decorations (window manager), toolbars etc. are separate programs that communicate with each other by means of the X server. The X server itself just splits the screen into overlapping rectangles where the clients could draw their images.

Alternatives to X11: Wayland/Weston is proposed to replace X11. A full-screen program on an embedded system may use kernel framebuffer and/or OpenGL directly or via DirectFB library. Qt has an option for that.

There are toolkit-independent wrappers around simple 2D/3D graphics (no widgets), i.e. SDL. SDL is able to work fullscreen without X. There are cross-platform widget library wrappers like wxWidgets if you want to write the same code for Windows and Linux.

Regards, Alex

Reply to
Alexey Galakhov

Hi that's a very good explanation from Alex.

I think wanderer is right that I should start from the X11 and windows manager

if I stuck anywhere I will ask you guys.

Thanks a lot Alex and wandere.

Meanwhile this is for you Alex , do you have good collections or links about this topic if yes please do share it with me.

Thanks again.

--------------------------------------- Posted through

formatting link

Reply to
piyushpandey

Unfortunately I don't have one. I would recommend you the "Linux from Scratch" book that describes the build process of everything. All the dependencies between the components are explained here.

formatting link

The X11 is the most widely used technology. It is however considered outdated by many people, and all modern GUI libraries use only about 10% of X11 functions, replacing everything else with their own more effective solutions. That's why Wayland was created - like "X11 without unused obsolete stuff". If you're building an embedded system from scratch, consider learning Wayland too.

Qt Embedded may be the easy way to build GUI without X. But I don't like it due to the way how it is made. For really very simple drawings just use Cairo on top of fbdev, it is very easy to do but very limited. OpenGL (ES) is very easy without X too.

Regards, Alex

Reply to
Alexey Galakhov

That's why "modern" X11 applications can't be run remotely the way older X11 applications can be. One of the things that modern GUI libraries are "effective" at is creating tens of thousands of extra network transactions that will stop an application dead in its tracks if you try to use a link slower than 100Mbps.

--
Grant Edwards               grant.b.edwards        Yow! Are you mentally here 
                                  at               at Pizza Hut?? 
 Click to see the full signature
Reply to
Grant Edwards

I'm a bit puzzled here. The OP is asking about a desktop GUI. I don't see how the external network speed should affect transfers to and from the X11 server. Do those transactions actually go in and out of the physical network interface? That would certainly be useful for a remote desktop, but is it actually done for the desktop on a single system?

Mark Borgerson

Reply to
Mark Borgerson

No of course not, not when the X server is the same machine as the X client.

X has the advantage that everything still works the same as before when they are *not* the same machine - when you are running applications remotely, with the physical display (x server) on a separate machine from the application (x client). But modern GUIs can be very slow when run like that on a network, due to latencies of all the transactions involved. Much slower than you would think just from looking at the bandwidth.

--

John Devereux
Reply to
John Devereux

On a typical desktop, they don't go through a physical network interface (no Ethernet packets are sent down twisted-pair). However, they _do_ go through network sockets, and the X11 system was designed to be transport-agnostic so that it would work the same if the serverclient connection was a Unix-domain socket or a TCP/IP connection via Ethernet, DSL, PPP, SLIP or whatever.

Usually an actual Unix-domain stream socket is used, but it's all handled locally by the OS.

NB: There are some X11 extension that can allocate a local shared memory segment that is then used for communications between client and server. I think this is typically done for things like video playback.

--
Grant Edwards               grant.b.edwards        Yow! I'm GLAD I 
                                  at               remembered to XEROX all 
 Click to see the full signature
Reply to
Grant Edwards

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.