shell: Set geometry directly in configure
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 17 Feb 2012 04:43:59 +0000 (23:43 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 17 Feb 2012 04:43:59 +0000 (23:43 -0500)
We already set half of it directly, and overwrite it in other cases, so
just skip weston_surface_configure().

src/shell.c

index ce46eb1..e4d4768 100644 (file)
@@ -1470,7 +1470,6 @@ configure(struct weston_shell *base, struct weston_surface *surface,
          GLfloat x, GLfloat y, int32_t width, int32_t height)
 {
        struct wl_shell *shell = container_of(base, struct wl_shell, shell);
-       int do_configure = !shell->locked;
        enum shell_surface_type surface_type = SHELL_SURFACE_NONE;
        struct shell_surface *shsurf;
 
@@ -1478,31 +1477,29 @@ configure(struct weston_shell *base, struct weston_surface *surface,
        if (shsurf)
                surface_type = shsurf->type;
 
+       surface->geometry.x = x;
+       surface->geometry.y = y;
        surface->geometry.width = width;
        surface->geometry.height = height;
        surface->geometry.dirty = 1;
 
        switch (surface_type) {
        case SHELL_SURFACE_SCREENSAVER:
-               do_configure = !do_configure;
-               /* fall through */
        case SHELL_SURFACE_FULLSCREEN:
                center_on_output(surface, surface->fullscreen_output);
-               x = surface->geometry.x;
-               y = surface->geometry.y;
                break;
        case SHELL_SURFACE_MAXIMIZED:
                /*setting x, y and using configure to change that geometry*/
-               x = surface->output->x;
-               y = surface->output->y + get_output_panel_height(shell,surface->output);
+               surface->geometry.x = surface->output->x;
+               surface->geometry.y = surface->output->y +
+                       get_output_panel_height(shell,surface->output);
                break;
        default:
                break;
        }
 
        /*  XXX: would a fullscreen surface need the same handling? */
-       if (do_configure) {
-               weston_surface_configure(surface, x, y, width, height);
+       if (surface->output) {
                weston_surface_assign_output(surface);
 
                if (surface_type == SHELL_SURFACE_SCREENSAVER)