-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Uli Schlachter wrote:
> Hi list,
> 
> Evil_Bob complained about some wibox flickering in #awesome and I had to do
> something about this. ;)
> 
> Wiboxes didn't have a bit gravity and where set to inherit their parent's 
> pixmap
> as background. This means that the X server filled the wibox with the 
> wallpaper
> after each resize step which was noticable as e.g. titlebar flicker.
> 
> By setting the proper background as BackPixel and a NorthWest bit gravity, 
> this
> flicker goes away.
> 
> Attached are the two patches and my test case (just for the lulz, but it did 
> work!)

Just after this I found another problem:

Between a new wibox being made visible and actually painting it, we could
already be receiving expose events on it. I noticed this with awful.menu, which
creates a lot of wiboxes. Some of them were filled with random blue-ish stuff
for a split second. The commit message got more details.

Uli
- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBCAAGBQJK9c59AAoJECLkKOvLj8sGwb8H/1nrtteo9LXqSD5UjQgxakbB
1oOTOfnBY5uPkZ5LCS9TrneaApU3YZUt3t0TrSbdYLfCZ+Wj5uTFwC6ipw8aKTBy
+hVn54wsklSUrHZH1UyVmWieyKfdVtE9R39qrj51UcrivV/RUqTaYpLqw15GXN0G
DtzX/3M0Yq/BQfGMqYJs0kqgL90/y1knLTtV1ZodQEkDZh0c65KXHnBHG5E5XHJG
TO0YVTz8fGsM3XWU1IrYm4CQOGA96CeRmxhIqHGQutku9wDb8Q/kGJUpWFSq5vSs
dyUi2nAMmtuKvX0kNjh0UlUY2VjoJpfOdA6pov0KRVye5sqHVxxpr7ucjMai05c=
=IWUa
-----END PGP SIGNATURE-----
>From 1aa6fc27c1230bc221e966d79306b23fa4734ffb Mon Sep 17 00:00:00 2001
From: Uli Schlachter <[email protected]>
Date: Sat, 7 Nov 2009 20:36:56 +0100
Subject: [PATCH] Make sure no garbage is painted to the screen

Wiboxes are lazily updated. This means that we could receive an expose event on
them between making them visible and actually painting their content.

Due to this we were copying undefined content to the wibox, because the pixmap
was only created just now, but it wasn't actually filled with anything yet.

Signed-off-by: Uli Schlachter <[email protected]>
---
 event.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/event.c b/event.c
index ecc57ff..a97d789 100644
--- a/event.c
+++ b/event.c
@@ -528,7 +528,10 @@ event_handle_expose(void *data __attribute__ ((unused)),
 {
     wibox_t *wibox;
 
-    if((wibox = wibox_getbywin(ev->window)))
+    /* If the wibox got need_update set, skip this because it will be repainted
+     * soon anyway. Without this we could be painting garbage to the screen!
+     */
+    if((wibox = wibox_getbywin(ev->window)) && !wibox->need_update)
         wibox_refresh_pixmap_partial(wibox,
                                      ev->x, ev->y,
                                      ev->width, ev->height);
-- 
1.6.5

Reply via email to