From 2de43d080f410213f255d8eb9e2a34a45d6e639d Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 27 Jun 2010 13:27:14 +0200 Subject: [PATCH] Redraw the screen when a ObWindow is destroyed, but not on every related event We won't get an event we recognize is a window if we destroy the window (such as a MenuFrame going away), as the event will no longer be tracable to that window. Also don't redraw on every map/unmap/configurenotify we see, just ones for the top-level windows. --- openbox/event.c | 6 +++--- openbox/window.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index b9ed709c..2dcdb6ca 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1819,15 +1819,15 @@ static void event_handle_window(ObWindow *wi, XEvent *e) break; case MapNotify: - composite_dirty(); if (e->xmap.window == window_redir(wi)) { + composite_dirty(); wi->mapped = TRUE; pixchange = TRUE; } break; case UnmapNotify: - composite_dirty(); if (e->xunmap.window == window_top(wi)) { + composite_dirty(); wi->mapped = FALSE; } break; @@ -1838,8 +1838,8 @@ static void event_handle_window(ObWindow *wi, XEvent *e) e->type == obt_display_extension_shape_basep + ShapeNotify) { XShapeEvent *s = (XShapeEvent*)e; - composite_dirty(); if (s->window == window_redir(wi) && s->kind == ShapeBounding) { + composite_dirty(); window_adjust_redir_shape(wi); } } diff --git a/openbox/window.c b/openbox/window.c index b9f58310..6a0d1632 100644 --- a/openbox/window.c +++ b/openbox/window.c @@ -117,8 +117,11 @@ void window_set_top_area(ObWindow *self, const Rect *r, gint border) void window_cleanup(ObWindow *self) { - if (window_redir(self)) + if (window_redir(self)) { composite_window_cleanup(self); + /* when the window goes away, we will need to redraw */ + composite_dirty(); + } } void window_free(ObWindow *self) -- 2.34.1