From: Dana Jansens Date: Wed, 13 Jun 2007 12:37:52 +0000 (+0000) Subject: no un-needed rendering X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=44bc0dab886c924b6aac1d3f1eaf4cc0164950c9;p=chaz%2Fopenbox no un-needed rendering --- diff --git a/openbox/frame.c b/openbox/frame.c index 7d7ac901..aab30f1f 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -248,6 +248,7 @@ void frame_show(ObFrame *self) { if (!self->visible) { self->visible = TRUE; + framerender_frame(self); XMapWindow(ob_display, self->client->window); XMapWindow(ob_display, self->window); } @@ -773,6 +774,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->size.left, self->size.top); if (resized) { + self->need_render = TRUE; framerender_frame(self); frame_adjust_shape(self); } @@ -871,23 +873,27 @@ void frame_adjust_client_area(ObFrame *self) void frame_adjust_state(ObFrame *self) { + self->need_render = TRUE; framerender_frame(self); } void frame_adjust_focus(ObFrame *self, gboolean hilite) { self->focused = hilite; + self->need_render = TRUE; framerender_frame(self); XFlush(ob_display); } void frame_adjust_title(ObFrame *self) { + self->need_render = TRUE; framerender_frame(self); } void frame_adjust_icon(ObFrame *self) { + self->need_render = TRUE; framerender_frame(self); } diff --git a/openbox/frame.h b/openbox/frame.h index 2f7d1e74..cf840bdf 100644 --- a/openbox/frame.h +++ b/openbox/frame.h @@ -185,6 +185,7 @@ struct _ObFrame gboolean iconify_hover; gboolean focused; + gboolean need_render; gboolean flashing; gboolean flash_on; diff --git a/openbox/framerender.c b/openbox/framerender.c index a02567bd..fe789d96 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -36,6 +36,11 @@ void framerender_frame(ObFrame *self) { if (frame_iconify_animating(self)) return; /* delay redrawing until the animation is done */ + if (!self->need_render) + return; + if (!self->visible) + return; + self->need_render = FALSE; { gulong px;