Allow explicit raises from same client, not just same app

We currently allow XRaiseWindow when the same application (defined
by the window group) is focused, but the kind of old applications
that XRaiseWindow are frequently not setting the window group.

Expand the check to allow the same X client (defined by the looking
at client ID) to raise windows above the focus window.

Based on metacity commit: 632d3983fbc402432c6ceae05bea8903ad2f11c0
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=567528
Update keybindings when XKB keyboard layout changes

* Select for XKB keyboard notification events explicitly; since GTK+
  has selected for XKB events, delivery of old-school MappingNotify
  events is disabled.

* Fix a bug where once a keycode was loaded for a key binding,
  it would never be reassigned; we want to laod new keycodes for
  all bindings that have a key symbol rather than a fixed
  keycode.

[ With fixes from Owen W. Taylor <otaylor@fishsoup.net> ]

Based on metacity commit: c262e3d65a37abedc507705cddfec72c901c321f
From: Derek Poon <gnomebugs@acrotect.com>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=565540
Unify keymap-reloading code branches

Simplify the keymap loading logic by unifying the different
branches; in the reorganization this patch fixes a bug where when
we got a MappingKeyboard event we wouldn't update virtual modifiers
correctly.

Based on a patch by Thomas Thurman <tthurman@gnome.org>

Based on metacity commit: ba2e5f7f541446931299814bafa642d09047f386
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=565540
Fix drawing of <arc> elements

This patch fixes the drawing of <arc> theme elements to appear in the desired orientation

Based on metacity commit: 120c7790d6c5a837372ef1e0105e89ac674facd8
From: Nickolas Lloyd <ultrageek.lloyd@gmail.com>
buttons: Fix background functions for non-default layouts

While the configured layout is taken into account for positioning
the buttons, the mapping from button function states to button
position states just assumed the default button layout in LTR
locales.
Do a proper mapping depending on the actual layout instead.

Based on metacity commit: 6a52883c2b670ad645257373515d1e704408b93d
From: Florian Müllner <fmuellner@gnome.org>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=638700
Work around usage of XPointer

XLib has historically used "char*" for "generic pointer" but
compliers rightly complain when casting this to a structure.

Work around this by casting to void * and letting the implicit
conversion to a structure type take effect.

Based on metacity commit: 687376bb549b3d60ba848c9d4105fe41087f3a77
From: Colin Walters <walters@verbum.org>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=611644
Unconditionally reset minimize_after_placement on placement

GTK+ has now started using _NET_WM_STATE_HIDDEN for iconified windows.
For windows iconified at creation time, this causes metacity to set
minimize_after_placement, which then causes the window to become
minimized immediately after the first time it has been activated by
the user.

This happens because:

 (1) minimize_after_placement is reset after placing the window
 (2) if a window is minimized, placement is deferred

Reset minimize_after_placement unconditionally in place_window_if_needed()
to solve the issue.

Reported and tested by Daniel Drake <dsd@laptop.org>

Based on metacity commit: b0700e20b79896de7d28d2ff2bb18be324d8e19f
From: Florian Müllner <fmuellner@gnome.org>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=684741
Merge remote-tracking branch 'upstream/master'