Hi,

----- Original Message -----
> 2016-09-01 11:52 GMT+02:00 Olivier Fourdan <ofour...@redhat.com>:
> > Hi
> >
> >> > +   keyboard->grab_serial =
> >> > wl_display_get_serial(compositor->wl_display);
> >> >     if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
> >> > -           keyboard->grab_serial =
> >> > -                   wl_display_get_serial(compositor->wl_display);
> >> >             keyboard->grab_time = time;
> >> >             keyboard->grab_key = key;
> >> >     }
> >> >
> >>
> >> I’m ok with that, but why not updating all three "grab_*" members?
> >
> > While I think the key itself would be OK, I suspect updating the grab_time
> > on all states (ie like key release) might have additional side effects.
> >
> > So I took the most conservative approach which was to update the serial
> > only, as this one is compared against the popup serial.
> 
> I can't tell if it's right or not, but so maybe it would be good to
> add a comment about it, unless someone (daniels?) can confirm it's
> right.

Well, this is needed when traversing submenus using the keyboard.

Once you navigate to a submenu with the keyboard, the corresponding popup is 
created by the toolkit using the serial provided by the compositor, which will 
compare against the last known serial. If the grab serial is updated on key 
press only, the serial won't match and the submenu will be dismissed.

This can easily be reproduced using an up-to-date gtk+ from git master.

Cheers,
Olivier
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to