-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Julien Danjou wrote:
> At 1259271987 time_t, Uli Schlachter wrote:
>> One thing though: Any idea what to do if wibox->parent->need_update is set?
>> (AKA
>> the pixmap being outdated)
>
> In that case property::pixmap is emitted by the 'parent'. Then we look
> in all wiboxes if they have the wibox that emitted that signal as
> parent and an transparent bg: if yes, we tag them as needing update.
In that case we'd have to call wibox_refresh() again, don't we? (Or loop over
all wiboxes in wibox_refresh() until none got need_update set)
B got A as parent, both got need_update set:
- - A is updated
- - B is updated which causes A's need_update to be set, but we won't be looking
at A's need_update flag until after the next main loop?
> This is not optimal (but still fast). The good solution is make wiboxes
> listen their parent property::pixmap signal, and update on signal
> receiption, but that was more complicated for a little gain, so I
> dropped that for now. :)
>
>> Or are you working your way downwards from the top-level wiboxes?...
>
> Nah, I still have a global array with all wiboxes ordered by X window
> id. It's useful for finding a wibox when you receive a X event for it.
Does a wibox only know about its parents or is there also a list of childs? If
yes we could do the repainting recursively:
- - wibox_refresh() calls some "refresh" function on top-level wiboxes and just
skips the rest.
- - This "refresh" function calls "refresh" for all children. If one of them was
repainted or need_refresh is set, this wibox is repainted.
- - If this wibox was repainted we return true, else false.
I'm not saying you must do it like this, but it would avoid the bug that I
outlined above (can that bug happen at all?) without repainting wiboxes more
than once per main loop.
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)
iQEcBAEBCAAGBQJLD9IdAAoJECLkKOvLj8sGl90H/3KPtT4wuqJHFr4Z06BhTpu8
y8kHBRV9m6cLP00PzTuw3EiCh04IT/8UR+v9QHVsSri7QcwifsODh6A1aTQLce4M
t1FMQjXKvdMmh9J3ak2xM3buK34WPaYyZHEclLcFVxqJ5kqsLWGphRMYx+Qas33J
FjYPxgst5cun7bRnb2XU29M8Yc8LDzgFsmZ7wFKStKgRLRREHwYXuj5iPcWMHSI7
Y4E850j96AoiLFW8Zcr/J2qoGUaW6ol7lKZ4VvXoNGuI/TcVUZrqxCt8xQOF0yVZ
zQ1udEYg0Wk2AES7081hs01hgsc/E2b2x5ibFV+nIx/uAudM/w/4MG/Q0I/MWRs=
=3xUU
-----END PGP SIGNATURE-----
--
To unsubscribe, send mail to [email protected].