Make sure timestamp is initialized before using it for seting selection owner.
authorGatis Paeglis <gatis.paeglis@digia.com>
Wed, 3 Oct 2012 12:53:33 +0000 (14:53 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 13 Oct 2012 03:51:19 +0000 (05:51 +0200)
commitce81da52ea1fffa67188e19eb9dbba66501dd82f
tree579c8ba02a35252b69b39296cfe79c283e5c1953
parentbefea1d93285bdf2ea8134718fb9c74a89bc551e
Make sure timestamp is initialized before using it for seting selection owner.

Convention from icccm: Clients attempting to acquire a selection must set
the time value of the xcb_set_selection_owner request to the timestamp of
the event triggering the acquisition attempt, not to XCB_CURRENT_TIME. In
some cases it happened that timestamp was set to XCB_CURRENT_TIME.

A zero-length append to a property is a way to obtain a timestamp for this
purpose; the timestamp is in the corresponding XCB_PROPERTY_NOTIFY event.
We used to have this mechanism in 4.8, it was achieved by XWindowEvent.

AFAIK there isn't an equivalent for XWindowEvent in XCB. Therefore i had to
introduce a new mechanism in QXcbConnection - getTimestamp. This function
blocks until it receives the requested event.

Change-Id: Ide46a4fdd44cf026fdd17a79d3c4b17741d1b7d4
Task-number: QTBUG-26783
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/plugins/platforms/xcb/qxcbclipboard.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection.h