How does the DE > WM > Xorg stack work on Cinnamon?

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
g_o

How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Hey, I got interested in how desktop environments work because I want to customize my desktop a bit further.
There's something that I find hard to understand though - I get that a desktop environment is basically intergrating a bunch of tools together and make them coherent but for example what does it mean that Cinnamon is based on Gnome-Shell. Like what Cinnamin did? What's it job/interaction added to gnome, or maybe I'm just getting the wrong impression and it just changed it from the source rather than "adding" or building-upon it things.
The thing is - I want to make some customized desktop environment, but it requires some serious change in fundamental interactions, yet at the same time I'd say that the window manager should stay mostly as it is so I don't really get the architecture of DEs like Cinnamon.
Like the lines are very blurry to me between the Window Manager , X System and the Desktop Environment jobs.
So, I need a place to start from in order to least get my head around this thing even if I won't really change things fundamentally, but at least enough to make it really customized.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

That's not really a question regular users can answer, so moved your topic from the support forum to here as here we find a few more Linux gurus. Altered your topic title to reflect where your doubts are.

You can find most answers on Wikipedia I think. For example http://en.wikipedia.org/wiki/GNOME_Shell explains Gnome Shell to be the graphical shell plugin for Mutter. If you click through you find Mutter to be the window manager for GNOME. And see http://en.wikipedia.org/wiki/Cinnamon_%28software%29 for what Cinnamon is. In short they made a copy of the Gnome Shell and mutter code in 2011 and rebranded it as Cinnamon and Muffin (the window manager for Cinnamon). Since that fork, as it is called, the Cinnamon developers have worked on that code to reshape it into what has become Cinnamon today. Along the way other components developed by GNOME also were forked to reshape them to better fit in with Cinnamon (like GNOME's file manager Nautilus was forked and reshaped into Cinnamon's Nemo).

As for desktop environment (DE) vs window manager (WM) vs X.org, there are a lot of articles on that. But in short X.org provides the basic windowing system that allows for graphic elements to be drawn on the display. The window manager sets the appearance of windows (borders and titlebar) and handles the behaviour of windows (ability to move and resize windows, decide which window is on top, and such). The GUI toolkit (Gtk+ or Qt) sets the appearance and behaviour of GUI elements in the applications (buttons, scrollbars, input boxes, and such). The desktop environment adds things like a panel, a system menu, and desktop widgets; and handles things like drag & drop. It usually has its own window manager for best integration and comes with a set of applications and utilities (like a control panel, file manager, text editor, calculator, and such).
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

xenopeek wrote:That's not really a question regular users can answer, so moved your topic from the support forum to here as here we find a few more Linux gurus. Altered your topic title to reflect where your doubts are.

You can find most answers on Wikipedia I think. For example http://en.wikipedia.org/wiki/GNOME_Shell explains Gnome Shell to be the graphical shell plugin for Mutter. If you click through you find Mutter to be the window manager for GNOME. And see http://en.wikipedia.org/wiki/Cinnamon_%28software%29 for what Cinnamon is. In short they made a copy of the Gnome Shell and mutter code in 2011 and rebranded it as Cinnamon and Muffin (the window manager for Cinnamon). Since that fork, as it is called, the Cinnamon developers have worked on that code to reshape it into what has become Cinnamon today. Along the way other components developed by GNOME also were forked to reshape them to better fit in with Cinnamon (like GNOME's file manager Nautilus was forked and reshaped into Cinnamon's Nemo).

As for desktop environment (DE) vs window manager (WM) vs X.org, there are a lot of articles on that. But in short X.org provides the basic windowing system that allows for graphic elements to be drawn on the display. The window manager sets the appearance of windows (borders and titlebar) and handles the behaviour of windows (ability to move and resize windows, decide which window is on top, and such). The GUI toolkit (Gtk+ or Qt) sets the appearance and behaviour of GUI elements in the applications (buttons, scrollbars, input boxes, and such). The desktop environment adds things like a panel, a system menu, and desktop widgets; and handles things like drag & drop. It usually has its own window manager for best integration and comes with a set of applications and utilities (like a control panel, file manager, text editor, calculator, and such).
Oh thanks very much, I think it all starts to make sense. So if for example I want to change the behaviour of the panel I need to change the panel component only?
Or if I want to change the behaviour of the windows I need to tweak the Window Manager only? I mean is changing drastically a DE merely via customizing components is a possible thing to do? And if so - what's really the difference between 2 DEs? Thanks for clearing this stuff for me =]
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

Yes basically that is how it is. Let's not trivialize the effort though. Muffin, Cinnamon's window manager, has almost 70,000 lines of C code (750,000 lines of source code total).

The real difference between 2 DEs is basically how they look, how they behave, what GUI toolkit they use, and their sets of applications and utilities are.

You can change only a small portion of a DE source code to implement the change you want. But be clear about trademarks and copyrights. Most DEs' licenses allow you to modify the source code and distribute your changes, but likely their names and branded artwork (logos, themes, etc.) are respectively trademarked and copyrighted. You'd have to redistribute them using your own name and artwork, and not confuse its users into think that your modifications are "the real deal" and misrepresent the situation.
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

xenopeek wrote:Yes basically that is how it is. Let's not trivialize the effort though. Muffin, Cinnamon's window manager, has almost 70,000 lines of C code (750,000 lines of source code total).

The real difference between 2 DEs is basically how they look, how they behave, what GUI toolkit they use, and their sets of applications and utilities are.

You can change only a small portion of a DE source code to implement the change you want. But be clear about trademarks and copyrights. Most DEs' licenses allow you to modify the source code and distribute your changes, but likely their names and branded artwork (logos, themes, etc.) are respectively trademarked and copyrighted. You'd have to redistribute them using your own name and artwork, and not confuse its users into think that your modifications are "the real deal" and misrepresent the situation.
I'm not quiet sure then - so basically the desktop environment in essence designing the UI itself making the components a whole?
Yet, it seems like the panels and menus of mint are unique to mint, as well for example the workspaces view. So have the developers changed things around the components themselves, if so are the components "theirs" or like what does it mean as of possession - is it a part of the DE or the WM?
Also, I didn't really understand your comment about the copyright. I mean, having Gnome, for example an open source software - I'm pretty sure their license allow me to change the software as I wish. I don't even think about redistributing the thing into the net, at most to some friends unless I'll get sucked in customizing all day and night tryin' to code an entire DE which probably won't happen cause this sounds like tons of work XD
So .. yeah about the copyright - like what should I do/say in order to clean my ass from getting kicked?
Still, I'd like to know like, is making a super simplistic DE a doable thing, and if I want to customize my desktop, should I customize Gnome or Cinnamin, like what would be easier cause if I understood things right Cinnamin is based of Gnome. So what would be better to customize in order to get more flexibility - Cinnamin or Gnome (I'm not even sure what Gnome-shell is yet so...). Last question in this sea of doubt - I know some WM have the option to customize your UI using scripting languages, would using it make a nice result rather than customizing a pre-existing DE? (I know some ppl just make sessions and customize the required components instead)
Just wanted to say srry for the amount of troubling and tricky questions - it's just that every article I read confuses me more rather than making things clear - a lots of terms, blurry borders between them. Thanks for the patience if you read this far P: !
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

Uh, I don't follow fully but yes a desktop environment is a collection of components. Panels and menus and workspaces view aren't unique to Linux Mint. They are unique to Cinnamon as they were developed by the Cinnamon developers for use with Cinnamon. Same for KDE panels and menus and workspaces, developed by the KDE developers for use with KDE. And so on, and so on, for other DEs.

GNOME source code is GPL licensed and indeed is free/libre software. However, "GNOME" is a registered trademark. You can't distribute software modifications and call it GNOME. You're not the holder of the trademark, nor do you have permission from the holder of the trademark, or a sublicense, to use it. So if, like the Cinnamon developers did, you want to fork (modify) components developed by the GNOME project you'll have to distribute those under your own name. The same thing goes for the GNOME logos. Those are copyrighted and part of the GNOME brand. You can't use those for your product (your modified source code or binaries) without permission of the copyright owner. The GPL gives you permission to do with the source code what you want, but it doesn't give you free reign to use somebody else's trademarked name or copyrighted branded artwork. You can modify the source code and distribute it, as long as when you start it up it doesn't say "Welcome to GNOME" :wink: Examples are MATE (fork of GNOME 2) and Cinnamon (fork of GNOME 3), which have their own names and own branded artwork while originally being copies of components of GNOME (and since then heavily modified under their own name).

As for easiest DE to customize; what do you want to do? A DE is a collection of components. You want to change the file manager? Don't change the DE, change the file manager! And so on; focus on what you want to do. You can customize Gnome Shell through extensions and themes, making it look and behave completely different. You can customize Cinnamon through applets, extensions, and themes for the same effect though it might be a little less flexible with regards to extensions. For Gnome Shell there are kinds of links for extension development in this recent article: https://somepirate.wordpress.com/2015/0 ... ell-it-is/. You can find some information for Cinnamon extension development on the wiki: https://github.com/linuxmint/Cinnamon/wiki. Extensions modify standard behaviour of a DE. Themes customize the looks.

BTW, please don't quote entire posts for no reason. It's clear you're responding to my post, you don't need to repeat my post. Only makes it hard for others to follow the topic.
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Well sir, thank you very much =]
Actually before I installed mint on my pc I tried a bunch of other distros but they were all uncomfortable to me; I'm not really a fan of the ubuntu launcher nor the "activities" screen of Gnome, but Cinnamon did pretty well except for the panel for example. Let's take a simple example - the presentation of open windows - let's say I want to make windows of the same program "stacked" and get rid of the brackets for example - are those things achievable using those "extensions"? And if so what about the panel itself - like actually changing its shape and behaviour? And just to summerize this issue to make sure I won't ask any more annoying questions ( :x :x :x ) - in order to make a custom DE , with a certain UI and behaviour - I don't really need to rewrite a lot of C/C++ graphics libs codes? I can build upon existing "shells" or other recommended libs/methods?
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

The window list on the panel in Cinnamon is, like other items on the panel, just an applet (go to System Settings > Applets to browse your installed and in use applets). Knowing a little bit about how naming conventions for Cinnamon applets work it's easy to find this applet's source code can be found on your system in:
/usr/share/cinnamon/applets/window-list@cinnamon.org/

The applet is just a JavaScript file there (applet.js), along with a metadata configuration file (metadata.json). You can also browse the file online, though this is the development version for Cinnamon so will differ from the version on your installation: https://github.com/linuxmint/Cinnamon/b ... /applet.js. All the code for what/how the panel window list works is in there. In the earlier link I shared for the Cinnamon wiki you can also find information for applet developers (what objects does Cinnamon expose to JavaScript).
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

OK so basically I should just stick to changing the applets right? but what about menus design for instance? Is it also an applet?
Oh and thank you so much you helped me beyond believe!
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

Yes, the menu is also an applet: /usr/share/cinnamon/applets/menu@cinnamon.org/applet.js. In the System Settings > Applets you can also get more applets to install and use. You'll find different menus and different window list applets created by other users. You can also browse the collection of community developed applets online if you want: http://cinnamon-spices.linuxmint.com/applets
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

God bless you dude, god bless you =]
At last, I know where to start =]

But with this level of customization why some people prefer KDE for example instead of GNOME? Or pick different DEs in the first place, we can just use one really general and broad library for components of DE and that's it, why ppl rewrite so much code?
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

g_o wrote:why ppl rewrite so much code?
To scratch their own itch :wink:
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Haha alright then, thanks a tons!
Honestly I don't think anyone ever had such patience online so - once again: god bless u :P !
If u (or anyone) ever feel bored feel free to join me ;)
OK, going to work on this thing! see u later :)
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

No problem, happy to help you find your way :)

If you're wanting to get more into writing Cinnamon applets (or extensions or desklets), you can look at the source code of all on the websites I linked to (both those developed by Linux Mint and developed by others) and also on your own system can you look at the files. You're also welcome to come say hi to the Linux Mint and Cinnamon developers on IRC. Just open HexChat from your menu and type /join #linuxmint-dev to join the developer channel. If you're stuck with something writing an applet, desklet, or extension, or hacking on the Cinnamon code itself, you can usually find somebody there that can point you in the right direction.
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Cheers =]
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

Some details about the components developed by Linux Mint can be found here: http://projects.linuxmint.com/projects.html
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Oh thanks! This is very useful :) !
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Well I did some research, and I think we had some misunderstanding. When I said "the menu" I meant the context menu like when you right click.
Also, changing the panel it seems isn't about those applets since I want to change the panel itself - it's shape, location and behavior. The unfortunate thing is that no one says where I should begin when wanting to replace the panel. I find it funny cause there tons of tutorials on how to switch the window manager - for example to move to compiz isn't that hard, but trying to switch a single component such as the panel is something I can't find anywhere. The thing is - I may for example write an extension but what about the internal panel then? I don't think there's an option for making it disappear completely, so it wouldn't even load up this way. It would just be the equivalent of replacing it. But the panel itself isn't considered as extension since it's internal in the system so I don't think stuff work that way. If you can give me some pointers and any indication that I'm getting the right idea, I'd be glad to hear your opinion.
User avatar
xenopeek
Level 25
Level 25
Posts: 29606
Joined: Wed Jul 06, 2011 3:58 am

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by xenopeek »

Extensions have more possibilities than applets. See what others have down through extensions with the panel here (CinnaDock for example replaces the context menu): http://cinnamon-spices.linuxmint.com/extensions. If that still doesn't meet your needs, you'll have to go into the source code of Cinnamon and hack things there. Searching for "panel" in the Cinnamon source code repository finds me this bit: https://github.com/linuxmint/Cinnamon/b ... i/panel.js. In that folder is also panelMenu.js. I'm not at home in the source code of Cinnamon, but these look like obvious places to start (if extensions aren't enough).
Image
g_o

Re: How does the DE > WM > Xorg stack work on Cinnamon?

Post by g_o »

Thanks once again :)
Locked

Return to “Chat about Linux”