_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
This patch provides functions to get/set current keyboard layout.
Current implementation doesn't support any configuration of layout,
it's a merely a layout indicator and switcher, however layout
configuration can be set by tools like setxkbmap or by any third-party
tools.
Everything that needs the lua_State should create a local variable like this:
lua_State *L = globalconf_get_lua_State();
This ensures that the compiler warns if there are two variables with name "L" in
scope. The idea here is that it should become harder to accidentally use the
global lua state instead of the state of the current state.
While writing this commit, I found another place that gets its wrong: Reading
client.focus from a coroutine was broken, since it was returning the result on
the main thread instead of the current one.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This means we have one less file which gets recompiled every time the result
from "git describe" changes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Every .c file has to include the corresponding .h file first to make sure the
headers are self-contained. Additionally, this moves some unneeded includes
around.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the screen objects use our existing infrastructure for implementing
classes and objects with lua instead of hand-rolling an own version.
This results in some small API change: Screen objects no longer have an
add_signal() function and instead this function exists on the parent screen
class.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Most of these are unused since the drawing code was moved to lua. For example,
the old wibox code needed the metatable entries __next, __ipairs and __pairs so
that w.widgets worked correctly and could pretend to be a regular lua table.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commits adds awesome.register_xproperty(). This allows lua code to register
arbitrary X11 properties with awesome which will then watch these properties.
Whenever such a property is changed on a client or drawin, we will emit the
xproperty::name signal.
This also adds window:get_xproperty(name) and window:set_xproperty(name, value)
which allows to mess with properties.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We do some special magic so that we can have tracebacks on errors messages.
However, the code for parsing the rc.lua called it without this magic and thus
errors didn't have tracebacks.
This is bad, because if something goes wrong in e.g. wibox.widget.textbox, you
don't really have any clue where this error is coming from.
Fix this by adding our "print traceback on error"-magic here, too.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit ports awesome from libev to the glib main loop. This means that
awesome has fewer dependencies, because we were already depending on glib before
and now no longer need glib.
However, the main reason for this change is that, thanks to lgi, we have glib
bindings for lua. This means that lua code can add all kinds of event sources to
the main loop (timeouts, fd watchers, SIGCHLD watchers, ....). Yay
Signed-off-by: Uli Schlachter <psychon@znc.in>
A drawable is something that you can draw to, just like a drawin. However, a
drawable isn't necessarily its own windows. This will later on be used to
implement titlebars where the titlebars are drawables.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The original struct name is luaL_Reg, but Lua v5.1 had a
`typedef luaL_reg luaL_Reg`, which in v5.2 was removed
and as a result breaking the build in Awesome which uses luaL_reg
version exclusively.
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Now that the C code uses lightuserdata for passing around cairo surfaces, they
are no longer automatically garbage collected. To avoid memleaks, this commit
compares the C code to use cairo_surface_t pointers instead of the lua stack.
This also fixes a memleak were a client's icon was leaked.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This uses imlib2 for loading the image and thus supports more image formats than
just PNG.
Almost fixes: FS#958
Signed-off-by: Uli Schlachter <psychon@znc.in>
If loading of any config file fails, awesome will now remember the error message
and make it available to lua. The default config is modified to open a naughty
popup on errors.
This should help all those people who modify their config and then wonder why
there change is ignored, not noticing awesome's error message on stderr.
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>
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Awesome is built with -Wno-unused-parameter which means there is no point in
explicitly marking arguments as unused.
Signed-off-by: Uli Schlachter <psychon@znc.in>
luaA_loadrc() now returns a failure when executing the config file causes an
error.
Previously it returned a success which meant the next config file wasn't tried.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We use lua_class_t pointer as key in the registry to store metatable we
will compare.
lauxlib uses a string, which sucks, because it forces to do a
pushliteral() each time you want to get a metatable from the registry,
which is slower.
Signed-off-by: Julien Danjou <julien@danjou.info>
Before this, awesome_refresh() could be called multiple times per mainloop and
one had to make sure to add awesome_refresh() calls in the right places.
Now, the prepare handler is invoked just before libev puts the process to sleep
(e.g. by calling select()) and awesome_refresh() does its thing.
All redundant calls to awesome_refresh() are removed, but the one in
selection.c has to stay because this function blocks in xcb_wait_for_event()
without using libev.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>