summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-06-08 05:13:55 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-06-08 05:13:55 +0000
commit9e8800561e0f8c00a342a8f77289030c0590e1fb (patch)
tree6072464327bddd97aec0d6f9a2fbbb0f661aa43b /src/window.c
parent5fba648e8584e0f49dccabecf3c83bdad092bcfa (diff)
downloadmetacity-9e8800561e0f8c00a342a8f77289030c0590e1fb.tar.gz
metacity-9e8800561e0f8c00a342a8f77289030c0590e1fb.tar.bz2
only invalidate things if the struts actually change, since the panel
2002-06-08 Havoc Pennington <hp@pobox.com> * src/window.c (update_struts): only invalidate things if the struts actually change, since the panel likes to set them over and over. May fix the infinite loop that caused 100% CPU usage.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index d0b84f9..ca26a25 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4653,9 +4653,22 @@ update_struts (MetaWindow *window)
{
gulong *struts = NULL;
int nitems;
-
+ gboolean old_has_struts;
+ gboolean old_do_not_cover;
+ int old_left;
+ int old_right;
+ int old_top;
+ int old_bottom;
+
meta_verbose ("Updating struts for %s\n", window->desc);
+ old_has_struts = window->has_struts;
+ old_do_not_cover = window->do_not_cover;
+ old_left = window->left_strut;
+ old_right = window->right_strut;
+ old_top = window->top_strut;
+ old_bottom = window->bottom_strut;
+
window->has_struts = FALSE;
window->do_not_cover = FALSE;
window->left_strut = 0;
@@ -4727,10 +4740,23 @@ update_struts (MetaWindow *window)
}
}
- meta_topic (META_DEBUG_WORKAREA,
- "Invalidating work areas of window %s due to struts update\n",
- window->desc);
- invalidate_work_areas (window);
+ if (old_has_struts != window->has_struts ||
+ old_do_not_cover != window->do_not_cover ||
+ old_left != window->left_strut ||
+ old_right != window->right_strut ||
+ old_top != window->top_strut ||
+ old_bottom != window->bottom_strut)
+ {
+ meta_topic (META_DEBUG_WORKAREA,
+ "Invalidating work areas of window %s due to struts update\n",
+ window->desc);
+ invalidate_work_areas (window);
+ }
+ else
+ {
+ meta_topic (META_DEBUG_WORKAREA,
+ "Struts on %s were unchanged\n", window->desc);
+ }
}
static void