diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-03 15:46:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-03 15:46:20 (GMT) |
commit | 0489ba37346e4f8efc4a7c1661a60905dc4aa423 (patch) | |
tree | 9974317f49b9fbad41e77aa7c24783f988c38d89 /src/gui/kernel | |
parent | 7dacb5be7a97657754c844882f9e68365fd474d4 (diff) | |
parent | be1037d7b6bcdf0ab34fe7fab00d706f8daa01b5 (diff) | |
download | Qt-0489ba37346e4f8efc4a7c1661a60905dc4aa423.zip Qt-0489ba37346e4f8efc4a7c1661a60905dc4aa423.tar.gz Qt-0489ba37346e4f8efc4a7c1661a60905dc4aa423.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Removed unused macro.
Fix runtime warning on Gtk versions < 2.16
Fix compile
Follow-up to c1b067e: fix aliasing in QReadWriteLock too.
Bug with toolbar focus on Mac
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 6 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 6dda961..4fe3900 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -117,10 +117,6 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp #include <private/qt_cocoa_helpers_mac_p.h> #endif -#ifndef QT_GUI_DOUBLE_CLICK_RADIUS -#define QT_GUI_DOUBLE_CLICK_RADIUS 5 -#endif - //#define ALIEN_DEBUG static void initResources() diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 29ae51f..b5ccb3e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7535,6 +7535,23 @@ void QWidgetPrivate::hideChildren(bool spontaneous) QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) continue; +#ifdef QT_MAC_USE_COCOA + // Before doing anything we need to make sure that we don't leave anything in a non-consistent state. + // When hiding a widget we need to make sure that no mouse_down events are active, because + // the mouse_up event will never be received by a hidden widget or one of its descendants. + // The solution is simple, before going through with this we check if there are any mouse_down events in + // progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and + // then we continue. + // In X11 and Windows we send a mouse_release event, however we don't do that here because we were already + // ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the + // mouse release event. There are two ways to interpret this: + // 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it + // might be waiting for a release event that will never arrive. + // 2. If we send the mouse release event, then the widget might decide to trigger an action that is not + // supposed to trigger because it is not visible. + if(widget == qt_button_down) + qt_button_down = 0; +#endif // QT_MAC_USE_COCOA if (spontaneous) widget->setAttribute(Qt::WA_Mapped, false); else diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c7acf69..5bce17f 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -152,6 +152,7 @@ static bool qt_mac_raise_process = true; static OSWindowRef qt_root_win = 0; QWidget *mac_mouse_grabber = 0; QWidget *mac_keyboard_grabber = 0; +extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp #ifndef QT_MAC_USE_COCOA #ifdef QT_NAMESPACE @@ -866,7 +867,6 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, & ~Qt::WindowMaximized)); QApplication::sendSpontaneousEvent(widget, &e); } - extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp qt_button_down = 0; } else if(ekind == kEventWindowCollapsed) { if (!widget->isMinimized()) { @@ -894,7 +894,6 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, //we send a hide to be like X11/Windows QEvent e(QEvent::Hide); QApplication::sendSpontaneousEvent(widget, &e); - extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp qt_button_down = 0; } else if(ekind == kEventWindowToolbarSwitchMode) { macSendToolbarChangeEvent(widget); @@ -1519,7 +1518,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if (widget) { qt_event_request_window_change(widget); if (!HIViewIsVisible(HIViewRef(widget->winId()))) { - extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp if (widget == qt_button_down) qt_button_down = 0; } @@ -1528,7 +1526,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, break; } case kEventClassMouse: { bool send_to_app = false; - extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp if(qt_button_down) send_to_app = true; if(send_to_app) { @@ -3405,7 +3402,6 @@ void QWidgetPrivate::hide_sys() Q_Q(QWidget); if((q->windowType() == Qt::Desktop)) //you can't hide the desktop! return; - QMacCocoaAutoReleasePool pool; if(q->isWindow()) { OSWindowRef window = qt_mac_window_for(q); |