xwayland: Make resizing work again
9c376b54ea fixed the crash when a client goes
away during a resize grab. The shsurf->resource is set to NULL in that
case and we were trying to send out events to a NULL resource. However,
xwayland shell surfaces are created by the xwayland module and don't have a
resource. We use a different function pointer for sending the configure
events that handle the events inside xwayland instead of sending protocol
events.
To fix all this, we just move the check for a NULL resource into the
functions that we use for sending configure events for wl_shell and
xdg_shell.
This commit is contained in:
@@ -1630,7 +1630,7 @@ resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
|
|||||||
|
|
||||||
weston_pointer_move(pointer, x, y);
|
weston_pointer_move(pointer, x, y);
|
||||||
|
|
||||||
if (!shsurf || !shsurf->resource)
|
if (!shsurf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
weston_view_from_global_fixed(shsurf->view,
|
weston_view_from_global_fixed(shsurf->view,
|
||||||
@@ -1665,8 +1665,9 @@ send_configure(struct weston_surface *surface,
|
|||||||
|
|
||||||
assert(shsurf);
|
assert(shsurf);
|
||||||
|
|
||||||
wl_shell_surface_send_configure(shsurf->resource,
|
if (shsurf->resource)
|
||||||
edges, width, height);
|
wl_shell_surface_send_configure(shsurf->resource,
|
||||||
|
edges, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct weston_shell_client shell_client = {
|
static const struct weston_shell_client shell_client = {
|
||||||
@@ -3514,7 +3515,8 @@ xdg_send_configure(struct weston_surface *surface,
|
|||||||
|
|
||||||
assert(shsurf);
|
assert(shsurf);
|
||||||
|
|
||||||
xdg_surface_send_configure(shsurf->resource, width, height);
|
if (shsurf->resource)
|
||||||
|
xdg_surface_send_configure(shsurf->resource, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct weston_shell_client xdg_client = {
|
static const struct weston_shell_client xdg_client = {
|
||||||
|
|||||||
Reference in New Issue
Block a user