wayland-seat: Fix updating the grab serial

We shouldn't update the grab serial if we go from 2 buttons => 1.
This commit is contained in:
Jasper St. Pierre 2013-11-12 15:42:31 -05:00
parent 7908eca579
commit ad84aef766

View File

@ -280,13 +280,14 @@ handle_button_event (MetaWaylandSeat *seat,
const ClutterEvent *event)
{
MetaWaylandPointer *pointer = &seat->pointer;
gboolean state = event->type == CLUTTER_BUTTON_PRESS;
gboolean implicit_grab;
uint32_t button;
MetaWaylandSurface *surface;
notify_motion (seat, event);
if (state && pointer->button_count == 1)
implicit_grab = (event->type == CLUTTER_BUTTON_PRESS) && (pointer->button_count == 1);
if (implicit_grab)
{
button = clutter_event_get_button (event);
pointer->grab_button = button;
@ -307,7 +308,7 @@ handle_button_event (MetaWaylandSeat *seat,
pointer->grab->interface->button (pointer->grab, event);
if (pointer->button_count == 1)
if (implicit_grab)
pointer->grab_serial = wl_display_get_serial (seat->display);
}