summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_mac.mm')
-rw-r--r--src/gui/kernel/qapplication_mac.mm41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index b1aa75f78a..beccfb0d39 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -1069,7 +1069,7 @@ void qt_init(QApplicationPrivate *priv, int)
if (GetCurrentProcess(&psn) == noErr) {
// Jambi needs to transform itself since most people aren't "used"
// to putting things in bundles, but other people may actually not
- // want to tranform the process (running as a helper or somethng)
+ // want to tranform the process (running as a helper or something)
// so don't do that for them. This means checking both LSUIElement
// and LSBackgroundOnly. If you set them both... well, you
// shouldn't do that.
@@ -1377,29 +1377,6 @@ QWidget *QApplication::topLevelAt(const QPoint &p)
#endif
}
-static QWidget *qt_mac_recursive_widgetAt(QWidget *widget, int x, int y)
-{
- if (!widget)
- return 0;
- const QObjectList kids = widget->children();
- for(int i = kids.size()-1; i >= 0; --i) {
- if ( QWidget *kid = qobject_cast<QWidget*>(kids.at(i)) ) {
- if (kid->isVisible() && !kid->isTopLevel() &&
- !kid->testAttribute(Qt::WA_TransparentForMouseEvents)) {
- const int wx=kid->x(), wy=kid->y(),
- wx2=wx+kid->width(), wy2=wy+kid->height();
- if (x >= wx && y >= wy && x < wx2 && y < wy2) {
- const QRegion mask = kid->mask();
- if (!mask.isEmpty() && !mask.contains(QPoint(x-wx, y-wy)))
- continue;
- return qt_mac_recursive_widgetAt(kid, x-wx, y-wy);
- }
- }
- }
- }
- return widget;
-}
-
/*****************************************************************************
Main event loop
*****************************************************************************/
@@ -1770,7 +1747,7 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
if(window) {
HIViewRef hiview;
if(HIViewGetViewForMouseEvent(HIViewGetRoot(window), event, &hiview) == noErr) {
- widget = QWidget::find((WId)hiview);;
+ widget = QWidget::find((WId)hiview);
if (widget) {
// Make sure we didn't pass over a widget with a "fake hole" in it.
QWidget *otherWidget = QApplication::widgetAt(where.h, where.v);
@@ -1887,9 +1864,10 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
tablet_button_state = new_tablet_button_state;
QMacTabletHash *tabletHash = qt_mac_tablet_hash();
- if (!tabletHash->contains(tabletPointRec.deviceID)) {
- qWarning("QCocoaView handleTabletEvent: This tablet device is unknown"
- " (received no proximity event for it). Discarding event.");
+ if (!tabletHash->contains(tabletPointRec.deviceID) && t != QEvent::TabletRelease) {
+ // Never discard TabletRelease events as they may be delivered *after* TabletLeaveProximity events
+ qWarning("handleTabletEvent: This tablet device is unknown"
+ " (received no proximity event for it). Discarding event.");
return false;
}
QTabletDeviceData &deviceData = tabletHash->operator[](tabletPointRec.deviceID);
@@ -1931,8 +1909,13 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
tp, rotation, z, modifiers, deviceData.tabletUniqueID);
QApplication::sendSpontaneousEvent(widget, &e);
if (e.isAccepted()) {
+ if (t == QEvent::TabletPress) {
+ qt_button_down = widget;
+ } else if (t == QEvent::TabletRelease) {
+ qt_button_down = 0;
+ }
#if defined(DEBUG_MOUSE_MAPS)
- qDebug("Bail out early due to table acceptance");
+ qDebug("Bail out early due to tablet acceptance");
#endif
break;
}