finished INCR transfer changes. also made motifGetTime() return

icccmGetTime() because it seems motif does TIMESTAMP like ICCCM.
This commit is contained in:
crs 2002-07-25 09:23:24 +00:00
parent d3ea39149a
commit 3bfd2e252e
1 changed files with 2 additions and 14 deletions

View File

@ -793,8 +793,7 @@ CXWindowsClipboard::motifGetSelection(const CMotifClipFormat* format,
IClipboard::Time IClipboard::Time
CXWindowsClipboard::motifGetTime() const CXWindowsClipboard::motifGetTime() const
{ {
// FIXME -- where does Motif report this? return icccmGetTime();
return 0;
} }
bool bool
@ -955,18 +954,15 @@ CXWindowsClipboard::sendReply(CReply* reply)
// send using INCR if already sending incrementally or if reply // send using INCR if already sending incrementally or if reply
// is too large, otherwise just send it. // is too large, otherwise just send it.
const UInt32 maxRequestSize = 50000;//XXX 4 * XMaxRequestSize(m_display); const UInt32 maxRequestSize = 3 * XMaxRequestSize(m_display);
const bool useINCR = (reply->m_data.size() > maxRequestSize); const bool useINCR = (reply->m_data.size() > maxRequestSize);
log((CLOG_INFO "useINCR: %s", useINCR ? "true" : "false"));
// send INCR reply if incremental and we haven't replied yet // send INCR reply if incremental and we haven't replied yet
if (useINCR && !reply->m_replied) { if (useINCR && !reply->m_replied) {
UInt32 size = reply->m_data.size(); UInt32 size = reply->m_data.size();
log((CLOG_INFO "send first INCR, size=%d", size));
if (!CXWindowsUtil::setWindowProperty(m_display, if (!CXWindowsUtil::setWindowProperty(m_display,
reply->m_requestor, reply->m_property, reply->m_requestor, reply->m_property,
&size, 4, m_atomINCR, 32)) { &size, 4, m_atomINCR, 32)) {
log((CLOG_INFO "send first INCR failed"));
failed = true; failed = true;
} }
} }
@ -977,8 +973,6 @@ log((CLOG_INFO "send first INCR failed"));
UInt32 size = reply->m_data.size() - reply->m_ptr; UInt32 size = reply->m_data.size() - reply->m_ptr;
if (size > maxRequestSize) if (size > maxRequestSize)
size = maxRequestSize; size = maxRequestSize;
if (useINCR)
log((CLOG_INFO "more INCR, size=%d, ptr=%d", size, reply->m_ptr));
// send it // send it
if (!CXWindowsUtil::setWindowProperty(m_display, if (!CXWindowsUtil::setWindowProperty(m_display,
@ -986,8 +980,6 @@ log((CLOG_INFO "more INCR, size=%d, ptr=%d", size, reply->m_ptr));
reply->m_data.data() + reply->m_ptr, reply->m_data.data() + reply->m_ptr,
size, size,
reply->m_type, reply->m_format)) { reply->m_type, reply->m_format)) {
if (useINCR)
log((CLOG_INFO "more INCR failed"));
failed = true; failed = true;
} }
else { else {
@ -996,8 +988,6 @@ log((CLOG_INFO "more INCR failed"));
// we've finished the reply if we just sent the zero // we've finished the reply if we just sent the zero
// size incremental chunk or if we're not incremental. // size incremental chunk or if we're not incremental.
reply->m_done = (size == 0 || !useINCR); reply->m_done = (size == 0 || !useINCR);
if (useINCR)
log((CLOG_INFO "more INCR sent, done = %s", reply->m_done ? "true" : "false"));
} }
} }
} }
@ -1009,7 +999,6 @@ log((CLOG_INFO "more INCR sent, done = %s", reply->m_done ? "true" : "false"));
// the final zero-length property. // the final zero-length property.
// FIXME -- how do you gracefully cancel an incremental transfer? // FIXME -- how do you gracefully cancel an incremental transfer?
if (failed) { if (failed) {
log((CLOG_INFO "clipboard: sending failure to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property));
log((CLOG_DEBUG1 "clipboard: sending failure to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property)); log((CLOG_DEBUG1 "clipboard: sending failure to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property));
reply->m_done = true; reply->m_done = true;
if (reply->m_property != None) { if (reply->m_property != None) {
@ -1040,7 +1029,6 @@ log((CLOG_INFO "clipboard: sending failure to 0x%08x,%d,%d", reply->m_requestor,
// send notification if we haven't yet // send notification if we haven't yet
if (!reply->m_replied) { if (!reply->m_replied) {
log((CLOG_INFO "clipboard: sending notify to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property));
log((CLOG_DEBUG1 "clipboard: sending notify to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property)); log((CLOG_DEBUG1 "clipboard: sending notify to 0x%08x,%d,%d", reply->m_requestor, reply->m_target, reply->m_property));
reply->m_replied = true; reply->m_replied = true;