desktop-shell: Make resize and move functions take a pointer instead of a seat

An earlier patch made surface_resize() and surface_move() take pointers
instead of seats, this updates the weston_shell_interface resize and move to
match.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Derek Foreman 9 years ago committed by Daniel Stone
parent 88249cdc28
commit e4d6c83986
  1. 8
      desktop-shell/shell.c
  2. 5
      src/compositor.h
  3. 14
      xwayland/window-manager.c

@ -3087,17 +3087,17 @@ shell_interface_set_maximized(struct shell_surface *shsurf)
} }
static int static int
shell_interface_move(struct shell_surface *shsurf, struct weston_seat *ws) shell_interface_move(struct shell_surface *shsurf, struct weston_pointer *pointer)
{ {
return surface_move(shsurf, weston_seat_get_pointer(ws), true); return surface_move(shsurf, pointer, true);
} }
static int static int
shell_interface_resize(struct shell_surface *shsurf, shell_interface_resize(struct shell_surface *shsurf,
struct weston_seat *ws, struct weston_pointer *pointer,
uint32_t edges) uint32_t edges)
{ {
return surface_resize(shsurf, weston_seat_get_pointer(ws), edges); return surface_resize(shsurf, pointer, edges);
} }
static const struct weston_pointer_grab_interface popup_grab_interface; static const struct weston_pointer_grab_interface popup_grab_interface;

@ -56,6 +56,7 @@ struct shell_surface;
struct weston_seat; struct weston_seat;
struct weston_output; struct weston_output;
struct input_method; struct input_method;
struct weston_pointer;
enum weston_keyboard_modifier { enum weston_keyboard_modifier {
MODIFIER_CTRL = (1 << 0), MODIFIER_CTRL = (1 << 0),
@ -106,9 +107,9 @@ struct weston_shell_interface {
struct weston_output *output); struct weston_output *output);
void (*set_xwayland)(struct shell_surface *shsurf, void (*set_xwayland)(struct shell_surface *shsurf,
int x, int y, uint32_t flags); int x, int y, uint32_t flags);
int (*move)(struct shell_surface *shsurf, struct weston_seat *ws); int (*move)(struct shell_surface *shsurf, struct weston_pointer *pointer);
int (*resize)(struct shell_surface *shsurf, int (*resize)(struct shell_surface *shsurf,
struct weston_seat *ws, uint32_t edges); struct weston_pointer *pointer, uint32_t edges);
void (*set_title)(struct shell_surface *shsurf, void (*set_title)(struct shell_surface *shsurf,
const char *title); const char *title);
void (*set_window_geometry)(struct shell_surface *shsurf, void (*set_window_geometry)(struct shell_surface *shsurf,

@ -1362,7 +1362,7 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window,
detail = client_message->data.data32[2]; detail = client_message->data.data32[2];
switch (detail) { switch (detail) {
case _NET_WM_MOVERESIZE_MOVE: case _NET_WM_MOVERESIZE_MOVE:
shell_interface->move(window->shsurf, seat); shell_interface->move(window->shsurf, pointer);
break; break;
case _NET_WM_MOVERESIZE_SIZE_TOPLEFT: case _NET_WM_MOVERESIZE_SIZE_TOPLEFT:
case _NET_WM_MOVERESIZE_SIZE_TOP: case _NET_WM_MOVERESIZE_SIZE_TOP:
@ -1372,7 +1372,7 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window,
case _NET_WM_MOVERESIZE_SIZE_BOTTOM: case _NET_WM_MOVERESIZE_SIZE_BOTTOM:
case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT: case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT:
case _NET_WM_MOVERESIZE_SIZE_LEFT: case _NET_WM_MOVERESIZE_SIZE_LEFT:
shell_interface->resize(window->shsurf, seat, map[detail]); shell_interface->resize(window->shsurf, pointer, map[detail]);
break; break;
case _NET_WM_MOVERESIZE_CANCEL: case _NET_WM_MOVERESIZE_CANCEL:
break; break;
@ -1758,6 +1758,7 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
struct weston_shell_interface *shell_interface = struct weston_shell_interface *shell_interface =
&wm->server->compositor->shell_interface; &wm->server->compositor->shell_interface;
struct weston_seat *seat; struct weston_seat *seat;
struct weston_pointer *pointer;
struct weston_wm_window *window; struct weston_wm_window *window;
enum theme_location location; enum theme_location location;
enum frame_button_state button_state; enum frame_button_state button_state;
@ -1775,6 +1776,7 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
return; return;
seat = weston_wm_pick_seat_for_window(window); seat = weston_wm_pick_seat_for_window(window);
pointer = weston_seat_get_pointer(seat);
button_state = button->response_type == XCB_BUTTON_PRESS ? button_state = button->response_type == XCB_BUTTON_PRESS ?
FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED; FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED;
@ -1793,14 +1795,14 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
weston_wm_window_schedule_repaint(window); weston_wm_window_schedule_repaint(window);
if (frame_status(window->frame) & FRAME_STATUS_MOVE) { if (frame_status(window->frame) & FRAME_STATUS_MOVE) {
if (seat != NULL) if (pointer)
shell_interface->move(window->shsurf, seat); shell_interface->move(window->shsurf, pointer);
frame_status_clear(window->frame, FRAME_STATUS_MOVE); frame_status_clear(window->frame, FRAME_STATUS_MOVE);
} }
if (frame_status(window->frame) & FRAME_STATUS_RESIZE) { if (frame_status(window->frame) & FRAME_STATUS_RESIZE) {
if (seat != NULL) if (pointer)
shell_interface->resize(window->shsurf, seat, location); shell_interface->resize(window->shsurf, pointer, location);
frame_status_clear(window->frame, FRAME_STATUS_RESIZE); frame_status_clear(window->frame, FRAME_STATUS_RESIZE);
} }

Loading…
Cancel
Save