Unix/Linux Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Requesting general advice about window manager development

Programming


Tags
design, development, documentation, tutorial, window manager

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 3 Weeks Ago
SirSalt SirSalt is offline
Registered User
 
Join Date: Dec 2016
Last Activity: 16 January 2017, 12:21 PM EST
Location: Southeast Iowa
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
Unix or Linux 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 Linux

[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; 3 Weeks Ago at 12:48 PM.. Reason: Editing is fun!
Sponsored Links
    #2  
Old Unix and Linux 3 Weeks Ago
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 22 January 2017, 5:48 AM EST
Location: In the leftmost byte of /dev/kmem
Posts: 5,300
Thanks: 94
Thanked 1,432 Times in 1,066 Posts
Quote:
Originally Posted by SirSalt View Post
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 View Post
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 View Post
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 View Post
[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
The Following User Says Thank You to bakunin For This Useful Post:
SirSalt (3 Weeks Ago)
Sponsored Links
    #3  
Old Unix and Linux 3 Weeks Ago
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 16 January 2017, 8:07 AM EST
Location: Loughborough
Posts: 1,127
Thanks: 329
Thanked 296 Times in 228 Posts
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...
The Following User Says Thank You to wisecracker For This Useful Post:
SirSalt (3 Weeks Ago)
    #4  
Old Unix and Linux 3 Weeks Ago
SirSalt SirSalt is offline
Registered User
 
Join Date: Dec 2016
Last Activity: 16 January 2017, 12:21 PM EST
Location: Southeast Iowa
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by bakunin View Post
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 View Post
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 View Post
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 View Post
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 View Post
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! Linux

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

Quote:
Originally Posted by wisecracker View Post
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! Linux
Sponsored Links
    #5  
Old Unix and Linux 3 Weeks Ago
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 22 January 2017, 5:48 AM EST
Location: In the leftmost byte of /dev/kmem
Posts: 5,300
Thanks: 94
Thanked 1,432 Times in 1,066 Posts
Quote:
Originally Posted by SirSalt View Post
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 View Post
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 View Post
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
The Following User Says Thank You to bakunin For This Useful Post:
SirSalt (3 Weeks Ago)
Sponsored Links
    #6  
Old Unix and Linux 3 Weeks Ago
SirSalt SirSalt is offline
Registered User
 
Join Date: Dec 2016
Last Activity: 16 January 2017, 12:21 PM EST
Location: Southeast Iowa
Posts: 6
Thanks: 5
Thanked 0 Times in 0 Posts
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; 3 Weeks Ago at 03:55 PM.. Reason: Adding an article I found
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Window Manager messi777 Fedora 6 09-14-2011 11:27 AM
Window manager on Fedora messi777 Red Hat 3 08-03-2011 11:17 AM
Slimmest Window Manager ccc UNIX Desktop Questions & Answers 3 07-31-2011 06:00 PM
Window Manager of the ... Choice vermaden UNIX Desktop Questions & Answers 8 02-16-2008 12:37 AM
Setting window manager manually for GNome auswipe UNIX Desktop Questions & Answers 1 02-28-2002 01:04 AM



All times are GMT -4. The time now is 02:14 PM.