This commit adds a function called extents() to widgets. In the case of
a systray, it takes the systray's screen as its argument to correctly
calculate the width. By default, 1 is assumed. For all other widgets,
the argument can be ommitted.
The function doesn't return the geometry as drawn, instead it returns
the geometry the widget _wants_ to be drawn at, for example an imagebox
always has (image width, image height) as the return values even if it's
drawn with a smaller width and height on a smaller wibox.
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
In each widget's *_geometry function, two warnings were generated, e.g.:
warning: ‘geometry.y’ is used uninitialized in this function
warning: ‘geometry.x’ is used uninitialized in this function
Found by gogonkt with GCC 4.2.4 on gentoo.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Pretty much every single source file needs this struct, so it makes sense to
define it in a common header instead of in every single .c file.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>