diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index d7746a0e2..deaa6f404 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -3321,7 +3321,7 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu { Eina_List *l; struct wl_client *wc; - uint32_t serial, btn; + uint32_t serial, btn, *state_serial; struct wl_resource *res; if (ec->cur_mouse_action || ec->border_menu || e_comp_wl->drag) @@ -3353,12 +3353,16 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu } if (state == WL_POINTER_BUTTON_STATE_PRESSED) - e_comp_wl->ptr.button_mask |= 1 << button_id; + { + e_comp_wl->ptr.button_mask |= 1 << button_id; + state_serial = &e_comp_wl->ptr.serial[0]; + } else { /* reject release events if button is not pressed */ if (!(e_comp_wl->ptr.button_mask & (1 << button_id))) return EINA_FALSE; e_comp_wl->ptr.button_mask &= ~(1 << button_id); + state_serial = &e_comp_wl->ptr.serial[1]; } e_comp_wl->ptr.button = btn; @@ -3368,7 +3372,7 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu return EINA_TRUE; wc = wl_resource_get_client(ec->comp_data->surface); - serial = wl_display_next_serial(e_comp_wl->wl.disp); + *state_serial = serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 8d0ac5a90..a78f5cd0c 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -188,6 +188,7 @@ struct _E_Comp_Wl_Data wl_fixed_t x, y; wl_fixed_t grab_x, grab_y; uint32_t button; + uint32_t serial[2]; //down/up uint32_t button_mask; E_Client *ec; Eina_Bool enabled : 1; diff --git a/src/modules/wl_desktop_shell/xdg5.c b/src/modules/wl_desktop_shell/xdg5.c index 7d21c6196..4d4857ab4 100644 --- a/src/modules/wl_desktop_shell/xdg5.c +++ b/src/modules/wl_desktop_shell/xdg5.c @@ -237,6 +237,7 @@ _e_xdg_shell_surface_cb_move(struct wl_client *client EINA_UNUSED, struct wl_res if (e_object_is_del(E_OBJECT(ec))) return; if ((ec->maximized) || (ec->fullscreen)) return; + if (serial != e_comp_wl->ptr.serial[0]) return; switch (e_comp_wl->ptr.button) { @@ -280,6 +281,7 @@ _e_xdg_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_r return; } if (e_object_is_del(E_OBJECT(ec))) return; + if (serial != e_comp_wl->ptr.serial[0]) return; if ((edges == 0) || (edges > 15) || ((edges & 3) == 3) || ((edges & 12) == 12)) return; diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c index f9bfd5a9a..8045b450d 100644 --- a/src/modules/wl_desktop_shell/xdg6.c +++ b/src/modules/wl_desktop_shell/xdg6.c @@ -1043,6 +1043,7 @@ _e_xdg_toplevel_cb_move(struct wl_client *client EINA_UNUSED, struct wl_resource if (e_object_is_del(E_OBJECT(ec))) return; if ((ec->maximized) || (ec->fullscreen)) return; + if (serial != e_comp_wl->ptr.serial[0]) return; switch (e_comp_wl->ptr.button) { @@ -1086,6 +1087,7 @@ _e_xdg_toplevel_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_resour return; } if (e_object_is_del(E_OBJECT(ec))) return; + if (serial != e_comp_wl->ptr.serial[0]) return; if ((edges == 0) || (edges > 15) || ((edges & 3) == 3) || ((edges & 12) == 12)) return;