Merged changes from 1.0 branch.
This commit is contained in:
parent
2f9cdfd1b2
commit
4fea7719f3
|
@ -753,9 +753,6 @@ CArchMultithreadWindows::doThreadFunc(CArchThread thread)
|
||||||
lockMutex(m_threadMutex);
|
lockMutex(m_threadMutex);
|
||||||
unlockMutex(m_threadMutex);
|
unlockMutex(m_threadMutex);
|
||||||
|
|
||||||
// default priority is slightly below normal
|
|
||||||
setPriorityOfThread(thread, 1);
|
|
||||||
|
|
||||||
void* result = NULL;
|
void* result = NULL;
|
||||||
try {
|
try {
|
||||||
// go
|
// go
|
||||||
|
|
|
@ -170,8 +170,13 @@ CThread::threadFunc(void* vjob)
|
||||||
result = e.m_result;
|
result = e.m_result;
|
||||||
LOG((CLOG_DEBUG1 "caught exit on thread 0x%08x, result %p", id, result));
|
LOG((CLOG_DEBUG1 "caught exit on thread 0x%08x, result %p", id, result));
|
||||||
}
|
}
|
||||||
|
catch (XBase& e) {
|
||||||
|
LOG((CLOG_ERR "exception on thread 0x%08x: %s", id, e.what()));
|
||||||
|
delete job;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
LOG((CLOG_DEBUG1 "exception on thread 0x%08x", id));
|
LOG((CLOG_ERR "exception on thread 0x%08x: <unknown>", id));
|
||||||
delete job;
|
delete job;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1049,27 +1049,60 @@ CXWindowsClipboard::sendReply(CReply* reply)
|
||||||
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;
|
||||||
|
|
||||||
// HACK -- work around apparent bug in lesstif, which doesn't
|
// dump every property on the requestor window to the debug2
|
||||||
// wait around for the SelectionNotify then gets confused when
|
// log. we've seen what appears to be a bug in lesstif and
|
||||||
// it sees it the next time it requests the selection. if it
|
// knowing the properties may help design a workaround, if
|
||||||
// looks like a lesstif requestor window then don't send the
|
// it becomes necessary.
|
||||||
// SelectionNotify. it looks like a lesstif requestor if:
|
if (CLOG->getFilter() >= CLog::kDEBUG2) {
|
||||||
// it has a _MOTIF_CLIP_LOCK_ACCESS_VALID property
|
CXWindowsUtil::CErrorLock lock(m_display);
|
||||||
// it does not have a GDK_SELECTION property
|
int n;
|
||||||
CString dummy;
|
Atom* props = XListProperties(m_display, reply->m_requestor, &n);
|
||||||
if (m_id != kClipboardClipboard ||
|
LOG((CLOG_DEBUG2 "properties of 0x%08x:", reply->m_requestor));
|
||||||
!CXWindowsUtil::getWindowProperty(m_display,
|
for (int i = 0; i < n; ++i) {
|
||||||
|
Atom target;
|
||||||
|
CString data;
|
||||||
|
char* name = XGetAtomName(m_display, props[i]);
|
||||||
|
if (!CXWindowsUtil::getWindowProperty(m_display,
|
||||||
reply->m_requestor,
|
reply->m_requestor,
|
||||||
m_atomMotifClipAccess,
|
props[i], &data, &target, NULL, False)) {
|
||||||
&dummy, NULL, NULL, False) ||
|
LOG((CLOG_DEBUG2 " %s: <can't read property>", name));
|
||||||
CXWindowsUtil::getWindowProperty(m_display,
|
}
|
||||||
reply->m_requestor,
|
else {
|
||||||
m_atomGDKSelection,
|
// if there are any non-ascii characters in string
|
||||||
&dummy, NULL, NULL, False)) {
|
// then print the binary data.
|
||||||
sendNotify(reply->m_requestor, m_selection,
|
static const char* hex = "0123456789abcdef";
|
||||||
|
for (CString::size_type j = 0; j < data.size(); ++j) {
|
||||||
|
if (data[j] < 32 || data[j] > 126) {
|
||||||
|
CString tmp;
|
||||||
|
tmp.reserve(data.size() * 3);
|
||||||
|
for (j = 0; j < data.size(); ++j) {
|
||||||
|
unsigned char v = (unsigned char)data[j];
|
||||||
|
tmp += hex[v >> 16];
|
||||||
|
tmp += hex[v & 15];
|
||||||
|
tmp += ' ';
|
||||||
|
}
|
||||||
|
data = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
char* type = XGetAtomName(m_display, target);
|
||||||
|
LOG((CLOG_DEBUG2 " %s (%s): %s", name, type, data.c_str()));
|
||||||
|
if (type != NULL) {
|
||||||
|
XFree(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name != NULL) {
|
||||||
|
XFree(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (props != NULL) {
|
||||||
|
XFree(props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendNotify(reply->m_requestor, m_selection,
|
||||||
reply->m_target, reply->m_property,
|
reply->m_target, reply->m_property,
|
||||||
reply->m_time);
|
reply->m_time);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait for delete notify
|
// wait for delete notify
|
||||||
|
|
Loading…
Reference in New Issue