Fixes wrong mapping of picture controls on OSD"

patch by <warpme@o2.pl>

Fixes #11983 and #11885

(cherry picked from commit d1e942b2cf8fcb4123e94a28688d1538910df5b6)
Fix fullscreen windowing with Compiz/Unity

Also fixes live transitions from full screen to windowed screen.

Tested on the following systems:
* Linux Ubuntu 12.04 and 14.04, with box Xfce and Unity, with multi and single screens setup (including TwinView). AMD, nVidia and intel drivers.
* MacOS 10.9: multi and single screens setup

Fixes #9589
Fixes #8021
Fixes #7958

(cherry picked from commit 1c440ba970bfa0718bd5bc240f412e0bbc24ccf5)
Trigger system events when devices connect and disconnect to AirPlay and AirTunes

Fixes #11182
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>

(cherry picked from commit c5306f3ba063de7b25ce3cfc3757f9b8998b251b)
Force refresh of xf86VidMode current modeline

After changing the mode with XRRSetScreenConfigAndRate, the modeline returned
by XF86VidModeGetModeLine is wrong until XRRGetScreenInfo is called (at
least for X.Org 1.14.5 and 1.15.0 with Intel video driver).

DisplayResX::SwitchToVideo first calls XRRGetScreenInfo, then calls
XRRSetScreenConfigAndRate. This leads to XF86VidModeGetModeLine always
returning the previous modeline instead of the current one.

This was causing juddering in some cases, because the refreshrate used
in MythPlayer for initializing avsync_predictor is obtained from
XF86VidModeGetModeLine.

For example the following scenario was causing me consistent juddering
every second:

The display has modelines for 24 Hz, 50 Hz and 60 Hz modes, and the desktop
mode is 60 Hz.
I first play a 23.976 fps video. The display switches to 24 Hz mode, but the
refreshrate used by avsync_predictor is set to 60. This does not cause
noticeable judderng. Then, I play a 25 fps video. The display switches to
50 Hz mode, and the refreshrate is set to 24 (the previous one). Every second
the avsync_predictor kicks in and drops some frames.

This patch fixes this issue by calling XRRGetScreenInfo after the mode is
changed by XRRSetScreenConfigAndRate.

Fixes #12150
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>

(cherry picked from commit b8d5f110581bee170807e32e4c919f6f17e6a9e1)