summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-05-25 16:26:13 +0200
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-05-25 16:39:13 +0200
commit3d560a498803fadfec9163d7a9695aee60cca8d4 (patch)
treecbfa2f56d448d0de3cd55ed57705ef0d998b6cb0 /src/gui
parent9021113c583cc6b54b3b764e8e74d1448474c773 (diff)
BT: fix systray balloon crash bug on Windows CE
Its the context menu handling code... again. Problem is, that during execution of translateMouseEvent, the widget is closed and a modal message box is shown. After that, there's no widget at globalPos and thus, alienWidget is null. This patch just adds a null check for alienWidget. Task-number: 254425 Reviewed-by: mauricek BT: yes
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_win.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index f14ad6ffa1..239ee1416c 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -1675,20 +1675,23 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// send the context menu event is a different one
if (!alienWidget->testAttribute(Qt::WA_NativeWindow) && !alienWidget->testAttribute(Qt::WA_PaintOnScreen)) {
alienWidget = QApplication::widgetAt(globalPos);
- pos = alienWidget->mapFromGlobal(globalPos);
+ if (alienWidget)
+ pos = alienWidget->mapFromGlobal(globalPos);
}
- SHRGINFO shrg;
- shrg.cbSize = sizeof(shrg);
- shrg.hwndClient = hwnd;
- shrg.ptDown.x = GET_X_LPARAM(lParam);
- shrg.ptDown.y = GET_Y_LPARAM(lParam);
- shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
- resolveAygLibs();
- if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
- if (qApp->activePopupWidget())
- qApp->activePopupWidget()->close();
- QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
- result = qt_sendSpontaneousEvent(alienWidget, &e);
+ if (alienWidget) {
+ SHRGINFO shrg;
+ shrg.cbSize = sizeof(shrg);
+ shrg.hwndClient = hwnd;
+ shrg.ptDown.x = GET_X_LPARAM(lParam);
+ shrg.ptDown.y = GET_Y_LPARAM(lParam);
+ shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
+ resolveAygLibs();
+ if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
+ if (qApp->activePopupWidget())
+ qApp->activePopupWidget()->close();
+ QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
+ result = qt_sendSpontaneousEvent(alienWidget, &e);
+ }
}
}
}