Requesting general advice about window manager development


 
Thread Tools Search this Thread
Top Forums Programming Requesting general advice about window manager development
# 1  
Old 12-26-2016
Question Requesting general advice about window manager development

I've begun studying aewm (which I can't post a link to), because I'm interested in learning how window managers, desktop environments, and X work. My long-term goal is to develop a usable and simple DE for Linux that has the look and feel of Mac OS 9. It's possible to configure your themes and stuff to make it look like Mac OS 9 to a certain extent, and I've done that, but I wasn't satisfied.

So I figured why not make my own. The thing is, I figured I'd start with a simple wm that others have been based on, since that would mean it was a good one to learn, so I chose aewm. However, the documentation isn't that good for it, and I've never dabbled with WMs before, just program/application development (and only for certain, niche situations I've found myself in).

I realized I don't really understand how the whole thing is supposed to work together.

Should I choose a different one to learn, or can someone who's programmed WMs before possibly give me some tips or sagely advice on how to get started?

At this point I'm thinking about choosing another WM, since I am not able to compile this one. Does anyone have any other WM that they think I should study instead (hopefully with decent documentation)? I'm really looking forward to learning this, but maybe I need someone else's philosophy or point-of-view to see this from another angle so I can begin understanding WM mechanics and design.

Thanks in advance Smilie

[Edit: All the books on smile.amazon that look promising are almost 30 years old.]
[Edit 2: I found an article (which I can't post a link to...) that looks very good on beginning to program with Xlib.]

Last edited by SirSalt; 12-27-2016 at 12:48 PM.. Reason: Editing is fun!
# 2  
Old 12-27-2016
Quote:
Originally Posted by SirSalt
I've begun studying aewm (which I can't post a link to), because I'm interested in learning how window managers, desktop environments, and X work.
I have (in fact several times over) explained in principle how X-Windows works. Use the search function of this forum and you will find a few threads with such explanations.

Quote:
Originally Posted by SirSalt
My long-term goal is to develop a usable and simple DE for Linux that has the look and feel of Mac OS 9.
OK, but notice: there is a sharp distinguation between a desktop envionment and a window manager. They do different things. You might want to clarify what exactly you are up to first before making further plans.

Quote:
Originally Posted by SirSalt
So I figured why not make my own. The thing is, I figured I'd start with a simple wm that others have been based on, since that would mean it was a good one to learn
This is, in general terms, a commendable strategy. However (i don't know aewm at all), i suppose the one you chose to base your studies on is a rather uncommon one (i haven't even heard of it yet) and that may be so for a reason.

You might want to look at "mwm", the "Motif Window Manager", which is part of Motif. As far as i ever needed its documentation (conceded, i never thought about writing my own wm) it was very complete. It might be worth a try.

Quote:
Originally Posted by SirSalt
[Edit: All the books on smile.amazon that look promising are almost 30 years old.]
This is not so bad - most good books on, say, TCP/IP or UNIX architecture - are of the same age. This is because the principles on which many UNIX parts are based upon are so powerful that they - despite their implementation being completely different today - still work the same way they did 30 years ago. If you look at cars you see that they are very different from the ones 30 years ago, but they still have a steering wheel, an accelerator pedal, a clutch, a gearbox, etc. - so, in some sense, they still work the same way they did back then and a book from 1980 about how cars work will - in this respect - still be up-to-date.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 3  
Old 12-27-2016
Hi SirSalt...

It might be worthwhile looking at:-

The Comprehensive List of Window Managers for Unix

A plethora of WMs to guide you along, with source code for many of them.

(Surprisingly even the AMIGA catered for.)

It could be _virtually_ any popular language that they could be written in.

Enjoy the choice...

I admire you for wanting to take the plunge but beware of library updates, OS changes, kernel updates and more as they will hit your development sooner or later. These things break your code and you will have to go back chasing workarounds or rewrites to allow for them. I won't bore you with OSX and Quicktime Player but it has hit me several times on my project.
What should be a smooth development can be a rough ride, but hold in there and don't give in to application fatigue. See your project through to your end goal and beyond if that is what you want.

Good luck...
This User Gave Thanks to wisecracker For This Post:
# 4  
Old 12-28-2016
Quote:
Originally Posted by bakunin
I have (in fact several times over) explained in principle how X-Windows works. Use the search function of this forum and you will find a few threads with such explanations.
I searched the forum for "window manager" before I started this topic, but I didn't find any results that seemed relevant. I think I did find a topic on X.

Quote:
Originally Posted by bakunin
OK, but notice: there is a sharp distinguation between a desktop envionment and a window manager. They do different things. You might want to clarify what exactly you are up to first before making further plans.
I want to make a DE. On another site, I found a topic in which someone was asking for advice on DEs, since he or she wanted to develop a DE. The advice given to him or her was to start with a window manager first. Since my end goal is, in fact, a DE, in your opinion, should I disregard the advice this person gave, and actually start with a DE instead? And if so, are there any that you feel are more worthy of starting with? CDE, since it's a traditional DE based on Motif?

Quote:
Originally Posted by bakunin
This is, in general terms, a commendable strategy. However (i don't know aewm at all), i suppose the one you chose to base your studies on is a rather uncommon one (i haven't even heard of it yet) and that may be so for a reason.
One of the main sites I've been referencing lately was the one that wisecracker linked to, and that I alluded to in my OP, but this site's spam-fighting policy prevented me from providing a link (which would have helped, since no one knows what site I was talking about without the link...) to it. And in cases like this, I think the benefit of being able to provide a link (despite how few posts I've submitted on this site so far) would far outweigh the benefits of this site's spam-fighting policy. The site wisecracker linked to explains that many wms have been forked from aewm, hence my desire to start with it.

Quote:
Originally Posted by bakunin
You might want to look at "mwm", the "Motif Window Manager", which is part of Motif. As far as i ever needed its documentation (conceded, i never thought about writing my own wm) it was very complete. It might be worth a try.
Thank you, I will definitely check it out. The documentation for aewm is nothing to brag about.

Quote:
Originally Posted by bakunin
This is not so bad - most good books on, say, TCP/IP or UNIX architecture - are of the same age. This is because the principles on which many UNIX parts are based upon are so powerful that they - despite their implementation being completely different today - still work the same way they did 30 years ago. If you look at cars you see that they are very different from the ones 30 years ago, but they still have a steering wheel, an accelerator pedal, a clutch, a gearbox, etc. - so, in some sense, they still work the same way they did back then and a book from 1980 about how cars work will - in this respect - still be up-to-date.

I hope this helps.

bakunin
Indeed, just tonight, I did order 4 books which appear to be in the same series from the late '80s through the early '90s from smile.amazon. Yes, you've definitely helped me, so thank you! I really appreciate it! Smilie

---------- Post updated at 11:07 PM ---------- Previous update was at 10:58 PM ----------

Quote:
Originally Posted by wisecracker
Hi SirSalt...

It might be worthwhile looking at:-

The Comprehensive List of Window Managers for Unix

A plethora of WMs to guide you along, with source code for many of them.

(Surprisingly even the AMIGA catered for.)

It could be _virtually_ any popular language that they could be written in.

Enjoy the choice...

I admire you for wanting to take the plunge but beware of library updates, OS changes, kernel updates and more as they will hit your development sooner or later. These things break your code and you will have to go back chasing workarounds or rewrites to allow for them. I won't bore you with OSX and Quicktime Player but it has hit me several times on my project.
What should be a smooth development can be a rough ride, but hold in there and don't give in to application fatigue. See your project through to your end goal and beyond if that is what you want.

Good luck...
Thank you, and that's an awesome site. I've been using that for the last week, downloading various WMs.

And about your point where you talk about code getting broken, this article talks about that briefly: Linux has "only 10 great apps" according to Gnome Creator - gHacks Tech News

Despite that, I'm undeterred. Thanks again for your support! Smilie
# 5  
Old 12-28-2016
Quote:
Originally Posted by SirSalt
I searched the forum for "window manager" before I started this topic, but I didn't find any results that seemed relevant. I think I did find a topic on X.
For instance here or here, but i will try to explain it again:

X-Windows is a client-server system, like NFS, telnet, ftp, etc.. It deals with providing (graphical) UIs for remotely run applications over the network. Here are its parts:

The most important part is a certain protocol - the "X-protocol" (TCP, port 6000), over which the messages of participating network nodes are exchanged. It is based on TCP and operated on top of it.

Next, there is a "server" part: an "X-server" is a "driver" for a graphics card, along with a (network-aware) library of graphic primitives clients can use (the "Xlib"). X-servers are developed for a certain kind of graphics equipment (with PCs this is usually a graphics adapter but there have been much more sophisticated equipments out there) and provide the means to switch the managed screen to graphics mode as well as perform all sorts of functions ("graphics primitives", i.e. "draw rectangle", etc.) on this screen. All these functions can be requested by X-clients using the servers services over the network. Note, that the "X-server" runs on the "client"-system, which has caused (and still causes) endless confusion among the users of X, even though it is absolutely logical. Examples for X-servers are the things you can download from X.Org or "Opentext Exceed" (the former "Hummingbird Exceed"), which is an X-server for Windows-systems.

What the X-server also does is to manage one or more "keyboard"s and one or more "pointing device"s (usually a mouse, but other things, i.e. trackballs, laser pointers, etc. are also possible). Note that there does not need to be a 1:1 relation between real existing hardware and these virtual constructs (although there usually is).

Now, that we have established the server part and the means of communication we look at the clients: X-clients are the programs which start, connect to a certain X-server and then use that to display their UI. These programs can run on all sorts of systems, even on the local system where the X-server is running too. This is the mode desktop systems are working in: they start an X-server to manage the display, then some X-clients to make use of the sevices the X-server provides. Examples for X-clients would be Firefox (for web-browsing), "xterm" (for commandline-sessions), etc..

A (very special) X-client is the so-called "Window Manager", which is usually the first X-client you start after having started the X-server. You see, X-clients display their UI in so-called "windows" - rectangular portions of the display the X-server gives them. If you start several such X-clients chances are you might want to switch the focus from one such window to the other, resize it, put one after the other into the foreground, overlapping the others, etc.. For these things there is the Window Manager, which does exactly that: first, it decorates each window with a frame, by which it can usually be resized (click on the border, then move the pointer while holding the button down). Second, it adds a title bar to the window, which usually also provides a menu of its own, a means to move the window, etc.. All these things are basically commands to the window manager which does these things without the application itself being aware of them. If you have one window in front of another and want to get the other in front the window manager will give the appropriate commands to the X-server (which in turn will really do the work by redrawing the parts of the screen which need to be redrawn).

This, in fact is what a Window Manager does. Desktop Evironments do something else: they manage your environment, not only your graphical display. They will provide all sorts of panels, preferred applications for some types of files (i.e. when you click on a text document and your favourite word processor comes up with this document loaded - this is the desktop enviroment at work), etc.. Some of its functions overlap with the functions of a window manager which is why they either incorporate their own minimalistic one or use some WM specifically designed for the use with them: metacity, for instance.

I have to admit, personally i detest desktop environments and it is one of the more sore points of my usage of Linux that - realistically - you have to use one of these DEs, otherwise the system is not usable as a work environment. Things like WLAN management, audio options, etc. are only provided as "applets", not as real X-clients, so they work only within some sort of DE but not outside. If i want a system where the function is so tightly tied to the presentation i could use Windows where this kludge is standard. Still, this is just my personal opinion. For reference: my preferred work environment and how it looks like.

Quote:
Originally Posted by SirSalt
Since my end goal is, in fact, a DE, in your opinion, should I disregard the advice this person gave, and actually start with a DE instead? And if so, are there any that you feel are more worthy of starting with? CDE, since it's a traditional DE based on Motif?
As i said above: these two are different things. I understand it might be valuable to know how a WM works so it will not be in vain to try that first, but in fact i think the two are too different to really compare.

Quote:
Originally Posted by SirSalt
but this site's spam-fighting policy prevented me from providing a link
Yes, but that will be quickly over. we found (over years of manually fighting spam - believe me, i am one of the moderators who fought that battle) that it helps greatly to put a lower limit on the right to post links as spammers usually only create accounts and start spamming right away. You may try again after a few more contributions here and you will notice that you indeed are allowed to post links like all the others. That is one of the reasons we can keep this sites information-to-noise ratio so high. Otherwise you would have to wade through several pages of fake viagra advertisements (and postings of similar technical merit) to get to the technical stuff.

Ah, and by the way: i have left out some less relevant parts of the X-Windows system above: font servers, authentication mechanisms, etc.. There is much more, but to understand the basic workings these things can be safely left out. Have fun learning more and more of it.

I hope this helps.

bakunin
These 2 Users Gave Thanks to bakunin For This Post:
# 6  
Old 12-30-2016
I appreciate your time. I can tell it will definitely take time to figure all this stuff out. I can't wait to receive my X books. I also switched to mcwm, and its code is a lot easier to follow and almost every line has a useful comment. I only have thousands of lines of code to figure out now! :P

Thanks again!

Edit: I found this cool tutorial article on X programming Basic Graphics Programming With The XCB Library

Last edited by SirSalt; 12-30-2016 at 03:55 PM.. Reason: Adding an article I found
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Fedora

Window Manager

Hi guys, I want to get back to my old days and re-obtain my unix skills, I remember I installed a window manager wmii / wmii2 /mwm on my debian and started to learn unix/linux and now after some years not touching it and having to deal with gnome on redhat (because of my work) I feel like very... (6 Replies)
Discussion started by: messi777
6 Replies

2. Red Hat

Window manager on Fedora

Hi eveybody, I want to install fedora on my personal laptop, but I dont want to use any graphical desktop environment, this way i will force myself to learn more. I want to install wm2 which i used to work with it on debian a couple of yeras ago, so is there any instruction that how I can do this?... (3 Replies)
Discussion started by: messi777
3 Replies

3. UNIX Desktop Questions & Answers

Slimmest Window Manager

Hi Which is the absolutely slimmest window manager Window Manager? THX (3 Replies)
Discussion started by: ccc
3 Replies

4. UNIX Desktop Questions & Answers

slim window manager for a thin client

hi I'm looking for a slim and quite comfortable window manager for a unix/linux thin client? (5 Replies)
Discussion started by: ccc
5 Replies

5. Shell Programming and Scripting

Determining window manager from command line

How to know what is my window manager from Linux command line? ---------- Post updated at 02:46 PM ---------- Previous update was at 12:07 PM ---------- How to determine the display manager from command line? (1 Reply)
Discussion started by: proactiveaditya
1 Replies

6. Programming

How to override Window Manager placement of windows.

Hello, everyone! Is it possible to create a window in X11/WM, but override the position Window Manager sets for the window. I'm not sure how to use 'override_redirect' flag, and what to do in order to use it. But the problem with the flag is also that it probably will disable all decorations... (2 Replies)
Discussion started by: AOne
2 Replies

7. UNIX Desktop Questions & Answers

Window Manager of the ... Choice

Inspired by Window Manager of the Year threads from LinuxQuestions.org Like these: 2002 | 2003 | 2004 | 2005 | 2006 I wonder what WMs are used by UNIX people ... People sometimes select diffrent WMs for (old and slow) laptop and (overpowered) workstation, that is why poll allows multiple... (8 Replies)
Discussion started by: vermaden
8 Replies
Login or Register to Ask a Question