Screen/Linux: Auto-Disable desktop composition on KDE-KWin and compatible WM's.

KDE's KWin window manager honors the window property
_KDE_NET_WM_BLOCK_COMPOSITING by suspending desktop composition as long
as at least one fullscreen window with that XAtom set is open. Use this
to make sure KDE disables composition as long as we have a standard
opaque fullscreen onscreen window open.

-> Troublefree plug & play experience on KDE desktop :-)
Screen/Linux: Add standard NETWM property to auto-disable compositors.

The KDE/KWIN method to disable desktop compositors has been
standardized as a NETWM standard. The property
_NET_WM_BYPASS_COMPOSITOR if set on a fullscreen onscreen window will
ask the compositor to auto-disable as long as the window exists. Set
this property on our windows additionally to the "old" KDE/KWIN
property, so we cover the past and the future.

All compositors are supposed to honor this property in the future. The
first one to implement it in its master branch is "Mutter" the
compositor for GNOME-3, as of 18th December 2012.
Screen/Linux: Disable build against GStreamerSDK for release.

Use system installed GStreamer, ie., disable selection of video
encoding profiles for camerabin2 based video recording. This because we
don't use camerabin2 by default on Linux, but camerabin1, and standard
build allows for backwards compatibility with older distros.
Screen: Allow check if desktop composition is active on all platforms.

So far we only had heuristics for Windows Vista/7/8. This refactors
code a bit to implement PsychOSIsDWMEnabled(screenNumber) for all
platforms. OSX should just work but is basically pointless, implemented
anyway.

Linux is not clear, we may need to disable this again for the time
being - test pending. The problem is that the detection code
(supposedly) can detect if composition on a specifix screen is active
or not, but that info may not be useful because we want to know if it
is active for our window, not for the whole screen on which our window
resides. According to mailinglists (test pending), KDE/KWIN suspends
desktop composition for a whole screen if asked by us, so screen state
== windows state -> all good. But other WM's, e.g., apparently
Unity/Compiz do not suspend composition for whole screen, they just
suspend it for our fullscreen windows via unredirection, so while our
window may not suffer composition, the method still returns
"composition enabled", as it wasn't globally disabled for the whole
x-screen. In that case the new check would only produce false alarms at
least on Unity/Compiz - thereby would be harmful instead of helpful.

Some testing required. Screen for 32-Bit Octave on Linux rebuilt. Will
see what we do...
Screen('Openwindow'): Fix single-buffered mode.

Still erroneously tried to start imaging pipeline in single-buffer mode
due to typo.
Screen: Implement panelFitter support.

A new optional rect parameter 'clientRect' for Screen('Openwindow')
allows to set the windows virtual framebuffer size to a size different
from the actual size of the windows framebuffer. Screen() operates "as
if" the specified size would be the real window size, e.g.,
Screen('Rect') and Screen('Windowsize') report this size instead of
real window size, drawing is clipped against this size, the virtual
framebuffer is only that size. At Screen('Flip') time, the virtual
drawbuffer is copied into the real pipeline and backbuffer, properly
scaled up or down to fit into the real framebuffer size. These actions
are performed in the drawBuffer->inputBuffer copy path of the imaging
pipelines preflip operations, using a scaled framebuffer blit (and
potential multisample resolve). Parameters (size and location of source
and destination regions) of the rescaling can be controlled via the new
Screen('PanelFitter') function. Higher-Level setup code in
PsychImaging('UsePanelFitter') will follow soon.

High-Level setup code can now query the true framebuffer size via
Screen('Rect/WindowSize') by passing an optional flag. This will be
needed by the PTB imaging pipeline setup code, now that the client area
is no longer constrained to be twice or half the width or height of the
real framebuffer. However, if the panel scaler is not used, all
functionality behaves backward compatible to previous behaviour, so
changes to high-level M-File setup code can be made and tested
incrementally.

This works with both multisamples and regular framebuffers, with
various sizes. It needs support for
GL_EXT_framebuffer_multisample_blit_scaled
 if panel fitter and multisample anti-aliasing shall be used at the
same time. Without the extension, Screen will disable multi-sampling
while panel fitter is in use.

Screen for 64-Bit Matlab on OSX rebuilt and tested.
PsychDebugWindowConfiguration: Code cleanup.
Screen: Tiny fix for panel scaler error / fallback handling.
Screen, PsychHID, PsychKinecCore for 64-Bit Octave on Linux rebuilt.
BlurredMipmapDemo: More clever choices for videocapture settings.

Use 'realmax' fps to adapt to camera.
Use 'dropframes' flag for low-latency realtime capture.
PsychHID, PsychKinectCore for 64-Bit Matlab on Linux rebuilt.
Merge branch 'master' of https://github.com/kleinerm/Psychtoolbox-3
Screen/Linux: Make WM hints for disable of compositors actually work.

At least KDE/KWin didn't honor our properties to disable desktop
composition. The culprit seems to be our window being override_redirect
= true. Removing that, and setting the window fullscreen via
_NET_WM_STATE_FULLSCREEN property, makes it work. KWin nicely disables
desktop composition as soon as our opaque fullscreen window appears :-).

However, not all is shiny and rosy. On multi-display setups, the window
manager ignores the (x,y) position of the top-left corner of our window
and  picks one display monitor and positions the window so it goes
fullscreen on that monitor - it doesn't cover the whole x11 screen,
which is bad, as only then we get maximum performance and precision due
to page flipping.

So what to do? First we have a new conservevram setting that allows to
go back to the old override_redirect strategy which served us well for
many years without any problems, but doesn't allow auto-disable of
compositor.

Then the solution (hack?) for now is to let the WM have its way and
misplace the window, but after the window has been mapped, we set
the override_redirect = true to lock the WM out of future window
management and then move the window to its proper location, without
the WM noticing or complaining.

Net result is we get proper windows under KDE/KWin, but also the
benefit of automatically disabled compositing, as long as one of
our standard fullscreen onscreen windows is active.

This commit contains a working Screen mex file for 64-Bit Octave
on Linux. Successfully tested with KDE/KWin.
Screen/Linux: Restrict new window setup path to KDE/KWin for now.

Quick testing with Unity/Compiz, LXDE/OpenBox, GNOME-3-Shell, GNOME-2
and KDE shows that new path only performs well with KDE/KWin
("Plasma"). Maybe the hack is not a good universal solution :(

Anyway, now we only use the new path if we can assume we're running
under KDE-4. Our heurstic is to check if the env variable
"KDE_FULL_SESSION" exists.

With this setup, we get good performance on KDE, GNOME-3 and iirc LXDE.
Unity/Compiz shows weird results. I wonder if all the gaming
performance fixes introduced bugs into Unity/Compiz which bite us? Or i
messed up the unity settings with all my tinkering?
Screen/Linux: Apply PsychOSIsDWMEnabled() only for debugging.

...not for real reporting, as the check only works reliably on KDE/KWin
and produces endless false positives on other compositors, e.g.,
GNOME-Shell and Compiz.

Reason is that KWin has a different standby behaviour. It actually
disables compositing for a whole x-screen on request and releases all
resources, whereas other compositors still composite other windows on
the x-screen, they only unredirect our onscreen window, so our test for
global disable on a x-screen is too coarse/global to work on non-KDE.

Anyway leave the check in at high verbosity levels > 10 for testing and
debugging purposes, not as a "end user feature".
Rebuild mex files for Linux: Screen, PsychKinectCore, PsychHID

For 32-Bit Matlab/Octave on Linux.
For 64-Bit Matlab/Octave on Linux only Screen, as others already
rebuilt.
-> This completes the set of mex files for Linux.
Screen for 32/64-Bit Matlab on Windows rebuilt.
Screen for OSX rebuilt: 32/64-Bit Matlab, 64-Bit Octave.

This completes the set of mex files for this beta release, assuming
nothing goes wrong anymore.
VBLSyncTest: Add workaround for Datapixx + Octave bug.

A strange bug. If Datapixx timestamping is used under Octave,
then Screen('Flip') only returns its first tvbl argument, but
not the other ones. Needs investigation, but is too close to
release, so we plaster over it with this workaround.

Causes fake-discrepancy of 1 vblank duration ~ 4% or 0.5 msecs
on a typical display at typical refresh and resolution.