[gtk+/wip/ebassi/gsk: 6/11] drawingarea: Resize the GSK layer on allocation changes
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk: 6/11] drawingarea: Resize the GSK layer on allocation changes
- Date: Sun, 9 Aug 2015 15:51:05 +0000 (UTC)
commit e993f4a2ce33602cbaf6f03bce25075342e8d92c
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Mar 16 18:49:17 2015 +0000
drawingarea: Resize the GSK layer on allocation changes
Sadly, GtkDrawingArea still overrides GtkWidget::size-allocate, which
means that we need to explicitly resize the GskLayer root, like we
resize the GdkWindow.
gtk/gtkdrawingarea.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index a9b659e..81f4db3 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -205,6 +205,16 @@ gtk_drawing_area_size_allocate (GtkWidget *widget,
allocation->x, allocation->y,
allocation->width, allocation->height);
+ if (gtk_widget_get_has_layer (widget))
+ {
+ graphene_rect_t bounds;
+
+ graphene_rect_init (&bounds,
+ 0, 0,
+ allocation->width, allocation->height);
+ gsk_layer_set_bounds (gtk_widget_get_layer (widget), &bounds);
+ }
+
gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]