Hello ke007,
I was able to reproduce your application case. When analyzing the behavior note following two aspects:
1. When you present a dialog via PresentDialog(), the corresponding dialog appears with a small delay of at least one screen update. This delay may become longer if the dialog is presented with an animation. This is expected behavior.
2. When you present the dialog inside a component, widgets existing inside this component continue reacting to user inputs. This is an expected behavior too (for details see Take a closer look at the Dialog functionality).
Now let us analyze the application case:
3. Let's assume there is a component containing a Simple Touch Handler configured to react on 2-finger taps.
4. Furthermore let's assume the Simple Touch Handler is configured to redirect the touch events to other handler when the user performed a wipe gesture.
5. Finally let's assume behind the Simple Touch Handler is found a widget e.g. Push Button.
6. Now the user touches the screen with two fingers.
7. The Simple Touch Handler responds to this event. A signal is sent to a slot method associated to its OnPress property.
8. In the slot method you present a dialog.
9. The dialog is presented in context of the component containing the Simple Touch Handler (it was the case in your version of Washing Maschine).
10. The dialog appears after a short delay (see 1 above)
11. Now the user drags the fingers.
12. The Simple Touch Handler detects this gestures and asks which GUI component is willing to take over the interaction.
13. Since the dialog is already visible (note 10), the touch handler existing in the dialog is able to take over the interaction.
This was the good scenario with a delay between the 2-finger tap and the finger movement large enough to present the dialog. Now let focus on a first bad scenario:
3-9. are the same as above.
14. Still before the dialog appeared the user dragged the finger.
15. The Simple Touch Handler detects this gestures and asks which GUI component is willing to take over the interaction.
16. The dialog is not yet visible. It can't take over the interaction. This is because of the aspect 1 above.
17. Therefore the widget in the background takes over.
18. Your widget is activated.
A second bad scenario:
3-9. are the same as above.
19. The dialog appears after a short delay (see 1 above)
20. Now the user drags the fingers.
21. The screen position where the user touched does not lie inside the Touch Handler in the dialog.
22. The Touch Handler in the dialog thus can't take over the interaction.
23. Therefore the widget in the background takes over. This is true even if the dialog is already presented (visible). This is because of aspect 2 above.
24. Your widget is activated.
Now please open my example I have prepared for you some weeks ago. This example is implemented to correctly handle the aspects 1 and 2:
25. The first important detail is, the component containing the Simple Touch Handler intended to detect the 2-finger gestures and present the DoubleFinger dialog is also a dialog. This Basic dialog is presented at the startup time of the application. This is a condition to avoid aspect 1. Why? Even if DoubleFinger dialog will appear with a small delay, the fact that it was scheduled for the presentation may revoke the active state of the Basic dialog immediately. See in the example the code to present the Basic dialog:
26. Both the Basic and DoubleFinger dialogs are presented in context of the same owner, in this example in context of the Application component (root object). This is the a condition to avoid aspect 2. Note the usage of GetRoot() when the DoubleFinger dialog is presented:
Well I hope it clarifies the behavior.
Best regards
Paul Banach