IPC reply and event handlers no longer call bar->refresh()
directly. Instead, they set a 'dirty' bit. Then, in burst_done(), we
call bar->refresh() when the dirty bit has been set.
Previously, the 'content' of i3 was a map, where the keys where i3
workspace names, mapping to a particle template.
Now, that configuration type is still allowed. But we also allow a
variant where the 'content' is a list, of either 1 or 2 entries.
Both entries *must* be dictionaries. The key is either 'dynlist',
which is the same as the dictionary-only type of
configuration. I.e. it maps to a dictionary where the keys are
workspace names, mapping to particle templates.
If the key is *not* dynlist, then it is assumed to be a particle name,
and we treat that as a "regular" label, that will be appended after
the workspace dynlist when instantiating the content.
This particle will be instantiated with, for now, the title and
application of the _currently focused_ workspace.
This is done on a per-workspace basis.
Note that the initial state is currently not detected. I.e. we
retrieve the initial workspace list, but we don't get the currently
focused window.
In cases where it makes sense, use calloc() instead of malloc():
* When allocating large objects with many members, many for which
NULL/0 is a good default value.
* Arrays etc where we explicitly initialize to NULL anyway.
This fixes an issue where switching between empty workspaces (or one
empty, one non-empty) momentarily flashed two workspaces.
I.e. we immediately rendered the new workspace, and then re-rendered
when the first workspace was destroyed.
Instead, we need to check if xcb_connection_has_error() says something
went wrong. We also need to call xcb_disconnect() on the disfunctional
XCB connection object.
Since this struct only contained function pointers, make all modules
export those functions directly.
The plugin manager now defines a module interface struct, and fills it
it by dlsym:ing the functions that used to be in module_info.
All modules are expected to handle a call to content() after having
been instantiated.
I.e. modules *cannot* even expect run() to have started running.
Previously we allowed it on the bar, and on all particles. Now we also
allow it on all modules.
This allows us to specify a "default" font/foreground on a per-module
basis, having it applied to all the modules particles.
If the user hasn't specified a specific template for a workspace, try
to lookup a default one (the empty string).
This allows the user to configure a "fallback" template to be used for
"extra", or not-often-used workspaces.
Gcc (correctly) figured out that we may end up truncating the socket
path. In practice, it's something that should never happen.
Never the less, silence the warning by writing the socket path
directly into the sockaddr_un object.