Commit Graph

79 Commits

Author SHA1 Message Date
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 9e45e016e9 tag.viewmore: Add an optional limit to the number of selection. 2018-10-03 08:38:12 -04:00
Uli Schlachter f9eec13144 awful.tag.object.set_screen: Cope with screen being nil (#2202)
For "stuff around screen's 'removed' signal", it might make sense to
temporarily set a tags screen to nil. The idea is that it will only
later be assigned to a new screen, not immediately.

However, currently a tag with screen nil causes quite some problems in
the set_screen() function. This commit works around this with a generous
amount of "wrap this in if".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-12 22:50:44 -04:00
Uli Schlachter 60b5df1308 awful.tag: Apply a default layout to tags (#1952)
Related-to: https://github.com/awesomeWM/awesome/pull/1950
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-29 13:58:45 -04:00
Uli Schlachter 20d15b8be6 awful.tag.new: Handle too few given layouts
When awful.tag.new() got a list of layouts shorter than the list of
names, it would previously create tags with nil as their layout. This
commit changes this so that the first layout is repeated if necessary.

Related-to: https://github.com/awesomeWM/awesome/issues/1853
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 09:44:02 +02:00
Emmanuel Lepage Vallee 1839c4ecaa tag: Save history after the first iteration
Fix #1651
2017-06-10 23:52:13 -04:00
Emmanuel Lepage Vallée 7818fd3dba Merge pull request #1666 from awesomeWM/doc_tag_signal
doc: Add 2 missing tag singals
2017-03-19 17:21:42 -04:00
Emmanuel Lepage Vallée 9aa801cc97 doc: Add 2 missing tag singals 2017-03-19 16:28:38 -04:00
Emmanuel Lepage Vallée 32341b1091 doc: find_by_name: Fix the doc
Swap the parameters the next time the API break / deprecation season is open.

This is indeed confusing, as reported on IRC. The screen is *not* optional,
`awful.tag.find_by_name(name)` wont work
2017-03-19 16:06:22 -04:00
Kevin Zander 7687275607 Move awful.util.deprecate and awful.util.deprecate_class to gears.debug
Change all awful.util function calls to gears.debug function calls
Update all old deprecate calls to have deprecated_in=4
2017-03-15 20:08:22 -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 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
Kevin Zander ad3782b08a Fix typo in awful.tag.setmwfact 2017-03-05 18:04:33 -06: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
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
Emmanuel Lepage Vallee 7faac6b59f doc: Fix awful.tag.attached_connect_signal 2017-01-22 09:31:56 -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 2b462cb2e3 doc: Document the tag `master_fill_policy` 2016-12-21 11:41:30 -05: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
Michael Beaumont 4cb11b8754 Fix awful.tag.add ignoring props.index (#1245) 2016-12-01 22:04:57 +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
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 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 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
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
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
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
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 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
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 f5cfc03e49 tag: Fix restoring invalid tags from history (#963)
If:

 1) An app is open in a tag
 2) A new tag is created
 3) The app is closed in the first tag
 4) The first tag is deleted
 5) The new tag is deleted

Then this history would try to restore an inactive tag without
a screen. Bad things will then happen.
2016-06-12 13:09:09 +02:00
Uli Schlachter 0857f6f1b5 Lua: Remove calls to add_signal()
The requirement to call add_signal() was added to catch typos. However, this
requirement became increasingly annoying with property::<name> signals and e.g.
gears.object allowing arbitrary properties to be changed.

All of this ended up in a single commit because tests/examples fails if I first
let add_signal() emit a deprecation warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 18:23:48 +02:00
Emmanuel Lepage Vallee 6e6c4c3a5d tag: Avoid a race condition when deleting tags.
Since the screen removal patchset, the tags properties were
cleaned too early. This caused code connecting to "property::activated"
to be called with the tag already partially deleted. For code depending
on those properties, such as radical.impl.taglist, this caused errors.
2016-05-18 15:46:09 -04:00
Uli Schlachter 5b1f8cd35c Emit more signals when removing a screen's tags
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 15:01:05 +02:00
Uli Schlachter 975aac5c0c awful.tag: Delete a screen's tag on removal
Any clients with these tags end up somewhere random (the first tag on the first
remaining screen). This certainly can be improved in the future, but at least
this is a start.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 851e0065fe awful.tag.object.delete: Delete a tag's data
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter a641d88d4e awful.tag.object.delete: Add option to force deletion
When this force-argument is not given, the code will refuse to delete a tag
which has a non-sticky client. With this force argument, the client will just be
moved to the fallback tag.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 962a73c18c awful.tag.object.delete: Remove dead code
The case fallback_tag == nil was already checked some lines above.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 9b44e9a011 tag:delete(): Allow deletion of the last tag
When a tag is deleted, this code tries to select some other tag. If the tag
which is to delete is the last tag of a screen, this code failed and indexed a
nil value. Fix this with a simple "if".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-26 09:34:54 +02:00
Emmanuel Lepage Vallee 299e155acc client: Extend request::tag instead of awful.tag.withcurrent
There was a regression when refactoring the API. It was no longer
possible to disable the automatic tag selection.

Due to recent changes, it was no longer possible to disable the
default tag selection handler. This commit extend the already
existing request::tag mechanism to let handlers select the tags.
2016-04-20 00:11:04 -04:00
Uli Schlachter 7d5e80a8ee Add awful.tag.find_by_name
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:30:52 +02:00
Emmanuel Lepage Vallee f9add1c49a awful.tag: Rename nmaster to master_count 2016-04-11 23:54:28 -04:00