Added code for loading a configuration file

This was copied from the old iteration of cantera-wm.  The config file is used
to assign hot-keys.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Get rid of the "flag" member of struct window

This was previously used to keep track of override_redirect window, but now we
just keep them out of the compositing by calling XCompositeUnredirectWindow
when they're created.  The other three values in the flags enum served no
purpose.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Created the "cantera_wm" namespace

Also moved declarations of the various X11 global variables into cantera-wm.h,
so that they can be used from other .cc files.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Use struct rect instead of XineramaScreenInfo to store screen size

Also store total desktop size, and create the rect::union_rect() function to
accomplish this.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Switch from CompositeRedirectManual to CompositeRedirectAutomatic

This relieves us from having to track damage and composite the entire desktop
image.  This commit might be informative later, if it is decided that we need
manual redirect to support some important feature.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Immaterial style changes

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added the "active_screen" variable to struct session

This variable stores the currently active physical screen (monitor), currently
always 0.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added the window::hide() function

Currently, this functions moves the window off the rightmost screen in order to
keep its display buffer, so that we can composite a window list view.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added XReparentWindow call missing from 7a1b0773cc

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Automatically remove X window from our buffers upon receiving BadWindow

As far as I know, there's no way to completely avoid getting BadWindow
messages, due to the asynchronous behavior of the X window system.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Add some input handling code and associated behavior

Programs can now be launched through hotkey configured in ~/.cantera/config.
It is also possible to switch between workspaces, making this a functional
window manager for very simple work.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>