Before commit 1b2826 in lgi, the get_rgba() function on cairo SolidPatterns was
specified like this:
get_rgba = { ret = cairo.Status,
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' } },
The above commit fixed this (without saying so) and the code became:
get_rgba = { ret = cairo.Status,
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' } },
The prototype for the corresponding cairo function is:
cairo_public cairo_status_t
cairo_pattern_get_rgba (cairo_pattern_t *pattern,
double *red, double *green,
double *blue, double *alpha);
As you see, this functions gets four double* as arguments and it will save its
result via those pointers. Old versions of lgi call this function with too few
arguments and this will cause a segmentation fault when cairo dereferences an
invalid pointer.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If a drawable has an opaque background, we don't need pseudo transparency and
thus its content don't change when it is moved. However, when we need pseudo
transparency, then we have to redraw the drawable to apply the new background.
Previously we just always did the redraw. This commit adds a helper function
gears.color.create_opaque_pattern() that analyzes a cairo pattern for
transparency. We use this new function to only redraw-on-move when there is
actual pseudo transparency in effect. Otherwise, this redraw can be skipped.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When no wallpaper exists yet, instead of creating a black image surface which
covers all the screens, just create a surface for the screen which we need. This
means that way less pixels have to be uploaded to the X11 server, which should
be faster.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows to use cairo patterns directly for any kind of "color". This makes
it easier to use things which aren't possible through gears.color.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If user changes locale with os.setlocale to a "dirty"
locale (which use comma as decimal separator (not dot), e.g.
hu_HU) `tonumber` will produce "0,6" instead of "0.6"
which causes bad comparision.
Signed-off-by: uzsolt <udvzsolt@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
It helps a lot to know which signal does not exist. That should make it a lot
easier to look for the "guily" code without having to resort to the backtrace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
dump_return is no longer local, so debug prefix must be provided
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
Currently it takes `require('lgi.version')`, converts it blindly to
number and compares with another value.
I am using lgi v0.6.1 and that is not convertable to number value,
thus tonumber() returns nil and crashes Awesome.
The fix is to take major and minor numbers only ignoring the rest.
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The cairo bindings are quite new in lgi and thus we depend on a quite new
version of lgi. Older versions will fail with lots of weird errors, e.g.:
lib/gears/color.lua:61:attempt to call field 'create_rgba' (a nil value)
Signed-off-by: Uli Schlachter <psychon@znc.in>
dump_raw function wasn't printing the plain (non-table) value if the
tag was not specified.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The corresponding pattern factory that `string_pattern` delegates to is stored
in the `creator` parameter, and not `v`; probably a typo.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Replaced all references to image_surface_create_from_png to
awesome.load_image
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Luadoc confuses '<stop>' with an HTML tag otherwise.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
In general, patterns are specified as 'type:arguments', where 'arguments' is
specific to the pattern used. The example provided in the documentation,
defined the pattern type to be 'linear', but used arguments meant to create
radial pattern. So we modify the example to use the correct type -- 'radial'.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The documentation for these functions were hidden (intentionally?) from luadoc
because of misspelt @class and @name tags. Fixed the spelling, so luadoc can do
its job.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
So far this only contains an "assert()" function, but I guess this could be
enhance. For example, a function which pretty-prints a table's contents might be
useful to have.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This implements objects in lua. Objects provide the signal functions that are
known from the C API ({dis,}connect_signal(), emit_signal(), add_signal()).
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a lua module for parsing colors. Named colors like "black" aren't
supported, but #rrggbb and #rrggbbaa colors do work.
Signed-off-by: Uli Schlachter <psychon@znc.in>