}
static int
-weston_surface_move(struct weston_surface *es,
- struct weston_seat *ws)
+surface_move(struct shell_surface *shsurf, struct weston_seat *ws)
{
struct weston_move_grab *move;
- struct shell_surface *shsurf = get_shell_surface(es);
if (!shsurf)
return -1;
shell_grab_init(&move->base, &move_grab_interface, shsurf);
- move->dx = wl_fixed_from_double(es->geometry.x) -
+ move->dx = wl_fixed_from_double(shsurf->surface->geometry.x) -
ws->seat.pointer->grab_x;
- move->dy = wl_fixed_from_double(es->geometry.y) -
+ move->dy = wl_fixed_from_double(shsurf->surface->geometry.y) -
ws->seat.pointer->grab_y;
wl_pointer_start_grab(ws->seat.pointer, &move->base.grab);
ws->seat.pointer->focus != &shsurf->surface->surface)
return;
- if (weston_surface_move(shsurf->surface, ws) < 0)
+ if (surface_move(shsurf, ws) < 0)
wl_resource_post_no_memory(resource);
}
{
struct weston_surface *surface =
(struct weston_surface *) seat->pointer->focus;
+ struct shell_surface *shsurf;
if (surface == NULL)
return;
- switch (get_shell_surface_type(surface)) {
+ shsurf = get_shell_surface(surface);
+ if (shsurf == NULL)
+ return;
+
+ switch (shsurf->type) {
case SHELL_SURFACE_PANEL:
case SHELL_SURFACE_BACKGROUND:
case SHELL_SURFACE_FULLSCREEN:
break;
}
- weston_surface_move(surface, (struct weston_seat *) seat);
+ surface_move(shsurf, (struct weston_seat *) seat);
}
static void
ec->ping_handler = ping_handler;
ec->shell_interface.create_shell_surface = create_shell_surface;
ec->shell_interface.set_toplevel = set_toplevel;
+ ec->shell_interface.move = surface_move;
wl_list_init(&shell->backgrounds);
wl_list_init(&shell->panels);