Page MenuHomePhabricator

PlanarFigure statemachine behaves badly when opening a contextmenu
Closed, ResolvedPublic

Description

When hovering over a PlanarFigure (not a controlpoint) and performing a right-mousebutton click an contextmenu is requested.
Afterwards, the statemachine remains in the hovering state. This is fine and correct if no context menu is shown.

If this menu is a modal dialog (like it's the default with contextmenus in Qt) the dialog 'eats' all the mousemove events and the interactor does not notice that the cursor has actually moved. In this case, the state should actually change to something different than hovering.

However, as it is not possible to actively get the cursor-position from inside the interactor (it simply does not work like this) I had to add a new helper-state 'ContextMenuHelperState'. This state is entered when the 'SecondaryButtonPressed' event is processed.
This new state is left after the first MouseMoveEvent after the contextmenu is closed. Depending on the new position of the cursor with this new mousemove, the statemachine switches to the correct state.

Event Timeline

User engelm has pushed new remote branch:

bug-17453-planarfigure-contextmenu-snapshot

User engelm has pushed new remote branch:

bug-17453-planarfigure-contextmenu-master

The changes have been merged into my snapshot with commit db6236d91ee15437cfaf05f38b962ab019fab278

I was not yet able to merge the changes into master as t he dashboard is currently red

Is this bug release relevant? (Do we need a release_fix flag?)

The bugfix is not really relevant as the MITK Workbench does not use this feature, but as the bug is already fixed and tested and ready for merge...

You can set the flag.

Current release is finished. Resetting target milestone

[b3110c]: Merge branch 'bug-17453-planarfigure-contextmenu-master'

Merged commits:

2014-03-11 10:47:12 Markus Engel [a9c397]
added new helper state when requesting contextmenu from PlanarFigureInteractor