PDA

View Full Version : Right-click context menus freeze on Windows



E099844
25th October 2010, 16:28
I am developing a multi-threaded, (near) real-time app for Windows and Linux (using 4.6.0). Context menu requests (right-clicks) sometimes cause the app to "freeze up" on Windows (XP only, not currently targeting Windows 7). The real-time piece of the app stops updating, and I only get an "outline" of the context menu. This is not an issue on our Linux platforms. I have to move the mouse then right-click again (sometimes several times) to clear this behavior. I have also observed this behavior occasionally in QtCreator (on Windows). I have added "raise()" and "activateWindow()" calls on all context menu event handlers, but this does not seem to have affected the behavior. Has anyone else observed (and hopefully corrected) this behavior?

E099844
25th October 2010, 18:35
I think I found and fixed my own issue: Basically I replaced every occurrence of:

_contextMenu->exec(event->globalPos());

with:

_contextMenu->popup(event->globalPos());

The difference being that "exec()" executes the menu synchronously while "popup()" executes the menu asynchronously.