wayland: Allow setting the clipboard with the current serial
Some clients (for example Chromium and LibreOffice) display a certain behavior in that they will set the clipboard twice in short succession deleting the data source in between and using the same serial twice. This allows setting the clipboard with the same serial as the current clipboard which only the current owner (or previous owner when the source was deleted) should know.
This commit is contained in:
parent
8141cc1871
commit
5a3d2593f1
1 changed files with 2 additions and 2 deletions
|
@ -321,7 +321,7 @@ void SeatInterfacePrivate::endDrag()
|
||||||
|
|
||||||
void SeatInterfacePrivate::updateSelection(DataSourceInterface *dataSource, quint32 serial)
|
void SeatInterfacePrivate::updateSelection(DataSourceInterface *dataSource, quint32 serial)
|
||||||
{
|
{
|
||||||
if (currentSelectionSerial - serial < UINT32_MAX / 2) {
|
if (currentSelectionSerial - serial < UINT32_MAX / 2 && currentSelectionSerial != serial) {
|
||||||
if (dataSource) {
|
if (dataSource) {
|
||||||
dataSource->cancel();
|
dataSource->cancel();
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ void SeatInterfacePrivate::updateSelection(DataSourceInterface *dataSource, quin
|
||||||
|
|
||||||
void SeatInterfacePrivate::updatePrimarySelection(PrimarySelectionSourceV1Interface *dataSource, quint32 serial)
|
void SeatInterfacePrivate::updatePrimarySelection(PrimarySelectionSourceV1Interface *dataSource, quint32 serial)
|
||||||
{
|
{
|
||||||
if (currentPrimarySelectionSerial - serial < UINT32_MAX / 2) {
|
if (currentPrimarySelectionSerial - serial < UINT32_MAX / 2 && currentPrimarySelectionSerial != serial) {
|
||||||
if (dataSource) {
|
if (dataSource) {
|
||||||
dataSource->cancel();
|
dataSource->cancel();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue