summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-01 10:56:31 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-01 11:16:01 (GMT)
commit7edd3d86530ed4036482d05e2791569f3f53afa6 (patch)
tree2c067d819000bb3c5f4f24615bc049cb9d0e214b /src
parentb8544f961ea8b5b2aee49aec330883191d2c910c (diff)
downloadQt-7edd3d86530ed4036482d05e2791569f3f53afa6.zip
Qt-7edd3d86530ed4036482d05e2791569f3f53afa6.tar.gz
Qt-7edd3d86530ed4036482d05e2791569f3f53afa6.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.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 33da0f3..da150fb 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,12 +542,13 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data
dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm;
dm->xdndMimeTransferedPixmapIndex =
(dm->xdndMimeTransferedPixmapIndex + 1) % 2;
+ ret = true;
}
} else {
DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName));
}
}
- return data;
+ return ret && data != 0;
}
//$$$