only update the screen areas when a window actually has a strut (or when the strut changes), don't waste extra calls to screen areas, because it makes people redraw when they don't need to

This commit is contained in:
Dana Jansens 2007-03-02 15:19:39 +00:00
parent 80a6f06c0a
commit 140c5313cf
2 changed files with 11 additions and 4 deletions

View file

@ -476,7 +476,8 @@ void client_manage(Window window)
g_hash_table_insert(window_map, &self->window, self); g_hash_table_insert(window_map, &self->window, self);
/* this has to happen after we're in the client_list */ /* this has to happen after we're in the client_list */
screen_update_areas(); if (STRUT_EXISTS(self->strut))
screen_update_areas();
/* update the list hints */ /* update the list hints */
client_set_list(); client_set_list();
@ -523,7 +524,8 @@ void client_unmanage(ObClient *self)
/* once the client is out of the list, update the struts to remove it's /* once the client is out of the list, update the struts to remove it's
influence */ influence */
screen_update_areas(); if (STRUT_EXISTS(self->strut))
screen_update_areas();
for (it = client_destructors; it; it = g_slist_next(it)) { for (it = client_destructors; it; it = g_slist_next(it)) {
Destructor *d = it->data; Destructor *d = it->data;
@ -2354,7 +2356,8 @@ static void client_iconify_recursive(ObClient *self,
if (changed) { if (changed) {
client_change_state(self); client_change_state(self);
client_showhide(self); client_showhide(self);
screen_update_areas(); if (STRUT_EXISTS(self->strut))
screen_update_areas();
} }
/* iconify all transients */ /* iconify all transients */
@ -2540,7 +2543,8 @@ void client_set_desktop_recursive(ObClient *self,
/* raise if it was not already on the desktop */ /* raise if it was not already on the desktop */
if (old != DESKTOP_ALL) if (old != DESKTOP_ALL)
client_raise(self); client_raise(self);
screen_update_areas(); if (STRUT_EXISTS(self->strut))
screen_update_areas();
/* add to the new desktop(s) */ /* add to the new desktop(s) */
if (config_focus_new) if (config_focus_new)

View file

@ -113,6 +113,9 @@ typedef struct _StrutPartial {
(s1).top = MAX((s1).top, (s2).top), \ (s1).top = MAX((s1).top, (s2).top), \
(s1).bottom = MAX((s1).bottom, (s2).bottom) (s1).bottom = MAX((s1).bottom, (s2).bottom)
#define STRUT_EXISTS(s1) \
((s1).left || (s1).top || (s1).right || (s1).bottom)
#define STRUT_EQUAL(s1, s2) \ #define STRUT_EQUAL(s1, s2) \
((s1).left == (s2).left && \ ((s1).left == (s2).left && \
(s1).top == (s2).top && \ (s1).top == (s2).top && \