shell: Use desired output when sending configure events when maximised

With shell_surface.set_maximised the caller can provide an output to maximise
to or the default output will be used. With the corresponding configure we
should use the dimensions from the chosen output not the output the surface
was currently on.

Similarly when calculating the position for the window in the map() function
we should use the desired output again.

There is no need to assign shsurf->output to es->output since that happens in
the map() function later.
This commit is contained in:
Rob Bradford 2012-07-02 19:00:19 +01:00 committed by Kristian Høgsberg
parent 8f24156926
commit 31b6862eeb
1 changed files with 5 additions and 5 deletions

View File

@ -1358,12 +1358,12 @@ shell_surface_set_maximized(struct wl_client *client,
shsurf->output = get_default_output(es->compositor); shsurf->output = get_default_output(es->compositor);
shell = shell_surface_get_shell(shsurf); shell = shell_surface_get_shell(shsurf);
panel_height = get_output_panel_height(shell, es->output); panel_height = get_output_panel_height(shell, shsurf->output);
edges = WL_SHELL_SURFACE_RESIZE_TOP|WL_SHELL_SURFACE_RESIZE_LEFT; edges = WL_SHELL_SURFACE_RESIZE_TOP|WL_SHELL_SURFACE_RESIZE_LEFT;
shsurf->client->send_configure(shsurf->surface, edges, shsurf->client->send_configure(shsurf->surface, edges,
es->output->current->width, shsurf->output->current->width,
es->output->current->height - panel_height); shsurf->output->current->height - panel_height);
shsurf->next_type = SHELL_SURFACE_MAXIMIZED; shsurf->next_type = SHELL_SURFACE_MAXIMIZED;
} }
@ -2548,8 +2548,8 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
case SHELL_SURFACE_MAXIMIZED: case SHELL_SURFACE_MAXIMIZED:
/* use surface configure to set the geometry */ /* use surface configure to set the geometry */
panel_height = get_output_panel_height(shell,surface->output); panel_height = get_output_panel_height(shell,surface->output);
weston_surface_set_position(surface, surface->output->x, weston_surface_set_position(surface, shsurf->output->x,
surface->output->y + panel_height); shsurf->output->y + panel_height);
break; break;
case SHELL_SURFACE_POPUP: case SHELL_SURFACE_POPUP:
shell_map_popup(shsurf); shell_map_popup(shsurf);