[PATCH weston 1/2] window: Only set menu element when menu widget is focused

Jonas Ådahl jadahl at gmail.com
Fri Oct 19 04:45:05 PDT 2012


On Fri, Oct 19, 2012 at 1:10 PM, Pekka Vuorela <pvuorela at iki.fi> wrote:
> 2012/10/19 Jonas Ådahl <jadahl at gmail.com>:
>> Motion handlers are called for either grabbed or focused widgets. If a
>> menu is displayed, thus grabbed, motion events relative to the parent
>> surface are delivered to the menu widget motion handler even though it
>> is not in focus. By checking that the menu widget is the focused one we
>> can avoid setting incorrect menu elements.
>>
>> This fixes the issue when an unexpected menu item gets selected when the
>> pointer is just outside the menu area.
>
> Was discussed earlier this month and the understanding was that on
> grab events should be always relative to menu surface. This patch
> would paper over the wrong behavior.

While it would make sense to have the motion events relative to the
surface in these cases, I think that it would still be better if the
menu elements were not selected when the pointer is outside of the
menu widget. Without this patch, but with the relative coordinate fix
in place, that would not be the behavior, right? The commit message
should be different though, in that case.

Jonas


More information about the wayland-devel mailing list