diff --git a/ChangeLog b/ChangeLog index ef38bdbdf..4dc7b4df4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-06-08 Havoc Pennington + + * 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. + 2002-06-07 Havoc Pennington * src/screen.c (meta_screen_new): use XineramaIsActive() not diff --git a/src/window.c b/src/window.c index d0b84f990..ca26a2598 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