[Interest] Any possible workaround for QTBUG-40889 ?
Elvis Stansvik
elvstone at gmail.com
Fri Jul 1 11:02:03 CEST 2016
2016-06-30 18:59 GMT+02:00 Thiago Macieira <thiago.macieira at intel.com>:
> On quinta-feira, 30 de junho de 2016 17:16:54 PDT Elvis Stansvik wrote:
>> Would it be possible to install a QAbstractNativeEventFilter and
>> somehow "fix-up" the event combination that makes the event
>> compression fail? Has anyone else been in the same boat?
>
> Yes, in combination with a non-native filter that detects when the event has
> been delivered and processed. You need to keep a state:
>
> if event has been seen
> and event has not been delivered
> swallow event
>
Hm, as an initial test, I installed a filter like
bool MotionEventFilter::nativeEventFilter(const QByteArray &eventType,
void *message, long *result)
{
Q_UNUSED(result);
if (eventType == "xcb_generic_event_t") {
auto event = static_cast<xcb_generic_event_t *>(message);
switch (event->response_type & ~0x80) {
case XCB_MOTION_NOTIFY: {
xcb_motion_notify_event_t *motion =
reinterpret_cast<xcb_motion_notify_event_t *>(event);
std::cout << "XCB_MOTION_NOTIFY("
<< "x: " << motion->event_x << ", y: " << motion->event_y
<< ")" << std::endl;
break;
}
case XCB_GE_GENERIC: {
std::cout << "XCB_GE_GENERIC" << std::endl;
break;
}
default:
break;
}
}
return false;
}
and all I get when moving the mouse over the window is
XCB_GE_GENERIC
XCB_GE_GENERIC
...
So the behavior doesn't really match what the fix commit message says,
unless I'm misunderstanding.
I thought I would get
XCB_MOTION_NOTIFY
XCB_GE_GENERIC
XCB_MOTION_NOTIFY
XCB_GE_GENERIC
...
On my end it seems mouse motions come in as only XCB_GE_GENERIC, not
as XCB_MOTION_NOTIFY and XCB_GE_GENERIC interleaved. Could that be why
compression is not working here? (XCB_GE_GENERIC are never
compressed?)
Sorry for all the questions, just trying to understand what's going on.
Elvis
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
> Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
More information about the Interest
mailing list