mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
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.
This commit is contained in:
parent
5fba648e85
commit
9e8800561e
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
||||
2002-06-07 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/screen.c (meta_screen_new): use XineramaIsActive() not
|
||||
|
36
src/window.c
36
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
|
||||
|
Loading…
Reference in New Issue
Block a user