XCB: Silence clipboard warning "SelectionRequest too old"
Use the predefined logging category for clipboard warnings and change the offending warning to qCDebug() so that it is silent by default. Pick-to: 6.2 5.15 Fixes: QTBUG-60257 Change-Id: Icf1bc84cd64207b94ef471f13090c43b45e20728 Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
9422dd0e19
commit
2160042dc3
@ -71,7 +71,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qWarning("QXcbClipboardMime: Internal error: Unsupported clipboard mode");
|
qCWarning(lcQpaClipboard, "QXcbClipboardMime: Internal error: Unsupported clipboard mode");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ QXcbClipboard::~QXcbClipboard()
|
|||||||
if (auto event = waitForClipboardEvent(m_owner, XCB_SELECTION_NOTIFY, true)) {
|
if (auto event = waitForClipboardEvent(m_owner, XCB_SELECTION_NOTIFY, true)) {
|
||||||
free(event);
|
free(event);
|
||||||
} else {
|
} else {
|
||||||
qWarning("QXcbClipboard: Unable to receive an event from the "
|
qCWarning(lcQpaClipboard, "QXcbClipboard: Unable to receive an event from the "
|
||||||
"clipboard manager in a reasonable time");
|
"clipboard manager in a reasonable time");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -371,7 +371,7 @@ void QXcbClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
|
|||||||
xcb_set_selection_owner(xcb_connection(), newOwner, modeAtom, connection()->time());
|
xcb_set_selection_owner(xcb_connection(), newOwner, modeAtom, connection()->time());
|
||||||
|
|
||||||
if (getSelectionOwner(modeAtom) != newOwner) {
|
if (getSelectionOwner(modeAtom) != newOwner) {
|
||||||
qWarning("QXcbClipboard::setMimeData: Cannot set X11 selection owner");
|
qCWarning(lcQpaClipboard, "QXcbClipboard::setMimeData: Cannot set X11 selection owner");
|
||||||
}
|
}
|
||||||
|
|
||||||
emitChanged(mode);
|
emitChanged(mode);
|
||||||
@ -538,7 +538,7 @@ void QXcbClipboard::handleSelectionClearRequest(xcb_selection_clear_event_t *eve
|
|||||||
void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
|
void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
|
||||||
{
|
{
|
||||||
if (requestor() && req->requestor == requestor()) {
|
if (requestor() && req->requestor == requestor()) {
|
||||||
qWarning("QXcbClipboard: Selection request should be caught before");
|
qCWarning(lcQpaClipboard, "QXcbClipboard: Selection request should be caught before");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,7 +553,8 @@ void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
|
|||||||
QMimeData *d;
|
QMimeData *d;
|
||||||
QClipboard::Mode mode = modeForAtom(req->selection);
|
QClipboard::Mode mode = modeForAtom(req->selection);
|
||||||
if (mode > QClipboard::Selection) {
|
if (mode > QClipboard::Selection) {
|
||||||
qWarning() << "QXcbClipboard: Unknown selection" << connection()->atomName(req->selection);
|
qCWarning(lcQpaClipboard, "QXcbClipboard: Unknown selection %s",
|
||||||
|
connection()->atomName(req->selection).constData());
|
||||||
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -561,14 +562,14 @@ void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
|
|||||||
d = m_clientClipboard[mode];
|
d = m_clientClipboard[mode];
|
||||||
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
qWarning("QXcbClipboard: Cannot transfer data, no data available");
|
qCWarning(lcQpaClipboard, "QXcbClipboard: Cannot transfer data, no data available");
|
||||||
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_timestamp[mode] == XCB_CURRENT_TIME // we don't own the selection anymore
|
if (m_timestamp[mode] == XCB_CURRENT_TIME // we don't own the selection anymore
|
||||||
|| (req->time != XCB_CURRENT_TIME && req->time < m_timestamp[mode])) {
|
|| (req->time != XCB_CURRENT_TIME && req->time < m_timestamp[mode])) {
|
||||||
qWarning("QXcbClipboard: SelectionRequest too old");
|
qCDebug(lcQpaClipboard, "QXcbClipboard: SelectionRequest too old");
|
||||||
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -623,7 +624,7 @@ void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
|
|||||||
property, XCB_ATOM_INTEGER, 32, 1, &m_timestamp[mode]);
|
property, XCB_ATOM_INTEGER, 32, 1, &m_timestamp[mode]);
|
||||||
ret = property;
|
ret = property;
|
||||||
} else {
|
} else {
|
||||||
qWarning("QXcbClipboard: Invalid data timestamp");
|
qCWarning(lcQpaClipboard, "QXcbClipboard: Invalid data timestamp");
|
||||||
}
|
}
|
||||||
} else if (target == targetsAtom) {
|
} else if (target == targetsAtom) {
|
||||||
ret = sendTargetsSelection(d, req->requestor, property);
|
ret = sendTargetsSelection(d, req->requestor, property);
|
||||||
@ -728,7 +729,7 @@ bool QXcbClipboard::clipboardReadProperty(xcb_window_t win, xcb_atom_t property,
|
|||||||
// recover -- this shouldn't normally happen, but it doesn't
|
// recover -- this shouldn't normally happen, but it doesn't
|
||||||
// hurt to be defensive
|
// hurt to be defensive
|
||||||
if ((int)(buffer_offset + length) > buffer->size()) {
|
if ((int)(buffer_offset + length) > buffer->size()) {
|
||||||
qWarning("QXcbClipboard: buffer overflow");
|
qCWarning(lcQpaClipboard, "QXcbClipboard: buffer overflow");
|
||||||
length = buffer->size() - buffer_offset;
|
length = buffer->size() - buffer_offset;
|
||||||
|
|
||||||
// escape loop
|
// escape loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user