Commit Graph

2898 Commits

Author SHA1 Message Date
Kevin Zander 2f105eac86 Move string functions out of awful.util into new gears.string (#1584)
Update deprecated awful.util string function calls to gears.string calls
2017-03-11 18:57:32 -05:00
Uli Schlachter 64b964972b systray: Enable properties and improve documentation
I spent way too much time trying to figure out why setting "visible" to
false did not work...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:46:40 +01:00
Uli Schlachter 13dbc558fc wibox.hierarchy: Only count "really visible" widgets
Widgets with width or height zero cannot really be counted as visible,
so do not do so.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:44:56 +01:00
Uli Schlachter 51e4a47938 Partly fix removal of systray from a wibox
This commit changes the systray widget, wibox.drawable and the C code to
fix the following bug: When the systray widget is removed from a
drawable without being moved somewhere else, the systray stayed visible.
This was because the systray is not drawn by awesome, but only placed.
When the widget is no longer "drawn", it stays wherever it was placed
last.

This change works by detecting the situation when the systray is
removed. Then, the C code is specifically told to remove the systray
window from the drawable.

Note that this is only a partial fix. This change works correctly when
the widget is removed completely, because it is no longer placed by its
parent widget. However, for example, when you do
wibox.widget.systray().visible = false, the effect is just that the
systray widget gets size 0x0. This is not really visible, but as far as
this change is concerned, the widget is still part of the drawable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 18:14:38 +01:00
Uli Schlachter e1fe1de98f wibox.hierarchy: Add ability to count widgets
This adds new code so that we can count how often a specific widget is
visible inside of all widget hierarchies.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-11 13:55:57 +01:00
Christoph Mertz 2d91d49b30 awful.screen.focus_bydirecttion: fix setting screen focus (#1635)
This was broken in 9cb60b8 in PR #1597 (from myself).

focus() is not defined on the screen instance as method
but on the screen module as function.

Signed-off-by: Christoph Mertz <chris@nimel.de>

Fix #1644
2017-03-09 00:07:35 -05:00
Kevin Zander 0066257a59 Move ensure_pango_color out of awful.util into gears.color
Update deprecated awful.util.ensure_pango_color calls to gears.color.ensure_pango_color calls
2017-03-08 15:28:48 -06:00
0x041E caf90887a7 doc: Fix arcchart documentation (#1643) 2017-03-08 16:05:23 -05:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00
Emmanuel Lepage Vallée d3ca6aa301 Merge pull request #1637 from psychon/deprecation_warnings
Fix some deprecation warnings
2017-03-07 18:43:32 -05:00
Uli Schlachter 73944dac00 Add awful.widget.clienticon
This adds a new widget that displays the icon of a client. This widget
tries to use the best fitting of the available icons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-07 22:45:49 +01:00
Jan Larres 862bfbf795 menubar: add trailing slash with $XDG_DATA_HOME (#1631)
The $XDG_DATA_HOME environment variable may not necessarily end in a
slash, so insert it when generating the list of all menu dirs to make
sure the directory can be found.
2017-03-06 22:58:09 +01:00
Uli Schlachter 675b05ff34 fixup! Fix code using awful.util.round 2017-03-06 17:28:31 +01:00
Uli Schlachter dde71265c5 fixup! Fix code using awful.util.cycle 2017-03-06 17:28:08 +01:00
Uli Schlachter ad113fa3aa Fix code using awful.util.cycle
This gets rid of lots of deprecation warnings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:15:40 +01:00
Uli Schlachter 6f803cf3b3 Fix code using awful.util.round
This gets rid of lots of deprecation warnings

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:11:05 +01:00
Kevin Zander ad3782b08a Fix typo in awful.tag.setmwfact 2017-03-05 18:04:33 -06:00
actionless e0f9245abc fix(awful: hotkeys_popup: vim): fix hotkeys for scroll line up/down 2017-03-05 22:01:11 +01:00
Christoph Mertz 9cb60b8130 awful.screen: extract screen:get_next_in_direction() (#1597)
This extracts the code for finding the next screen
from focus_bydirection to a separate method on
the screen object.

The main reason was to use the finding code without
actually changing the screen focus but this should
incidentally make the code slightly easier to test
as well since both concerns can be tested in
isolation.

Signed-off-by: Christoph Mertz <chris@nimel.de>
2017-03-04 22:16:15 -05:00
Emmanuel Lepage Vallée 2b88c92d52 Merge pull request #1604 from Lawful-Lazy/master
Add naughty presets `ok`, `warn` and `info`.
2017-03-04 22:14:35 -05:00
Emmanuel Lepage Vallée dacf22aae7 Merge pull request #1618 from legostax/master
Added _hover & _click to client buttons
2017-03-04 22:13:21 -05:00
getzze 9a3cdab534 Add grid layout
Remove dependency to awful and remove get_cell_sizes function

Remove matrix and add superpose property

Update documentation, remove beautiful dep

Add insert, extend and remove columns and rows

Change x and y to horizontal and vertical
2017-03-04 20:57:33 -05:00
Emmanuel Lepage Vallée 971adec0d0 Merge pull request #1622 from Veratil/fix-new-luacheck
Fix Luacheck 0.19.0 release Travis breaks
2017-03-04 13:32:53 -05:00
Daniel Hahler 0bd29ae1e9 Merge pull request #1580 from psychon/only_on_screen
Add a only_on_screen container widget
2017-03-04 04:06:21 +01:00
Kevin Zander 3f6df8ddee Fix Luacheck 0.19.0 release Travis breaks 2017-03-03 16:41:12 -06:00
Uli Schlachter 232c5a014a menubar.show(): Remove duplicate call to menubar.refresh()
This changes a line of code that was added in the previous commit.
Previously, when menubar.cache_entries was set to false,
menubar.refresh() was called twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 18:46:55 +01:00
Uli Schlachter 67b12579d9 Deprecate menubar.get()
The function seems useless and its documentation is wrong. It does not
return a wibox, but a widget. Also, the widget cannot really be used on
its own since it depends on the size of the wibox.

So menubar.get() and its wrapper through the metatable __call should
just be removed. Until then, the needed initialisation code is moved
around a bit and the function is deprecated.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 18:45:47 +01:00
Uli Schlachter 2b2612314c Add a only_on_screen container widget
Fixes: https://github.com/awesomeWM/awesome/issues/1565
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 13:25:28 +01:00
Kevin Zander d8f57e4997 Move math functions out of awful.util into new gears.math 2017-03-02 18:15:59 -06:00
Lego Stax cb311a5d61 Updated to comply 2017-03-02 16:01:22 -07:00
Lego Stax 8ffe4460d0 Added _hover & _click to client buttons
Every client button type (e.g. minimize, maximize_inactive, maximize_active, close) has the option to show a different icon when the mouse hovers over it or a "button::press" signal is sent.
Signed-off-by: Lego Stax legostax@gmail.com
2017-03-02 14:49:14 -07:00
Kevin Zander edd9415df6 Add a deprecated_in variable to util.deprecate args table (#1586) 2017-03-01 23:02:49 +01:00
SammysHP 2f0d0e37da Add beautiful property to control busy cursor during spawn 2017-03-01 21:57:59 +01:00
Emmanuel Lepage Vallée 2f34e69cab Merge pull request #1605 from legostax/master
Added disable_task_name property
2017-03-01 14:42:38 -05:00
Emmanuel Lepage Vallée ef668bc028 ewmh.tag: Fix the transient_for clients without parent client tags (#1610)
ewmh.tag: Fix the transient_for clients without parent client tags

Fix #1594
2017-03-01 14:11:38 -05:00
Daniel Hahler 04b73db722 Merge pull request #1601 from psychon/improvements-thanks-to-Unode
Improvements on wibox.container.scroll thanks to Unode
2017-02-28 19:58:28 +01:00
Emmanuel Lepage Vallée 3b0269d5e9 Merge pull request #1600 from Drauthius/master
Corrected selected check in awful.tag.set_screen()
2017-02-27 16:48:08 -05:00
Emmanuel Lepage Vallee 4e161d4a0a doc: Fix the variable names
It was still wrong
2017-02-27 16:20:47 -05:00
Emmanuel Lepage Vallee f24e957c17 doc: Fix wibar documentation
I got it wrong in the PR that introduced the beautiful variables.

Too much find&replace...
2017-02-27 16:12:37 -05:00
Emmanuel Lepage Vallée 8210b11ab0 wibar: Add beautiful variables (#1602)
* wibar: Add beautiful variables

This was done a few weeks ago for the notifications. This was
requested on IRC a while ago to have different font for the wibars.

Now that shapes are supported, it also makes more sense for the
border.
2017-02-26 15:56:09 -05:00
Lego Stax b54cf0330b Added disable_task_name property
style.disable_task_name and beautiful.tasklist_disable_task_name.  Suppresses display of a given client's name, but preserves the setting of tasklist_plain_task_name
2017-02-25 17:21:36 -07:00
Samuel Hunter 97287596e2 Add naughty presets `ok`, `warn` and `info`. 2017-02-25 13:20:53 -08:00
Uli Schlachter d8a272d2dd wibox.container.scroll: Also mention some caveats
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 17:05:33 +01:00
Uli Schlachter 3b40954223 wibox.container.scroll: Add a description
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:56:51 +01:00
Uli Schlachter 6fb40a196f wibox.container.scroll: Add a usage example
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:51:03 +01:00
Uli Schlachter 3d12ba3b65 Fix wibox.container.scroll's property magic
Creating a widget already sets a metatable (at least these days).
However, wibox.container.scroll overwrote this metatable with its own
metatable. This commit removes this overwrite.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-25 16:42:27 +01:00
Drauthius 28709c282e Corrected selected check in awful.tag.set_screen()
Previously it would check if the awful.tag.selected function existed,
and not whether the tag was actually selected.
2017-02-25 16:07:36 +01:00
Lego Stax bc728a5f46 doc: Update fixed.lua (#1591) 2017-02-21 22:03:21 -05:00
Emmanuel Lepage Vallée 94311913bb Merge pull request #1579 from psychon/gears-wallpaper-improvements
Gears wallpaper improvements
2017-02-21 13:31:45 -05:00
morethanoneanimal 1c71260389 Replace improperly used asserts with warnings.
Add awful.spawn noop function to hooks.lua test. Previously it was nil.
2017-02-21 00:31:33 +01:00
Uli Schlachter 4efee3c3d6 gears.wallpaper: Check for cairo errors
This makes things fail loudly which otherwise fail without giving a hint
on what went wrong.

Reference: https://github.com/awesomeWM/awesome/issues/1570
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-19 14:10:26 +01:00
Uli Schlachter 4fc396ec57 gears.wallpaper: Only finish own surfaces
If the caller provides a file name, these function load the image, set
it as the wallpaper and make sure that the memory used for the image
data is freed immediately. However, this was also done when the caller
provided a cairo surface, thus breaking their surface.

Fix the code so that it does not finish surfaces that it did not create
itself.

Fixes: https://github.com/awesomeWM/awesome/issues/1570
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-19 14:10:05 +01:00
Daniel Hahler a4b06bca58 awful.prompt.run: improve deprecation warnings (#1577) 2017-02-18 19:39:19 +01:00
Daniel Hahler bd02ee8558 minor: code style and comment fixes 2017-02-16 10:40:54 +01:00
Daniel Hahler 52011a68e1 util.deprecate_class: use raw=true always (#1564)
Fixes

> W: awful: function margin is deprecated, see wibox.layout.margin has been renamed to wibox.container.margin.

to

> W: wibox.layout.margin has been renamed to wibox.container.margin.
2017-02-15 19:45:23 +01:00
copycat-killer ad72d204c9 menubar.init: menulist_update doc fixed 2017-02-15 12:38:46 +01:00
Emmanuel Lepage Vallee a158c3adab wibar: Fix a race condition when adding new wibars
Fix #1523
2017-02-13 21:01:13 -05:00
Emmanuel Lepage Vallée 77c92d0d63 Merge pull request #1536 from jmccrohan/naughty_icon_urldecode
naughty: urldecode icon URI file
2017-02-12 20:25:09 -05:00
actionless 09a678345c feat(naughty: core): add shape configuration; expose options to beautiful 2017-02-12 22:37:31 +01:00
Emmanuel Lepage Vallée 6d00d34b41 Merge pull request #1557 from Elv13/add_place_container
Add place container
2017-02-12 13:23:39 -05:00
actionless f8d12a855f feat(awful: widget: promptbox): accepts `fg` and `bg` as arguments; improve docstring 2017-02-12 17:59:19 +01:00
Emmanuel Lepage Vallee 1e50f7b376 container: Add an placement container.
It should be called "align", but the name is already taken

It doesn't use awful.placement because it would break the dependency
graph.

Some cases previously required 2 wibox.layout.align layouts,
one for each axis. This is massively overkill to simply place
a widget at the center of a larger area.
2017-02-11 16:10:13 -05:00
actionless 20c132fa38 feat(menubar): cache count_table reading 2017-02-11 16:58:57 +01:00
actionless 0089b5d7c7 refactor(menubar): simplify file handling for count_table 2017-02-11 16:58:57 +01:00
actionless 978889e739 fix(menubar): close count_file after opening
closes #1548
2017-02-11 16:58:57 +01:00
Yauhen Kirylau 439d0c804c fix(menubar): reset search query when menubar closes (#1553)
* fix(menubar): reset search query when menubar closes

* refactor(menubar): remove redundant argument for menulist_update()
2017-02-11 01:16:57 +01:00
Yauhen Kirylau 148723f053 refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget (#1533)
* refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget

closes #1352
closes #1497

* doc(awful: hotkeys_popup): add @beautiful docstrings

* fix(awful: hotkeys_popup): add label_bg for misc labels; improve @beautiful docstrings
2017-02-10 19:50:10 +01:00
copycat-killer 7a728cec6b awful.widget.watch: return timer too 2017-02-08 14:53:40 +01:00
Jonathan McCrohan 12e5998698 naughty: urldecode icon URI file
file:// URIs should be urlencoded; decode URIs where required.

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
2017-02-08 01:15:36 +00:00
Emmanuel Lepage Vallee 69f292a31f doc: Add basic documentation for the custom rules properties.
In the lack of a better documentation.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 477df4a35b maximized/fullscreen: Use relative coords when restoring size.
Also apply a copy of the memento instead of mutating the
original.

Fixes #1320
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 6da20bb301 rules.placement: Add properties to honor padding and workarea 2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 5f693ead30 rules: Move tags into the same group as tag
Unrelated to this PR, but found while doing a review.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 0bf8bb6a64 fullscreen: Add a beautiful option to remove borders.
This was previously done in a callback, but wasn't really
clean and/or bug free. Borders could end up leaking on other
screens as proven by an integration test.

Fix #171
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 4ea6e133f8 placement: Add some missing `ignore_border_width` checks.
It was done in some places, but not all.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 3a0f139b9e maximize: Officially honor screen padding
Add an option too.

Fix #1459
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 631e75a757 ewmh: Use the request:: API in the border_width / wa callback
And stop listening to property::geometry, it's no longer needed.

This also remove messing up the border without saving it
somewhere. The concept is sound, but not the implementation.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee d5b681502a maximize: Stop mixing horizontal, vertical and both.
Before this commit, do this:

    c.maximize_hoizontal = true
    c.maximize = true
    c.maximize = false
    assert(c.maximize_hoizontal)

Would not work because the states were not preserved individually.
This commit fixes that. Awesome wont be confused about it's own
state anymore.

This may seem pointless, but when it come to undoing these
maximizations, it was ambiguous.
2017-02-07 11:12:42 -05:00
Emmanuel Lepage Vallee 3b1599bd99 maximize: Stop doing it in 2 operations.
Before 4.0, maximizing could only be done in 2 operations.

4.0 add an unified way, but kept doing 2 operations. The old
Lua EWMH code to serialize the 2 operations was dropped when
the codepath was simplified and replaced by a generic version
in awful.placement. However this version never implemented
combining multiple mementos into 1.

This commit unify the maximize C code, drop the ugly macro
template and actually fixes a couple more issues that were
caused because request::geometry was sent twice.
2017-02-07 11:12:40 -05:00
Emmanuel Lepage Vallee 51ddb5639e mouse: Handle `maximized` client like `fullscreen` ones.
There is already a way to prevent them from moving them, but the
next few commits will remove it. There is no reasons to handle
this differently from fullscreen clients.
2017-02-07 11:12:40 -05:00
Yauhen Kirylau c1cd968803 import vim hotkeys from user config, not hotkeys_popup module (#1432) 2017-02-07 13:50:52 +01:00
Emmanuel Lepage Vallée 206a5f664f Merge pull request #1529 from actionless/menubar-fix-menu-refresh-with-query
fix(menubar): use current query after refreshing entries list
2017-02-06 13:19:13 -05:00
actionless 4c3b63009c fix(menubar): use current query after refreshing entries list
closes #1421
2017-02-05 22:06:29 +01:00
actionless 3cc613fa20 test(awful: hotkeys_popup): add a minimal test 2017-02-05 21:32:43 +01:00
Uli Schlachter 130acf1c00 Fix client shape handling
The functions awful.client.shape.update.bounding and .clip handle both
the client's shape and the shape set by Lua. However,
awful.client.shape.update.all only handles the shape set by Lua and
ignores the client's own shape. This can easily be noticed with xeyes.
When update.all ran last and you move around xeyes, the wallpaper behind
it is moved along, because it is not actually outside of the window.

Fix this by partly reverting 1a5f6b7ad2 and having update.all just
call the other two functions again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-04 07:20:56 +01:00
copycat-killer 1a5f6b7ad2 client: Allow clients to have shapes
Also fixes awful.client.shape docs

Closes #1507
2017-02-03 17:48:28 -05:00
Emmanuel Lepage Vallée cbd22eea50 Merge pull request #1475 from psychon/input-shape-support
Input shape support
2017-02-03 12:25:56 -05:00
Uli Schlachter aaea976108 layoutbox: Update when a tag's screen changes (#1505)
In theory it would be enough to only update the old and new screen of
the tag whose screen changed. However, we cannot easily get the old
screen, so just update all layoutboxes.

Fixes: https://github.com/awesomeWM/awesome/issues/1503
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-02 22:45:33 +01:00
getzze c0c083bf7d hotkeys_popup: add custom keys to existing groups (#1504) 2017-02-02 22:44:24 +01:00
Kevin Zander e1aacfaa22 awful.wibar: move wibar:remove() call outside of loop over all wiboxes (#1501)
Removing a wibar mid-loop will corrupt the indexing of the for loop and can
cause other wibars from being removed.
2017-02-02 22:42:20 +01:00
Emmanuel Lepage Vallée 5439c34723 Merge pull request #1513 from Elv13/merge_copycat
object/client.c: added position and size properties
2017-02-02 13:29:42 -05:00
Luke Bonham ff47b0d0c4 object/client.c: added position and size properties
added client signals connection

added comments doc
2017-02-02 13:09:03 -05:00
actionless 79a60b3009 fix(awful: key): clone table with user data
closes #1401

fix(tests: awesomerc): use `awful.key.execute` instead of local helper function
2017-01-30 18:19:24 +01:00
Emmanuel Lepage Vallée a1a5e18b62 Merge pull request #1483 from blueyed/rules-remove-duplicate-placement
rules: remove duplicate handling of placement props
2017-01-28 21:55:13 -05:00
Uli Schlachter 5191fcbdd2 beautiful.theme_assets: Use screen geometry instead of workarea (#1462)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-28 15:05:53 +01:00
Holger Schurig bf2c1993db doc: fix signals (#1455)
- rule reordering was mentioned twice in the NEWS
- fix all shown luadoc errors
- add missing descriptions for signals in module "awesome"
2017-01-28 15:03:56 +01:00
Daniel Hahler b43918613a rules: remove duplicate handling of placement props
Fixes https://github.com/awesomeWM/awesome/issues/1481.
2017-01-27 18:00:19 +01:00
Uli Schlachter df8346ceae Merge branch 'export-paths' of https://github.com/psychon/awesome 2017-01-27 17:36:55 +01:00
Daniel Hahler dd339fd62a naughty: mouse: only react on release events
Fixes https://github.com/awesomeWM/awesome/issues/1445.
2017-01-27 17:35:50 +01:00
Giuseppe Bilotta f22ef5014d Make beautiful fallback properly if Xft.dpi is missing
As documented in
<https://keithp.com/~keithp/talks/xtc2001/paper/xft.html#sec-editing>,
the fallback value for Xft.dpi should be the vertical DPI reported by X.
On Xorg, this will generally be 96, unless the user has overridden the
value by either forcing Xorg to report the EDID-derived DPI, or by
setting the DPI themselves (via configuration, command line, or xrandr).
The 96 value is kept as ultimate fallback if anything goes wrong.
2017-01-27 13:02:49 +01:00
Emmanuel Lepage Vallée 5a914b3496 Merge pull request #1198 from psychon/wibox-shape
Wibox: Add gears.shape support
2017-01-26 05:30:42 -05:00
Uli Schlachter 47d69e7824 Update docs for shape_input
I grepped for shape_clip and edited places that needed editing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-26 11:15:28 +01:00
Uli Schlachter 2d736bf3b5 wibox.drawable: Draw black if no wallpaper is available (#1437)
Fixes: https://github.com/awesomeWM/awesome/issues/1411
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 23:10:37 +01:00
Uli Schlachter c2759077d6 beautiful: Reset theme when theme loading fails (#1470)
Commit c50d62749b added an empty table as a default theme. However,
when loading the actual theme fails, we will end up with theme having
value nil. This commit fixes this by reverting back to an empty table.

Fixes: https://github.com/awesomeWM/awesome/issues/1417
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 23:06:15 +01:00
Alexander Gehrke e2edabb8b1 ewhm: fix some transient windows not being movable to other screens (#1406) (#1452) 2017-01-25 12:11:11 +01:00
Uli Schlachter 288e44596f Export build-time paths as entries on awesome
This removes some @EXPANSIONS@ from Lua files and removes a hack that
was needed. All is better now! :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 09:41:11 +01:00
Daniel Hahler 90bbcf1903 awful.tag: handle invalid client in delayed_call (#1372)
A short-lived client (e.g. `urxvt -e false`) might be invalid already
when the delayed callback is called.
2017-01-23 22:53:01 +01:00
Yauhen Kirylau f9975f763c Avoid cyclic dependency between awful and menubar (#1433) 2017-01-23 22:51:41 +01:00
Holger Schurig 2627f087c5 doc: fix beautiful.arcchart_thickness (#1439)
The arcchart_ prefix was missing.
2017-01-23 21:26:18 +01:00
Emmanuel Lepage Vallée 193c73353f Merge pull request #1426 from SammysHP/prompt-customization
prompt: Make awful.widget.prompt themeable
2017-01-23 07:27:58 -05:00
SammysHP 37f0b7e3bf prompt: Make awful.widget.prompt themeable
Adds new optional properties to the theme:
    prompt_fg
    prompt_bg
    prompt_fg_cursor
    prompt_bg_cursor
    prompt_font
2017-01-23 13:15:09 +01:00
SammysHP 9553f616c0 doc: fix typo (#1430) 2017-01-22 21:57:26 +01:00
Emmanuel Lepage Vallee 7faac6b59f doc: Fix awful.tag.attached_connect_signal 2017-01-22 09:31:56 -05:00
Emmanuel Lepage Vallée e0bce2936f Merge pull request #1329 from Elv13/prompt_refactor
Prompt documentation & fixes
2017-01-22 09:14:00 -05:00
Emmanuel Lepage Vallee 2229d7aeed doc: Fix a copy/paste error in the master_count doc 2017-01-22 09:00:53 -05:00
Emmanuel Lepage Vallee 1c4b991e33 doc: Better document the prompt hooks 2017-01-22 01:14:20 -05:00
Emmanuel Lepage Vallee a6161d1229 tests: Test the prompt highligher 2017-01-22 01:14:20 -05:00
Emmanuel Lepage Vallee 2472201b71 prompt: Add command highlighter support. 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee 39f0a1c95c doc: Document the prompt callbacks 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee 928f7b04b4 prompt: Add a key filter example 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee f6cce940a5 prompt: Add a Vi like prompt parser
Otherwise hooks that modify the command are not documented well
enough.
2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 4934697817 prompt: Add a more complete hook example 2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 42205220dd prompt: Move the keybindings section to the header
This is part of a longer series of commit to expand the
documentation.
2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 53d32d362a prompt: Unit test the example 2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 856244723c prompt: Restore the ability to use hooks without exiting
It was in an earlier version of the patchset but was lost at
some point.
2017-01-20 00:22:49 -05:00
Emmanuel Lepage Vallee 1e1bebc269 timer: Add a "real world" example
This was asked on IRC. While many user configs have such patterns,
the documentation had none.

It isn't using the test framework because of the delay.
2017-01-20 00:22:49 -05:00
Emmanuel Lepage Vallee 595ade2228 timer: Add a `singleshot` constructor property.
Also save some boilerplate code.

This closes the gap between timer.start_new and timer.new. Now the
only difference is that one have a special callback format while
the other only has predefined properties.
2017-01-20 00:22:49 -05:00
Emmanuel Lepage Vallee d8f51a4039 timer: Add a callback constructor property
Avoids having to keep a local variable just to be able to
register the callback.
2017-01-20 00:22:49 -05:00
Emmanuel Lepage Vallee bd96eacbe2 timer: Add an autostart constructor property 2017-01-20 00:22:49 -05:00
Yauhen Kirylau bfb3534955 doc(awful: hotkeys_popup): change variable names to fix ldoc result and add one missing docstring (#1396) 2017-01-17 10:13:26 +01:00
Emmanuel Lepage Vallée a9e8cc3dab Merge pull request #1404 from Veratil/tasklist-spacing-fix
Tasklist spacing fix + taglist spacing doc addition
2017-01-16 23:39:53 -05:00
Kevin Zander 44e0ea5681 taglist_shape_border_width_focus and taglist_shape_border_color_focus are not put into the correct variables 2017-01-16 11:18:47 -06:00
Kevin Zander 74b5ac72da Fix incorrect variable lookup for theme.tasklist_bg_image_* 2017-01-16 02:39:01 -06:00
Kevin Zander 56a2e98896 Add doc for taglist_spacing 2017-01-16 01:12:12 -06:00
Kevin Zander c3b565faab Fix theme lookup of tasklist_spacing; fix doc typo 2017-01-16 01:11:42 -06:00
Yauhen Kirylau 316734a681 move `theme_assets` from xresources theme to `beautiful` module. (#1219) 2017-01-14 04:09:54 +01:00
Yauhen Kirylau f69769f7ba fix(awful: hotkeys_popup): use new widget api in pagination (#1384) 2017-01-11 13:12:38 +01:00
Daniel Hahler 83a118e421 awful.util.{get_themes_dir,get_awesome_icon_dir}: support env
Look at environment variables AWESOME_THEMES_PATH and AWESOME_ICON_PATH,
which allows to override this in the integration test runner.
2017-01-08 20:34:13 +01:00
rob 703b11182c taglist: added volatile tag theme variables 2017-01-07 21:21:46 -07:00
Daniel Hahler 466988eb5a Merge pull request #1354 from psychon/menubar-fixes
Menubar fixes
2017-01-04 20:55:51 +01:00
Emmanuel Lepage Vallee cefa14d1bd layout: Fix the magnifier layout
It was broken since the dynamic screen support was merged.

Fix #1338
2017-01-04 04:56:54 -05:00
Emmanuel Lepage Vallee 790d2aa6ee doc: Add a missing test example macro
I found this while doing a review in case the intentation changes
broke other tests.
2017-01-03 00:07:57 -05:00
Daniel Hahler 4b9e8e232d Merge pull request #1341 from psychon/modeline
Lots of fun with vim modelines
2017-01-02 19:56:06 +01:00
Uli Schlachter 1078a9f395 Bump minimal LGI version to 0.8.0 (#1350)
Turns out that menubar already uses features that were only added in
that version.

Fixes: https://github.com/awesomeWM/awesome/issues/1348
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 19:53:02 +01:00
Uli Schlachter dadf8463bd menubar: Fix refresh without show
When menubar.refresh() is called, it tries to update the menubar widget.
The call chain looks like this: menulist_update -> common.list_update ->
get_current_page. get_current_page then tries to query information about
the size of the menubar.

Since there is not much point in this, just skip the whole callback in
this case.

Side note: What is the point of menubar.get()? It seems quite useless to
me.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 17:23:20 +01:00
Uli Schlachter 7f3ff5f26f menubar: Fix hide()
When hide() was called without any calls to shown() before, an error
would occur.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 17:21:10 +01:00
Uli Schlachter 68f0883a44 menubar: Refactor initialisation
No functional changes intended. I just like things more like this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-02 17:20:41 +01:00
Uli Schlachter 2b79165622 Add missing vim modelines in lib/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-31 14:07:13 +01:00
Daniel Hahler af961e974c doc: improve client.dockable (#1336) 2016-12-31 00:40:17 +01:00
Uli Schlachter e7b4898a7e Fix typo: Remove double tasklist_tasklist_ (#1323) 2016-12-28 22:25:23 +01:00
Daniel Hahler d13f465374 awful.screen: add stacked arg to some functions (#1301)
Fixes https://github.com/awesomeWM/awesome/issues/1300
2016-12-28 12:41:59 +01:00
Uli Schlachter bdb7e90b74 Fix classmod in awful.widget.keyboardlayout (#1314)
Fixes: https://github.com/awesomeWM/awesome/issues/1313
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-27 21:38:20 +01:00
Uli Schlachter ddfe652173 fixup! wibox: Add shape property 2016-12-26 13:55:33 +01:00
Uli Schlachter 1a9887335e wibox: Add shape property
This bridges between gears.shape and the shapes. So far, it does not try
to do any kind of anti-aliasing magic, so you get "steep edges".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-26 13:28:34 +01:00
Uli Schlachter 40c653c4b6 Fix luacheck warnings in wibox.drawable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-25 13:05:26 +01:00
Uli Schlachter 0907411997 Merge branch 'force-drawable-screen' of https://github.com/psychon/awesome 2016-12-25 11:09:58 +01:00
Emmanuel Lepage Vallee 2b462cb2e3 doc: Document the tag `master_fill_policy` 2016-12-21 11:41:30 -05:00
Emmanuel Lepage Vallée 8935ed2a30 Remove traces of the old URL (#1280)
**WARNING**: This breaks the API
2016-12-21 02:03:03 +01:00
Uli Schlachter 4d2a1d5534 wibox.drawable: Support forced screens
Up to now, a drawable always figured out the screen that it is on by
looking at its position. This causes memleak-like problems with wibars:
A wibar has a screen assigned, but its underlying drawable will end up
referring to another screen. Via this, we were managing to build a long
reference chain of screens and drawable that meant that none of the fake
screens that our test suite added could be garbage collected.

To fix this, add wibox.drawable._force_screen(s). After this function is
called, the normal screen detection based on the position is skipped and
instead the given screen is always used. This breaks the above reference
chain and things become garbage-collectable.

Also, this chains the drawable to the life time of the screen: When the
screen becomes invalid (.valid == false), the drawable will stop
redrawing.

Fixes: https://github.com/awesomeWM/awesome/issues/1237
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-18 10:56:47 +01:00
Emmanuel Lepage Vallee 5ff29bb00e doc: Document how to open a document using `awful.spawn` 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee 1efbb57049 doc: Add a little awful.spawn async tutorial 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee 7f1933f99c doc: Document when spawning with a shell is needed 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee b9dbc79308 doc: Add more `awful.spawn` documentation
It was lacking
2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallée 65ec764416 Merge pull request #1267 from Elv13/fix_rules_screen_mismatch
Fix more rules screen mismatch
2016-12-12 13:07:18 -05:00
Emmanuel Lepage Vallee 4b61dbba82 rules.tags: Behave like rules.tag
One did try to match tag by name and the other didn't.

While at it, also ensure that the screen is consistent.
2016-12-12 11:49:11 -05:00
Emmanuel Lepage Vallée f22c067efd Merge pull request #1265 from Elv13/improve_deprecation
Improve deprecation messages
2016-12-12 10:26:39 -05:00
Emmanuel Lepage Vallee c96aa9866e rules.tag: Prevent a screen mismatch
As c:tags() doesn't (cannot) check for screen mismatch, then it
has to be done.

This is a follow up of 6f7019b2d0, see #1236.
2016-12-11 22:50:00 -05:00
Emmanuel Lepage Vallee 828d6f2cd9 utils: Better class deprecation warnings
Fix #1228
2016-12-11 14:54:12 -05:00
Emmanuel Lepage Vallee e239492696 utils: Add optional awful.util.deprecate options.
For now, only a `raw` option is implemented.
2016-12-11 14:51:33 -05:00
Emmanuel Lepage Vallee 52fbf49309 prompt: Fix indentation
There was tabs mixed with spaces
2016-12-11 14:39:08 -05:00
Emmanuel Lepage Vallee 73afe0e954 doc: Add a prompt example. 2016-12-11 14:35:20 -05:00
Emmanuel Lepage Vallee 0e1c193450 prompt: Make exe_callback optional
The menubar already bypass it using keypress listener. Having an
empty callback is ugly.

Fixes #1180
2016-12-11 14:19:25 -05:00
Emmanuel Lepage Vallee 1eeaf6b9c9 doc: Add a missing awful.rule field 2016-12-11 00:10:39 -05:00
Emmanuel Lepage Vallee 5aa38f6fe5 doc: Add a missing ewmh handler documentation 2016-12-11 00:10:39 -05:00
Emmanuel Lepage Vallée 548b15e883 doc: Document the client layouts. (#1247)
This commit doesn't add any useful documentation, but adds
previously hidden documentation variables. It can be the basis
of a better layout documentation.

Fix #1246
2016-12-10 02:24:22 +01:00
Uli Schlachter 9a5092226a awful.wibox.stretch: Spell out full replacement
The function that is documented as awful.wibox.stretch is deprecated,
because it was removed (that's not a deprecation, is it?!?). For the
replacement, we used "@see stretch". However, LDoc was randomly
resolving this reference to awful.wibar.stretch (good) or
awful.wibox.stretch (bad; the see points to the element where it
appears).

Fix this by spelling out the "full name" of the function in the @see.

Related-to: https://github.com/awesomeWM/awesome/issues/834
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-09 18:03:03 +01:00
Uli Schlachter 480b8b6477 Remove @see tag.swap on awful.tag.object.swap
The only other swap function is awful.tag.swap and that one is
deprecated. Thus, it should not be linked to.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-09 18:00:40 +01:00
Uli Schlachter 1784518415 Add pointless naughty.lua and beautiful.lua files (#1259)
People who use a plain "make install" to install awesome will likely
also use the same approach to update their installation. However, this
does not actually work, because in awesome 3.5 there are beautiful.lua
and naughty.lua. These modules have since been split up into multiple
files and we now have beauitful/init.lua and naughty/init.lua instead.
The result is that the newer awesome will use some code from an older
version of awesome.

This commit has a work-around for this: We add "empty" beautiful.lua and
naughty.lua files whose only purpose is to load the real file. These
"empty" files will then overwrite files from an older installation and
everything works.

Sadly, this bad hack will have to be kept around forever and in the
future we will only have more instances of it. I would like to just say
people to fix their system, but apparently this should be worked around
instead.

Fixes: https://github.com/awesomeWM/awesome/issues/244
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-08 23:53:50 +01:00
Uli Schlachter 9f2c4719ed Make the piechart deterministic (#1258)
Previously, the API to set the data that should be displayed was
:set_data(t) where t is a table. This table has the labels to use as its
keys and the numbers as its values. With this API, it was not possible
to influence the order in which the "pie pieces" were drawn.

This commit adds and uses a new API called :set_data_list(t). Here, t is
a table with integer keys and tables as values, thus one can iterate
over this with ipairs() and the order is well-defined. The tables used
as values contain the label as their first entry and the number as their
second entry.

Fixes: https://github.com/awesomeWM/awesome/issues/1249
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-07 20:20:09 +01:00
Emmanuel Lepage Vallée 883b5934c0 Merge pull request #1236 from Elv13/fix_new_tag_rule
rules.new_tag: Fix when the tag screen doesn't match the client
2016-12-01 19:53:17 -05:00
Michael Beaumont 4cb11b8754 Fix awful.tag.add ignoring props.index (#1245) 2016-12-01 22:04:57 +01:00
Uli Schlachter f9cdc98c73 Fix spawn callbacks
Spawn callbacks were never invoked when no startup-notification-rules were
given. This commit fixes the code so that "startup done" callbacks are also
called when no rules were given.

Fixes: https://github.com/awesomeWM/awesome/issues/1218
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-01 15:32:21 +01:00
MoreThanOneAnimal 6558164e53 Create artificial gears.color documentation.
Point from parse_color function to gears.color in documentation.
Fix minor issues (typos, indentation) in docs.
2016-11-28 20:23:46 -08:00
MoreThanOneAnimal 495e579fdb parse_color function refactoring:
- simplified parsing logic,
- return nil for incorrect input,
- update tests and doc.
2016-11-28 20:22:39 -08:00
MoreThanOneAnimal 51bbb53b30 Add references to gears.color in documentation. 2016-11-28 20:07:29 -08:00
Emmanuel Lepage Vallee 6f7019b2d0 rules.new_tag: Fix when the tag screen doesn't match the client
Also add the documented `props` argument to the high priority
rules.
2016-11-27 04:57:35 -05:00
Daniel Hahler fc13b1b4eb doc: s/Wether/Whether/ 2016-11-22 02:40:15 +01:00
Daniel Hahler eed3d7e63a lib/wibox/widget/base.lua: doc fixes 2016-11-22 02:40:15 +01:00
Daniel Hahler 71259748d2 Minor doc and code style fixes
Closes https://github.com/awesomeWM/awesome/pull/1215.
2016-11-21 22:38:40 +01:00
Daniel Hahler aeab2a70e9 Fix whitespace warnings reported by luacheck (#1229) 2016-11-21 22:38:23 +01:00
actionless 3fea2db8c5 feat(awful: hotkeys_popup): add possibility to create new widget instance 2016-11-21 13:44:20 +01:00
MoreThanOneAnimal 61d4f4310a Use unmodified command for the command history.
Closes awesomeWM/awesome#1104.
2016-11-15 23:25:31 -08:00
Emmanuel Lepage Vallee 2d5a1798af doc: Document tasklist_plain_task_name
It was missing.
2016-11-15 16:33:20 -05:00
Daniel Hahler d0dc447dd5 Emit screen::arrange signal outside of arrange_lock (#1191)
This will handle changes in the layout recursively, e.g. when changing
the border_width of clients.

Ref: https://github.com/awesomeWM/awesome/issues/171#issuecomment-256146578
2016-10-26 16:20:34 +02:00
Uli Schlachter d07fc822a1 Fix awful.tag.object.get_gap_single_client (#1190)
The usual "a or b"-trick to simulate C's ?:-operator does not work when
"false" is a valid value. Fix the code to handle this correctly and add
a short unit test which would have caught this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-26 01:43:45 +02:00
Uli Schlachter f71592a00a gears.matrix: Add create_rotate_at() (#1181)
We already have a variant of this function for transforming an actual
matrix. This adds the corresponding static factory.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-25 15:37:49 +02:00
Uli Schlachter c1b6b204d6 awful.util.file_readable: Use Gio (#1187)
Instead of doing Linux-specific magic with error codes and trying to
read the first byte of a file, just use Gio to check if a file exists
and is readable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-25 00:23:18 +02:00
Uli Schlachter 70d4961a3e awful.spawn: Separate rules from callbacks (#1186)
When adding callbacks as a `callback` entry in a property, the callback
is run by `awful.rules`, because it does `c.callback =
result_of_function`. This is obviously not intended. Also, this causes
the callbacks to run twice, because the code already handled this
`callback` property specially.

Fix this by just not merging callbacks with the normal rules at all.

Fixes: https://github.com/awesomeWM/awesome/issues/1159
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-25 00:22:36 +02:00
Uli Schlachter 7292be1add Merge branch 'fix-missing-args' of https://github.com/hexchain/awesome 2016-10-22 10:31:45 +02:00
Uli Schlachter ed3aac711d Fix traceback in gears.protected_call (#1178)
The traceback should not include the error handler because this is confusing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-22 00:54:08 +02:00
Uli Schlachter 289dfd1615 gears.surface.widget_to_*: Ignore repaints (#1155)
For some reason, the code here tried to handle widget::redraw_needed
signals even though it should apparently/obviously only produce a
current snapshot of the widget's look.

Fix this by just removing the redraw code.

While here, also factor out the widget context table into a local
variable and re-use it for the initial layout and for the later draw.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-19 12:32:30 +02:00
Uli Schlachter bc75ef5689 menubar.utils: Use a protected call (#1174)
When awesome calls any Lua code, it does so with a protected call. This
means that any kind of Lua error should (there are exceptions) just
result in an error message being printed and everything continuing as
usual. When LGI calls Lua code, it uses a normal call. This means that
in an asynchronous context, that is, when there is no more call
generated by awesome's C code on the call stack, we must be careful,
since any error results in Awesome's unprotected error handler to be
called which restarts the WM.

menubar.utils.parse_dir() asynchronously parses a directory containing
.desktop files. This means that it is no longer in a protected call
context. Let's assume that the code itself is fine. However, the
callback that the caller provided for handling the results can be quite
arbitrary. Make sure that it is run in a protected context.

Helps-with: https://github.com/awesomeWM/awesome/issues/1173
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-19 12:29:54 +02:00
Haochen Tong a6af703c5d menubar: Fix missing exe_callback in args table (#1173)
Signed-off-by: Haochen Tong <i@hexchain.org>
2016-10-18 12:40:47 +08:00
Emmanuel Lepage Vallée 6b90ed7e73 Merge pull request #1169 from Elv13/fix_prompt_deprecation_warnings
Fix prompt deprecation warnings
2016-10-12 15:52:15 -04:00
Emmanuel Lepage Vallee 4b34e64fe2 widget: Add a slider widget. 2016-10-12 02:24:47 -04:00
Emmanuel Lepage Vallee 07f3a178fa prompt: Fix 2 deprecation warnings
An oversaw in a previous commit introduced deprecation warnings
on the default config.
2016-10-12 01:53:53 -04:00
Emmanuel Lepage Vallée de121975bf Merge pull request #1165 from psychon/fix-deprecation-warning
Corner layout: Fix deprecation warning
2016-10-10 18:01:32 -04:00
Uli Schlachter c9f085f439 Fix a broken deprecation warning (#1164)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-10 21:00:20 +02:00
Uli Schlachter 19fe233982 Corner layout: Fix deprecation warning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-10 20:59:49 +02:00
Uli Schlachter fd3daf54b3 keyboardlayout: Don't break if parsing the layout fails (#1154)
Fixes: https://github.com/awesomeWM/awesome/issues/1108
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:41 +02:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Daniel Hahler 05d962f778 Merge pull request #1147 from psychon/remove_weak_tables
Remove some weak tables
2016-10-07 22:00:23 +02:00
Emmanuel Lepage Vallée c79e49b985 Merge pull request #1124 from Elv13/prompt_args_refactor
Prompt args refactor
2016-10-06 15:17:11 -04:00
Uli Schlachter 01a9cb2031 Merge branch 'drawable-visibility' of https://github.com/psychon/awesome 2016-10-06 20:59:38 +02:00
Uli Schlachter ab789e57a9 awful.tag: Save all "generic" tag properties as real props
Instead of using magic with a weak table, the code now saves this data
as a property under the tag object. This avoids all kinds of leaks, for
example caused by t.foo = t.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:16:33 +02:00
Uli Schlachter bf97cb6bfe awful.tag: Save dynamic_cache as a tag property
Instead of using magic with a weak table, the code now saves this cache
as a property under the tag object.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:03:34 +02:00
Uli Schlachter 4ef63d9416 awful.screen: Save last mouse position as screen property
Instead of using a weak table to save the last mouse position, this is
now saved directly as a property under the screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:00:47 +02:00
Uli Schlachter 3d048dca04 awful.client: Save client properties under c.data
Instead of using a weak table with some magic to save properties of a
client, the code now uses the c.data table provided by the C code
instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:55:28 +02:00
Uli Schlachter 22d1375e5f awful.client: Remove persistent_properties_loaded
Instead of having an extra weak table to save a boolean per client, this
now sets a property directly on the client.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:52:01 +02:00
Uli Schlachter 90044e00da wibox: Remove weak table hack
No idea what self referencing loops this refers to. Lua 5.1's and
LuaJIT's garbage collector both should handle cycles just fine. Things
only start getting complicated when you start using weak tables.

Unless someone comes up with an example where this patch causes a leak,
let's remove the weak table magic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:35:04 +02:00
Uli Schlachter 4bb02d1b53 wibox.hierarchy: Fix the matrix_to/from_device
Matrix operations are hard. Apparently I always keep confusing the order
that transformations are applied in the matrix resulting from a matrix
multiplication.

This commit fixes things in wibox.hierarchy that were wrong due to the
wrong order and changes a unit test so that it would now catch the
breakage (and makes sure that it does not happen again).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:07:19 +02:00
Uli Schlachter 6d8e91f5e2 Change API for wibox.drawable:find_widgets()
Instead of matrix_to_device and matrix_to_parent, this now provides the
full hierarchy instance managing the current widget.

In addition to x, y, width and height (which are an over-approximation
of the widget's extents on the drawable), this now also provides
widget_width and widget_height in the widget's local coordinate system.
These last two values are exact.

For example, the tooltip needs x/y/width/height while a widget that
wants to figure out which point on it was hit with a mouse press will
need widget_width and widget_height (together with the position argument
that is passed in with mouse::press).

I don't know how to document the return type of this function properly.
Hopefully just describing the structure of the resulting table is good
enough.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:04:24 +02:00
Uli Schlachter eb9dbf991c Widgets: Get mouse position right for button press/release
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:04:24 +02:00
Uli Schlachter 0183372ac2 wibox.drawable: Do not relayout while invisible
Similar to the previous commit, this makes the drawable not apply a
pending relayout while it is not visible. When it becomes visible again,
the relayout is done.

The hope here is that less work is done while a drawable is not visible,
saving CPU time.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:00:20 +02:00
Daniel Hahler 332681aaad progressbar: keep set_height/set_width working (#1141)
Ref: https://github.com/awesomeWM/awesome/issues/1140
2016-10-05 00:24:43 +02:00
Uli Schlachter 9b51779f2f wibox.drawable: Fix a possible crash
LGI does not protect against use-after-free issues that can occur due to
using an object after finalisation. This manifests itself as occasional
crashes on Travis in cairo_region_union_rectangle() (AFAIK no one ran
into this issue in real-world usage).

Since visible drawables are always strongly reachable, the issue can
only occur with invisible drawables. The previous commit made sure that
those are fully repainted when they become visible, so we can just
ignore redraws for those and fix the crash issue.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-04 21:27:10 +02:00
Uli Schlachter 650b01eb71 wibox.drawable: Stop using weak tables
Instead of tracking all drawables that are alive, the code now only
tracks visible drawables. When a drawable is made visible it is
completely repainted. This should not cause a difference when a wibox is
initially made visible, because it has to be redrawn anyway. However,
this introduces a full repaint when a wibox is hidden and then made
visible again.

Thanks to this change, we can stop using weak tables. Visible drawables
cannot be collected and so we can keep a strong reference to them. This
allows us to get rid of the weak tables which solves various problems
involving finalizers and using objects after finalisation.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-04 21:20:55 +02:00
Uli Schlachter 843d0bdcf5 wibox.drawable: Add visibility tracking callback
This new function is called whenever the visibility of the drawable
changes. Later commits can use this for explicitly tracking the lifetime
of drawables instead of using magic weak tables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-04 21:18:18 +02:00
Emmanuel Lepage Vallee ef50f75551 prompt: Add a key release callback.
A possible use case is to highlight something when a key is
pressed and un-highlight it when the key is released.
2016-10-04 00:51:45 -04:00
Emmanuel Lepage Vallee 11644f4582 prompt: Deprecate 8 parameters. 2016-10-04 00:51:45 -04:00
Emmanuel Lepage Vallee c00c14ade3 doc: Improve the prompt documentation
It was still pre-ldoc
2016-10-04 00:43:05 -04:00
Emmanuel Lepage Vallee e5ebcc1e4c prompt: Allow each argument to be passed to the "args"
This is the first step in deprecating them. A function with so
many optional arguments is just bad design.

The next few commits will rewrite the documentation and deprecate
the old arguments.
2016-10-04 00:43:05 -04:00
Emmanuel Lepage Vallee d52c1e7f7a client: Add focus stealing filters.
For a while, it was often suggested on IRC to replace the default
request::activate handler to implement custom focus stealing policies.

While it is working, it isn't user friendly. This commit add a simple
mechanism to add such policies.
2016-10-04 00:42:25 -04:00
Daniel Hahler d513e2c4fc doc fixes for awful.{client,screen,tag} (#1134)
This adds a tparam alias "@screen" for "@tparam screen" (when used to
document e.g. arguments for callbacks), and "@screen_or_idx" when a
function accepts a "screen" or "number".
2016-10-02 16:03:11 +02:00
Uli Schlachter da6012da3e Fix memory leak in the default config on screen removal
The default config had tables like mywibox and mywibox[s] was the wibox
that is visible on screen s. When a screen is removed, nothing cleans up
these tables and so the screen and the wibox could not be garbage
collected. The same applies to the layoutbox, taglist etc.

This commit removes the global mywibox table and instead saves it as a
property on the screen. This way, the screen is not explicitly
referenced and when it is removed, the screen, its wibox and all of its
widgets become unreachable and can be garbage collected.

This commit also updates the docs and the tests that referenced things
(mostly the wibox) via mywibox[s] to now use s.mywibox.

Fixes: https://github.com/awesomeWM/awesome/issues/1125
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 22:46:51 +02:00
Uli Schlachter b6a3ae43fb gears.object.properties: Use the new .data table
Previously, gears.object.properties used a weak table for adding
additional information to a C object. However, weak tables can easily
cause leaks when the value references the key.

This commit makes the code instead use the new .data property that is
available on all C objects. This means we have no more magic with a weak
table and instead only use "regular" tables instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 11:11:55 +02:00
Emmanuel Lepage Vallee fb4a48b744 doc: Document where gears.shape can be used. 2016-09-26 01:21:15 -04:00
Emmanuel Lepage Vallee b6421699da doc: Add more graph documentation. 2016-09-26 01:20:57 -04:00
Emmanuel Lepage Vallee 5ef9b64b40 graph: Add shape support
This complete the shape API. Now, everything support shapes.
2016-09-26 01:20:57 -04:00
Emmanuel Lepage Vallee 68999f4a86 graph: Add min_value
Fix #277
2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee bbb3d14822 doc: Document the tasklist variables. 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 9e8c4a71e3 doc: Document taglist theme variables 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 6e829ce104 tasklist: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 520bd02416 tasklist: Add spacing support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 967fc87a92 taglist: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee da47357ae7 widget.common: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee f517538b6a background: Avoid some redraw 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 00ee99851b taglist: Add spacing support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 549d68dcc5 doc: Add more progressbar shape examples 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 7b11f1c1b4 tests: Test progressbat paddings, margins and clip 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee a8568eb969 doc: Add examples for vertical and labelled progressbar 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e1733dd37a progressbar: Add paddings and margins properties
This restore a feature that was available in Awesome 2.1-3.2.

The reason margin is implemented rather than use a container is to
be able to make the background smaller than the bar.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 915c10b1f8 progressbar: Add shape support
The current progressbar code dates from a time when Awesome had
a very limited drawing API. This commit first re-write the
algorithm to remove the workaround used to draw the border using
full rectangles only. It then add support for outer and inner
shapes with their respective border settings.

This commit also add clip support. This is enabled by default, but
could be disabled to have the bar taller than the background.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 8ec53c827b progressbar: Fix a race condition
When created using the declarative syntax, set_value could be
called before set_max_value, this trimmed the value.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e5d4c188f1 progressbar: Remove vertical/width/height code
The deprecation message should be enough. This doesn't remove
the functionalities themselves.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e28b79944f doc: Use @property for the progressbar doc. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 8d7f228301 progressbar: Conform to the new widget conventions.
It is not Awesome 3.2 anymore, progressbars are no longer userdata.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 7cbcc800bc progressbar: Remove dead code. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 2c620468f0 progressbar: Deprecate width, height and vertical properties. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 260aeba78b doc: Fix the menubar fields documentation 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 280973c9cb doc: Document all client layout theme properties. 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 85334faffd doc: Remove invalid tasklist documentation 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 1b9f44c62d doc: Document the titlebar theme variables. 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee d5aca4ccd7 doc: Fix gears.timer documentation 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 4a8a1423e8 doc: Fix improper punctuation (causing an ldoc issue) 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee be8f0c376b doc: Document the basic variables. 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee abd2a271af doc: Document menu variables. 2016-09-26 00:40:19 -04:00
Emmanuel Lepage Vallee bb96f94845 tasklist: Add some documentation 2016-09-25 22:47:35 -04:00
Emmanuel Lepage Vallee 2b6ff1b3ca taglist: Add more documentation 2016-09-25 22:47:35 -04:00
Emmanuel Lepage Vallee 89f796b268 doc: Fix copy paste mistake. 2016-09-25 22:47:35 -04:00
Daniel Hahler 9b7e655afe Merge pull request #1111 from psychon/assorted-fixes
Some assorted fixes
2016-09-25 01:35:55 +02:00
Emmanuel Lepage Vallee 525a76018f container: Add an 'Arc chart' container.
A lot of conky config use this type of widgets. It looks very nice
on thicker wiboxes.
2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 9b5cecf53e shape: Move_to is necessary for circle strokes 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee d03d63ecae shape: Add circle radius parameter. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 2475aa6e9b shape: Add the 'arc' shape. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 0a3a71dd45 widgets: Add a piechart widget. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee a027589150 shape: Add pie shape. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 3f0b033e72 checkbox: Add a shape based checkbox widget. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee a4743ed2c2 radialprogressbar: Upstream Elv13 round progressbar 2016-09-24 14:45:08 -04:00
Uli Schlachter ab135fa7c9 wibox.drawable: Don't redraw invalid drawables
Twice now we had problems with the garbage collector which caused signals
established via weak_connect_signal() not to be disconnected when we wanted them
to be disconnected. The effect was that we tried to redraw a drawable after it
was garbage collected which caused errors.

Instead of playing whack-a-mole with all the various ways that might make us
redraw a drawable after GC, let's just fix all of these issues by explicitly
checking for this case and turning it into a no-op.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter f6761e662c wibox.drawable: React to screen changes
The previous commit made wibox.drawable turn a "normal redraw" into a complete
repaint when it was moved to another screen. However, nothing happened until
that normal redraw.

This commit triggers a normal redraw when we are (possibly) moved to another
screen. More precise, this means that whenever a screen appears, disappears or
changes its geometry and when the drawable is moved, we trigger a normal redraw.
This redraw will likely do nothing, because no relayout is pending and no part
of the surface needs a redraw, so it is cheap.

However, if the drawable really ends up on another screen, then the code from
the previous commits makes us do a full relayout and redraw.

This commit likely fixes the current instability of test-screen-changes.lua. See
https://github.com/awesomeWM/awesome/issues/982#issuecomment-231712056.

As explained there, the test fails because the fake screen that it created is
still referenced, so cannot be garbage collected, but the test doesn't succeed
unless the screen is garbage collected. So something is still referencing the
screen that was removed. This something can be a client's titlebar, because the
underlying drawable still has a context member referring to the old screen.

This commit should fix that problem, because we now trigger a redraw which will
compute a new context and thus the reference to the old screen is released.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter 752d49ed47 wibox.drawable: Force full repaint when the context changes
The previous commit made the hierarchy do a re-layout when the context changes.
However, widgets could change their appearance depending on the context without
changing their layout. Thus, the previous commit is not enough.

This commit also makes the drawable redraw everything when the context changes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter e0a3ecba01 wibox.hierarchy: Update when the context changes
When the context for widget changes (e.g. we are on a new different screen or
have a different DPI value), widgets might change their appearance even though
they didn't emit widget::layout_changed. Thus, update the hierarchy in these
cases.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter 8d2dde3a34 wibox: Remove some dead code
widget_at() no longer exists since 0aa4304bda (and the surrounding commits
stopped us using this function).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter 803264a488 Fix magnifier layout when focus is on another screen
The magnifier layout wants to ignore floating clients. Before 82342f0 this was
done by calling awful.client.floating.get(focus). If "focus" was nil, this might
have checked the floating status of a wrong client (if some other client was
focused, and the code in magnifier set focus=nil before). This issue can easily
be missed and might exist since forever. After 82342f, floating status is
checked via "focus.floating" and this now causes an "attempt to index nil value"
error instead. Much easier to notice.

Fix this by adding the missing nil check and while touching the code, merge this
with the previous "if" and correct another error (the wrong thing happened if we
had #cls=0).

Fixes: https://github.com/awesomeWM/awesome/issues/1103
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Daniel Hahler 204e2ffada Merge pull request #1099 from Elv13/fix_1091
Closes https://github.com/awesomeWM/awesome/pull/1099.
Fixes https://github.com/awesomeWM/awesome/issues/1091.
2016-09-21 22:16:21 +02:00
Emmanuel Lepage Vallee 1c177cabce awesomerc: Explicitly select a default screen
A client is supposed to go to a screen when:

 * It has been started using `awful.spawn` with explicit instructions [1]
 * An `awful.rules` rule **or any of its callbacks** set the screen [2]
 * When something handle `request::screen` and/or `request::tag` in some
   custom ways. [3]
 * Some clients can request a screen and mean it (like MythTV/Kodi/XBMC and
   some multi-window DAW) [4]

A client is supposed to go to the focused screen when none of the above are
true [5].

Other constraints:

 * The screen need to be set only once, anything will will emit
   `property::screen` many time and cause side effects.
 * There has to be a single entry point to the algorithm, no multiple
   "manage" handler.
 * Awesome internals must use the `request::` signal API and not force
   their decision outside of request handlers.
 * Restarting Awesome must not change the client screen

Commit 2178744 fix use case number [1] and [2]. It actually fix [4] too, but
it is an accident and I am not sure we care about [4] anyway. Use case [1]
and [2], however, are very important.

Fix #1091
2016-09-21 22:15:09 +02:00
Emmanuel Lepage Vallee e8649d0a29 screen: Add a function to get the client preferred screen 2016-09-15 16:50:10 -04:00
Emmanuel Lepage Vallee 0fbb02f95c ewmh: Remove dead code
The geometry storage has been moved into awful.placement. This
code was never executed as data[] was never populated.

There is some behavior that is indeed lost, but it is unlikely
someone will ever notice (it has been broken for 6 months).
The previous code attempted to handle scrren changes while
maximized. The new code organization shift this responsability
to awful.placement. However, it doesn't yet fully implement the
previous logic.
2016-09-15 16:22:46 -04:00
Emmanuel Lepage Vallée f02b73b0ee Merge pull request #1066 from Akulen/fix_gap_ignore
awful.tag: Add `gap_single_client` property and user changeable defau…
2016-09-15 16:01:19 -04:00
Hisham bcab5c71a7 Compatibility tweak for minimize and 3.5 themes
Awesome 3.5.9 accepts `_active`/`_inactive` names for `beautiful`
minimize keys (such as "titlebar_minimize_button_focus_inactive").
Some themes rely on those, meaning that when they loaded under
the current Git, the minimize button went missing. This adds a
fallback, to improve compatibility with the existing themes.
2016-09-15 11:21:49 -03:00
Akulen 5844bd0ade awful.tag: moved defaults to a local variable 2016-09-14 23:22:11 +02:00
Akulen 8ee3611848 awful.tag: Add `gap_single_client` property and user changeable defaults. 2016-09-11 13:34:17 +02:00
Emmanuel Lepage Vallée 39aace50e9 Merge pull request #1084 from Elv13/use_screen_props
Use screen props
2016-09-11 04:40:35 -04:00
Emmanuel Lepage Vallée 67e82047b0 Merge pull request #1081 from Elv13/fix_screen_memory_leak
screen: Fix a memory leak.
2016-09-11 04:39:26 -04:00
Emmanuel Lepage Vallée cf1556bfdd Merge pull request #1082 from Elv13/fix_1018
resize: Use the right mouse cursor
2016-09-11 04:38:09 -04:00
Emmanuel Lepage Vallee 0394b768a0 wallpaper: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee 50da373903 tile: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee ecdcd01dba magnifier: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee 1ede1acc9d hotkey_popup: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00