[gtk+] inspector: Redraw when visual debugging tools are toggled
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Redraw when visual debugging tools are toggled
- Date: Thu, 15 May 2014 23:36:30 +0000 (UTC)
commit d52a01631e5065c76d411c29e7bfb30639c34670
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 15 16:11:14 2014 -0400
inspector: Redraw when visual debugging tools are toggled
This doesn't address the pixel cache yet.
gtk/inspector/visual.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c
index 7bdaa40..e16cb9a 100644
--- a/gtk/inspector/visual.c
+++ b/gtk/inspector/visual.c
@@ -83,10 +83,20 @@ init_direction (GtkInspectorVisual *vis)
gtk_combo_box_set_active_id (GTK_COMBO_BOX (vis->priv->direction_combo), direction);
}
+static void
+redraw_everything (void)
+{
+ GList *toplevels;
+ toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc) gtk_widget_queue_draw, NULL);
+ g_list_free (toplevels);
+}
+
void
updates_activate (GtkSwitch *sw)
{
gdk_window_set_debug_updates (gtk_switch_get_active (sw));
+ redraw_everything ();
}
static void
@@ -102,6 +112,7 @@ baselines_activate (GtkSwitch *sw)
flags &= ~GTK_DEBUG_BASELINES;
gtk_set_debug_flags (flags);
+ redraw_everything ();
}
static void
@@ -117,6 +128,12 @@ pixelcache_activate (GtkSwitch *sw)
flags &= ~GTK_DEBUG_PIXEL_CACHE;
gtk_set_debug_flags (flags);
+ /* FIXME: this doesn't work, because it is redrawing
+ * _from_ the cache. We need to recurse over the tree
+ * and invalidate the pixel cache of every widget that
+ * has one.
+ */
+ redraw_everything ();
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]