Commit Graph

83 Commits

Author SHA1 Message Date
▟ ▖▟ ▖ 0414a579c2 Expose dbus signal sender
Closes https://github.com/awesomeWM/awesome/pull/198.
2015-09-23 21:05:03 +02:00
Julian Wollrath 26f15a13f3 Document C API directly in the C source code
v2: Add available signals to the docs.

Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-06-19 23:13:31 +02:00
Daniel Hahler 8919faa7b3 doc: fix warnings from doxygen 2015-02-14 20:17:13 +01:00
Uli Schlachter 3bccb0ab73 a_dbus_message_iter: Handle DBUS_TYPE_DOUBLE
Fixes #78 on GitHub.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-17 19:44:04 +01:00
Da Risk 0ccda0eb9e Add luadoc for dbus.emit_signal() 2015-01-02 20:07:22 +01:00
Da Risk e664a74710 Add support for notification actions
The desktop notification specification says that a notification can have
different actions. These actions allow the user to interact with the client
application and should be displayed by the notification server.
* Add function to emit a DBus signal
* Notifications : emit NotificationClosed signal when closing notification
* Notifications: use constant for notification closed reasons
* notifications: Implement notifications actions

This is just a basic implementation to display the actions send with the
notifications. The actions should be displayed differently
* Notifications: add support for default action
2014-12-31 14:28:46 +01:00
Uli Schlachter e5120e1bec Hide globalconf.L
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>
2014-12-06 11:56:58 +01:00
Uli Schlachter d668268591 Fix some more dubious uses of globalconf.L
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 11:07:20 +01:00
Uli Schlachter d2b1e92f9e Clean up header includes
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>
2014-03-30 20:07:48 +02:00
Uli Schlachter 88facb7f57 Make debug::index::miss and newindex work on classes and all objects
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 19:27:06 +01:00
Gregor Best a2cd466103 Remove compiler warnings
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-24 18:15:34 +01:00
Uli Schlachter bfcb1628b7 dbus: Fix event handling
The port to glib failed to actually watch the file descriptor for events and
thus awesome silently ignored all dbus messages. My bad.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-21 22:05:15 +01:00
Uli Schlachter ea30119410 Use glib instead of libev
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>
2012-11-21 21:01:12 +01:00
Arvydas Sidorenko d612b922f3 lua_objlen wrapped in luaA_rawlen
In lua 5.2 lua_objlen was renamed for now reason

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 11:02:57 +02:00
Arvydas Sidorenko d61cdb86c9 Renamed luaL_reg to luaL_Reg
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>
2012-06-12 10:52:10 +02:00
Majic 0e8fc995bb Minor readability fixes, STREQ()-like macros added
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-11-18 17:56:21 +01:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
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>
2011-09-11 17:34:09 +02:00
Uli Schlachter 4f6c6cf32e dbus: Make sure the lua stack is balanced
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-31 14:59:59 +01:00
Uli Schlachter f61dca7068 dbus: Stop using a_tokenize()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-02 19:02:21 +02:00
Uli Schlachter 4b69718072 signal: Fix another "unknown signal" warning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 18:07:09 +02:00
Uli Schlachter ab4c151ed8 Add signals before using them
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>
2010-08-25 23:00:36 +02:00
Uli Schlachter 948f960b7e Also rename the signal_* C function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 20:48:42 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Gregor Best 6e6a07b660 dbus: fix compiling error
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 14:32:54 +02:00
Julien Danjou bd30468d7a dbus: only warn, dot not raises an error (FS#713)
This is not user-called error, so it's a really bad idea to raise an Lua
error here.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 10:46:01 +02:00
Julien Danjou 596cac5fb1 dbus: add support for array as returned type
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-12-28 10:40:07 +01:00
Julien Danjou af01e176d7 dbus: move some convert code in a function
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-12-28 10:40:04 +01:00
Julien Danjou 019608aa9e dbus: check that interface is not NULL (FS#667)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 20:49:37 +01:00
Julien Danjou 1dfa2c2a8d dbus: field can be nil
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 20:49:02 +01:00
Julien Danjou 1c54d2fd12 dbus: fix crash if interface is NULL
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-05 14:42:38 +02:00
Julien Danjou b2297fda46 globalconf: remove config.h include
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-07 17:28:55 +02:00
Brian Gianforcaro 73aa29645f Added documentation to D-Bus functions. Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 18:18:04 +02:00
Julien Danjou 6dc68905dc dbus: check for signal uniqness
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou 81d44ec5c4 dbus: call only one signal handler by interface
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou 299bc00286 dbus: move to signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-29 16:10:29 +02:00
Uli Schlachter 55524ece8d Use a libev prepare watcher for calling awesome_refresh()
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>
2009-06-19 09:34:42 +02:00
Julien Danjou acf4202143 dbus: do not exit on bus disconnection
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-17 10:27:54 +02:00
Jonny Lamb 88be323e4a dbus: Use org.naquadah.awesome instead of org.awesome.
http://dbus.freedesktop.org/doc/dbus-specification.html#naming-conventions

Signed-off-by: Jonny Lamb <jonny@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-15 20:42:28 +02:00
Julien Danjou e4acb74a5a luaa: split dofunction()
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:44:29 +02:00
Julien Danjou 0c800d9612 dbus: use dbus_bool_t when reading messages
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-28 22:40:02 +02:00
Julien Danjou 6993f088b1 dbus: use dbus_bool_t for pushing boolean
dbus_bool_t is 32 bits (has to be for the wire protocol) but our bool is
only 8 bits.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-28 22:37:48 +02:00
Julien Danjou 2dffbe9c72 dbus: fix cleanup code
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 14:54:09 +02:00
Julien Danjou 3831c84a84 dbus: do not exit on disconnection
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 14:49:58 +02:00
Julien Danjou dc29720ef7 Replace lua_newtable() with lua_createtable()
Lua can preallocate space in table for array or non-array elements type.
This should improve performance when setting table, so when we can we
use lua_createtable() since this is just a gain.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-25 15:04:27 +02:00
Julien Danjou 467737250c dbus: allow usage of the system bus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 16:07:31 +02:00
Julien Danjou fac192f6ef dbus: fix warning message
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 15:00:10 +02:00
Julien Danjou f473a107b0 cleanup #includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:52:25 +02:00
Uli Schlachter 4b82608952 Remove the argument to awesome_refresh()
awesome_refresh() had a xcb_connection_t as first argument. Since there is
only one connection to the X server, this argument doesn't really have any
alternatives to globalconf.connection and thus makes no sense.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 18:02:49 +02:00
Uli Schlachter 95457c5ab7 Move the definition of globalconf into a header file
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>
2009-04-10 16:32:42 +02:00
Julien Danjou 82329ad78a dbus: refresh everything after message has been handled
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 13:57:27 +02:00