summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2016-08-15 10:56:52 +0200
committerQuentin Glidic <sardemff7+git@sardemff7.net>2016-08-27 18:45:38 +0200
commitfff39817bc88fba9bb581a953ae14dbd951bbf6d (patch)
tree497f868d3cfe5f8f21bdd8eed02283845076f690
parent96c6a798a56cb2cd96b2c16dfee17330f1744fbb (diff)
libweston: Drop shell_interface
Its usage is now limited to some dock-related helper, and the plugin registry is a better fit for that kind of helper. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
-rw-r--r--desktop-shell/shell.c19
-rw-r--r--libweston/compositor.h7
2 files changed, 8 insertions, 18 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 7589586c..653e85b0 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -51,6 +51,7 @@
#endif
struct focus_state {
+ struct desktop_shell *shell;
struct weston_seat *seat;
struct workspace *ws;
struct weston_surface *keyboard_focus;
@@ -332,11 +333,10 @@ get_output_panel_size(struct desktop_shell *shell,
}
static void
-get_output_work_area(void *data,
+get_output_work_area(struct desktop_shell *shell,
struct weston_output *output,
pixman_rectangle32_t *area)
{
- struct desktop_shell *shell = data;
int32_t panel_width = 0, panel_height = 0;
area->x = output->x;
@@ -633,7 +633,6 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
struct focus_state *state = container_of(listener,
struct focus_state,
surface_destroy_listener);
- struct desktop_shell *shell;
struct weston_surface *main_surface;
struct weston_view *next;
struct weston_view *view;
@@ -658,13 +657,12 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
if (main_surface != state->keyboard_focus)
next = get_default_view(main_surface);
- shell = state->seat->compositor->shell_interface.shell;
if (next) {
state->keyboard_focus = NULL;
- activate(shell, next, state->seat,
+ activate(state->shell, next, state->seat,
WESTON_ACTIVATE_FLAG_CONFIGURE);
} else {
- if (shell->focus_animation_type == ANIMATION_DIM_LAYER) {
+ if (state->shell->focus_animation_type == ANIMATION_DIM_LAYER) {
if (state->ws->focus_animation)
weston_view_animation_destroy(state->ws->focus_animation);
@@ -680,7 +678,8 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
}
static struct focus_state *
-focus_state_create(struct weston_seat *seat, struct workspace *ws)
+focus_state_create(struct desktop_shell *shell, struct weston_seat *seat,
+ struct workspace *ws)
{
struct focus_state *state;
@@ -688,6 +687,7 @@ focus_state_create(struct weston_seat *seat, struct workspace *ws)
if (state == NULL)
return NULL;
+ state->shell = shell;
state->keyboard_focus = NULL;
state->ws = ws;
state->seat = seat;
@@ -713,7 +713,7 @@ ensure_focus_state(struct desktop_shell *shell, struct weston_seat *seat)
break;
if (&state->link == &ws->focus_list)
- state = focus_state_create(seat, ws);
+ state = focus_state_create(shell, seat, ws);
return state;
}
@@ -4867,9 +4867,6 @@ module_init(struct weston_compositor *ec,
shell->transform_listener.notify = transform_handler;
wl_signal_add(&ec->transform_signal, &shell->transform_listener);
- ec->shell_interface.shell = shell;
- ec->shell_interface.get_output_work_area = get_output_work_area;
-
weston_layer_init(&shell->fullscreen_layer, &ec->cursor_layer.link);
weston_layer_init(&shell->panel_layer, &shell->fullscreen_layer.link);
weston_layer_init(&shell->background_layer, &shell->panel_layer.link);
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 301bdca5..16db03b0 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -100,12 +100,6 @@ struct weston_mode {
struct wl_list link;
};
-struct weston_shell_interface {
- void *shell; /* either desktop or tablet */
-
- void (*get_output_work_area)(void *shell, struct weston_output *output, pixman_rectangle32_t *area);
-};
-
struct weston_animation {
void (*frame)(struct weston_animation *animation,
struct weston_output *output, uint32_t msecs);
@@ -758,7 +752,6 @@ struct weston_compositor {
struct wl_display *wl_display;
struct weston_desktop_xwayland *xwayland;
const struct weston_desktop_xwayland_interface *xwayland_interface;
- struct weston_shell_interface shell_interface;
/* surface signals */
struct wl_signal create_surface_signal;