window: Check if we can use CSD before enabling them
window: Check if we can use CSD before enabling them

The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules
as to when CSD can be enabled, but it also unconditionally enables CSD
with the implicit assumption that client-side shadows were the real
issue, and that we could work around that by drawing our own borders.
This also means that setting a titlebar for a GtkWindow will enable CSD
unconditionally.

In reality, some window managers (like Matchbox) *only* support
server-side decorations, and will ignore all hints to the contrary, to
the point of drawing decorations at random locations on top of the
window.

Since CSD are enabled unconditionally, the GTK_CSD environment variable
is also not a suitable escape hatch.

In the grand tradition of asking ourselves if we should do something
just because we can, we should split the environment checks from the
checks on what the user requested; by doing that, we can also check
when enabling client-side decorations, and ideally bail out if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=750343

alexlarsson/gtk,jigpu/gtk,chergert/gtk,jigpu/gtk,davidgumberg/gtk,davidgumberg/gtk,jigpu/gtk,grubersjoe/adwaita,jigpu/gtk,alexlarsson/gtk,chergert/gtk,grubersjoe/adwaita,alexlarsson/gtk,alexlarsson/gtk,Adamovskiy/gtk,jadahl/gtk,davidgumberg/gtk,jadahl/gtk,jadahl/gtk,grubersjoe/adwaita,jadahl/gtk,alexlarsson/gtk,Adamovskiy/gtk,chergert/gtk,Adamovskiy/gtk,grubersjoe/adwaita,jadahl/gtk,grubersjoe/adwaita,chergert/gtk,alexlarsson/gtk,jadahl/gtk,Adamovskiy/gtk,jigpu/gtk,jigpu/gtk,davidgumberg/gtk,alexlarsson/gtk,jadahl/gtk,chergert/gtk,alexlarsson/gtk,davidgumberg/gtk,jadahl/gtk,Adamovskiy/gtk,grubersjoe/adwaita,Adamovskiy/gtk,grubersjoe/adwaita,davidgumberg/gtk,chergert/gtk,davidgumberg/gtk,grubersjoe/adwaita,davidgumberg/gtk,Adamovskiy/gtk,Adamovskiy/gtk,chergert/gtk,chergert/gtk,jigpu/gtk,jigpu/gtk