What is the lifecycle for loading a Linux Desktop Environment?

I’m looking into delving into a bit of custom OS work (and yes I understand that doing any development at the DE level or lower on an OS is extremely complex and not a light thing to undertake, curiosity is driving this though), I’m in the research phase right now, digging around and learning by example from the source code for projects like GNOME, KDE and XFCE.

I can’t seem to find a really good resource, or resources that describes how a “desktop environment” is initialized, instantiated and drawn to the screen of the user (i.e. it’s lifecycle). I know that Xorg/X11 sits in there somewhere, acting as server and the users screen is the client, and your desktop sits on top of this client. A lot of resources just start talking about rearranging combinations of already developed window managers, apps and such in order to customize your desktop experience, but what I’m thinking is what If I wanted a stripped down OS that only consisted of a screen with three buttons that performed some actions and that was it? I don’t need window management, applications, or other GUI items, just the ability to draw a desktop and three buttons… (hypothetical)

My problem is at the distro level, how does a DE get registered as an available desktop environment, how is it strapped into the distros boot up, what happens after the login, what’s run, what is the topography of a DE? By example, in Ubuntu you can have KDE, XFCE and GNOME installed on one distro and switch between them by logging out, changing the active DE and logging back in so how does the DE make the OS aware of its existence in the first place?

I only really need high level here really, I want to do something fairly simple in that I want to make a DE available in a distro like Ubuntu Desktop (not openly, I mean just for myself) and initialize to an empty desktop (no taskbar, apps, window manager, etc…; just the most base state possible) in order to understand what’s required to get a DE running.

I don’t need code specific answers (where’s the challenge in that right?) but pointers to good resources on how this process works. I’ll take a well formed textual answer over a chunk of code as I’m looking to understand how it all works, the path taken to get to a DE and not implementation specifics.

The outcome of this will not technically be published (code-wise) but I’m looking at doing some blog posts that describe the process of learning all of this and writing the DE layer in order to get a “Raw” desktop up and running in a pre-existing/established OS like Ubuntu, Mint, Gentoo or another distro.

Well, I never actually did what you want to do, but I have some ideas you may consider.

If I were to try what you are doing I would look for a very basic, ultra-minimalistic DE, so that there is little noise and maybe I can build on it.

See an extensive list here: http://xwinman.org/others.php

About how things are starting up. Well, you explained it in big. I would add the following details, general stuff – not Ubuntu specific.

On my Linux, I use Sabayon, but probably on other distros too, there should be a service responsible to initializing X.org and maybe offering the graphical login screen. Look for things like /etc/init.d/xdm , or kdm, gdm, etc. Where “dm” is usually stands for “Display Manager”.

After login, “/etc/X11/xinit/xinitrc” is involved in the action. I’m not sure why. In this, or in the user’s “~/.xinitrc” a line will specify the DE you want to use. Here are some examples from my .xinitrc file:

#exec /usr/bin/enlightenment_start
exec /usr/bin/startkde

The first line would start E17 DE, de second one, currently active, starts KDE.

Additionally, as @sepp2k pointed out, “X has the concept of a root window that you can draw to like to any other X11 window. This window exists automatically and doesn’t have to be created (the X11 API (as well as higher-level APIs like GDK) has a method to get a reference to the root window). That’s how you can draw stuff on the desktop.”

Finally, X.org provides a “handle to the DisplayContext” and you can add a “window on top of the display and draws some lines to it.” as @jduren discovered later.

7

X Window overview:

  • a display is one or several screens, a keyboard, a pointer device (often a mouse) (1)

  • the display server is the program which act a mediator between the display and the program who want to use it (the clients). The server do very little as a matter of ui policy (but it handles the access right one).

  • clients are drawing on windows, rectangular area on the screens.

  • there are special windows which cover each a whole screen, the root windows of those screens.

  • X is a network protocol, so the clients may run on another machine than the server. Part of the protocol allows some communication between clients.

  • drawing window borders, changing the focus, minimizing, … and such kind of ui policy is handled by a client called the window manager. There is very little special about the window manager excepted that it answer to events which are ignored by other clients and for which there can be only one recipient. In some situations, you may end up without a window manager active.

  • there are more or less standardized conventions for communicating between clients and the window manager.

  • desktop environment isn’t a well defined term. What it usually covers is a window manager and a set of applications designed to provide a coherent use model and some more conventions so applications can interact with them and between them. Part of those conventions are also more or less standardized.

  • when you start an X server after having logged in in text mode, or when you use a graphical display manager to log in, there is a session script which is executed. That session script may launch just an xterm on the display, launch several programs and a window manager or starts the initialization of a whole desktop environment. Display managers tend to allow to choose one of several session scripts.

  • Linux distributions do their packaging in such a way that when you install a desktop environment, it registers a session scripts for each of the display manager installed.


(1) well there may be several keyboards and mouses, but you are unable to make a difference between them

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật