Commit bd60840
committed
QMenu: Trigger on button releases without seeing pressed buttons before
On Wayland we can't make any assumptions about button state when
we don't have pointer focus. Crucially when opening a popup (menu in this
case), a pointer leave (focus out) event for the parent window and a
pointer enter (focus in) event for the new menu window will be sent,
and accordingly the platform backend resets the button state.
However, this means QMenu might never see a move event with pressed
buttons; and upon release, no action is triggered.
If we see a release without having seen any pressed buttons:
if the release happens over an action, activate it; otherwise
do nothing, as before (it's just release of the press that opened
the menu).
Fixes: QTBUG-124920
Change-Id: Id86e81431621ce577101bf7cf45252dd1a02bfc4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 7412278)
Reviewed-by: David Redondo <qt@david-redondo.de>1 parent 4a91973 commit bd60840
File tree
1 file changed
+7
-3
lines changed- src/widgets/widgets
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2921 | 2921 | | |
2922 | 2922 | | |
2923 | 2923 | | |
2924 | | - | |
| 2924 | + | |
| 2925 | + | |
2925 | 2926 | | |
2926 | 2927 | | |
2927 | 2928 | | |
2928 | 2929 | | |
| 2930 | + | |
| 2931 | + | |
2929 | 2932 | | |
| 2933 | + | |
2930 | 2934 | | |
2931 | 2935 | | |
2932 | | - | |
| 2936 | + | |
2933 | 2937 | | |
2934 | 2938 | | |
2935 | 2939 | | |
| |||
2945 | 2949 | | |
2946 | 2950 | | |
2947 | 2951 | | |
2948 | | - | |
| 2952 | + | |
2949 | 2953 | | |
2950 | 2954 | | |
2951 | 2955 | | |
| |||
0 commit comments