There's no pkg-config file shipped with i3, so our only option is to
manually look for the file (and assume it can be found in the "normal"
include paths).
De-registering events from the previous active window may fail (when
the previous window has been destroyed).
Catch this early, and only log a debug message. This avoids having a
normal occurrence polluting the output with error messages.
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.
By default, generates an error message with the major/minor opcodes,
the error code and sequence number.
If available, it will use xcb-errors to generate an even better
description.
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.
Module plugins are (still) built in <build-dir>/modules.
When installing, f00bar binary is installed to <install-dir>/bin, and
the module plugins to <install-dir>/lib/f00bar.
For this to work, we now also set RPATH correctly. Since the installed
module plugins end up in a different location then when building,
different settings is required for BUILD_RPATH and INSTALL_RPATH.
TODO: optimizations and proper cleanup
* We currently reload the shared library for each *instance* of the
module, and we do it twice; once when verifying, and once when
instantiating.
* The shared libraries are never dlclosed()