Commit Graph

2995 Commits

Author SHA1 Message Date
Peter Nerlich e55cc7c912 stop keygrabber on hide through click
fixes #2434
2018-12-17 16:29:36 +01:00
Michele Lazzeri 2308509f39 lib/awful/rules.lua fix requesting nil tag name (#2479)
Related PR: #2354 

We always passed a nil value, guess it's a typo.
2018-11-14 15:23:05 -05:00
mergify[bot] bf50daf94e
Merge pull request #2182 from blueyed/doc-gtable-iterate
doc: improve gears.table.iterate
2018-11-12 16:40:53 +00:00
Sergey Vlasov d266309ef8 awful.client: Fix c.requests_no_titlebar
The property was always false because of a typo.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-11-12 11:48:59 +03:00
Uli Schlachter 55639547a2 menubar.utils: Remove some (basically) dead code
This removes unused public functions from menubar.utils. This is not an
API break, because these functions were only added in commit
8d34201ec3, which is after v4.2. These new functions became
unused in commit e88f1e8735, not long after they were added.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-11-07 13:23:25 +01:00
Uli Schlachter c80bf6f46e wibox.layout.flex: Do not leave empty space behind
It is not possible to distribute 100px to three widgets equally. The
current version of wibox.layout.flex tries to do that anyway, by giving
each widget 33px and leaving one pixel outside of any widget. Thus, if
the widgets e.g. have a common background, this leads to a one pixel gap
in the background.

This patch changes the flex layout so that the extra pixel is assigned
to some widget instead. It does so by basically keeping a sum of
space_per_item for the widgets that was assigned so far. This sum is
rounded and when this leads to rounding, the corresponding child widget
gets an extra pixel.

More precisely, this tracks a pos as before. Widgets get their position
still assigned based on rounding pos. However, this now also remembers
this rounded position for the next iteration of the loop. This allows to
assign the size of widgets based on the difference between the current
and last rounded position.

(Possibly) fixes: https://github.com/awesomeWM/awesome/issues/2461
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-11-05 10:13:18 +01:00
actionless b6b6bc0bd6 feat(awful: hotkeys_popup): add args.show_awesome_keys option
Update lib/awful/hotkeys_popup/widget.lua

Update lib/awful/hotkeys_popup/widget.lua

fix(awful: hotkeys_popup): caching issue if showing the same widget instance with and without AwesomeWM hotkeys

doc(awful: hotkeys_popup): extend docstring for args.show_awesome_keys
2018-11-03 17:27:29 +01:00
tototest99 38505a00a2 doc(awful: spawn): Correct a typo in spawn.lua, Fixes #2456 (#2458) 2018-11-02 15:19:31 +01:00
Emmanuel Lepage Vallée 2458f127f3
Merge pull request #2360 from Elv13/add_awful_tag_layouts
awful.tag: Add awful tag layouts
2018-10-22 14:40:16 -04:00
Uli Schlachter 4744a744f0 gears.table.join: Ignore nil arguments (#2440)
When calling join with e.g. arguments (nil, {"a"}), then everything past
the nil was ignored, because the code internally used ipairs() to
iterate over the arguments and this stops at the first nil it
encounters.

Fix this by using select() to iterate over the arguments.

This also adds a unit test for this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-16 10:17:45 -04:00
Emmanuel Lepage Vallée aa16d77d15
Merge pull request #2423 from Elv13/better_rules_doc
Better awful.rules doc
2018-10-16 08:44:58 -04:00
Emmanuel Lepage Vallée 35130169c9
keygrabber: Rename release_event to stop_event (#2422)
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.

The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
2018-10-16 08:42:56 -04:00
Emmanuel Lepage Vallee 990b1ddb9d awful.tag: Add a "tag centric" way to manage a layout list.
Previously, the layout list was global. However it wasn't covering all
possible use cases and make using `awful.widget.layoutlist` hard since
a layout could be excluded from the `awful.layout.layouts` but still
used for a tag (by setting it explicitly).
2018-10-15 16:10:18 -04:00
Emmanuel Lepage Vallee ae5fc042ae layout: Add a get_tag_layout_index function.
It helps check of the current tag layout is part of

    awful.layout.layouts
2018-10-15 14:21:24 -04:00
actionless 3cef72bb30 fix(awful: rules): don't raise every focusable client on awesome startup
re #2095
2018-10-14 20:41:45 +02:00
Emmanuel Lepage Vallee 43a82f34f0 doc: Add more examples about the spawn.easy_async
Ref #1373
Ref https://stackoverflow.com/questions/52634985/awesome-wm-os-execute-vs-afwul-spawn
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 845b9a930c doc: Refactor awful.spawn doc to have a property list. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b4e0363ac3 doc: Move the awful.rules to the header.
It's easier to find.
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b49f7e22dd doc: Add an index of valid properties to awful.spawn and awful.rules. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 90b17bdc09 awful.rules: Add proper documentation to the extra client properties.
Until now there wasn't much documentation available about how to use
these properties. With the new work on `awful.spawn` that rely more and
more on `awful.rules` integration, it is worth fixing.

This commit add a new documentation section and a future commit will
aggregate them to generate an index.
2018-10-10 01:58:18 -04:00
mergify[bot] 7020a9707f
Merge pull request #2421 from Elv13/fix_2419
Fix 2419
2018-10-08 16:46:46 +00:00
gabriel klawitter 7519c6966a dbus: fix nil notifications (#2180)
When mangling notifications via naughty.config.notify_callback it is
advised (1) to return nil to reject a notification. The underlaying dbus
library tries to access a field of that notification table and fails.

(1) https://awesomewm.org/doc/api/libraries/naughty.html
2018-10-07 16:09:12 +02:00
mergify[bot] 2f70fd6cce
Merge pull request #2409 from Elv13/spawn_once
A better run_or_raise/spawn.once/singleton API
2018-10-07 11:35:11 +00:00
Emmanuel Lepage Vallée 768184d152
Merge pull request #2368 from psychon/motif_hints
Add c.requests_no_titlebar based on motif hints
2018-10-06 22:00:03 -04:00
Emmanuel Lepage Vallee 789cf11d8d titlebar: Emit `request::titlebars` from `awful.titlebar`.
The toggle/show/hide function were incompatible with the current
`rc.lua` is `titlebars_enabled` was removed from the rules because
they were never created. This has always been the case but the
introduction os `request::titlebars` in Awesome 4.0 allows to solve
this longstanding issue. However until now it didn't.

Fix #2419
2018-10-06 18:46:50 -04:00
Alyssa Ross ee9670b1ea Gracefully fail when history file is inaccessible (#2410)
If the history file (or its parents) can't be created, running a command
will fail entirely. Since saving command history is not an integral part
of running a command, it would be nicer if it carried on, just without
saving history. This is what shells usually do.

This patch removes assertions in the history saving function and
instead adds an early return, so if the history isn't saved the command
invocation simply carries on.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2018-10-06 22:53:48 +02:00
Emmanuel Lepage Vallee 021a1feec8 awful.spawn: Add a `raise_or_spawn` method. 2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 0ac99a5dc5 awful.rules: Rename switchtotag to switch_to_tags.
First of all, it select many tags, so there is an "s". Also, Awesome
standardised naming to snake case in v4.0, but this was missed.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 927e7b2796 awful.spawn: Add an `once` and `single_instance` methods.
This commit adds a way to leverage the xproperty and startup_id APIs
to persist an execution token across restarts. It allows to use
`awful.rules` on clients that were executed by a previous Awesome
instance.

The main limitations of these methods is the lack of entropy used to
build the token. If the command is the same in multiple
`awful.spawn.once`, then it will not work as expected. To mitigate this
issue, the system try to concatenate the `awful.rules` table after the
command and hash the resulting string. Given rules are a table, it can
have loops and/or issues with keys ordering. The hash function sort and
limite recursion to prevent a stack overflow. Another issue is the
unreliability of startup notifications.
2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 9250610a77 activate: Add `switch_tag_tag` and `switch_to_tags`.
Also bring some consistency with `awful.rules` naming. A future commit
will add a `TODO v5` to resolve this naming issue.
2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee 9e45e016e9 tag.viewmore: Add an optional limit to the number of selection. 2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee da68b3cbaf table.join: Make deterministic.
`pairs` order isn't defined and `{...}` will always be ordered.
There is no reason to have random behavior where it can be
predicted at no additional cost.
2018-10-01 14:57:55 -04:00
Yauhen Kirylau 3931ae370c feat(menubar): expose menubar styling to beautiful (#2375) 2018-09-28 00:35:10 -04:00
Uli Schlachter 3927dbcf02 Fix incorrect @name annotation in gears.string
gears.string.xml_escape was annotated with "@name escape" and
gears.string.xml_unescape was annotated with "@name unescape".

Reference: https://github.com/awesomeWM/awesome/issues/2397#issuecomment-424630100
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-09-26 10:37:59 +02:00
Sergey Vlasov 61cdc40595 awful.placement: Fix no_offscreen when composed with other functions
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken.  The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.

All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.

This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov db11c7e9da awful.placement: Fix client size corruption in no_overlap
The awful.placement.no_overlap function was adding the window border
width to the client width and height (this is performed in
area_common(), which is called by geometry_common()), but did not
reverse this operation by calling remove_border() before returning the
final geometry; because of this, using no_overlap resulted in increasing
the window width and height by 2*border_width.

The bug was probably introduced in commit ebcc19844e (before
that commit no_overlap changed the window position directly instead of
relying on the new placement infrastructure), but was not noticed
because of other problems (e.g., in the default configuration the result
of no_overlap was overridden by the buggy no_offscreen).

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Emmanuel Lepage Vallee 96bbbc82f3 widget.common: Add custom sources for the taglist and tasklist.
The current taglist/tasklist allow filter function to remove elements
from the list. However they don't allow sorting or additional entries
to be listed.

This commit introduced such a concept. It will later be used by the
layoutlist where it becomes more relevant since layouts are used created
"objects".
2018-08-27 00:03:22 -04:00
Yauhen Kirylau e332e2d868 fix(menubar): apply both menu bg and fg, not only bg (#2372) 2018-08-26 12:35:14 -04:00
Uli Schlachter fa1728d749 Add c.requests_to_titlebar
This property is based on Motif WM hints and checks if the client
requests that it is not decorated with a titlebar.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 48d4a31b17 awful.rules: Support titlebars_enabled being a function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 3f958d60da Merge branch 'master' of https://github.com/mrschyte/awesome 2018-08-22 12:27:05 +02:00
Uli Schlachter 2383209e9a Merge branch 'naughty_icon_data_lifetime' of https://github.com/psychon/awesome 2018-08-22 12:26:49 +02:00
Uli Schlachter 4d6920c165 Merge branch 'rules_tag_by_screen' of https://github.com/psychon/awesome 2018-08-22 12:26:37 +02:00
Uli Schlachter 674cd21b81 Merge branch 'second-try-no-offcreen' of https://github.com/actionless/awesome 2018-08-22 12:26:05 +02:00
Peter Kasza 016be728b1 Remove unsatisifiable condition when destination screen is empty
This commit fixes the following issue: https://github.com/awesomeWM/awesome/issues/2365
2018-08-21 13:19:02 +02:00
Uli Schlachter 3301e9b0ff naughty.dbus: Duplicate surface data
When an icon is sent over dbus, we turn this into a cairo ImageSurface.
This is done by turning the actual icon data into a string and using
cairo.ImageSurface.create_for_data() to create a surface for this data.
However, this function only creates an ImageSurface that refers to this
data. It does not copy the data. Thus, when the Lua GC later frees the
string, we have a cairo surface that refers to already-freed data.

Fix this by duplicating the cairo surface, which makes cairo create a
copy of the data. Then, we finish the original surface. While doing
this, the string is kept alive in a local variable.

(Possibly) Fixes: https://github.com/awesomeWM/awesome/issues/2361
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-19 20:49:03 +02:00
mergify[bot] 81da3a2ce7
Merge pull request #2358 from Elv13/add_filter_section
doc: Add filter section for the taglist and tasklist
2018-08-19 07:02:06 +00:00
Emmanuel Lepage Vallee 250475d65c widget.common: Use the new ldoc filter section. 2018-08-18 18:14:24 -04:00
Uli Schlachter 5b45442c73 Fix documentation of awful.menu.new
Fixes: https://github.com/awesomeWM/awesome/issues/2348
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 14:20:31 +02:00
Uli Schlachter ea98919f61 awful.rules: Also check for tag on other screens
When a tag is specified by name, awful.rules only searched for the tag
on the client's screen. This commit extends the search to all screens,
but only if no specific screen was specified for the new client by some
rule.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 09:44:29 +02:00