shell: Don't cast weston_view to surface when we just need view->surface
Most of the shell.c bindings take effect on the current pointer or touch focus. That's now a view, but we need a surface in these cases. Just get the surface from view->surface instead of trying to cast a view to a surface.
This commit is contained in:
+7
-14
@@ -2850,8 +2850,7 @@ get_shell_surface_type(struct weston_surface *surface)
|
|||||||
static void
|
static void
|
||||||
move_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
|
move_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
|
||||||
{
|
{
|
||||||
struct weston_surface *focus =
|
struct weston_surface *focus = seat->pointer->focus->surface;
|
||||||
(struct weston_surface *) seat->pointer->focus;
|
|
||||||
struct weston_surface *surface;
|
struct weston_surface *surface;
|
||||||
struct shell_surface *shsurf;
|
struct shell_surface *shsurf;
|
||||||
|
|
||||||
@@ -2870,8 +2869,7 @@ move_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *dat
|
|||||||
static void
|
static void
|
||||||
touch_move_binding(struct weston_seat *seat, uint32_t time, void *data)
|
touch_move_binding(struct weston_seat *seat, uint32_t time, void *data)
|
||||||
{
|
{
|
||||||
struct weston_surface *focus =
|
struct weston_surface *focus = seat->touch->focus->surface;
|
||||||
(struct weston_surface *) seat->touch->focus;
|
|
||||||
struct weston_surface *surface;
|
struct weston_surface *surface;
|
||||||
struct shell_surface *shsurf;
|
struct shell_surface *shsurf;
|
||||||
|
|
||||||
@@ -2890,8 +2888,7 @@ touch_move_binding(struct weston_seat *seat, uint32_t time, void *data)
|
|||||||
static void
|
static void
|
||||||
resize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
|
resize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
|
||||||
{
|
{
|
||||||
struct weston_surface *focus =
|
struct weston_surface *focus = seat->pointer->focus->surface;
|
||||||
(struct weston_surface *) seat->pointer->focus;
|
|
||||||
struct weston_surface *surface;
|
struct weston_surface *surface;
|
||||||
uint32_t edges = 0;
|
uint32_t edges = 0;
|
||||||
int32_t x, y;
|
int32_t x, y;
|
||||||
@@ -2934,8 +2931,7 @@ surface_opacity_binding(struct weston_seat *seat, uint32_t time, uint32_t axis,
|
|||||||
{
|
{
|
||||||
float step = 0.005;
|
float step = 0.005;
|
||||||
struct shell_surface *shsurf;
|
struct shell_surface *shsurf;
|
||||||
struct weston_surface *focus =
|
struct weston_surface *focus = seat->pointer->focus->surface;
|
||||||
(struct weston_surface *) seat->pointer->focus;
|
|
||||||
struct weston_surface *surface;
|
struct weston_surface *surface;
|
||||||
|
|
||||||
/* XXX: broken for windows containing sub-surfaces */
|
/* XXX: broken for windows containing sub-surfaces */
|
||||||
@@ -3153,8 +3149,7 @@ static void
|
|||||||
rotate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
|
rotate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct weston_surface *focus =
|
struct weston_surface *focus = seat->pointer->focus->surface;
|
||||||
(struct weston_surface *) seat->pointer->focus;
|
|
||||||
struct weston_surface *base_surface;
|
struct weston_surface *base_surface;
|
||||||
struct shell_surface *surface;
|
struct shell_surface *surface;
|
||||||
|
|
||||||
@@ -3265,8 +3260,7 @@ click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t butt
|
|||||||
if (seat->pointer->grab != &seat->pointer->default_grab)
|
if (seat->pointer->grab != &seat->pointer->default_grab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
activate_binding(seat, data,
|
activate_binding(seat, data, seat->pointer->focus->surface);
|
||||||
(struct weston_surface *) seat->pointer->focus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3275,8 +3269,7 @@ touch_to_activate_binding(struct weston_seat *seat, uint32_t time, void *data)
|
|||||||
if (seat->touch->grab != &seat->touch->default_grab)
|
if (seat->touch->grab != &seat->touch->default_grab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
activate_binding(seat, data,
|
activate_binding(seat, data, seat->touch->focus->surface);
|
||||||
(struct weston_surface *) seat->touch->focus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user