Commit a347da44 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix pressure sensitivity in the Scratch Pad

BUG:328955
parent a6b160cc
......@@ -346,20 +346,28 @@ bool translateTabletEvent(const MSG &msg, PACKET *localPacketBuf,
QPoint globalPos(qRound(hiResGlobal.x()), qRound(hiResGlobal.y()));
// make sure the tablet event get's sent to the proper widget...
QWidget *w = QApplication::activePopupWidget();
QWidget *w = 0;
/**
* Find the appropriate window in an order of preference
*/
if (!w) w = qApp->widgetAt(globalPos);
if (!w) w = QWidget::find(msg.hwnd);
QWidget *parentOverride = 0;
if (!parentOverride) parentOverride = qApp->activePopupWidget();
if (!parentOverride) parentOverride = qApp->activeModalWidget();
if (!w || (parentOverride && !parentOverride->isAncestorOf(w))) {
w = parentOverride;
}
if (kis_tablet_pressed) {
w = kis_tablet_pressed;
}
if (!w) w = qApp->activeModalWidget();
if (!w) w = qApp->widgetAt(globalPos);
if (!w) w = QWidget::find(msg.hwnd);
if (t == KisTabletEvent::TabletPressEx && !kis_tablet_pressed) {
kis_tablet_pressed = w;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment