Do not use SO_SNDBUF on Vista or later

Task-number: QTBUG-30478
Change-Id: I6c41bc8bea21aa00277d8bfce070ea993e2a0f28
Reviewed-by: Richard J. Moore <rich@kde.org>
Avoid duplicate emulated mouse events with XInput2

When using a touch screen on a Linux machine, we receive both touch-events
and emulated mouse events from XInput, on top of that we synthesize mouse-
events ourselves for the touch events.

This patch grabs the touch device for touch events whenever it processes
a touch-begin thereby avoiding XInput from synthesizing mouse events.

Task-number: QTBUG-35157
Change-Id: I5849d5841be236d6719cd080af2e9e39eb9cdd84
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Remove disabling of warning 4660 on MSVC

This warning no longer exists since at least MSVC.NET 2003. It's
reported to have existed on MSVC 6 and older only.

Task-number: QTBUG-35815
Change-Id: Ifb35d027edc3c1cbadac9a0d0a9c26524c52c87f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Keep the configure listing of features alphabetical

Change-Id: I0786b26a89e3e592bc47cb016ee7876ea7238c69
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fix Qt build when mtdev is detected

If it's detected, we have "mtdev" in QT_CONFIG, not in CONFIG. With
the bad test, libQt5PlatformSupport.prl would not get -lmtdev and, in
turn, the evdevtouch generic plugin would fail to link.

Change-Id: I5dab57b648e66943f98a22527717a20be35f02a4
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fix mtdev auto-detection

The source code is valid C++. But not valid C.

Change-Id: I43126001d33caef050b0bc8c248cf9f3b01091df
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
XCB: Fix pixmap leak

In qt_xcb_XPixmapFromBitmap(), a new pixmap is generated for the caller.
This pixmap has to be freed after use. However,
createNonStandardCursor() didn't do this and instead leaked the pixmap.

Change-Id: I6fee180ec6508db9e82a5bb028957e7d9f7a4632
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I0b021b369725b73f09faa14b9da9e2431dc24fad
WinRT: Improve event dispatcher

- Sleep when there are no events to process. Otherwise, CPU usage remains
  high all the time.
- Reorder processing so window events are processed after being collected
  by the native event loop.
- Provide basic interrupt and WaitForMoreEvents flag support.

Task-number: QTBUG-35327

Change-Id: I8a5545cba5f3e65eafd0bb40695bf6ffde68bb04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
WinRT: Enable accessibility by default

While there is no implementation for accessibility yet, enabling it allows
the interfaces to be used and an accessibility plugin to be developed
for this platform.

IAccessible2 and MSAA bridge autotests are disabled for this platform.

Change-Id: I2bfd07f6b21ca469b27d88ef11df723ac8ff8202
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
qmake vcproj generator: Honor the preferred MSVC version in the mkspec

Some cross-compiling mkspecs may require a different MSVC version than
the one found in the path (or the default version). This change allows
the preferred MSVC version to be selected from the mkspec's MSVC_VER
variable when found.

Task-number: QTBUG-35328
Change-Id: I19e03101e3921dfd5026421aef4630e11b9f131e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
qmake vcproj generator: Don't generate WinMD by default on WinRT

Visual Studio will default to generating metadata, even if it is not
written to the vcproj. Since there is no metadata file, the build will
fail. This change keeps a saner default for this option when generating
WinRT project files.

Task-number: QTBUG-35328

Change-Id: Ie693e270ef0b9d9677d53af0c60905f048235bc5
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
qmake vcproj generator: Add app manifest for WinRT projects

When creating a MSVC project file for WinRT/WinPhone, the package
manifest and all referenced icons should be automatically added as
content items.

Task-number: QTBUG-35328

Change-Id: Id7f34388c5ba6746392ddadbb795ef47bef34af6
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
qmake vcproj: Correct VCProject Version strings

These strings are one version too large.

Change-Id: If83649725ccf087075610255516ebf7a51338359
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
qmake vcproj: Support setting the SDK version

This adds the required members to allow setting the SDK version, and uses
them when creating WinRT projects.

Task-number: QTBUG-35328

Change-Id: I500ea77c41e27cbcc850462034c0eba8c5d1f124
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
WinRT: Properly return exit code

Instead of returning the HRESULT of the Run method, return the actual
exit code of the application.

Change-Id: I1e3d654ecdb4c319d4a08fe8a11e8699d186f66b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
WinRT: Clean up core event dispatcher

- Move private classes in the .cpp file (they aren't needed outside)
- Conform to Qt style, such as includes and braces
- Use ComPtr where appropriate
- Use foreach where appropriate
- Remove non-functional wake/interrupt leftovers
- Remove redundant timer list
- Make the timer callback a static method, so it won't crash if it
  gets called on shutdown

Task-number: QTBUG-35945

Change-Id: I5426fba2735e908a04ea60287f9936f5abde6644
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Prevent foolish use of setuid when using Qt.

In order to prevent people from shooting themselves in the foot, abort
if we're running setuid. This behavior can be disabled by calling
QCoreApplication::setSetuidAllowed(true) in order to support legacy code.

[ChangeLog][QtCore][Important Behavior Changes] Running Qt applications
that are setuid has been prevented. If you really need to do this then
you can call QCoreApplication::setSetuidAllowed(true) before creating the
QCoreApplication instance.

Change-Id: I992a9a0cd8420693d438852a05666e3dbb2c9d6a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add takeTexture() to QOpenGLFramebufferObject

Add an API that allows to retrieve and detach the texture from the
framebuffer object. The next bind() call will then create and attach a
new texture.

[ChangeLog][QtGui][QOpenGLFramebufferObject] Added takeTexture() for
retrieving and detaching the texture from the framebuffer object.

Task-number: QTBUG-35881
Change-Id: I2cca37f5872c1685b1238047f8b912e6534ab781
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
QNX: Add some more properties to a touch point

Change-Id: Ic1c889557148f112e357c3ee34199ff6d19b4a6e
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>