[PATCH weston 2/3] desktop-shell: use output position in get_output_panel_size()
Derek Foreman
derekf at osg.samsung.com
Wed Apr 15 10:23:55 PDT 2015
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 at osg.samsung.com>
---
desktop-shell/shell.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 204068c..bb3fd2d 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -406,13 +406,12 @@ get_output_panel_size(struct desktop_shell *shell,
switch (shell->panel_position) {
case DESKTOP_SHELL_PANEL_POSITION_TOP:
case DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
-
weston_view_to_global_float(view,
view->surface->width, 0,
&x, &y);
- *width = (int) x;
- *height = view->surface->height + (int) y;
+ *width = (int)x - output->x;
+ *height = view->surface->height + (int) y - output->y;
return;
case DESKTOP_SHELL_PANEL_POSITION_LEFT:
@@ -421,8 +420,8 @@ get_output_panel_size(struct desktop_shell *shell,
0, view->surface->height,
&x, &y);
- *width = view->surface->width + (int) x;
- *height = (int) y;
+ *width = view->surface->width + (int)x - output->x;
+ *height = (int)y - output->y;
return;
default:
--
2.1.4
More information about the wayland-devel
mailing list