backends/native: Refactor g_object_set() call

Makes sense to update ::layout inside meta_renderer_native_set_legacy_view_size().

https://bugzilla.gnome.org/show_bug.cgi?id=745079
This commit is contained in:
Carlos Garnacho 2016-07-31 23:51:43 +02:00
parent 4b4eb3a039
commit 7baa1d8a8d
2 changed files with 9 additions and 10 deletions

View File

@ -868,6 +868,7 @@ meta_renderer_native_set_legacy_view_size (MetaRendererNative *renderer_native,
CoglDisplayEGL *egl_display = cogl_display->winsys;
struct gbm_surface *new_surface;
EGLSurface new_egl_surface;
cairo_rectangle_int_t view_layout;
/*
* Ensure we don't have any pending flips that will want
@ -914,6 +915,14 @@ meta_renderer_native_set_legacy_view_size (MetaRendererNative *renderer_native,
egl_onscreen->egl_surface,
egl_display->egl_context);
view_layout = (cairo_rectangle_int_t) {
.width = width,
.height = height
};
g_object_set (G_OBJECT (view),
"layout", &view_layout,
NULL);
_cogl_framebuffer_winsys_update_size (framebuffer, width, height);
}

View File

@ -270,7 +270,6 @@ maybe_resize_legacy_view (MetaStageNative *stage_native)
int width = stage_native->pending_width;
int height = stage_native->pending_height;
GError *error = NULL;
cairo_rectangle_int_t view_layout;
if (!stage_native->pending_resize)
return;
@ -288,16 +287,7 @@ maybe_resize_legacy_view (MetaStageNative *stage_native)
meta_warning ("Applying display configuration failed: %s\n",
error->message);
g_error_free (error);
return;
}
view_layout = (cairo_rectangle_int_t) {
.width = width,
.height = height
};
g_object_set (G_OBJECT (legacy_view),
"layout", &view_layout,
NULL);
}
static void