summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-01 12:56:31 +0200
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-01 15:21:14 +0200
commitda53926fe3e910941d0112072fcbeba565b967fe (patch)
tree2b2fc0a9e805327694f55ea0f1fcc8c5ac519b33
parentce7cf03ab1346b5f447db3d849d2c183abce0138 (diff)
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
-rw-r--r--src/gui/kernel/qdnd_x11.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index d1ef8101a2..d5a6095e1b 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;
}
//$$$