Commit Graph

6713 Commits

Author SHA1 Message Date
Daniel Hahler dc9295d981 gears.timer: use xpcall with timeout and delayed calls
This provides a traceback in case of errors.

Ref: https://github.com/awesomeWM/awesome/issues/301
2015-07-22 13:52:47 +02:00
Daniel Hahler aca856b5d2 keygrabber.grabber: rename function name
This makes it clearer / more explicit in the traceback in case of
errors.
2015-07-22 13:52:47 +02:00
Daniel Hahler d08e82d4c8 Use luaA_dofunction with key- and mousegrabber 2015-07-22 13:52:47 +02:00
Daniel Hahler 50982fc082 client_resize_do: prefer client's current screen
In case of an overlapping screen configuration, prefer the client's
current screen.

Without this, clients would be moved to the first matching screen.
2015-07-21 15:16:37 +02:00
Daniel Hahler f070c4e060 tests: wait until DISPLAY is ready; xrdb might complain/abort 2015-07-21 13:09:07 +02:00
Daniel Hahler cbe684efd1 Add awful.screen.focused [FS#1029]
This allows to configure / override what gets considered to be the
"focused screen".

Ref: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1029

Closes https://github.com/awesomeWM/awesome/pull/94.
2015-07-21 12:51:45 +02:00
actionless 34290433c2 feat(lib: awful: layout: suit: corner): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless fb4a331014 feat(lib: awful: layout: suit: tile): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless 0028349226 feat(lib: awful: tag, layout): add 'master_fill_policy' property to tag 2015-07-20 18:32:19 +02:00
Daniel Hahler 2c3c6b5ca8 tests: cleanup, remove sleep/print 2015-07-18 15:08:27 +02:00
Uli Schlachter f4ed41b39a tests: Check if test file is readable before running it
I tried calling this script with "tests/foo.lua" as an argument, but it actually
expects "foo.lua" since it changes into the appropriate directory itself.
Because this file does not exist, "cat $f | awesome-client" failed and thus this
whole script just hung (the test runner was never actually started).

Fix this by testing for the test-file to exist before trying to run it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 12:35:57 +02:00
Uli Schlachter f2a079204d tests: Make dbus session automatically exit when X server dies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 10:45:03 +02:00
Uli Schlachter 534084698b tests/run.sh: Use $! instead of pgrep
And yes, $! is specified by POSIX and thus should be portable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-18 10:44:16 +02:00
Daniel Hahler c6ede6e96e tasklist: display symbols with "above" and "below" clients
When windows are set as "above", they will basically behave as "ontop"
(under normal circumstances) and therefore an indicator is useful to get
displayed in that case, too.

Closes https://github.com/awesomeWM/awesome/pull/325.
2015-07-18 01:03:01 +02:00
Daniel Hahler 3c1871b91f awful.tooltip: add margin around text
Closes https://github.com/awesomeWM/awesome/pull/321.
2015-07-16 21:24:46 +02:00
Emmanuel Lepage Vallée 8917972c16 Merge pull request #315 from Elv13/fix_wfact
client: do not assume that wfact exists
2015-07-16 12:38:15 -04:00
Daniel Hahler 430fe7f710 tests/run.sh: fix 'waiting for awesome' via pgrep 2015-07-16 17:05:46 +02:00
Daniel Hahler 1e9da0947e Improve tests/run.sh
- `set -x` only for Travis/CI=true.
 - improve waiting for PID and awesome-client success.
 - kill childs via trap always.

Closes https://github.com/awesomeWM/awesome/pull/316.
2015-07-15 01:30:06 +02:00
Emmanuel Lepage Vallee 18e9bfbcfa client: Do not assume the wfact exist
Since the call can now be delayed, "windowfact" may not exist yet.

Regression from 74106462ac
2015-07-14 01:39:03 -04:00
Daniel Hahler d5cf6e0272 Add client.first_tag, as a shortcut for `c:tags()[1]`
This is meant to be a faster alternative in case only the first tag is
relevant/used.

Closes https://github.com/awesomeWM/awesome/pull/294.
2015-07-14 01:20:39 +02:00
Daniel Hahler 78abb4a54c Improved awesome-client: exit code, bash, prompt
- exit with a non-zero status code when dbus-send fails.
   If awesome does not respond to the D-Bus message, e.g. because it is not
   running (yet), awesome-client now returns with a non-zero return code.
   This can be used to check if awesome has finished starting up, which is
   meant to be used for the functional test runner.
 - changed the shebang to use bash directly, which simplifies the logic
   to detect/handle "bash as /bin/sh" and allows to use `set -o pipefail`
   (which makes handling the D-Bus error easier - without using a subshell).
 - fix the prompt: now with trailing space, and the prompt is actually used
   (which wasn't the case with /bin/sh not pointing at bash before).

Closes https://github.com/awesomeWM/awesome/pull/304.
2015-07-14 00:24:33 +02:00
Daniel Hahler f37a3544de Merge pull request #307 from blueyed/minor-style
Various minor style / doc / comment fixes
2015-07-12 20:53:39 +02:00
Daniel Hahler 94814c7512 screen_client_moveto: add comment/whitespace for 'emit signal' 2015-07-12 17:42:53 +02:00
Daniel Hahler 917965483d doc: improve docs/02-contributing.md 2015-07-12 17:42:53 +02:00
Daniel Hahler 1050237d04 minor: fix/improve doc comments 2015-07-12 17:42:53 +02:00
Daniel Hahler 5c3734e583 luaA_xrdb_get_value: add resource name/class to warning 2015-07-12 17:30:59 +02:00
Daniel Hahler a7b281294c Makefile: add "tags" to .PHONY targets
It could depend on $(shell git ls-files), but it's not worth the
overhead to get this list then always.
2015-07-11 22:50:11 +02:00
Max d22a65a103 Replace uses of color_strip_alpha with ensure_pango_color, refactor
This simplifies the logic a bit since all of the fg/bg colors are
always set when it gets to checking the client state.
2015-07-10 18:11:45 -04:00
Max 2ba9c8667f Replace color_strip_alpha with ensure_pango_color
color_strip_alpha was used to insert colors into Pango markup, but it
did not correctly check for valid Pango colors. ensure_pango_color
checks if the color is valid in Pango, and returns a placeholder if it
is not.
2015-07-10 18:09:45 -04:00
Daniel Hahler d4c7a7ce04 Make sure "err" is a string in debug::error handler
I've noticed that `Pango.parse_markup` returns "userdata" instead of a
string in case of errors [1], which then causes the `debug::error`
handler to not handle it correctly:

    W: awesome: luaA_dofunction:77: error while running function
    stack traceback:
     [C]: in ?
     [C]: in function 'error'
     /usr/local/share/awesome/lib/wibox/widget/textbox.lua:63: in function 'set_markup'
     [string "require("wibox").widget.textbox():set_markup(..."]:1: in function 'f'
     /usr/local/share/awesome/lib/awful/remote.lua:25: in function </usr/local/share/awesome/lib/awful/remote.lua:21>
    error: attempt to concatenate a userdata value

This patch makes sure that `err` is a string when passing it to
naughty.notify in the default `debug::error` handler.

Closes #302.

1: https://github.com/pavouk/lgi/issues/115
2015-07-10 20:53:12 +02:00
Daniel Hahler 0f3bf03cd2 travis: unpin luassert
Closes #258.

Build tested in https://travis-ci.org/blueyed/awesome/builds/70387485.
2015-07-10 15:54:26 +02:00
Daniel Hahler 4a845ced0f awful.widget.graph: setters: emit widget::updated only on changes
Ref: #284
2015-07-10 15:32:22 +02:00
Daniel Hahler 3be423fcb3 awful.widget.graph: expose properties via getters
This allows to see if a widget is stacked for example.

It uses getters instead of exposing the properties directly, which
should be made readonly then probably (which has drawbacks according to [1]).

1: http://lua-users.org/wiki/ReadOnlyTables

Closes https://github.com/awesomeWM/awesome/pull/284.
2015-07-10 15:32:07 +02:00
Daniel Hahler 611438a892 Add functional tests via Xephyr/Xvfb/xdotool
Closes https://github.com/awesomeWM/awesome/pull/133
2015-07-10 15:19:51 +02:00
Daniel Hahler ae6a1efe65 Fix ewmh.activate to use the hints argument
This was missed in cb7f4b06, where the `raise` argument was changed to
`hints`.
2015-07-10 15:13:16 +02:00
Daniel Hahler 9eb4661cde Fix raising clients with focus=true via awful.rules
In ed09d8e this was changed accidentally, while only `request::focus`
should have been changed:

    -        c:emit_signal('request::activate',"rules")
    +        c:emit_signal('request::activate', "rules", false)
2015-07-10 15:13:16 +02:00
Daniel Hahler bd885f59f5 awful.client.property.set: emit property:: signals only on change
Emit "propery::" signals and call `c:set_xproperty` only if the
properties new value has changed.
2015-07-09 13:04:29 +02:00
Daniel Hahler ae7c7ff382 awful.tag: emit property:: signals only on change
This can have a significant performance impact in case you listen to the
property::hide signal to auto-hide tags for example.
2015-07-09 13:04:29 +02:00
bjp 4f865e66ed Add more keyboard shortcuts to the prompt
This adds the following readline/emacs style shortcuts to the prompt:
Ctrl+p, Ctrl+n, Alt+b, Alt+f, Alt+d, Alt+BackSpace.

Closes https://github.com/awesomeWM/awesome/pull/282.
2015-07-09 12:03:49 +02:00
Daniel Hahler 5630ad1bb2 taglist: call taglist_update only once per main loop
Currently `taglist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
2015-07-09 11:46:46 +02:00
Daniel Hahler 1924e044f7 tasklist: call tasklist_update only once per main loop
Currently `tasklist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
2015-07-09 11:46:45 +02:00
Emmanuel Lepage Vallée 49bf635017 Merge pull request #297 from blueyed/tag-delete-single-call-to-client-tags
awful.tag.delete: single call to #c:tags()
2015-07-07 16:24:12 -04:00
Emmanuel Lepage Vallée a09fee243c Merge pull request #295 from blueyed/doc-signals
doc: signals: minor improvements, mainly for "tagged"
2015-07-07 16:09:22 -04:00
Daniel Hahler 367ad2d9a6 awful.tag.delete: single call to #c:tags()
This is a minor performance optimisation I came across.
2015-07-07 18:42:24 +02:00
Daniel Hahler 63b19efef8 doc: signals: minor improvements, mainly for "tagged" 2015-07-07 17:19:41 +02:00
Daniel Hahler d361eeab34 Make use of the new `oldscreen` argument with property::screen handlers
Closes #285
2015-07-05 17:42:57 +02:00
Uli Schlachter 34c059bf23 Document mouse.coords().buttons
This fixes issue #280 as well, just as the previous commit does, because it was
decided that that issue should be about two different things.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-05 16:21:30 +02:00
Uli Schlachter 18f6ab107f Mousegrabber: Correctly handle press/release events
When you run a mousegrabber, the C code calls this callback when the pointer is
moved or when a button is pressed/released. However, the button state is totally
bogus on press/release events, always claiming that the button that was
pressed/released is the only button that is pressed (even for release events!).

This commit fixes up the code so that the button state after the press/release
event is passed to the mousegrabber callback function.

Fixes: #280
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-05 16:14:41 +02:00
Uli Schlachter 55bffbcc45 Fix for previous commit
Forgot to commit the change that adds _NET_FRAME_EXTENTS to the list of atoms
that we actually query for and export to the C code.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-05 15:34:23 +02:00
Uli Schlachter 4a094fa482 Add support for _NET_FRAME_EXTENTS
Support for this property is required since EWMH version 1.3.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-05 14:45:51 +02:00