Commit graph

6330 commits

Author SHA1 Message Date
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
Emmanuel Lepage Vallée
d51a647003 Merge pull request #279 from actionless/useless_gapv3
Useless gap v3
2015-07-03 15:51:15 -04:00
Daniel Hahler
768a5b181e Merge pull request #273 from blueyed/cmake-no-recurse-into-build-dir
awesomeConfig.cmake: do not use GLOB_RECURSE with *.c/*.h
2015-07-03 19:11:09 +02:00
actionless
c961622fc0 fix(lib: awful: layout): equal useless gaps 2015-07-03 02:34:39 +02:00
actionless
1a32ba6ecb feat(themes): add 'useless_gap' prop to all themes 2015-07-03 00:20:28 +02:00
actionless
82549c04cd feat(lib: awful: tag): get useless_gap from beautiful if no any 2015-07-02 23:24:04 +02:00
actionless
01ac50c5ed feat(lib: awful: layout): set useless gap 2015-07-02 22:49:00 +02:00
Emmanuel Lepage Vallee
a7f2600a38 layout: attached_connect_signal is deprecated 2015-07-02 22:11:46 +02:00
Emmanuel Lepage Vallee
056dee0426 layout: Remove dead code 2015-07-02 22:11:39 +02:00
Emmanuel Lepage Vallee
1aacf1efc4 Add useless gap utility functions 2015-07-02 22:11:01 +02:00
Daniel Hahler
33a6ade4d7 Merge pull request #224 from blueyed/request-focus-signal
Add 'request::focus' signal, use it with autofocus
2015-06-25 07:00:22 +02:00
Daniel Hahler
cb7f4b06eb Use hints table argument with request::activate signal 2015-06-25 06:47:39 +02:00
Daniel Hahler
b7e2508144 docs: include lib/awful/ewmh.lua 2015-06-25 06:47:39 +02:00
Daniel Hahler
2e2d60a1f9 client.focus.byidx: handle raising in the function itself 2015-06-25 06:47:39 +02:00
Daniel Hahler
ed09d8ed4f Use request::activate with raise=false instead
Ref: https://github.com/awesomeWM/awesome/pull/224#issuecomment-101790416
2015-06-25 06:47:39 +02:00
Daniel Hahler
6dc355cf71 autofocus: use request::focus instead of request::activate
In #152 I've changed the autofocus handler to emit the request::activate
signal, instead of setting client.focus only.

This is wrong IMHO, and can be annoying:

If you have two floating clients above a tiled / maximized one, and
close one of the floating ones, with the tiled one being the one
selected by autofocus, it will be raised above the other floating
client.

This is changed now to use the new `request::focus` signal instead.

This basically reverts 20cdb5d (#152), but allows for customizing this
behavior, by overriding the default `request::focus` handler
(`ewmh.focus`).

It would be nice if there was a helper to check if a window's content
isn't visible at all (i.e. covered by other windows), and that could be
used then by the (new) default handler for request::focus - raising the
client only, if it's completely covered by another window.

Fixes https://github.com/awesomeWM/awesome/issues/217
2015-06-25 06:47:39 +02:00
Daniel Hahler
401f21f8e2 Add request::focus signal, with ewmh.focus being the default handler
This still does `client.focus = c` by default, but allows to customize
it.

This was initially suggested in #194, but by using `request::activate`
instead, which would not be the same.  Therefore a new signal is being
used instead.

Helped-by: Samir Benmendil <samir.benmendil@gmail.com>
2015-06-25 06:47:39 +02:00
actionless
cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Daniel Hahler
61275ccba0 Merge branch 'psychon-weak_connect'
Closes https://github.com/awesomeWM/awesome/pull/263
2015-06-25 06:37:42 +02:00
Uli Schlachter
d990e7918f Use :weak_connect_signal() for connecting to widget::updated
This way "that other widget" doesn't prevent the current widget from being
garbage collected.

Please note that this in all of these cases the widget under consideration does
have a strong reference to the callback function. This means that the callback
cannot be garbage collected until "this widget" itself is collected. Thanks to
this, this change is safe.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-25 06:37:05 +02:00
Uli Schlachter
089ed0e8dd gears.object: Add :weak_connect_signal()
Connecting to a signal weakly has the same effect as connecting to it strongly,
but it allows the garbage collector to disconnect the signal in case nothing
else references this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-25 06:37:04 +02:00
Daniel Hahler
38840c911b default config: raise with "maximize" and "fullscreen"
After using sloppy mouse focus to select a client (which does not raise
it already), maximizing/fullscreening it should then raise it.

This also uses the new shortcut `c.maximized = not c.maximized`.

Closes https://github.com/awesomeWM/awesome/pull/270
2015-06-24 05:17:00 +02:00
Emmanuel Lepage Vallée
7d430cf51a Merge pull request #274 from blueyed/spawn-warn-for-errors
Call `warn` in case of errors in luaA_spawn
2015-06-22 16:28:42 -04:00
Daniel Hahler
1992e1e429 awesomeConfig.cmake: do not use GLOB_RECURSE with *.c/*.h
This fixes "make (cmake)" picking up the files from the build dir itself
(recursively), i.e. "make cmake" would also create
`.build-HOST-x86_64-linux-gnu-4.9.2/.build-HOST-x86_64-linux-gnu-4.9.2/`.

It could also use `${AWE_SRCS}` etc here probably.
2015-06-22 14:04:57 +02:00
Daniel Hahler
ccb6843144 Call warn in case of errors in luaA_spawn
This is useful to have, as it might indicate a missing program etc.
2015-06-22 14:01:16 +02:00
Daniel Hahler
32b584258b CMakeLists.txt: fix installation of themes
Install *.lua from ${BUILD_DIR}/themes.
2015-06-22 13:26:36 +02:00
actionless
89beaf12e5 fix: rename the rest of *.lua.in files 2015-06-22 11:28:36 +02:00
Daniel Hahler
d4d5bbcd5d Merge pull request #266 from awesomeWM/juw-docs
docs: move documentation to C source
2015-06-21 21:33:22 +02:00
Daniel Hahler
3b366f993c Make stdout/stderr line buffered
This improves the behaviour with print()ing for debugging, when the
output is redirected to a file.

I was using `setbuf(…, 0)` initially, but it makes sense to buffer it
per line.  This uses `setvbuf` instead of `setlinebuf`, which might not
be available everywhere.

Closes https://github.com/awesomeWM/awesome/pull/267
2015-06-20 13:05:25 +02:00
Uli Schlachter
1408e8b952 Unset object's metatable in __gc
Run the following code:

  do
      local d
      local f = function() d.visible = true end
      if _VERSION >= "Lua 5.2" then
          setmetatable({}, { __gc = f })
      else
          getmetatable(newproxy(true)).__gc = f
      end
      d = drawin({})
  end
  collectgarbage("collect")

Awesome will segfault.

The reason for this is that after the above code ran, all variables in it are
unreferenced and will be garbage-collected at the next sweep phase. Lua runs
garbage collectors in the inverse order that their corresponding objects were
"marked" which means for the above code that the drawin's garbage collector will
run before function f runs. So the code will access the drawin after its
destructor already ran. Obviously, awesome's C code does not expect nor
correctly deal with this situation and was dereferencing a NULL pointer.

To fix this, this commit "unsets" the metatable of a userdata object when it is
being garbage collected. Since the type of a userdata is inferred via its
metatable, the object will no longer be accepted by luaA_toudata().

For the above code this will result in an unhelpful error message saying that
something tried to index a userdata, but userdata cannot be indexed. At least we
no longer crash and the traceback of the error will hopefully point at some __gc
metamethod which should be enough of a hint to figure out the problem.

Thanks-to: http://blog.reverberate.org/2014/06/beware-of-lua-finalizers-in-c-modules.html
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-20 12:33:17 +02:00
Daniel Hahler
d2e25c3594 cmake: s/ESCAPE_QUOTE/ESCAPE_QUOTES
This appears to be the correct name for 2.8.12 [1] already, but CMake
3.2.3 complains loud(er) now.

1: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:configure_file
2015-06-20 01:56:21 +02:00
Daniel Hahler
7989096cc2 Travis: install CMake 3+ (for newer FindLua) 2015-06-20 01:55:31 +02:00
Julian Wollrath
ba62665fd6 Remove some trailing whitespaces. 2015-06-19 23:13:31 +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