Commit Graph

5094 Commits

Author SHA1 Message Date
Uli Schlachter 64bb0bea08 tasklist: Update when a c.minimized changes
This fixes a bug where the tasklist would still show its old content after a
client was minimized/unminized because it didn't connect to the appropriate
signal.

This wasn't noticed before, because in most cases minimizing a client also
unfocuses this client which causes a tasklist update.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 22:28:14 +01:00
Uli Schlachter f6907e1296 awful.client.floating.toggle: Fix for dialogs
awful.client.floating.get() does some sensible defaults. E.g. dialogs are
floating by default. Since floating.toggle only checked the property, these
defaults made it break.

So floating.toggle() should use floating.get to decide if a given client is
floating. It should also use "false" instead of "nil" when the client is made
non-floating or else the default will apply again.

Thanks to vsp for making me figure this out. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 23:05:44 +01:00
André Aparício 3dd4cc3226 Fix default naughty preset for dbus notifications
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-03 18:07:52 +01:00
Benoît Ryder 1513f399e1 Don't ignore forced width for textbox with background image.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-01 19:50:53 +01:00
Benoît Ryder 89c3e7411d Fixed copy/paste bugs.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-01 19:50:53 +01:00
jpike 3eb12cdf00 Add naughty.config.notify_callback
This optional callback can be used for filtering and/or editing
notifications.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-28 21:05:01 +01:00
Uli Schlachter 23ff7a8414 Don't focus a different screen on unmanage (FS#850)
When some client on the left monitor was closed while client.focus is on the
right monitor (e.g. 'sleep 5 ; exit' in a terminal), awful.autofocus would shift
the input focus to whatever client happened to be next in the focus history on
the left monitor.

Fix this by only ever moving the input focus between screens when a tag is
selected, not when some client does its magic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-27 22:27:53 +01:00
Anurag Priyam b805492c2a add usage example for awful.menu
Added a very simple example to show the usage, and applicability of
awful.menu by dynamically constructing a menu of clients that match a
particular rule.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Anurag Priyam 41ba50fde2 fix minor grammar, and typo in awful.menu.new's documentation
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Anurag Priyam 9c3731c782 add markup to awful.menu.new's documentation
Display the possible keys to the 'menu' params as a bullet list
(unreadable otherwise).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:32 +01:00
Uli Schlachter 12c7e2852f Tag clients more intelligently (FS#700)
Before this commit, c:tags(tags) and t:clients(clients) first removed all
tags/clients and then added the new one.

This is now changed into only removing the tags/clients that have to be removed
and leaving the others in place. Hopefully, this avoids all kinds of weird
issues which we had.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-18 14:24:43 +01:00
Julien Danjou 95ae751bad change codename
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-01-17 12:38:13 +01:00
Anurag Priyam 8fc605abb8 add usage example for keygrabber API
To demonstrate keygrabber API usage, I added a small function to the
docs that can be bound to a key and used to resize clients using
keyboard.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-16 20:20:34 +01:00
Uli Schlachter 90f0939bee Make awful.client.idx public
The luadoc API documentation already contained this function and it seems to be
useful for user configs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-03 14:18:58 +01:00
Julien Danjou 95eb965883 timer: add again method
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-12-17 13:49:51 +01:00
Julien Danjou cdbbac3c6f awesome-client: allow to send multi line code
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-12-17 12:02:57 +01:00
Michael Abbott 9cdbb016f1 Revert "build: look for libs in /usr/local/lib"
This reverts commit 7c86714dca.

It doesn't make sense to hard-wire /usr/local into the build, as this
depends entirely on the build target.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-14 21:05:46 +01:00
Uli Schlachter 0e7d36703e Use _LDFLAGS instead of _LIBRARIES
If a library is in a non-standard path, the linker needs an extra argument so
that it knows how to find this library: -L/path/to/lib

pkg_check_modules() sets _LIBRARIES only to the library's name, but _LDFLAGS
also contains a -L flag if one was found.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-14 20:28:37 +01:00
Uli Schlachter 95403b9544 awful.client.setwfact: Handle invisible clients (FS#693)
setwfact() calls idx() on the client that it works on. When idx() is called with
a client that isn't visible, it fails while trying to find outs the client's
index in the current layout.

  event_handle_mousegrabber:119: error running function:
    lib/awful/client.lua:688: attempt to compare nil with number

Fix this by ignoring all clients that aren't visible in setwfact().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-11 14:23:31 +01:00
Radu Andries 35286d5ecc Improve naughty's dbus interface
Evil spec from galago project.
image_data should be read too as in http://www.galago-project.org/specs/notification/0.9/x344.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-10 17:20:51 +01:00
Uli Schlachter a756972962 spawn: Create sessions for processes
Each process spawned from awesome now gets its own session and process group.
This makes sure they aren't connected to awesome in any way any more. This
especially fixes some problems with signals.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-04 13:21:55 +01:00
Uli Schlachter 03010ca5c2 Properly die when the X server dies
When the X connection breaks for whatever reason, awesome wouldn't properly
exit, but go into a busy loop instead. Fix this by dying when our connection to
the X server dies.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-11-13 22:35:00 +01:00
Uli Schlachter d303957d01 Set minimum required cmake version to 2.8.0
We are using file(copy ...) which seems to be new in cmake 2.8.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-28 22:20:54 +02:00
Julien Danjou b0e8024e47 awful.prompt: add ctrl-backspace
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-21 09:05:55 +02:00
Julien Danjou 8805a99f73 awful.tag: do not update history when identical tags
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-20 17:30:48 +02:00
Julien Danjou f37d9f5c7c awful.tag: remove useless line
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-20 17:00:10 +02:00
Stjujsckij Nickolaj b4cc392e23 Remove last known usage of deprecated in Lua 5.1 `arg`
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-12 18:37:54 +02:00
Stjujsckij Nickolaj 7ef7fe7e03 awful.titlebar: Stop using arg
Implementing vararg functions via arg is deprecated in lua. This kind of thing
should instead be done via "...".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-12 18:37:54 +02:00
Alexandre "kAworu" Perrin 3961a2ee31 use CMake check_function_exists() for execinfo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 22:52:00 +02:00
Alexandre "kAworu" Perrin 56f0c84240 test for __builtin_clz() and fallback to an inline implementation.
__builtin_clz() is not defined by gcc prior to 3.4 and maybe not for some other
compiler vendors.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 20:41:44 +02:00
Uli Schlachter f9c2fcacb2 awful.util.join: Stop using arg
Implementing vararg functions via arg is deprecated in lua. This kind of thing
should instead be done via "...".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 17:13:51 +02:00
Alexandre "kAworu" Perrin f38566bd97 avoid using seq in awsetbg, and test for columns count argument of -m option.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 17:12:00 +02:00
Uli Schlachter 0116d739b5 Don't fail if execinfo is not available
Previously, cmake aborted when execinfo was not found. With this commit the
backtrace code is just disabled when execinfo is not available.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 16:42:34 +02:00
Alexandre "kAworu" Perrin 23d5b27206 awesomeConfig: test for execinfo.h/backtrace()
add a test for execinfo.h and backtrace() function which are defined by
GNU libc. If it fails, require libexecinfo.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-11 16:42:08 +02:00
koniu 02cd1cbda3 awful.completion: callback functions return table of matches
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 15:23:06 +02:00
koniu 595b344156 awful.prompt: add 'autoexec' argument
If set the prompt will execute the command upon completion which returns
only one match.

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 15:23:06 +02:00
Uli Schlachter 9e79d18747 Tasklist: Fail less badly with invalid utf8
xterm is famous for messing up the utf8 in its title (unless correctly
configured).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-07 18:42:05 +02:00
Uli Schlachter a4b8fc4894 Flush the cairo surface after drawing
It is perfectly valid for a cairo surface to delay the actual. This is mostly
done in situations where it speeds stuff up. Since we want our drawing to be
visible, we have to flush the cairo surface when we are done drawing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-05 19:48:54 +02:00
Julien Danjou 0ee01cc3fe change codename
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-04 10:51:54 +02:00
Roman Kosenko 4bdc716d8a Fix image cropping/enlarging
Function imlib_create_cropped_image() from imlib2 doesn't initialize
buffer for new image, so if we use crop bounds bigger than original ones
we need to erase garbage from derived image.
This bug produced colorful pressed buttons (FS#516, FS#822).

Signed-off-by: Roman Kosenko <madkite@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-27 11:14:18 +02:00
Gregor Best e6b99ae374 naughty: localize obj
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-09-19 20:16:55 +02:00
Uli Schlachter 268fe91434 widget layouts: Check the number of geometries
If we called the widget layout for x widgets, but the layouts returned less
geometries than this, we silently ignored the left-over widgets. If the layouts
returned more geometries, we crashed.

Fix this by verifying that the number of widgets and the number of geometries
are equal. If they are different, we use the smaller of the two.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-17 16:10:16 +02:00
Uli Schlachter 8c0a83f5ca Correctly unref widget_nodes
While drawing the wibox, the C core builds up a list of widgets and their
associated geometry. This list consists of widget_node_t objects and is
constructed like this (This is from luaA_table2widgets()):

   widget_node_t w;
   p_clear(&w, 1);
   w.widget = luaA_object_ref_item(L, idx, -1);
   widget_node_array_append(widgets, w);

After we are done with this list of widget nodes, it is freed via
wibox_widget_node_array_wipe(). However, wibox_widget_node_array_wipe() passed
"&w" to luaA_object_unref_item() while it should have used "w.widget" (which is
what was returned from luaA_object_ref_item()). This made the unref fail and the
wibox was carrying around a reference to this widget forever. This was
effectively a memory leak.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-17 15:49:20 +02:00
Uli Schlachter 222fb4c9c5 Fix a "table expected instead of nil" error
It seems like with lots of bad luck, the garbage collector manages to "steal"
the table with the buttons right after we decided to use it. Evil collector!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 20:23:36 +02:00
Uli Schlachter 74b5cddbac Wibox: Unref old widgets table
When setting a new widgets table, the wibox obviously should drop its reference
on the old widgets table.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 20:21:38 +02:00
Uli Schlachter 9114ed1846 {tag,task}list: Use a weak-valued table
The data table is used to map objects (clients/tags) to the buttons associated
with them. This is done so that we don't have to re-create the button objects
each time this lists are updated.

The problem was that this weak-keyed table was never cleared, because the value
had a strong reference to the key (via the button's signal):

btn:connect_signal("press", function () b:emit_signal("press", o) end)

"o" is the key in the table and btn is reachable from the value. This prevented
the garbage collection of the key. Using a weak-keyed and weak-valued table
fixes this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 17:38:40 +02:00
Uli Schlachter 2134a3c2e9 Partly revert cd53eb8d3f
Turns out there are files in themes/ which are still needed (e.g. the default
wallpaper and the layout icons).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-14 22:15:56 +02:00
Ignas Anikevicius (gns_ank) 1ee80cd5d0 Add match_any function and rule_any definition for different client matching.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-14 16:51:59 +02:00
Uli Schlachter cd53eb8d3f Use relative paths for the titlebar icons (FS#809)
The current code used "if(MATCHES)" to decide if a path was inside the source
directory or the build directory. MATCHES uses regular expressions and so this
check failed miserably if the path contained any characters that have a special
meaning in regular expressions (e.g. "+").

Fix this by only using paths inside the build dir for the icons. All icons are
copied from the source dir to the build dir so that we can freely assume that
everything is inside the build directory.

Instead of trying to "transform" the existing paths from the source dir to the
build dir, we use "file(GLOB)"'s RELATIVE option that gives us relative path.
Together with the way "file(COPY)" interprets its arguments, that's all we need.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-13 16:40:59 +02:00
Uli Schlachter 2f739a5326 awesome.spawn(): Return the PID
This modifies awesome.spawn() to return the process ID of the started process
which could e.g. be used for matching against _NET_WM_PID.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-09 20:49:17 +02:00