[gnome-calendar] view: fix gdk relayout warning
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] view: fix gdk relayout warning
- Date: Thu, 8 Jan 2015 18:10:12 +0000 (UTC)
commit 5a3e9577f2af824d3b474d4f7aa1269fe286f25a
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Jan 8 13:04:49 2015 -0500
view: fix gdk relayout warning
src/gcal-month-view.c | 9 +++++++++
src/gcal-year-view.c | 9 +++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 03ebbbf..114d619 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -785,6 +785,13 @@ gcal_month_view_size_allocate (GtkWidget *widget,
priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (widget));
ppriv = GCAL_SUBSCRIBER_VIEW (widget)->priv;
+ if (!ppriv->children_changed &&
+ allocation->height == gtk_widget_get_allocated_height (widget) &&
+ allocation->width == gtk_widget_get_allocated_width (widget))
+ {
+ return;
+ }
+
/* remove every widget' parts, but the master widget */
widgets = g_hash_table_get_values (ppriv->children);
for (aux = widgets; aux != NULL; aux = g_list_next (aux))
@@ -997,6 +1004,8 @@ gcal_month_view_size_allocate (GtkWidget *widget,
/* FIXME: remove on Gtk+ 3.15.4 release */
if (g_hash_table_size (ppriv->overflow_cells) != 0)
gtk_widget_queue_draw_area (widget, allocation->x, allocation->y, allocation->width, allocation->height);
+
+ ppriv->children_changed = FALSE;
}
static gboolean
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 749ec28..554407c 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -428,6 +428,13 @@ gcal_year_view_size_allocate (GtkWidget *widget,
priv = gcal_year_view_get_instance_private (GCAL_YEAR_VIEW (widget));
ppriv = GCAL_SUBSCRIBER_VIEW (widget)->priv;
+ if (!ppriv->children_changed &&
+ allocation->height == gtk_widget_get_allocated_height (widget) &&
+ allocation->width == gtk_widget_get_allocated_width (widget))
+ {
+ return;
+ }
+
/* remove every widget' parts, but the master widget */
widgets = g_hash_table_get_values (ppriv->children);
for (aux = widgets; aux != NULL; aux = g_list_next (aux))
@@ -625,6 +632,8 @@ gcal_year_view_size_allocate (GtkWidget *widget,
/* FIXME: remove on Gtk+ 3.15.4 release */
if (g_hash_table_size (ppriv->overflow_cells) != 0)
gtk_widget_queue_draw_area (widget, allocation->x, allocation->y, allocation->width, allocation->height);
+
+ ppriv->children_changed = FALSE;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]