Revert "wlr_xdg_popup: don't treat all surfaces of grabbing client as grabbing surfaces"
This reverts commit 52037d13f7
.
Fixes #1801
This commit is contained in:
parent
fa477c77c4
commit
cdfe836b03
|
@ -18,16 +18,7 @@ static void xdg_popup_grab_end(struct wlr_xdg_popup_grab *popup_grab) {
|
||||||
static void xdg_pointer_grab_enter(struct wlr_seat_pointer_grab *grab,
|
static void xdg_pointer_grab_enter(struct wlr_seat_pointer_grab *grab,
|
||||||
struct wlr_surface *surface, double sx, double sy) {
|
struct wlr_surface *surface, double sx, double sy) {
|
||||||
struct wlr_xdg_popup_grab *popup_grab = grab->data;
|
struct wlr_xdg_popup_grab *popup_grab = grab->data;
|
||||||
|
if (wl_resource_get_client(surface->resource) == popup_grab->client) {
|
||||||
bool grabbing = false;
|
|
||||||
struct wlr_xdg_popup *popup;
|
|
||||||
wl_list_for_each(popup, &popup_grab->popups, grab_link) {
|
|
||||||
if (surface == popup->base->surface) {
|
|
||||||
grabbing = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (grabbing) {
|
|
||||||
wlr_seat_pointer_enter(grab->seat, surface, sx, sy);
|
wlr_seat_pointer_enter(grab->seat, surface, sx, sy);
|
||||||
} else {
|
} else {
|
||||||
wlr_seat_pointer_clear_focus(grab->seat);
|
wlr_seat_pointer_clear_focus(grab->seat);
|
||||||
|
@ -106,15 +97,7 @@ static uint32_t xdg_touch_grab_down(struct wlr_seat_touch_grab *grab,
|
||||||
uint32_t time, struct wlr_touch_point *point) {
|
uint32_t time, struct wlr_touch_point *point) {
|
||||||
struct wlr_xdg_popup_grab *popup_grab = grab->data;
|
struct wlr_xdg_popup_grab *popup_grab = grab->data;
|
||||||
|
|
||||||
bool grabbing = false;
|
if (wl_resource_get_client(point->surface->resource) != popup_grab->client) {
|
||||||
struct wlr_xdg_popup *popup;
|
|
||||||
wl_list_for_each(popup, &popup_grab->popups, grab_link) {
|
|
||||||
if (point->surface == popup->base->surface) {
|
|
||||||
grabbing = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!grabbing) {
|
|
||||||
xdg_popup_grab_end(grab->data);
|
xdg_popup_grab_end(grab->data);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,16 +28,7 @@ static void xdg_popup_grab_end(struct wlr_xdg_popup_grab_v6 *popup_grab) {
|
||||||
static void xdg_pointer_grab_enter(struct wlr_seat_pointer_grab *grab,
|
static void xdg_pointer_grab_enter(struct wlr_seat_pointer_grab *grab,
|
||||||
struct wlr_surface *surface, double sx, double sy) {
|
struct wlr_surface *surface, double sx, double sy) {
|
||||||
struct wlr_xdg_popup_grab_v6 *popup_grab = grab->data;
|
struct wlr_xdg_popup_grab_v6 *popup_grab = grab->data;
|
||||||
|
if (wl_resource_get_client(surface->resource) == popup_grab->client) {
|
||||||
bool grabbing = false;
|
|
||||||
struct wlr_xdg_popup_v6 *popup;
|
|
||||||
wl_list_for_each(popup, &popup_grab->popups, grab_link) {
|
|
||||||
if (surface == popup->base->surface) {
|
|
||||||
grabbing = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (grabbing) {
|
|
||||||
wlr_seat_pointer_enter(grab->seat, surface, sx, sy);
|
wlr_seat_pointer_enter(grab->seat, surface, sx, sy);
|
||||||
} else {
|
} else {
|
||||||
wlr_seat_pointer_clear_focus(grab->seat);
|
wlr_seat_pointer_clear_focus(grab->seat);
|
||||||
|
@ -116,15 +107,7 @@ static uint32_t xdg_touch_grab_down(struct wlr_seat_touch_grab *grab,
|
||||||
uint32_t time, struct wlr_touch_point *point) {
|
uint32_t time, struct wlr_touch_point *point) {
|
||||||
struct wlr_xdg_popup_grab_v6 *popup_grab = grab->data;
|
struct wlr_xdg_popup_grab_v6 *popup_grab = grab->data;
|
||||||
|
|
||||||
bool grabbing = false;
|
if (wl_resource_get_client(point->surface->resource) != popup_grab->client) {
|
||||||
struct wlr_xdg_popup_v6 *popup;
|
|
||||||
wl_list_for_each(popup, &popup_grab->popups, grab_link) {
|
|
||||||
if (point->surface == popup->base->surface) {
|
|
||||||
grabbing = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!grabbing) {
|
|
||||||
xdg_popup_grab_end(grab->data);
|
xdg_popup_grab_end(grab->data);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue