diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-01 10:56:31 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-01 13:21:14 (GMT) |
commit | da53926fe3e910941d0112072fcbeba565b967fe (patch) | |
tree | 2b2fc0a9e805327694f55ea0f1fcc8c5ac519b33 /src | |
parent | ce7cf03ab1346b5f447db3d849d2c183abce0138 (diff) | |
download | Qt-da53926fe3e910941d0112072fcbeba565b967fe.zip Qt-da53926fe3e910941d0112072fcbeba565b967fe.tar.gz Qt-da53926fe3e910941d0112072fcbeba565b967fe.tar.bz2 |
Fixes clipboard handling on X11.
This fixes handling selection requests for invalid targets - when
someone asks for a target that is not supported by the clipboard content
we shouldn't do anything (unless it's MULTIPLE).
Fixes copying data when using Synergy which tries to get all targets it
knows about even if they are not listed in TARGETS.
Task-number: QTBUG-4652
Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qdnd_x11.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index d1ef810..d5a6095 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -506,6 +506,7 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data *atomFormat = textprop.encoding; *dataFormat = textprop.format; *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8); + ret = true; DEBUG(" textprop type %lx\n" " textprop name '%s'\n" @@ -541,10 +542,11 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; dm->xdndMimeTransferedPixmapIndex = (dm->xdndMimeTransferedPixmapIndex + 1) % 2; + ret = true; } } } - return data; + return ret && data != 0; } //$$$ |