desktop-shell: use output position in get_output_panel_size()

The panel size calculation needs to take the output position into account
or it's only correct when the output is at 0, 0.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
dev
Derek Foreman 10 years ago committed by Bryce Harrington
parent f814c5dc9d
commit 612341f1a6
  1. 9
      desktop-shell/shell.c

@ -424,13 +424,12 @@ get_output_panel_size(struct desktop_shell *shell,
switch (shell->panel_position) { switch (shell->panel_position) {
case DESKTOP_SHELL_PANEL_POSITION_TOP: case DESKTOP_SHELL_PANEL_POSITION_TOP:
case DESKTOP_SHELL_PANEL_POSITION_BOTTOM: case DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
weston_view_to_global_float(view, weston_view_to_global_float(view,
view->surface->width, 0, view->surface->width, 0,
&x, &y); &x, &y);
*width = (int) x; *width = (int)x - output->x;
*height = view->surface->height + (int) y; *height = view->surface->height + (int) y - output->y;
return; return;
case DESKTOP_SHELL_PANEL_POSITION_LEFT: case DESKTOP_SHELL_PANEL_POSITION_LEFT:
@ -439,8 +438,8 @@ get_output_panel_size(struct desktop_shell *shell,
0, view->surface->height, 0, view->surface->height,
&x, &y); &x, &y);
*width = view->surface->width + (int) x; *width = view->surface->width + (int)x - output->x;
*height = (int) y; *height = (int)y - output->y;
return; return;
default: default:

Loading…
Cancel
Save