Use PKG_CHECK_MODULES to find X11 dependencies

This eliminates the need for AC_CHECK_HEADER and hardcoded library names in
Makefile.am.

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

We want manual compositing to be able to draw translucent GUI elements on top
of application windows.

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

The workspace list is shown when Ctrl+Super is pressed and held.  The code was
mostly copied from the old cantera-wm, and requires some cleanup.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Avoid exiting on BadMatch errors

Race conditions can cause these to occur if resources were released before we
had time to handle events involving them.

It would be really nice if X11 could avoid releasing handles before all
associated events had been processed.  This would also prevent the problem of
future objects aliasing the stale handles of old objects.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Translate damage regions for off-origin windows

Prior to this commit, dialog boxes were incorrectly painted because we clipped
to the wrong regions.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Paint secondary windows in thumbnails

Prior to this commit, only one window per workspace was shown in the thumbnails.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Removed unused palette code

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Re-added tri-linear scaling, but now including dialogs

The display buffer is halved repeatedly until it the final resize is less than
or equal to 50%.  This guarantees that every pixel of the full-screen image
contributes to the thumbnail.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Adjust thumbnail sizes for prettier scaling

Avoiding odd sizes my help reduce aliasing.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Repaint entire screen when windows are unmapped or reconfigured

Also track override_redirect windows.  One example of a window needing all this
functionality is the URL suggestion box in the Chromium browser.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Merge branch 'desktop-menu'

Conflicts:
	main.cc
Avoid repainting all workspaces every time

Only paint the active ones.  Also, disregard clipping region if window menu is
open.  There are some optimizations to be made here later, by eliminating
unneeded redraws.

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