Commit Graph

2650 Commits

Author SHA1 Message Date
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
Emmanuel Lepage Vallee 98b561e806 mouse/drag_to_tag: Do not use the deprecated geometry access 2016-09-11 02:09:56 -04:00
Emmanuel Lepage Vallee e89a72acd5 mouse/snap: Do not use the deprecated geometry access 2016-09-11 02:09:49 -04:00
Emmanuel Lepage Vallee 8c2d85523f screen: Do not use the deprecated geometry access 2016-09-11 02:09:44 -04:00
Emmanuel Lepage Vallee f1e61092cd ewmh: Do not use the deprecated geometry access 2016-09-11 02:09:36 -04:00
Emmanuel Lepage Vallee 4d0c426040 menubar: Do not use the deprecated geometry access 2016-09-11 01:55:33 -04:00
modk 12ea5e2318 menubar: Refactoring and cleanup 2016-09-11 00:32:57 -04:00
modk 1a40333b9e menubar: Fix entry use count for categories
Fix #999
2016-09-11 00:32:47 -04:00
Emmanuel Lepage Vallee 9b96b4b448 resize: Use the right mouse cursor
Fix #1018
2016-09-10 23:56:10 -04:00
Emmanuel Lepage Vallee e66120913f screen: Fix a memory leak.
Found while investigating #1079
2016-09-10 23:54:45 -04:00
Emmanuel Lepage Vallee 12b72d6164 drawable: Prevent collected drawables from being redrawn. 2016-09-07 00:41:10 -04:00
Emmanuel Lepage Vallee 21787444e4 client: Simplify screen selection decision tree.
This commit remove the `awful.tag` "manage" hook. The relevant
code has been moved to ewmh.lua request::tag handler. The handler
is called either by a volontary screen change or by a forced one.

It also require the awful.rules to be executed. This is done by
default and the user would have to explicitly disable that
behavior. From now on, disabling the rules require the user to
handle tag selection.

Fixes #1028 #1052
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee abb36c3697 tag: Restore the history on the right screen when deleting. 2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee 180e70f6d6 tag: Fix off by one when deleting.
If a tag has been deleted, then the number of tags is decremented,
the code still used the old count.
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee 2af0553b67 tag: Fix :delete() when there is no clients
The logic was broken. It prevented tags from being deleted.

This also make sure the boolean return value is always set.
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee d2988d1aab tag: Fix index when screen count change.
There was still a problem that caused the "old" tags to be
inserted in the wrong position when "saved" from a screen being
removed.

Also, this use a :get_tags(true) to save an uneeded sorting pass.
2016-09-04 02:52:15 -04:00
Akulen 1be737be3a awful.widget.tasklist: Add an align option (#1065) 2016-09-02 18:14:43 +02:00
Emmanuel Lepage Vallée 83e0423e89 tooltip: Stop using a fallback font (#1061)
Let the default font be used, just as everywhere else.
2016-08-30 12:57:40 +02:00
Emmanuel Lepage Vallee 01db39f5bb screen: Use math.huge instead of 9999 2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallee bbfa6006f3 tag: Fix index calculation.
The index was updated on an unordered table. As the elements
order did not match the relative indices once they have been
changed, further calls to set_index produced garbage.

The default taglist didn't notice because it use screen.tags
table index instead of the tag index. A debug using

echo 'for _,t in ipairs(mouse.screen.tags) do
  print("INDEX:", _, t.index, t.name) end' | awesome-client

Would have shown two or more elements with the same index. To
debug issues related to tag indices, this bash script can be
enabled:

while true; do
  echo 'for _,t in ipairs(mouse.screen.tags) do
  assert( _==t.index) end' | awesome-client
  sleep 0.5
done
2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallée ba2750cf91 Merge pull request #929 from Elv13/geometry_overhaul_p3.03
Geometry overhaul part 3.03 (final part for 3.6)
2016-08-20 16:40:36 -04:00
Emmanuel Lepage Vallee 2088ca26e8 tooltip: Support generic properties in constructor 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee bc3cbc44c9 tooltip: Add position mode 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 141b191921 tooltip: Add shape support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 8468d06350 placement: Port next_to_mouse to the new API 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ea52b199c6 tooltip: Add align support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ade3fabaa9 tooltip: Make the 'visible' property dynamic 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 2910a007df tooltip: Turn into a class
As done with everything else
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 211907def2 placement: Add `next_to`
This commit add the last placement function imported from the
Radical module.

It allows to place a wibox/client next to another object. It tries
to find the best fit. It also support wibox widgets.

This is intended for tooltips and menus, but can also be used in
`awful.rules` to place the new client as close as possible to the
focused one without overlap.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ce5cdb49ed mouse: Add the current_widget_geometry property
Apparently, __index cannot return multiple values, so the previous
code wasn't working.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 732b170cb0 doc: Fix the awful.widget.button documentation
It was missing the macros.
2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee 370d333590 widget: Add recursive signals.
This allows to ignore containers and layouts when a signal is sent.
2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee ec923e96fc layout: Add more signals. 2016-08-17 02:31:16 -04:00
Emmanuel Lepage Vallee 19d4a3f602 placement.under_mouse: Fix a rounding error.
When object size contains odd numbers, the result was +1px off.
2016-08-12 17:02:33 -04:00
Emmanuel Lepage Vallée e3c24c8e09 Revert "screen: Fix potential nil index" (#1037)
This reverts commit facf676b13.

Using capi.client.focus.screen to decide which screen is focused breaks
a multiscreen setup. At least makes it extremely annoying to use.

In particular, if you have a focused client on screen 1, move the mouse
to screen 2 and launch a new client, the new client appears in screen 1,
since screen.focused reports that current focused screen is 1, not 2
because of the focused client.

Close #1035
Fix #1029
2016-08-11 19:03:17 +02:00
cmertz f5f8998d0c use c:jump_to instead of client.jumpto 2016-08-10 13:02:02 +02:00
Emmanuel Lepage Vallee 220dc4c5e5 doc: Document titlebar arguments.
It was reported as incomplete on IRC.
2016-08-01 15:35:00 -04:00
Emmanuel Lepage Vallee facf676b13 screen: Fix potential nil index
This looks like a copy-paste error.
2016-08-01 15:29:02 -04:00
Emmanuel Lepage Vallee 41feec02a5 widget.base: Fix the root get_children_by_id() widget.
If the wibox root widget had an id, it was added to the properties,
but not the get_children_by_id() table
2016-08-01 15:26:29 -04:00
Emmanuel Lepage Vallee f20053bb33 awful.mouse: Fix 4 invalid function names 2016-07-30 15:49:46 -04:00
Emmanuel Lepage Vallée e472339011 Merge pull request #1013 from psychon/screen_area_signals
Screen area signals
2016-07-27 21:34:53 -04:00
Emmanuel Lepage Vallée 739ab8adc2 Merge pull request #1017 from juw/master
Change move and resize cursors
2016-07-27 21:33:35 -04:00
cmertz 4389297b58 restore client.border_width after fullscreen 2016-07-27 09:54:42 +02:00
Julian Wollrath ed34df119a Change move and resize cursors 2016-07-26 15:13:42 +02:00
Emmanuel Lepage Vallée 78171ea038 Merge pull request #1010 from Elv13/fix_declarative_widgets
widgets: Apply attributes before adding the widgets
2016-07-24 14:58:07 -04:00
Uli Schlachter 6e8b4f99f8 awful.layout: Move clients if a screen is moved
Fixes: https://github.com/awesomeWM/awesome/issues/976
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-24 16:36:03 +02:00
Emmanuel Lepage Vallee 79394c0965 widgets: Apply attributes before adding the widgets
For example, some layouts may place the widgets in a different order
depending on some attreibutes.
2016-07-23 17:24:13 -04:00
Emmanuel Lepage Vallee c159ad3ab2 drawable: Add more data to the find_widgets metadata table 2016-07-23 16:46:11 -04:00
Emmanuel Lepage Vallee 2e827202ec doc: Fix a matrix copy paste mistake 2016-07-22 21:55:23 -04:00