diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-06-23 18:55:20 +0200 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2016-11-21 18:17:49 +0000 |
commit | e8bf959764a761ead74bc5376cc54d21a116f32b (patch) | |
tree | 1678bc4e7c6cc390334903f47df402960f75f38a | |
parent | 581df06ad13961568ecc99dd2e4142b33a4de089 (diff) |
desktop-shell: Properly position the panel surface
Now weston actually supports putting the panel at the bottom of the
screen.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r-- | desktop-shell/shell.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 92b4bee5..3913f95f 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2804,7 +2804,7 @@ static void shell_fade(struct desktop_shell *shell, enum fade_type type); static void -configure_static_view(struct weston_view *ev, struct weston_layer *layer) +configure_static_view(struct weston_view *ev, struct weston_layer *layer, int x, int y) { struct weston_view *v, *next; @@ -2816,7 +2816,7 @@ configure_static_view(struct weston_view *ev, struct weston_layer *layer) } } - weston_view_set_position(ev, ev->output->x, ev->output->y); + weston_view_set_position(ev, ev->output->x + x, ev->output->y + y); ev->surface->is_mapped = true; ev->is_mapped = true; @@ -2856,7 +2856,7 @@ background_committed(struct weston_surface *es, int32_t sx, int32_t sy) view = container_of(es->views.next, struct weston_view, surface_link); - configure_static_view(view, &shell->background_layer); + configure_static_view(view, &shell->background_layer, 0, 0); } static void @@ -2921,10 +2921,26 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy) { struct desktop_shell *shell = es->committed_private; struct weston_view *view; + int width, height; + int x = 0, y = 0; view = container_of(es->views.next, struct weston_view, surface_link); - configure_static_view(view, &shell->panel_layer); + get_panel_size(shell, view, &width, &height); + switch (shell->panel_position) { + case WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP: + break; + case WESTON_DESKTOP_SHELL_PANEL_POSITION_BOTTOM: + y = view->output->height - height; + break; + case WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT: + break; + case WESTON_DESKTOP_SHELL_PANEL_POSITION_RIGHT: + x = view->output->width - width; + break; + } + + configure_static_view(view, &shell->panel_layer, x, y); } static void |